Tool calling
The proxy accepts OpenAI tools / function definitions. Many Gonka hosts already emit native tool calls. When they do not, and SIMULATE_TOOL_CALLS is enabled on the server, the proxy rewrites the request into a structured prompt and parses JSON back into tool_calls.
You do not flip that flag yourself. From a client, send a normal tools payload.
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V4-Flash-0731",
messages=[{"role": "user", "content": "What's the weather in Berlin?"}],
tools=[{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"properties": {"location": {"type": "string"}},
"required": ["location"],
},
},
}],
)
print(response.choices[0].message.tool_calls[0].function.arguments)Loop
- Model returns
tool_calls - You run the function
- You send a
role: toolmessage withtool_call_id - Repeat until
contentis a final answer
DeepSeek + tools
If reasoning tokens leak into content, tool parsers in Cursor / OpenCode break. Turn on DeepSeek reasoning compatibility in Settings.
Not the same as MCP
type: "function" is your client-side tools. type: "mcp" is a remote server the proxy calls. See MCP. { "type": "web_search" } is also consumed by the proxy — see Web search. { "type": "deep_research" } is the research loop — see Deep research.