mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
0ef4e739d5
Remove input type checking in favour of explicit `.DescribeProtocolAsync()` flow. Also removes `.AsAgentAsync()` as the validation happens at workflow run time. This makes it easier to use Workflows with DI without resorting to async-over-sync.
24 lines
641 B
C#
24 lines
641 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows;
|
|
|
|
/// <summary>
|
|
/// Describes the protocol for communication with a <see cref="Workflow"/> or <see cref="Executor"/>.
|
|
/// </summary>
|
|
public class ProtocolDescriptor
|
|
{
|
|
/// <summary>
|
|
/// Get the collection of types accepted by the <see cref="Workflow"/> or <see cref="Executor"/>.
|
|
/// </summary>
|
|
public IEnumerable<Type> Accepts { get; }
|
|
|
|
internal ProtocolDescriptor(IEnumerable<Type> acceptedTypes)
|
|
{
|
|
this.Accepts = acceptedTypes.ToArray();
|
|
}
|
|
}
|