Skip to content

.NET: [Bug]: MAF 1.0.0-rc4 and MEAI 10.4.0 are incompatible #4709

@zxyao145

Description

@zxyao145

Description

I'm not sure what happened, but Microsoft.Extensions.AI.Abstractions removed UserInputResponseContent in version 10.4.0. If I'm using MAF 1.0.0-rc4 and MEAI 10.4.0, and when using a workflow:

StreamingRun run = await InProcessExecution.RunStreamingAsync(workflow, messages);

This will throw the following exception

System.TypeLoadException: Could not load type 'Microsoft.Extensions.AI.UserInputResponseContent' from assembly 'Microsoft.Extensions.AI.Abstractions, Version=10.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
   at Microsoft.Agents.AI.Workflows.Specialized.AIAgentHostExecutor.ConfigureUserInputHandling(ProtocolBuilder protocolBuilder)
   at Microsoft.Agents.AI.Workflows.Specialized.AIAgentHostExecutor.ConfigureUserInputHandling(ProtocolBuilder protocolBuilder)
   at Microsoft.Agents.AI.Workflows.Specialized.AIAgentHostExecutor.ConfigureProtocol(ProtocolBuilder protocolBuilder)
   at Microsoft.Agents.AI.Workflows.Executor.get_Protocol()
   at Microsoft.Agents.AI.Workflows.Executor.AttachRequestContext(IExternalRequestContext externalRequestContext)
   at Microsoft.Agents.AI.Workflows.InProc.InProcessRunnerContext.<>c__DisplayClass16_0.<<EnsureExecutorAsync>g__CreateExecutorAsync|0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.Agents.AI.Workflows.InProc.InProcessRunnerContext.EnsureExecutorAsync(String executorId, IStepTracer tracer, CancellationToken cancellationToken)
   at Microsoft.Agents.AI.Workflows.InProc.InProcessRunner.IsValidInputTypeAsync(Type messageType, CancellationToken cancellationToken)
   at Microsoft.Agents.AI.Workflows.InProc.InProcessRunner.EnqueueMessageUntypedAsync(Object message, Type declaredType, CancellationToken cancellationToken)
   at Microsoft.Agents.AI.Workflows.Execution.AsyncRunHandle.EnqueueMessageAsync[T](T message, CancellationToken cancellationToken)
   at Microsoft.Agents.AI.Workflows.Execution.AsyncRunHandleExtensions.EnqueueAndStreamAsync[TInput](AsyncRunHandle runHandle, TInput input, CancellationToken cancellationToken)
   at Microsoft.Agents.AI.Workflows.InProc.InProcessExecutionEnvironment.RunStreamingAsync[TInput](Workflow workflow, TInput input, String sessionId, CancellationToken cancellationToken)

Code Sample

StreamingRun run = await InProcessExecution.RunStreamingAsync(workflow, messages);

Error Messages / Stack Traces

System.TypeLoadException: Could not load type 'Microsoft.Extensions.AI.UserInputResponseContent' from assembly 'Microsoft.Extensions.AI.Abstractions, Version=10.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
   at Microsoft.Agents.AI.Workflows.Specialized.AIAgentHostExecutor.ConfigureUserInputHandling(ProtocolBuilder protocolBuilder)
   at Microsoft.Agents.AI.Workflows.Specialized.AIAgentHostExecutor.ConfigureUserInputHandling(ProtocolBuilder protocolBuilder)
   at Microsoft.Agents.AI.Workflows.Specialized.AIAgentHostExecutor.ConfigureProtocol(ProtocolBuilder protocolBuilder)
   at Microsoft.Agents.AI.Workflows.Executor.get_Protocol()
   at Microsoft.Agents.AI.Workflows.Executor.AttachRequestContext(IExternalRequestContext externalRequestContext)
   at Microsoft.Agents.AI.Workflows.InProc.InProcessRunnerContext.<>c__DisplayClass16_0.<<EnsureExecutorAsync>g__CreateExecutorAsync|0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.Agents.AI.Workflows.InProc.InProcessRunnerContext.EnsureExecutorAsync(String executorId, IStepTracer tracer, CancellationToken cancellationToken)
   at Microsoft.Agents.AI.Workflows.InProc.InProcessRunner.IsValidInputTypeAsync(Type messageType, CancellationToken cancellationToken)
   at Microsoft.Agents.AI.Workflows.InProc.InProcessRunner.EnqueueMessageUntypedAsync(Object message, Type declaredType, CancellationToken cancellationToken)
   at Microsoft.Agents.AI.Workflows.Execution.AsyncRunHandle.EnqueueMessageAsync[T](T message, CancellationToken cancellationToken)
   at Microsoft.Agents.AI.Workflows.Execution.AsyncRunHandleExtensions.EnqueueAndStreamAsync[TInput](AsyncRunHandle runHandle, TInput input, CancellationToken cancellationToken)
   at Microsoft.Agents.AI.Workflows.InProc.InProcessExecutionEnvironment.RunStreamingAsync[TInput](Workflow workflow, TInput input, String sessionId, CancellationToken cancellationToken)

Package Versions

Microsoft.Agents.AI:1.0.0-rc4, Microsoft.Extensions.AI: 10.4.0

.NET Version

.NET 10.0

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions