-
Notifications
You must be signed in to change notification settings - Fork 0
DeepSeek API Tool Calls
YarCraSy edited this page Jul 8, 2026
·
2 revisions
Previous page: Official References
Official reference:
src/deepseekApi/providers/deepseek/features/toolCall/ToolCallRequest.tssrc/deepseekApi/providers/deepseek/features/toolCall/ToolCallStreaming.tssrc/deepseekApi/providers/deepseek/features/toolCall/ToolCallCycle.tssrc/VsCodeApi/webviews/handlers/Chat/toolCalls/ToolCallSession.ts
- The conversation is sent with tool definitions.
- DeepSeek responds with tool calls.
- The backend validates the tool and arguments.
- Danger and execution mode are evaluated.
- If confirmation is required, the UI decides.
- The tool result goes back into the DeepSeek cycle.
- The final answer is shown and persisted.
- Tool definitions live in
core. - Concrete execution uses
ToolWorkspace. - Destructive or ambiguous operations must require confirmation.
- The UI should show structured results when available.
- DeepSeek receives tools through the
toolsparameter. - The API currently supports tools of type
function. -
tool_choicecan control whether the model avoids, chooses, or forces a tool. - The response may end with
finish_reason: "tool_calls". - Each result must return as a message with
role: "tool"andtool_call_id. - Arguments arrive as a JSON string; code must parse and validate them.
- In thinking mode with tool calls,
reasoning_contentmust be preserved for later turns. -
strictmode is beta and requires the beta base URL and compatible schemas.