Skip to content

Chat stream - #836

Closed
Rodrigo Roman (dedalo) wants to merge 2 commits into
microsoft:mainfrom
dedalo:chatStream
Closed

Rodrigo Roman (dedalo) wants to merge 2 commits into
microsoft:mainfrom
dedalo:chatStream

Conversation

@dedalo

@dedalo Rodrigo Roman (dedalo) commented May 6, 2023 •

Copy link
Copy Markdown
Contributor

Motivation and Context

  1. This change is required to add OpenAI chat stream capabilities to the Semantic Kernel, making it more versatile and useful in real-time chat applications.
  2. The problem it solves is the inability to process and handle chat data in real-time, leading to a less interactive and responsive user experience.
  3. This contributes to a scenario where developers can now integrate the Semantic Kernel with chat applications that require real-time processing and streaming of chat data.
  4. This PR does not fix an open issue but improves the overall functionality and usability of the Semantic Kernel. might be duplicate of this Streaming support, implementation of IAsyncEnumberalbe #378

Description

This PR adds OpenAI chat stream capabilities to the Semantic Kernel. The changes include modifications to the existing code to enable handling of real-time chat data and sending partial responses to the client as the data is received. The overall approach focuses on maintaining the existing architecture while extending its functionality. This update enhances the Semantic Kernel's ability to work with chat applications requiring real-time interactions and responsiveness.

Contribution Checklist

@github-actions github-actions Bot added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels May 6, 2023
@dedalo

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@dedalo

Rodrigo Roman (dedalo) commented May 6, 2023 via email

Copy link
Copy Markdown
Contributor Author

@shawncal

Copy link
Copy Markdown
Contributor

Hi Rodrigo Roman (@dedalo), thank you for your contribution, and welcome to Semantic Kernel!

It would seem "great minds think alike," as we've got two very similar PRs at the moment: yours and this one:
#829

It looks like #829 is the more comprehensive, as it includes updates to the samples and it uses the async streaming IAsyncEnumerable<string> pattern (instead of the Func callback) which is well-aligned with the Stream* methods in its sister classes, AzuretTextCompletion and OpenAITextCompletion.

That said, we'd love to include you as a contributor. Would you mind doing a review of #829 and let us know if it'll work for you? If you believe it will, please go ahead and close this PR.

Roger Barreto (@rogerbarreto), please add the co-author tag to the PR description in #829:

Co-authored-by: dedalo [email protected]

@shawncal Shawn Callegari (shawncal) added duplicate This issue or pull request already exists PR: paused PR temporarily parked labels May 7, 2023
@dedalo

Copy link
Copy Markdown
Contributor Author

reviewed #829 and it works great for me, changing from on to the other was a brieze so I have my lab with signalr warking with RB implementation. waiting forward for the merge. closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code PR: paused PR temporarily parked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants