CoherePrompt
What is it?
The CoherePrompt node sets up a connection to Cohere's AI models.
When would I use it?
Use this node when you want to:
- Use Cohere's AI models in your workflow
- Take advantage of Cohere's specific capabilities
How to use it
Basic Setup
- Add the CoherePrompt node to your workflow
- Connect its output to nodes that can use prompt drivers (like Agent)
Parameters
- model: The Cohere model to use (default is "command-r-plus")
- max_attempts_on_fail: How many times to retry if there's an error
- use_native_tools: Whether to use Cohere's built-in tools
- max_tokens: Maximum length of responses
- p: Controls diversity of outputs (similar to temperature)
- k: Controls focus on most likely tokens
- temperature: Controls randomness in responses (higher values = more creative, lower = more focused)
- stream: Whether to receive responses as they're generated (true) or all at once (false)
Outputs
- prompt_model_config: The configured Cohere driver that other nodes can use
Example
If you want to create an agent that uses Cohere:
- Add a CoherePrompt node to your workflow
- Connect the "driver" output to an Agent's "prompt_driver" input
Try:
- Set "model" to something besides the default
- Set "max_tokens" to 1000 (for moderate length responses)
Important Notes
- You need a valid Cohere API key set up in your environment as
COHERE_API_KEY
- The default model is "command-r-plus"
- The node checks if your API key is valid during setup
Common Issues
- Missing API Key: Make sure your Cohere API key is properly set up
- Connection Errors: Check your internet connection and API key validity