mirror of
				https://github.com/MindWorkAI/AI-Studio.git
				synced 2025-11-04 01:20:21 +00:00 
			
		
		
		
	
		
			Some checks are pending
		
		
	
	Build and Release / Publish release (push) Blocked by required conditions
				
			Build and Release / Prepare & create release (push) Blocked by required conditions
				
			Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
				
			Build and Release / Read metadata (push) Waiting to run
				
			Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Blocked by required conditions
				
			Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
				
			Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
				
			Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Blocked by required conditions
				
			Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
				
			
		
			
				
	
	
		
			148 lines
		
	
	
		
			7.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			148 lines
		
	
	
		
			7.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
@using AIStudio.Chat
 | 
						|
@inherits AssistantLowerBase
 | 
						|
@typeparam TSettings
 | 
						|
 | 
						|
<div class="inner-scrolling-context">
 | 
						|
 | 
						|
    <MudStack Row="true" AlignItems="AlignItems.Center" Class="mb-2 mr-3" StretchItems="StretchItems.Start">
 | 
						|
        <MudText Typo="Typo.h3">
 | 
						|
            @this.Title
 | 
						|
        </MudText>
 | 
						|
        
 | 
						|
        <MudIconButton Variant="Variant.Text" Icon="@Icons.Material.Filled.Settings" OnClick="@(async () => await this.OpenSettingsDialog())"/>
 | 
						|
    </MudStack>
 | 
						|
 | 
						|
    <InnerScrolling>
 | 
						|
        <ChildContent>
 | 
						|
            <MudForm @ref="@(this.form)" @bind-IsValid="@(this.inputIsValid)" @bind-Errors="@(this.inputIssues)" FieldChanged="@this.TriggerFormChange" Class="pr-2">
 | 
						|
                <MudText Typo="Typo.body1" Align="Align.Justify" Class="mb-2">
 | 
						|
                    @this.Description
 | 
						|
                </MudText>
 | 
						|
 | 
						|
                @if (this.Body is not null)
 | 
						|
                {
 | 
						|
                    <CascadingValue Value="@this">
 | 
						|
                        @this.Body
 | 
						|
                    </CascadingValue>
 | 
						|
                    
 | 
						|
                    <MudStack Row="true" AlignItems="AlignItems.Center" StretchItems="StretchItems.Start" Class="mb-3">
 | 
						|
                        <MudButton Disabled="@this.SubmitDisabled" Variant="Variant.Filled" OnClick="@(async () => await this.Start())" Style="@this.SubmitButtonStyle">
 | 
						|
                            @this.SubmitText
 | 
						|
                        </MudButton>
 | 
						|
                        @if (this.isProcessing && this.cancellationTokenSource is not null)
 | 
						|
                        {
 | 
						|
                            <MudTooltip Text="@TB("Stop generation")">
 | 
						|
                                <MudIconButton Variant="Variant.Filled" Icon="@Icons.Material.Filled.Stop" Color="Color.Error" OnClick="@(async () => await this.CancelStreaming())"/>
 | 
						|
                            </MudTooltip>
 | 
						|
                        }
 | 
						|
                    </MudStack>
 | 
						|
                }
 | 
						|
            </MudForm>
 | 
						|
            <Issues IssuesData="@(this.inputIssues)"/>
 | 
						|
 | 
						|
            @if (this.ShowDedicatedProgress && this.isProcessing)
 | 
						|
            {
 | 
						|
                <MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="mb-6" />
 | 
						|
            }
 | 
						|
            
 | 
						|
            <div id="@RESULT_DIV_ID" class="mr-2 mt-3">
 | 
						|
            </div>
 | 
						|
 | 
						|
            <div id="@BEFORE_RESULT_DIV_ID" class="mt-3">
 | 
						|
            </div>
 | 
						|
 | 
						|
            @if (this.ShowResult && !this.ShowEntireChatThread && this.resultingContentBlock is not null)
 | 
						|
            {
 | 
						|
                <ContentBlockComponent Role="@(this.resultingContentBlock.Role)" Type="@(this.resultingContentBlock.ContentType)" Time="@(this.resultingContentBlock.Time)" Content="@(this.resultingContentBlock.Content)"/>
 | 
						|
            }
 | 
						|
            
 | 
						|
            @if(this.ShowResult && this.ShowEntireChatThread && this.chatThread is not null)
 | 
						|
            {
 | 
						|
                foreach (var block in this.chatThread.Blocks.OrderBy(n => n.Time))
 | 
						|
                {
 | 
						|
                    @if (!block.HideFromUser)
 | 
						|
                    {
 | 
						|
                        <ContentBlockComponent Role="@block.Role" Type="@block.ContentType" Time="@block.Time" Content="@block.Content"/>
 | 
						|
                    }
 | 
						|
                }
 | 
						|
            }
 | 
						|
            
 | 
						|
            <div id="@AFTER_RESULT_DIV_ID" class="mt-3">
 | 
						|
            </div>
 | 
						|
        </ChildContent>
 | 
						|
        <FooterContent>
 | 
						|
            <MudStack Row="@true" Wrap="Wrap.Wrap" AlignItems="AlignItems.Center" StretchItems="StretchItems.None" Class="ma-1">
 | 
						|
                
 | 
						|
                @if (!this.FooterButtons.Any(x => x.Type is ButtonTypes.SEND_TO))
 | 
						|
                {
 | 
						|
                    @if (this.ShowSendTo)
 | 
						|
                    {
 | 
						|
                        <MudMenu AnchorOrigin="Origin.TopLeft" TransformOrigin="Origin.BottomLeft" StartIcon="@Icons.Material.Filled.Apps" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="@TB("Send to ...")" Variant="Variant.Filled" Style="@this.GetSendToColor()" Class="rounded">
 | 
						|
                            @foreach (var assistant in Enum.GetValues<Components>().Where(n => n.AllowSendTo()).OrderBy(n => n.Name().Length))
 | 
						|
                            {
 | 
						|
                                <MudMenuItem OnClick="@(async () => await this.SendToAssistant(assistant, new()))">
 | 
						|
                                    @assistant.Name()
 | 
						|
                                </MudMenuItem>
 | 
						|
                            }
 | 
						|
                        </MudMenu>
 | 
						|
                    }
 | 
						|
                }
 | 
						|
 | 
						|
                @foreach (var button in this.FooterButtons)
 | 
						|
                {
 | 
						|
                    switch (button)
 | 
						|
                    {
 | 
						|
                        case ButtonData buttonData when !string.IsNullOrWhiteSpace(buttonData.Tooltip):
 | 
						|
                            <MudTooltip Text="@buttonData.Tooltip">
 | 
						|
                                <MudButton Variant="Variant.Filled" Color="@buttonData.Color" Disabled="@buttonData.DisabledAction()" StartIcon="@GetButtonIcon(buttonData.Icon)" OnClick="@(async () => await buttonData.AsyncAction())">
 | 
						|
                                    @buttonData.Text
 | 
						|
                                </MudButton>
 | 
						|
                            </MudTooltip>
 | 
						|
                            break;
 | 
						|
 | 
						|
                        case ButtonData buttonData:
 | 
						|
                            <MudButton Variant="Variant.Filled" Color="@buttonData.Color" Disabled="@buttonData.DisabledAction()" StartIcon="@GetButtonIcon(buttonData.Icon)" OnClick="@(async () => await buttonData.AsyncAction())">
 | 
						|
                                @buttonData.Text
 | 
						|
                            </MudButton>
 | 
						|
                            break;
 | 
						|
 | 
						|
                        case SendToButton sendToButton:
 | 
						|
                            <MudMenu AnchorOrigin="Origin.TopLeft" TransformOrigin="Origin.BottomLeft" StartIcon="@Icons.Material.Filled.Apps" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="@TB("Send to ...")" Variant="Variant.Filled" Style="@this.GetSendToColor()" Class="rounded">
 | 
						|
                                @foreach (var assistant in Enum.GetValues<Components>().Where(n => n.AllowSendTo()).OrderBy(n => n.Name().Length))
 | 
						|
                                {
 | 
						|
                                    <MudMenuItem OnClick="@(async () => await this.SendToAssistant(assistant, sendToButton))">
 | 
						|
                                        @assistant.Name()
 | 
						|
                                    </MudMenuItem>
 | 
						|
                                }
 | 
						|
                            </MudMenu>
 | 
						|
                            break;
 | 
						|
                    }
 | 
						|
                }
 | 
						|
                
 | 
						|
                @if (this.ShowCopyResult)
 | 
						|
                {
 | 
						|
                    <MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.ContentCopy" OnClick="@(async () => await this.CopyToClipboard())">
 | 
						|
                        @TB("Copy result")
 | 
						|
                    </MudButton>
 | 
						|
                }
 | 
						|
 | 
						|
                @if (this.ShowReset)
 | 
						|
                {
 | 
						|
                    <MudButton Variant="Variant.Filled" Style="@this.GetResetColor()" StartIcon="@Icons.Material.Filled.Refresh" OnClick="@(async () => await this.InnerResetForm())">
 | 
						|
                        @TB("Reset")
 | 
						|
                    </MudButton>
 | 
						|
                }
 | 
						|
 | 
						|
                @if (this.SettingsManager.ConfigurationData.LLMProviders.ShowProviderConfidence)
 | 
						|
                {
 | 
						|
                    <ConfidenceInfo Mode="PopoverTriggerMode.BUTTON" LLMProvider="@this.providerSettings.UsedLLMProvider"/>
 | 
						|
                }
 | 
						|
 | 
						|
                @if (this.AllowProfiles && this.ShowProfileSelection)
 | 
						|
                {
 | 
						|
                    <ProfileSelection MarginLeft="" @bind-CurrentProfile="@this.currentProfile"/>
 | 
						|
                }
 | 
						|
            </MudStack>
 | 
						|
        </FooterContent>
 | 
						|
    </InnerScrolling>
 | 
						|
</div> |