mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
49d69b3bf5
* Expose workflow as MCP Tool * Expose workflow as MCP Tool * Cleanup * PR feedback fixes * update changelog to include PR numner * Improvements to error handling. * Adding a sample project demonstrating how to setup Agents and Workflows together. * Ensure duplicate agent registrations are properly handled.
47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
// Copyright (c) Microsoft. All rights reserved.
|
||
|
||
using Microsoft.Agents.AI.DurableTask;
|
||
|
||
namespace Microsoft.Agents.AI.Hosting.AzureFunctions;
|
||
|
||
/// <summary>
|
||
/// Provides Azure Functions–specific configuration for durable workflows.
|
||
/// </summary>
|
||
internal sealed class FunctionsDurableOptions : DurableOptions
|
||
{
|
||
private readonly HashSet<string> _statusEndpointWorkflows = new(StringComparer.OrdinalIgnoreCase);
|
||
private readonly HashSet<string> _mcpToolTriggerWorkflows = new(StringComparer.OrdinalIgnoreCase);
|
||
|
||
/// <summary>
|
||
/// Enables the status HTTP endpoint for the specified workflow.
|
||
/// </summary>
|
||
internal void EnableStatusEndpoint(string workflowName)
|
||
{
|
||
this._statusEndpointWorkflows.Add(workflowName);
|
||
}
|
||
|
||
/// <summary>
|
||
/// Returns whether the status endpoint is enabled for the specified workflow.
|
||
/// </summary>
|
||
internal bool IsStatusEndpointEnabled(string workflowName)
|
||
{
|
||
return this._statusEndpointWorkflows.Contains(workflowName);
|
||
}
|
||
|
||
/// <summary>
|
||
/// Enables the MCP tool trigger for the specified workflow.
|
||
/// </summary>
|
||
internal void EnableMcpToolTrigger(string workflowName)
|
||
{
|
||
this._mcpToolTriggerWorkflows.Add(workflowName);
|
||
}
|
||
|
||
/// <summary>
|
||
/// Returns whether the MCP tool trigger is enabled for the specified workflow.
|
||
/// </summary>
|
||
internal bool IsMcpToolTriggerEnabled(string workflowName)
|
||
{
|
||
return this._mcpToolTriggerWorkflows.Contains(workflowName);
|
||
}
|
||
}
|