mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
f74131ef61
* Add FoundryAgentFactory which uses AgentClient * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/FoundryAgentFactory.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/FoundryAgentFactory.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/FoundryAgentFactory.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/FoundryAgentFactory.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/Extensions/FunctionToolExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/Extensions/FileSearchToolExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/Extensions/CodeInterpreterToolExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/Extensions/PromptAgentExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Code review feedback * Add sample showing use of FoundryAgentFactory * Add sample showing use of FoundryAgentFactory * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/Extensions/CodeInterpreterToolExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/Extensions/FunctionToolExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/Extensions/McpServerToolExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/Extensions/CodeInterpreterToolExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/Extensions/FileSearchToolExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/Extensions/WebSearchToolExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/Extensions/PromptAgentExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix issue to get FoundryAgentFactory sample working * Run dotnet format * Undo changes made by dotnet format * Update dotnet/src/Microsoft.Agents.AI.Declarative.AzureAI/FoundryAgentFactory.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using Azure.AI.Agents.Persistent;
|
|
using Microsoft.Shared.Diagnostics;
|
|
|
|
namespace Microsoft.Bot.ObjectModel;
|
|
|
|
/// <summary>
|
|
/// Extension methods for <see cref="WebSearchTool"/>.
|
|
/// </summary>
|
|
internal static class WebSearchToolExtensions
|
|
{
|
|
/// <summary>
|
|
/// Creates a <see cref="BingGroundingToolDefinition"/> from a <see cref="WebSearchTool"/>.
|
|
/// </summary>
|
|
/// <param name="tool">Instance of <see cref="WebSearchTool"/></param>
|
|
internal static BingGroundingToolDefinition CreateBingGroundingToolDefinition(this WebSearchTool tool)
|
|
{
|
|
Throw.IfNull(tool);
|
|
|
|
// TODO: Add support for BingGroundingSearchToolParameters.
|
|
var parameters = new BingGroundingSearchToolParameters([]);
|
|
|
|
return new BingGroundingToolDefinition(parameters);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates a <see cref="OpenAI.Responses.WebSearchTool"/> from a <see cref="WebSearchTool"/>.
|
|
/// </summary>
|
|
/// <param name="tool">Instance of <see cref="WebSearchTool"/></param>
|
|
/// <returns>A new <see cref="OpenAI.Responses.WebSearchTool"/> instance.</returns>
|
|
internal static OpenAI.Responses.WebSearchTool CreateWebSearchTool(this WebSearchTool tool)
|
|
{
|
|
Throw.IfNull(tool);
|
|
|
|
return new OpenAI.Responses.WebSearchTool();
|
|
}
|
|
}
|