DeepSeek ACTION
Create Chat Completion
Creates a chat completion using the DeepSeek API. See the documentation
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's DeepSeek account once, then configure and run Create Chat Completion 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: "deepseek-create-chat-completion",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
deepseek: { authProvisionId: "apn_xxxxxxx" },
messages: ["Messages"],
frequencyPenalty: "Frequency Penalty",
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "deepseek-create-chat-completion",
"configured_props": {
"deepseek": { "authProvisionId": "apn_xxxxxxx" },
"messages": ["Messages"],
"frequencyPenalty": "Frequency Penalty"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "deepseek",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "deepseek-create-chat-completion",
arguments: {
messages: ["Messages"],
frequencyPenalty: "Frequency Penalty",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
messages Messages | string[] | The messages for the chat conversation as JSON strings. Each message should be a JSON string like '{"role": "user", "content": "Hello!"}'. See the documentation for further details. Required |
frequencyPenalty Frequency Penalty | string | Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. Optional |
maxTokens Max Tokens | integer | Integer between 1 and 8192. The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. If max_tokens is not specified, the default value 4096 is used. Optional |
presencePenalty Presence Penalty | string | Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. Optional |
responseFormatType Response Format Type | string | The format that the model must output. Setting to JSON Object enables JSON Output, which guarantees the message the model generates is valid JSON. Optional |
stop Stop Sequences | string[] | Up to 16 sequences where the API will stop generating further tokens. Optional |
stream Stream | boolean | If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events (SSE) as they become available, with the stream terminated by a data: [DONE] message. Optional |
streamIncludeUsage Stream Include Usage | string | If set, an additional chunk will be streamed before the data: [DONE] message. The usage field on this chunk shows the token usage statistics for the entire request, and the choices field will always be an empty array. All other chunks will also include a usage field, but with a null value. Optional |
temperature Temperature | string | What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or Top P but not both. Optional |
topP Top P | string | An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or Temperature but not both. Optional |
tools Tools | string[] | A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported. Optional |
toolChoice Tool Choice | string | Controls which (if any) tool is called by the model. See the documentation for further details. Optional |
logprobs Log Probs | boolean | Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message. Optional |
topLogprobs Top Log Probabilities | string | An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used. 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
- deepseek-create-chat-completion
- Version
- 0.0.2
- App
- DeepSeek
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗