claude-code-best/src/services/api/openai
uk0 e88dcb2f9e fix: OpenAI adapter tool calling compatibility
Two fixes for OpenAI-compatible provider compatibility:

1. Sanitize JSON Schema `const` → `enum` in tool parameters.
   Many OpenAI-compatible endpoints (Ollama, DeepSeek, vLLM, etc.)
   do not support the `const` keyword in JSON Schema. Recursively
   convert `const: value` to `enum: [value]` which is semantically
   equivalent.

2. Force stop_reason to `tool_use` when tool_calls are present.
   Some backends incorrectly return finish_reason "stop" even when
   the response contains tool_calls. Without this fix, the query
   loop treats the response as a normal end_turn and never executes
   the requested tools.
2026-04-06 13:31:28 +08:00
..
__tests__ fix: OpenAI adapter tool calling compatibility 2026-04-06 13:31:28 +08:00
client.ts 支持 OpenAI Chat 兼容协议 (#99) 2026-04-03 23:33:17 +08:00
convertMessages.ts feat: 支持 openai 图片兼容 2026-04-06 10:48:27 +08:00
convertTools.ts fix: OpenAI adapter tool calling compatibility 2026-04-06 13:31:28 +08:00
index.ts fix: 修复 openai 的 cost 计算问题 2026-04-04 16:37:50 +08:00
modelMapping.ts 支持 OpenAI Chat 兼容协议 (#99) 2026-04-03 23:33:17 +08:00
streamAdapter.ts fix: OpenAI adapter tool calling compatibility 2026-04-06 13:31:28 +08:00