fix(protocol): OpenAI 兼容插件 - 请求路径不再硬编码 /v1 前缀 (#399)

This commit is contained in:
Dade
2026-09-02 20:19:33 +08:00
committed by GitHub
parent a0b65006fb
commit 9fed0aa324
6 changed files with 10 additions and 8 deletions

View File

@@ -129,11 +129,11 @@ func TestOfficialAgentProfilesMapToolRequestsAndResponses(t *testing.T) {
name, packageName, providerID, marker, wantPath, response, wantID, wantSignature string
}{
{
name: "openai-chat", packageName: "openai-chat-completions.yingce-plugin", providerID: "chat-completion", marker: "chat", wantPath: "/v1/chat/completions", wantID: "call-chat",
name: "openai-chat", packageName: "openai-chat-completions.yingce-plugin", providerID: "chat-completion", marker: "chat", wantPath: "/chat/completions", wantID: "call-chat",
response: `{"choices":[{"message":{"content":"chat answer","tool_calls":[{"id":"call-chat","function":{"name":"canvas_get_state","arguments":"{\"scope\":\"all\"}"}}]}}]}`,
},
{
name: "openai-responses", packageName: "openai-responses.yingce-plugin", providerID: "openai-response", marker: "responses", wantPath: "/v1/responses", wantID: "call-responses",
name: "openai-responses", packageName: "openai-responses.yingce-plugin", providerID: "openai-response", marker: "responses", wantPath: "/responses", wantID: "call-responses",
response: `{"output_text":"responses answer","output":[{"type":"message"},{"type":"function_call","call_id":"call-responses","name":"canvas_get_state","arguments":"{\"scope\":\"all\"}"}]}`,
},
{