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

[Feature] Add streaming ability in chat page using Azure SignalR service #383

Merged

Conversation

phanthaiduong22
Copy link

@phanthaiduong22 phanthaiduong22 commented Nov 25, 2024

Purpose

  • Currently, on the Chat page, when we ask a question, the system gathers all information (e.g., answer, thought, supportingContent, etc.) and responds to the client through the API.
  • We are adding streaming capability. Whenever the LLM responds with an answer in a streaming format, we can use a SignalR connection (WebSocket) to push messages directly.

Does this introduce a breaking change?

[x] Yes
[ ] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
  • Test the code
azd up
  • Go to the Chat page.
  • There will be options to select between streaming mode and normal mode.

What to Check

Verify that the following are valid

  • Verify normal mode is working as previously
  • Verify streaming mode is working as expected

Next steps:

  • Add unit tests
  • Add docs
  • Verify running locally without AzureSignalREndpoint env configure

Other Information

@phanthaiduong22 phanthaiduong22 changed the title [Draft] Add streaming ability in chat page using Azure SignalR service [Feature] Add streaming ability in chat page using Azure SignalR service Nov 25, 2024
name: 'Premium_P1'
}

resource signalR 'Microsoft.SignalRService/signalR@2023-08-01-preview' = {

Check failure

Code scanning / templateanalyzer

Use managed identities for SignalR Services. Error

A managed identity allows your service to access other Azure AD-protected resources such as Azure Functions. The identity is managed by the Azure platform and doesn't require you to provision or rotate any secrets.
Using Azure managed identities have the following benefits: You don't need to store or manage credentials.
Azure automatically generates tokens and performs rotation. You can use managed identities to authenticate to any Azure service that supports Azure AD authentication. Managed identities can be used without any additional cost.
@jmatthiesen
Copy link
Collaborator

Thank you for the PR! This looks like a good approach to use for performance optimization and I think we should provide it as an option to customers. At the same time, we're working to have the main branch demonstrate the patterns used by AI libraries by default, such as Streaming APIs that they provide. @LittleLittleCloud suggested a great idea in an internal discussion - create a separate branch for this work and mention it in the Readme for the main branch. This is what we do for Redis support as well and it's a good way to present alternate architectures without increasing complexity on the default sample.

@phanthaiduong22 phanthaiduong22 changed the base branch from main to signalr December 16, 2024 03:59
@luisquintanilla luisquintanilla merged commit 3e072ed into Azure-Samples:signalr Jan 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants