fix(llm): enable native tool calls for SiliconFlow#584
Merged
pancacake merged 1 commit intoJun 23, 2026
Conversation
pancacake
added a commit
that referenced
this pull request
Jun 23, 2026
…mpatible providers #584 fixed SiliconFlow by adding a PROVIDER_CAPABILITIES entry, but the same class of bug affected every registered openai_compat cloud provider lacking an explicit entry: get_capability fell to DEFAULT_CAPABILITIES (supports_tools= False), so can_use_native_tool_calling() returned False and models emitted textual <tool_calls> markup instead of executable tool calls. Affected: gemini, zhipu, qianfan, stepfun, xiaomi_mimo, nvidia_nim, aihubmix, and the volcengine/byteplus coding-plan variants. Make the decision registry-backend-driven instead of per-provider data: can_use_native_tool_calling now treats a registered, non-local openai_compat provider as tool-capable by default (matching the catch-all 'custom' provider and the OpenAI-compatible API contract). Anthropic backends stay always-on; local servers (Ollama/vLLM/LM Studio/llama.cpp/Lemonade/OVMS) and bindings in _NATIVE_TOOL_BLOCKED_BINDINGS stay opted out; an explicit supports_tools flag still wins. This removes the registry/capabilities duplication for the tools flag and prevents the gap from recurring when new cloud providers are added. capabilities.py stays a pure static-data module (no registry coupling); the policy lives in client.py, which already consults the registry. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
20 tasks
vaskoyudha
added a commit
to vaskoyudha/deeptutor-for-programmer-fork
that referenced
this pull request
Jul 25, 2026
…ative-tools fix(llm): enable native tool calls for SiliconFlow SiliconFlow is a registered openai_compat provider but had no PROVIDER_CAPABILITIES entry, so it fell to the default supports_tools=False and can_use_native_tool_calling() disabled native tool schemas — models emitted textual <tool_calls> markup instead of executable calls. Register SiliconFlow with native tool support; per-model overrides (DeepSeek response_format / thinking tags) still apply. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
vaskoyudha
added a commit
to vaskoyudha/deeptutor-for-programmer-fork
that referenced
this pull request
Jul 25, 2026
…mpatible providers HKUDS#584 fixed SiliconFlow by adding a PROVIDER_CAPABILITIES entry, but the same class of bug affected every registered openai_compat cloud provider lacking an explicit entry: get_capability fell to DEFAULT_CAPABILITIES (supports_tools= False), so can_use_native_tool_calling() returned False and models emitted textual <tool_calls> markup instead of executable tool calls. Affected: gemini, zhipu, qianfan, stepfun, xiaomi_mimo, nvidia_nim, aihubmix, and the volcengine/byteplus coding-plan variants. Make the decision registry-backend-driven instead of per-provider data: can_use_native_tool_calling now treats a registered, non-local openai_compat provider as tool-capable by default (matching the catch-all 'custom' provider and the OpenAI-compatible API contract). Anthropic backends stay always-on; local servers (Ollama/vLLM/LM Studio/llama.cpp/Lemonade/OVMS) and bindings in _NATIVE_TOOL_BLOCKED_BINDINGS stay opted out; an explicit supports_tools flag still wins. This removes the registry/capabilities duplication for the tools flag and prevents the gap from recurring when new cloud providers are added. capabilities.py stays a pure static-data module (no registry coupling); the policy lives in client.py, which already consults the registry. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test Plan
./.venv/Scripts/python.exe -m pytest tests/services/llm/test_capabilities.py./.venv/Scripts/python.exe -m pytest tests/core/test_agentic_client_provider_kwargs.pyContext
SiliconFlow's OpenAI-compatible chat completions endpoint can return standard
tool_callsfor hosted DeepSeek models. Without a provider capability entry, DeepTutor treatedsiliconflowas an unknown provider and disabled native tool schemas, which could make models emit textual<tool_calls>markup instead of executable tool calls in chat/partner flows.