View as Markdown
Cohere icon

Cohere ACTION

Chat

Generates a text response to a user message. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Cohere account once, then configure and run Chat from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "cohere_platform-chat",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    cohere_platform: { authProvisionId: "apn_xxxxxxx" },
    message: "Message",
    model: "Model",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Chat inputs
Property Type Description
message Message string
Text input for the model to respond to. Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments
Required
model Model string
Defaults to command-r-plus. The name of a compatible Cohere model or the ID of a fine-tuned model. Compatible Deployments: Cohere Platform, Private Deployments.
Optional
temperature Temperature string
Must be between 0 and 1.0 inclusive that tunes the degree of randomness in generation. Lower temperatures mean less random generations, and higher temperatures mean more random generations. Randomness can be further maximized by increasing the value of the P parameter. Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments See Temperature for more details.
Optional
maxTokens Max Tokens integer
The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations. Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments. See BPE Tokens for more details.
Optional
k K integer
Ensures only the top K most likely tokens are considered for generation at each step. Defaults to 0, min value of 0, max value of 500. Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments
Optional
p P string
Ensures that only the most likely tokens, with total probability mass of P, are considered for generation at each step. If both K and P are enabled, P acts after K. Defaults to 0.75. min value of 0.01, max value of 0.99. Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments
Optional
stopSequences Stop Sequences string[]
A list of up to 5 strings that the model will use to stop generation. If the model generates a string that matches any of the strings in the list, it will stop generating tokens and return the generated text up to that point not including the stop sequence. Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments
Optional
frequencyPenalty Frequency Penalty string
Defaults to 0.0, min value of 0.0, max value of 1.0. Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation. Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
cohere_platform-chat
Version
0.0.2
App
Cohere
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes