Skip to content

Use ToChatCompletion / ToStreamingChatCompletionUpdates in CachingChatClient - #5616

Merged
stephentoub merged 3 commits into
dotnet:mainfrom
stephentoub:tostreaming
Nov 11, 2024
Merged

Use ToChatCompletion / ToStreamingChatCompletionUpdates in CachingChatClient#5616
stephentoub merged 3 commits into
dotnet:mainfrom
stephentoub:tostreaming

Conversation

@stephentoub

@stephentoubstephentoub commented Nov 11, 2024

Copy link
Copy Markdown
Member

Adds a ToStreamingChatCompletionUpdates method that's the counterpart to the recently added ToChatCompletion.

Then uses both from CachingChatClient instead of its now bespoke coalescing implementation. When coalescing is enabled (the default), CachingChatClient caches everything as a ChatCompletion, rather than distinguishing streaming and non-streaming.

Microsoft Reviewers: Open in CodeFlow

…tClient
Adds a ToStreamingChatCompletionUpdates method that's the counterpart to the recently added ToChatCompletion.
Then uses both from CachingChatClient instead of its now bespoke coalescing implementation. When coalescing is enabled (the default), CachingChatClient caches everything as a ChatCompletion, rather than distinguishing streaming and non-streaming.
@stephentoub
stephentoub merged commit 148e221 into dotnet:mainNov 11, 2024
@stephentoub
stephentoub deleted the tostreaming branch November 11, 2024 15:12
stephentoub added a commit to stephentoub/extensions that referenced this pull request Nov 19, 2024
…tClient (dotnet#5616)
* Use ToChatCompletion / ToStreamingChatCompletionUpdates in CachingChatClient
Adds a ToStreamingChatCompletionUpdates method that's the counterpart to the recently added ToChatCompletion.
Then uses both from CachingChatClient instead of its now bespoke coalescing implementation. When coalescing is enabled (the default), CachingChatClient caches everything as a ChatCompletion, rather than distinguishing streaming and non-streaming.
* Address PR feedback
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Dec 12, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-aiMicrosoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@stephentoub@eiriktsarpalis