Add unit tests for OpenAI plugin and establish coding standards
- Introduced comprehensive unit tests for the OpenAI plugin, covering SSE parsing, sentinel matching, delta extraction, request building, and more. - Created a new markdown file detailing coding and naming conventions for the dstalk project, including guidelines for comments, naming rules, code organization, and memory management practices.
This commit is contained in:
@@ -507,7 +507,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
// 查询插件服务 / Query plugin services
|
||||
const char* ai_provider = dstalk_config_get("ai.provider");
|
||||
if (!ai_provider) ai_provider = "ai.deepseek";
|
||||
if (!ai_provider) ai_provider = "ai.openai";
|
||||
g_ai = static_cast<const dstalk_ai_service_t*>(dstalk_service_query(ai_provider, 1));
|
||||
g_session = static_cast<const dstalk_session_service_t*>(dstalk_service_query("session", 1));
|
||||
|
||||
@@ -523,8 +523,8 @@ int main(int argc, char* argv[])
|
||||
const char* base_url = dstalk_config_get("api.base_url");
|
||||
const char* api_key = dstalk_config_get("api.api_key");
|
||||
const char* model = dstalk_config_get("api.model");
|
||||
if (!base_url) base_url = "https://api.deepseek.com/v1";
|
||||
if (!model) model = "deepseek-v4-pro";
|
||||
if (!base_url) base_url = "https://api.openai.com/v1";
|
||||
if (!model) model = "gpt-4o";
|
||||
g_ai->configure(ai_provider, base_url, api_key ? api_key : "", model, 4096, 0.7);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user