-
Notifications
You must be signed in to change notification settings - Fork 229
Closed
Labels
Description
Without the "required" field for every function object, Foundry Local (0.8.113) fails with the following error:
Provided tools are not defined using an OpenAI-compatible tool definition format per tool. Each provided tool should use the same tool definition format.
Unclear whether this is a big or not, but langchain only adds "required" if one or more parameters are required. If all are optional it does not send them.
Example payload:
{
"messages": [
{
"content": "You are a helpful email and calendar assistant.\n\nCurrent date: 2025-12-01\n\nYou have access to the following tools:\n- search_emails: Search for emails containing specific keywords\n- get_latest_emails: Get the most recent emails\n- search_calendar: Search calendar events by query or date\n- get_upcoming_events: Get upcoming calendar events\n\nWhen the user asks a question:\n1. Use the appropriate tools to gather information\n2. Synthesize a clear, specific answer based on the tool results\n3. Include relevant details like dates, times, subjects, and people\n\nBe concise but informative.",
"role": "system"
},
{
"content": "What are my latest emails about?",
"role": "user"
}
],
"model": "Phi-4-mini-instruct-generic-gpu:5",
"stream": false,
"temperature": 0.0,
"tools": [
{
"type": "function",
"function": {
"name": "search_emails",
"description": "Search emails for a specific query string.\n\nArgs:\n query: Search query to find in emails\n max_results: Maximum number of results to return (default: 5)\n\nReturns:\n Formatted string with matching emails",
"parameters": {
"properties": {
"query": {
"type": "string"
},
"max_results": {
"default": 5,
"type": "integer"
}
},
"required": [
"query"
],
"type": "object"
}
}
},
{
"type": "function",
"function": {
"name": "get_latest_emails",
"description": "Get the most recent emails.\n\nArgs:\n count: Number of recent emails to retrieve (default: 5)\n\nReturns:\n Formatted string with recent emails",
"parameters": {
"properties": {
"count": {
"default": 5,
"type": "integer"
}
},
"type": "object"
}
}
},
{
"type": "function",
"function": {
"name": "search_calendar",
"description": "Search calendar events by query or date.\n\nArgs:\n query: Optional search query for event subject\n date: Optional date in YYYY-MM-DD format to filter events\n\nReturns:\n Formatted string with matching calendar events",
"parameters": {
"properties": {
"query": {
"type": "string"
},
"date": {
"type": "string"
}
},
"required": [
"query",
"date"
],
"type": "object"
}
}
},
{
"type": "function",
"function": {
"name": "get_upcoming_events",
"description": "Get upcoming calendar events for the next N days.\n\nArgs:\n days: Number of days to look ahead (default: 7)\n\nReturns:\n Formatted string with upcoming events",
"parameters": {
"properties": {
"days": {
"type": "integer"
}
},
"required": [
"days"
],
"type": "object"
}
}
}
]
}
If nothing else, the error message could be improved