mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: [Breaking] RenameAgentRunResponse and AgentRunResponseUpdate classes (#3197)
* rename AgentRunResponse and AgentRunResponseUpdate classes - part1 * rename varialbles, parameters, methods and tests * rollback unnecessary changes
This commit is contained in:
committed by
GitHub
Unverified
parent
8b1449024e
commit
c70e594e6c
@@ -86,12 +86,12 @@ public abstract class BaseSample : TextWriter
|
||||
/// Processes and writes the latest agent chat response to the console, including metadata and content details.
|
||||
/// </summary>
|
||||
/// <remarks>This method formats and outputs the most recent message from the provided <see
|
||||
/// cref="AgentRunResponse"/> object. It includes the message role, author name (if available), text content, and
|
||||
/// cref="AgentResponse"/> object. It includes the message role, author name (if available), text content, and
|
||||
/// additional content such as images, function calls, and function results. Usage statistics, including token
|
||||
/// counts, are also displayed.</remarks>
|
||||
/// <param name="response">The <see cref="AgentRunResponse"/> object containing the chat messages and usage data.</param>
|
||||
/// <param name="response">The <see cref="AgentResponse"/> object containing the chat messages and usage data.</param>
|
||||
/// <param name="printUsage">The flag to indicate whether to print usage information. Defaults to <see langword="true"/>.</param>
|
||||
protected void WriteResponseOutput(AgentRunResponse response, bool? printUsage = true)
|
||||
protected void WriteResponseOutput(AgentResponse response, bool? printUsage = true)
|
||||
{
|
||||
if (response.Messages.Count == 0)
|
||||
{
|
||||
@@ -150,11 +150,11 @@ public abstract class BaseSample : TextWriter
|
||||
/// Writes the streaming agent response updates to the console.
|
||||
/// </summary>
|
||||
/// <remarks>This method formats and outputs the most recent message from the provided <see
|
||||
/// cref="AgentRunResponseUpdate"/> object. It includes the message role, author name (if available), text content, and
|
||||
/// cref="AgentResponseUpdate"/> object. It includes the message role, author name (if available), text content, and
|
||||
/// additional content such as images, function calls, and function results. Usage statistics, including token
|
||||
/// counts, are also displayed.</remarks>
|
||||
/// <param name="update">The <see cref="AgentRunResponseUpdate"/> object containing the chat messages and usage data.</param>
|
||||
protected void WriteAgentOutput(AgentRunResponseUpdate update)
|
||||
/// <param name="update">The <see cref="AgentResponseUpdate"/> object containing the chat messages and usage data.</param>
|
||||
protected void WriteAgentOutput(AgentResponseUpdate update)
|
||||
{
|
||||
if (update.Contents.Count == 0)
|
||||
{
|
||||
|
||||
@@ -75,13 +75,13 @@ public abstract class OrchestrationSample : BaseSample
|
||||
/// <summary>
|
||||
/// Writes the streamed agent run response updates to the console or test output, including role and author information.
|
||||
/// </summary>
|
||||
/// <param name="streamedResponses">An enumerable of <see cref="AgentRunResponseUpdate"/> objects representing streamed responses.</param>
|
||||
protected static void WriteStreamedResponse(IEnumerable<AgentRunResponseUpdate> streamedResponses)
|
||||
/// <param name="streamedResponses">An enumerable of <see cref="AgentResponseUpdate"/> objects representing streamed responses.</param>
|
||||
protected static void WriteStreamedResponse(IEnumerable<AgentResponseUpdate> streamedResponses)
|
||||
{
|
||||
string? authorName = null;
|
||||
ChatRole? authorRole = null;
|
||||
StringBuilder builder = new();
|
||||
foreach (AgentRunResponseUpdate response in streamedResponses)
|
||||
foreach (AgentResponseUpdate response in streamedResponses)
|
||||
{
|
||||
authorName ??= response.AuthorName;
|
||||
authorRole ??= response.Role;
|
||||
@@ -106,7 +106,7 @@ public abstract class OrchestrationSample : BaseSample
|
||||
/// <summary>
|
||||
/// Gets the list of streamed response updates received so far.
|
||||
/// </summary>
|
||||
public List<AgentRunResponseUpdate> StreamedResponses { get; } = [];
|
||||
public List<AgentResponseUpdate> StreamedResponses { get; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of chat messages representing the conversation history.
|
||||
@@ -131,9 +131,9 @@ public abstract class OrchestrationSample : BaseSample
|
||||
/// <summary>
|
||||
/// Callback to handle a streamed agent run response update, adding it to the list and writing output if final.
|
||||
/// </summary>
|
||||
/// <param name="streamedResponse">The <see cref="AgentRunResponseUpdate"/> to process.</param>
|
||||
/// <param name="streamedResponse">The <see cref="AgentResponseUpdate"/> to process.</param>
|
||||
/// <returns>A <see cref="ValueTask"/> representing the asynchronous operation.</returns>
|
||||
public ValueTask StreamingResultCallbackAsync(AgentRunResponseUpdate streamedResponse)
|
||||
public ValueTask StreamingResultCallbackAsync(AgentResponseUpdate streamedResponse)
|
||||
{
|
||||
this.StreamedResponses.Add(streamedResponse);
|
||||
return default;
|
||||
|
||||
Reference in New Issue
Block a user