Skip to content

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

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

Merged
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="Microsoft.Azure.SignalR" Version="1.27.0" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.8" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions app/SharedWebComponents/Components/Answer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
}
</div>
}
@if (answer is { FollowupQuestions.Count: > 0 })
@if (Retort?.Context?.FollowupQuestions is { Length: > 0 })
{
<div class="pt-4">
<MudText Typo="Typo.subtitle2" Class="pb-2">Follow-up questions:</MudText>
@foreach (var followup in answer.FollowupQuestions)
@foreach (var followup in Retort.Context.FollowupQuestions)
{
<MudChip Variant="Variant.Text" Color="Color.Tertiary"
OnClick="@(_ => OnAskFollowupAsync(followup))">
Expand Down
4 changes: 4 additions & 0 deletions app/SharedWebComponents/Components/SettingsPanel.razor
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
Color="Color.Primary"
Label="Use query-contextual summaries instead of whole documents" />

<MudCheckBox @bind-Checked="@Settings.Overrides.UseStreaming" Size="Size.Large"
Color="Color.Primary"
Label="Use streaming responses" />

<MudCheckBox @bind-Checked="@Settings.Overrides.SuggestFollowupQuestions" Size="Size.Large"
Color="Color.Primary" Label="Suggest follow-up questions"
aria-label="Suggest follow-up questions checkbox." />
Expand Down
4 changes: 4 additions & 0 deletions app/SharedWebComponents/Pages/Chat.razor
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@
OnClick="@OnClearChat" Disabled=@(_isReceivingResponse || _questionAndAnswerMap is { Count: 0 }) />
</MudTooltip>
</MudItem>
<MudItem xs="12" Class="pa-2">
<MudCheckBox @bind-Checked="_useStreaming" Label="Use streaming mode" Color="Color.Secondary"
Disabled="@_isReceivingResponse" />
</MudItem>
</MudGrid>
</MudItem>
</MudGrid>
Expand Down
Loading