Skip to content

fix(llm): enable native tool calls for SiliconFlow#584

Merged
pancacake merged 1 commit into
HKUDS:devfrom
TyrionH-is-coding:fix/siliconflow-native-tools
Jun 23, 2026
Merged

fix(llm): enable native tool calls for SiliconFlow#584
pancacake merged 1 commit into
HKUDS:devfrom
TyrionH-is-coding:fix/siliconflow-native-tools

Conversation

@TyrionH-is-coding

Copy link
Copy Markdown
Contributor

Summary

  • Add SiliconFlow to provider capabilities as an OpenAI-compatible endpoint with native tool-call support.
  • Preserve model-level overrides for DeepSeek response_format and thinking-tag behavior.
  • Add regression coverage for SiliconFlow DeepSeek native tool calling.

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.py

Context

SiliconFlow's OpenAI-compatible chat completions endpoint can return standard tool_calls for hosted DeepSeek models. Without a provider capability entry, DeepTutor treated siliconflow as 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.

@pancacake
pancacake changed the base branch from main to dev June 23, 2026 13:24
@pancacake
pancacake merged commit 50e7124 into HKUDS:dev Jun 23, 2026
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]>
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants