Large Language Model Configuration
This article mainly introduces how to configure the
LLMConfig
parameter in the StartAIConversation API.Parameter Description
Name | Description |
LLMType | Large language model types, if the model complies with the OpenAI API protocol, please fill in OpenAI . |
Model | Specific model name, such as gpt-4o . |
APIKey | API Key for large language models. |
APIUrl | API URL for large language models. |
Streaming | Whether to stream. |
SystemPrompt | Prompt words. |
Timeout | Timeout, default is 3 seconds (unit: seconds). |
History | Set the context rounds for LLM, default value: 0 (no context management provided), maximum value: 50 (provides context management for the last 50 rounds). |
MetaInfo | Custom Parameters will be passed through in the request body to the large language model. |
LLMConfig Configuration Example
Openai
"LLMConfig": {"LLMType": "openai","Model":"gpt-4o","APIKey":"api-key","APIUrl":"https://api.openai.com/v1/chat/completions","Streaming": true,"SystemPrompt": "You are a personal assistant""Timeout": 3.0,"History": 5,"MetaInfo": {}}
Minimax
"LLMConfig":{"LLMType": "openai","Model": "abab6.5s-chat","Streaming": true,"SystemPrompt": "You are a personal assistant""APIKey": "eyJhbGcixxxx","APIUrl": "https://api.minimax.chat/v1/text/chatcompletion_v2","History": 5,"MetaInfo": {}}
Huan Yuan
"LLMConfig":{"LLMType": "openai","Model": "hunyuan-standard", // hunyuan-turbo, hunyuan-standard"APIKey": "hunyuan-apikey","APIUrl": "https://hunyuan.cloud.tencent.com/openai/v1/chat/completions","Streaming": true,"History": 10,"MetaInfo": {}}
Note:
If the large language model complies with the
OpenAI API
protocol, we can support it. Fill in LLMType
with OpenAI
, and fill in other parameters according to the actual situation.Request For Large Model
In addition, we will add multiple parameters in the HTTP header to help users support more complex logic:
X-Task-Id: <task_id_value> // The ID of this taskX-Request-Id: <request_id> // The ID of this request; the same requestId will be carried on retry.X-Sdk-App-Id: SdkAppIdX-User-Id: UserIdX-Room-Id: RoomIdX-Room-Id-Type: "0" // "0" for digit room ID, "1" for string room ID