131 lines
6.5 KiB
XML
131 lines
6.5 KiB
XML
<UserControl x:Class="AnotherReplayReader.AIProviderSettingsControl"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="350" d:DesignWidth="650">
|
|
<Grid Margin="10">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="180"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- 左侧:Provider 列表 -->
|
|
<Grid Grid.Column="0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<ListBox x:Name="_providerListBox"
|
|
Grid.Row="0"
|
|
DisplayMemberPath="Name"
|
|
SelectionChanged="OnProviderSelectionChanged"/>
|
|
|
|
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
|
<Button Content="新增" Click="OnAddProviderClick" Margin="2"/>
|
|
<Button Content="删除" Click="OnRemoveProviderClick" Margin="2"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<!-- 右侧:Provider 编辑 + 模型管理 -->
|
|
<Grid Grid.Column="1" Margin="10,0,0,0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Provider 基本信息 -->
|
|
<Grid Grid.Row="0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="80"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Label Grid.Row="0" Grid.Column="0" Content="名称"/>
|
|
<TextBox x:Name="_providerNameBox" Grid.Row="0" Grid.Column="1"/>
|
|
|
|
<Label Grid.Row="1" Grid.Column="0" Content="Base URL"/>
|
|
<TextBox x:Name="_providerUrlBox" Grid.Row="1" Grid.Column="1"/>
|
|
|
|
<Label Grid.Row="2" Grid.Column="0" Content="API Key"/>
|
|
<PasswordBox x:Name="_providerKeyBox" Grid.Row="2" Grid.Column="1"/>
|
|
|
|
<StackPanel Grid.Row="3" Grid.ColumnSpan="2" Orientation="Horizontal" Margin="0,5">
|
|
<Label Content="Temperature" VerticalAlignment="Center"/>
|
|
<TextBox x:Name="_temperatureBox" Width="50" Margin="2"/>
|
|
<Label Content="TopP" VerticalAlignment="Center" Margin="10,0,0,0"/>
|
|
<TextBox x:Name="_topPBox" Width="50" Margin="2"/>
|
|
<Label Content="MaxTokens" VerticalAlignment="Center" Margin="10,0,0,0"/>
|
|
<TextBox x:Name="_maxTokensBox" Width="60" Margin="2"/>
|
|
<Button Content="应用" Click="OnApplyProviderClick" Margin="10,0,0,0"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<!-- 模型管理区域 -->
|
|
<GroupBox Header="模型" Grid.Row="1" Margin="0,5,0,0">
|
|
<DockPanel>
|
|
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="0,0,0,5">
|
|
<ComboBox x:Name="_modelComboBox"
|
|
Width="200"
|
|
DisplayMemberPath="DisplayText"
|
|
SelectionChanged="OnModelSelectionChanged"/>
|
|
<Button Content="获取模型列表" Click="OnFetchModelsClick" Margin="5,0"/>
|
|
<Button Content="添加自定义" Click="OnAddCustomModelClick" Margin="5,0"/>
|
|
<Button Content="删除模型" Click="OnRemoveModelClick" Margin="5,0"/>
|
|
</StackPanel>
|
|
|
|
<!-- 模型详情 -->
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="100"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Label Grid.Row="0" Grid.Column="0" Content="模型 ID"/>
|
|
<TextBox x:Name="_modelIdBox" Grid.Row="0" Grid.Column="1"/>
|
|
|
|
<Label Grid.Row="1" Grid.Column="0" Content="上下文长度"/>
|
|
<TextBox x:Name="_contextLengthBox" Grid.Row="1" Grid.Column="1"/>
|
|
|
|
<CheckBox x:Name="_supportsSseCheck"
|
|
Grid.Row="2" Grid.Column="1"
|
|
Content="支持 SSE 流式输出"
|
|
Margin="0,5"/>
|
|
|
|
<Label Grid.Row="3" Grid.Column="0" Content="高级参数"/>
|
|
<TextBox x:Name="_extraParamsBox"
|
|
Grid.Row="3" Grid.Column="1"
|
|
MinHeight="80"
|
|
AcceptsReturn="True"
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"/>
|
|
|
|
<StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
|
<Button Content="应用模型修改" Click="OnApplyModelClick" Margin="2"/>
|
|
<Button Content="从已知模板填充" Click="OnFillFromKnownModelsClick" Margin="2"/>
|
|
</StackPanel>
|
|
|
|
<TextBlock x:Name="_modelStatusText"
|
|
Grid.Row="5" Grid.ColumnSpan="2"
|
|
Foreground="Gray" Margin="0,5"/>
|
|
</Grid>
|
|
</DockPanel>
|
|
</GroupBox>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl> |