Function Calls not returned in Response "message.content"
Last updated: August 29, 2025
Models that support Function Calling (list of supported models HERE) return any tool calls in a separate part of the model Response, not inside of message.content. Some models will return "None" for this if any function calls are made.
Any tool calls instead will be found in:
message.tool_calls[0].function.name
For example, here is a simple call made with the following simple tools set up:
tools = [
{
"type": "function",
"function": {
"name": "returnFavoriteAnimal",
"description": "Return your favorite animal when asked",
"parameters": {}
}
},
{
"type": "function",
"function": {
"name": "returnFavoriteFood",
"description": "Return your favorite kind of food when asked",
"parameters": {}
}
},
{
"type": "function",
"function": {
"name": "returnFavoriteShow",
"description": "Return your favorite television program when asked",
"parameters": {}
}
}
]
messages = [
{"role": "system", "content": "You are a helpful assistant that can access external functions. The responses from these function calls will be returned when specific questions are asked. Please provide responses based on the information from these function calls."},
{"role": "user", "content": "I like food a lot!"}
]
### Call to Together model
response = client.chat.completions.create(
model="openai/gpt-oss-120b",
messages=messages,
tools=tools,
)This will generate the following RAW Response:
id='o97bWZR-31r7CA-976d7691df8a4cd6' object=<ObjectType.ChatCompletion: 'chat.completion'> created=1756485344 model='openai/gpt-oss-120b' choices=[ChatCompletionChoicesData(index=0, logprobs=None, seed=None, finish_reason=<FinishReason.ToolCalls: 'tool_calls'>, message=ChatCompletionMessage(role=<MessageRole.ASSISTANT: 'assistant'>, content=None, tool_calls=[ToolCalls(id='call_9ayy7ti5tshbo3a177gyn3i5', type='function', function=FunctionCall(name='returnFavoriteFood', arguments='{}'), index=0)]))] prompt=[] usage=UsageData(prompt_tokens=199, completion_tokens=147, total_tokens=346) metadata={'weight_version': 'default'}As you can see here, message.content is none, but if I use print(response.choices[0].message.tool_calls[0].function.name) I get back just:
returnFavoriteFood