Actions2
Overview
The DeepSeek node integrates with the DeepSeek API via the Vercel AI SDK to generate text completions or structured objects using AI models. It supports two main input modes: a simple single prompt or a conversation-style input with multiple messages. This flexibility makes it suitable for various natural language processing tasks such as chatbots, content generation, summarization, or extracting structured data from text.
Typical use cases include:
- Generating conversational responses in chatbots.
- Creating text completions based on a single prompt.
- Producing structured JSON objects that conform to a user-defined schema.
- Customizing model behavior with system prompts or multi-message conversations.
For example, you can provide a prompt like "Write a summary of today's news" or a series of chat messages simulating a conversation, and receive generated text output accordingly.
Properties
| Name | Meaning |
|---|---|
| Model Name or ID | Select which DeepSeek model to use. Options are dynamically loaded from the DeepSeek API or can be specified by ID. Common models include "DeepSeek Chat" (optimized for conversations) and "DeepSeek Reasoner" (for reasoning). |
| Input Type | Choose how to provide input: - Simple Prompt: Use a single text prompt. - Messages: Use a conversation with multiple messages. |
| System | (Shown if Input Type is Simple Prompt) Optional system prompt to guide the model's behavior, e.g., "You are a helpful assistant." |
| Prompt | (Shown if Input Type is Simple Prompt) The single text prompt to generate a completion for. |
| Messages | (Shown if Input Type is Messages and not using JSON input) A collection of messages forming a conversation. Each message has a role (Assistant, System, User) and corresponding content. |
| Messages as JSON | (Shown if Input Type is Messages) Boolean flag to input messages as a raw JSON array instead of UI fields. |
| Messages (JSON) | (Shown if Messages as JSON is true) JSON string representing an array of message objects with role and content properties. |
| Options | Collection of optional parameters: - Max Tokens: Maximum number of tokens to generate (default 2048). - Temperature: Controls randomness of output (0 to 2, default 0.7). - Include Request Body: Whether to include the request body in the output. |
| Operation | For the selected model, choose the operation: - Generate Text: Generate text using prompt or messages. - Generate Object: (Only for deepseek-chat) Generate a structured object based on a JSON schema. |
| Schema Name | (Shown if Operation is Generate Object) Optional name of the output schema for additional guidance. |
| Schema Description | (Shown if Operation is Generate Object) Optional description of the output schema. |
| Schema | (Shown if Operation is Generate Object) JSON schema describing the structure and constraints of the object to generate. |
Output
The node outputs an array of items where each item contains a json field with the following structure depending on the operation:
Generate Text:
The output JSON includes:text: The generated text completion.reasoning: (optional) Any reasoning provided by the model.finishReason: Why the generation stopped.usage: Token usage statistics (promptTokens,completionTokens,totalTokens) and cache metrics if available.response: Metadata about the response includingid,modelId,timestamp, and HTTP headers.warnings: Any warnings returned by the API.- Optionally, if enabled, the original request body sent to the API under
request.body.
Generate Object (only for deepseek-chat):
Similar metadata as above, but the main content is a structured object generated according to the provided JSON schema.
The node does not output binary data.
Dependencies
- Requires an API key credential for DeepSeek API access.
- Uses the Vercel AI SDK and DeepSeek client libraries internally.
- Needs internet access to call the DeepSeek API endpoints.
- The node dynamically loads available models from the DeepSeek API.
Troubleshooting
- Invalid JSON in Messages (JSON): If the JSON string for messages is malformed, the node throws an error indicating invalid JSON. Ensure the JSON is correctly formatted.
- Invalid JSON Schema: When generating objects, if the provided JSON schema is invalid or fails validation, an error will be thrown. Validate your schema before use.
- Missing API Key: The node requires a valid API key credential. If missing or incorrect, the node will throw an authentication error.
- Model Not Found or Unsupported Operation: Selecting an unsupported model-operation combination may cause errors. Verify the model supports the chosen operation.
- Token Limits: Setting
maxTokenstoo high might cause API errors or increased latency. Adjust according to your needs. - Continue On Fail: If enabled, the node will continue processing other items even if one fails, returning error details in the output.