mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
refactor: [BREAKING] Remove generic Workflow<T> (#1551)
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.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user