Я хочу использовать Azure Ai Foundry Agent с AzureFunctionToOldefinition для использования функции Azure в качестве инструмента . Я следил за этим образцом: как использовать функции Azure с Azure AI-агентами
фрагмент:
//Define Azure Function tool definition.
AzureFunctionToolDefinition azureFnTool = new(
name: "foo",
description: "Get answers from the foo bot.",
inputBinding: new AzureFunctionBinding(
new AzureFunctionStorageQueue(
queueName: "azure-function-foo-input",
storageServiceEndpoint: storageQueueUri
)
),
outputBinding: new AzureFunctionBinding(
new AzureFunctionStorageQueue(
queueName: "azure-function-tool-output",
storageServiceEndpoint: storageQueueUri
)
),
parameters: BinaryData.FromObjectAsJson(
new
{
Type = "object",
Properties = new
{
query = new
{
Type = "string",
Description = "The question to ask.",
},
outputqueueuri = new
{
Type = "string",
Description = "The full output queue uri."
}
},
},
new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }
)
);
//Create agent and give it the Azure Function tool.
PersistentAgent agent = client.Administration.CreateAgent(
model: modelDeploymentName,
name: "azure-function-agent-foo",
instructions: "You are a helpful support agent. Use the provided function any "
+ "time the prompt contains the string 'What would foo say?'. When you invoke "
+ "the function, ALWAYS specify the output queue uri parameter as "
+ $"'{storageQueueUri}/azure-function-tool-output'. Always responds with "
+ "\"Foo says\" and then the response from the tool.",
tools: [azureFnTool]
);
< /code>
Но это не удается с: < /p>
Invalid tool value(s): azure_function. Use the Enterprise Standard offering to access these tool(s).
Status: 400 (Bad Request)
Я попытался настроить своего агента с GPT-4O, GPT-4.1 и GPT-5 (Althogh GPT-5 не выбирается в качестве развертывания).
Я хочу использовать Azure Ai Foundry Agent с AzureFunctionToOldefinition для использования функции Azure в качестве инструмента . Я следил за этим образцом: как использовать функции Azure с Azure AI-агентами фрагмент: [code]//Define Azure Function tool definition. AzureFunctionToolDefinition azureFnTool = new( name: "foo", description: "Get answers from the foo bot.", inputBinding: new AzureFunctionBinding( new AzureFunctionStorageQueue( queueName: "azure-function-foo-input", storageServiceEndpoint: storageQueueUri ) ), outputBinding: new AzureFunctionBinding( new AzureFunctionStorageQueue( queueName: "azure-function-tool-output", storageServiceEndpoint: storageQueueUri ) ), parameters: BinaryData.FromObjectAsJson( new { Type = "object", Properties = new { query = new { Type = "string", Description = "The question to ask.", }, outputqueueuri = new { Type = "string", Description = "The full output queue uri." } }, }, new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase } ) );
//Create agent and give it the Azure Function tool. PersistentAgent agent = client.Administration.CreateAgent( model: modelDeploymentName, name: "azure-function-agent-foo", instructions: "You are a helpful support agent. Use the provided function any " + "time the prompt contains the string 'What would foo say?'. When you invoke " + "the function, ALWAYS specify the output queue uri parameter as " + $"'{storageQueueUri}/azure-function-tool-output'. Always responds with " + "\"Foo says\" and then the response from the tool.", tools: [azureFnTool] ); < /code> Но это не удается с: < /p> Invalid tool value(s): azure_function. Use the Enterprise Standard offering to access these tool(s). Status: 400 (Bad Request) [/code] Я попытался настроить своего агента с GPT-4O, GPT-4.1 и GPT-5 (Althogh GPT-5 не выбирается в качестве развертывания).