Function Calling
1. Use Cases
Function Calling allows a model to invoke external tools to augment its capabilities. With the model acting as the “brain” and tools as actuators (for example: searching external knowledge, checking itineraries, or calling domain‑specific utilities), you can effectively mitigate hallucinations and keep answers up to date.
2. How To Use
2.1 Add a tools parameter via the REST API
Add the tools field to the request body.
Example payload:
{
"model": "deepseek-ai/DeepSeek-V2.5",
"messages": [
{
"role": "user",
"content": "What opportunities and challenges will China’s LLM industry face in 2025?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "actual_function_name_to_execute",
"description": "Describe what this function does",
"parameters": {
"_comments": "Describe the function parameters here"
}
}
},
{
"_comments": "Other function-related notes"
}
],
"_comments": "Other request fields"
}