Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Add Examples to retrieve FinishReason/DoneReason and other details with the Ollama connector #8889

Conversation

akordowski
Copy link
Contributor

Motivation and Context

As other connectors are providing a FinishReason = "STOP" metadata in the last StreamingChatMessageContent message, I adjusted the GetStreamingChatMessageContentsAsync() method in the OllamaChatCompletionService to provide the expected metadata.

Description

The ChatResponseStream message from the OllamaSharp package provides a Done property, which indicates if the stream is finished. This property is used to determine when to set the metadata with FinishReason = "STOP".

Contribution Checklist

@akordowski akordowski requested a review from a team as a code owner September 18, 2024 09:00
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Sep 18, 2024
@akordowski akordowski changed the title .Net: Add missing FinishReason to the StreamingChatMessageContent in the Ollama connector (#8888) .Net: Add missing FinishReason to the StreamingChatMessageContent in the Ollama connector Sep 18, 2024
@RogerBarreto RogerBarreto self-assigned this Sep 19, 2024
@RogerBarreto
Copy link
Member

@akordowski Thank you for the contribution, I'm changing this PR to clarify how you can retrieve the desired information using the Breaking Glass inner content property.

@akordowski
Copy link
Contributor Author

@RogerBarreto Sounds good, thank you very much!

@RogerBarreto RogerBarreto changed the title .Net: Add missing FinishReason to the StreamingChatMessageContent in the Ollama connector .Net: Add Examples to retrieve FinishReason/DoneReason and other details with the Ollama connector Sep 19, 2024
@RogerBarreto RogerBarreto added this pull request to the merge queue Sep 19, 2024
Merged via the queue into microsoft:main with commit 0ae0e52 Sep 19, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants