Overview
This node integrates with the Doubao large language model API to generate text completions based on user input. It is useful for scenarios where automated text generation, chatbots, or AI-driven content creation is needed. For example, it can be used to generate conversational responses, assist in writing, or provide AI-powered suggestions by combining system and user prompts.
Use Case Examples
- Generating AI chat responses by providing system and user prompts.
- Creating content or text completions using specified Doubao models.
Properties
| Name | Meaning |
|---|---|
| 认证方式 | The authentication method used to access the Doubao API, currently supports API Key. |
| 模型 | The Doubao model to use for text generation. |
| 系统提示词 | System prompt guiding the AI's response style and direction. |
| 用户提示词 | User prompt combined with the system prompt to form the input context for the AI. |
| 用户输入 | The actual user input content to be processed by the AI. |
| 选项 | Additional options for the API request such as timeout and max retry count. |
Output
JSON
content- The generated text content from the Doubao model.model- The model used for generating the response.created- Timestamp when the response was created.id- Unique identifier for the API response.usageprompt_tokens- Number of tokens used in the prompt.completion_tokens- Number of tokens used in the completion.total_tokens- Total number of tokens used in the request.
Dependencies
- Requires an API key credential for Doubao API authentication.
- Uses axios for HTTP requests to the Doubao API endpoint.
Troubleshooting
- Common issues include API authentication errors if the API key is missing or invalid.
- Network errors or timeouts can occur; the node retries the request up to the configured maxRetries with incremental delays.
- API errors return status codes and messages which are surfaced as node errors; check the error message for details.
- If no response is received, the node throws an error indicating failure to get API response.
Links
- Doubao API Chat Completions Endpoint - Official API endpoint used by the node to generate chat completions.