mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: Update M.A.AI.OpenAI implementations (#1018)
* Update M.A.AI.OpenAI implementations
- There was only a ChatClient-based agent. Add a Responses one, too.
- Fix the public extension methods to create OpenAI types even when not backed by the right OpenAI client.
- Add reusable AgentRunResponse{Update} to ChatResponse{Update} conversion routines that are then used by the OpenAI agents and elsewhere
* Address feedback
This commit is contained in:
committed by
GitHub
Unverified
parent
8dad045c9d
commit
2d20e644df
@@ -72,19 +72,7 @@ internal sealed class MessageMerger
|
||||
throw new InvalidOperationException($"No updates found for message ID '{messageId}' in response '{this.ResponseId}'.");
|
||||
}
|
||||
|
||||
return updates.Select(oldUpdate =>
|
||||
oldUpdate.RawRepresentation as ChatResponseUpdate ??
|
||||
new()
|
||||
{
|
||||
AdditionalProperties = oldUpdate.AdditionalProperties,
|
||||
AuthorName = oldUpdate.AuthorName,
|
||||
Contents = oldUpdate.Contents,
|
||||
CreatedAt = oldUpdate.CreatedAt,
|
||||
MessageId = oldUpdate.MessageId,
|
||||
RawRepresentation = oldUpdate.RawRepresentation,
|
||||
Role = oldUpdate.Role,
|
||||
ResponseId = oldUpdate.ResponseId,
|
||||
}).ToChatResponse().Messages;
|
||||
return updates.Select(oldUpdate => oldUpdate.AsChatResponseUpdate()).ToChatResponse().Messages;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user