mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: [BREAKING] Add GetService for AIContextProviders and ChatMessageStore (#874)
* Add GetService for AIContextProviders and ChatMessageStore * Change styling and fix format issues * Update sample code to allow for missing memory component.
This commit is contained in:
committed by
GitHub
Unverified
parent
ae018ca4d9
commit
bd61e5f411
@@ -85,6 +85,10 @@ public abstract class InMemoryAgentThread : AgentThread
|
||||
return JsonSerializer.SerializeToElement(state, AgentAbstractionsJsonUtilities.DefaultOptions.GetTypeInfo(typeof(InMemoryAgentThreadState)));
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override object? GetService(Type serviceType, object? serviceKey = null) =>
|
||||
base.GetService(serviceType, serviceKey) ?? this.MessageStore?.GetService(serviceType, serviceKey);
|
||||
|
||||
/// <inheritdoc />
|
||||
protected internal override Task MessagesReceivedAsync(IEnumerable<ChatMessage> newMessages, CancellationToken cancellationToken = default)
|
||||
=> this.MessageStore.AddMessagesAsync(newMessages, cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user