mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET Workflows - Capture the identifier of the LastMessage (the workflow input) (#1372)
* Fixed * Test fix
This commit is contained in:
+2
-2
@@ -40,8 +40,8 @@ internal sealed class DeclarativeWorkflowExecutor<TInput>(
|
||||
}
|
||||
await declarativeContext.QueueConversationUpdateAsync(conversationId, isExternal: true, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
await options.AgentProvider.CreateMessageAsync(conversationId, input, cancellationToken).ConfigureAwait(false);
|
||||
await declarativeContext.SetLastMessageAsync(input).ConfigureAwait(false);
|
||||
ChatMessage inputMessage = await options.AgentProvider.CreateMessageAsync(conversationId, input, cancellationToken).ConfigureAwait(false);
|
||||
await declarativeContext.SetLastMessageAsync(inputMessage).ConfigureAwait(false);
|
||||
|
||||
await context.SendResultMessageAsync(this.Id, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
@@ -67,8 +67,8 @@ public abstract class RootExecutor<TInput> : Executor<TInput>, IResettableExecut
|
||||
}
|
||||
await declarativeContext.QueueConversationUpdateAsync(this._conversationId, isExternal: true, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
await this._agentProvider.CreateMessageAsync(this._conversationId, input, cancellationToken).ConfigureAwait(false);
|
||||
await declarativeContext.SetLastMessageAsync(input).ConfigureAwait(false);
|
||||
ChatMessage inputMessage = await this._agentProvider.CreateMessageAsync(this._conversationId, input, cancellationToken).ConfigureAwait(false);
|
||||
await declarativeContext.SetLastMessageAsync(inputMessage).ConfigureAwait(false);
|
||||
|
||||
await declarativeContext.SendResultMessageAsync(this.Id, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
+8
-1
@@ -274,6 +274,13 @@ internal sealed class WorkflowExpressionEngine
|
||||
expression.VariableReference?.ToString() :
|
||||
expression.ExpressionText;
|
||||
|
||||
return new(this._engine.Eval(expressionText), SensitivityLevel.None);
|
||||
FormulaValue result = this._engine.Eval(expressionText);
|
||||
|
||||
if (result is ErrorValue errorValue)
|
||||
{
|
||||
throw new DeclarativeActionException(errorValue.Format());
|
||||
}
|
||||
|
||||
return new(result, SensitivityLevel.None);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user