Skip to content

Foundry local doesn't support array for "type" property in tools #576

@BertanAygun

Description

@BertanAygun

Per OpenAI spec, a function property type can be an array of different types but this causes a 500 error in Foundry Local.

https://developers.openai.com/api/docs/guides/function-calling#strict-mode

See the following request for example. This currently blocks us from being able to use Foundry Local models in Visual Studio chat BYOK support.

{
	"top_p": 1,
	"messages": [
		{
			"role": "system",
			"content": "You are an AI programming assistant."
		},
		{
			"role": "user",
			"content": "..."
		}
	],
	"max_completion_tokens": 4096,
	"stream": true,
	"tools": [
		{
			"type": "function",
			"function": {
				"description": "..",
				"name": "grep_search",
				"parameters": {
					"type": "object",
					"required": [
						"includePattern"
					],
					"properties": {
						"includePattern": {
							"type": [
								"string",
								"null"
							],
							"description": "..."
						}
					},
					"additionalProperties": false
				}
			}
		}
	],
	"tool_choice": "auto",
	"model": "qwen2.5-coder-7b-instruct-generic-cpu:4"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions