Skip to main content

Cohere

Bundles contain custom components that support specific third-party integrations with Langflow.

This page describes the components that are available in the Cohere bundle.

For more information about Cohere features and functionality used by Cohere components, see the Cohere documentation.

Cohere text generation

This component generates text using Cohere's language models.

It can output either a Model Response (Message) or a Language Model (LanguageModel).

Use the Language Model output when you want to use a Cohere model as the LLM for another LLM-driven component, such as an Agent or Smart Function component.

For more information, see Language Model components.

Cohere text generation parameters

Some parameters are hidden by default in the visual editor. You can modify all parameters through the Controls in the component's header menu.

NameTypeDescription
InputStringInput parameter. Specifies the input text for text generation.
System MessageStringInput parameter. A system message to pass to the model.
StreamBooleanInput parameter. Whether to stream the response. Only works in chat. Default: false.
Cohere API KeySecretStringInput parameter. Your Cohere API key.
TemperatureFloatInput parameter. Specifies the randomness of sampling. Lower values (near 0) are more deterministic, and higher values (near 1) are more creative. Defaults to 0.75.

Cohere Embeddings

The Cohere Embeddings component is used to load embedding models from Cohere.

For more information about using embedding model components in flows, see Embedding Model components.

Cohere Embeddings parameters

Some parameters are hidden by default in the visual editor. You can modify all parameters through the Controls in the component's header menu.

NameTypeDescription
cohere_api_keySecretStringInput parameter. The API key required to authenticate with the Cohere service.
modelStringInput parameter. The language model used for embedding text documents and performing queries. Default: embed-english-v2.0
truncateBooleanInput parameter. How to handle input that exceeds the model's token limit. One of NONE, START, or END (default). For more information, see the Cohere truncate API reference.
max_retriesIntegerInput parameter. The maximum number of retry attempts for failed requests. Default: 3
user_agentStringInput parameter. A user agent string to include in requests. Default: langchain
request_timeoutFloatInput parameter. The timeout duration for requests in milliseconds. Default: 10000
Search