OpenAI
本文主要介绍如何在接口中配置 OpenAI。
OpenAI 的 GPT 系列模型是对话 AI 的行业基准,以强大的推理能力、指令遵循和自然对话质量著称。GPT-5.5 支持多模态能力且延迟低,是大多数要求顶级语言理解能力的语音 AI 应用的首选。
使用方式
// json — LLMConfig{"LLMType": "openai","Model": "gpt-5.5","APIKey": "<your_openai_api_key>","APIUrl": "https://api.openai.com/v1/chat/completions","Streaming": true,"SystemPrompt": "You are a helpful voice assistant.","Timeout": 3.0,"History": 5,"MetaInfo": {}}
参数参考
字段 | 类型 | 必填 | 说明 |
LLMType | String | 是 | 固定值: "openai"。 |
Model | String | 是 | |
APIKey | String | 是 | |
APIUrl | String | 是 | OpenAI chat completions 端点。 |
Streaming | Boolean | 否 | 启用流式响应。默认值: true。 |
SystemPrompt | String | 否 | 系统指令,用于引导模型行为。 |
Timeout | Float | 否 | 超时时间(秒)。默认值:3。 |
History | Integer | 否 | 对话轮次作为上下文。默认值:0。最大值:50。 |
MetaInfo | Object | 否 | 自定义参数,会传入请求体中。 |