Model attempts to call non non existent Function

Hi,

I’ve been exploring the function calling capability of your API and have encountered an issue related to the models handling off non-function related messages. Specifcally the model attempts to call a non-existent function “setMessage” when responding to the user.

request

{
	"model": "Meta-Llama-3.3-70B-Instruct",
	"messages": [
		{
			"role": "system",
			"content": "You are a friendly chatbot"
		},
		{
			"role": "user",
			"content": "Hi"
		}
	],
	"tools": [
		{
			"type": "function",
			"function": {
				"name": "setMessage",
				"description": "Update the main message text on the chatbot page",
				"strict": true,
				"parameters": {
					"type": "object",
					"required": [],
					"additionalProperties": false
				}
			}
		}
	],
	"tool_choice": "auto",
	"stream": false
}

response

{
	"id": "5c4eb464-b058-4aae-8664-b848da2e73df",
	"choices": [
		{
			"index": 0,
			"finish_reason": "tool_calls",
			"message": {
				"role": "assistant",
				"content": null,
				"tool_call_id": null,
				"tool_calls": [
					{
						"id": "call_45f8adced6834b429e",
						"type": "function",
						"function": {
							"name": "setMessage",
							"arguments": "{\"message\": \"Hello! How can I assist you today?\"}"
						}
					}
				]
			}
		}
	]
}

I would imagine this must be a bug as setMessage is not a function provided to the model.

Hello ,
Thank you for bringing this to our attention. Our team will investigate the issue and will work to resolve it as quickly as possible.
We will keep you updated with any progress and appreciate your patience and understanding in the meantime. If you have any further questions or concerns, please don’t hesitate to reach out.
Thanks

Hi lfitzy95,

Thanks for reporting this. The issue appears to be model-specific: Meta-Llama* automatically triggers tool calls if a tool is defined, even when not needed. This doesn’t happen with other models.