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. |
||
|---|---|---|
| .. | ||
| __tests__ | ||
| client.ts | ||
| convertMessages.ts | ||
| convertTools.ts | ||
| index.ts | ||
| modelMapping.ts | ||
| streamAdapter.ts | ||