Compare commits

..

No commits in common. "735fbfb83dc59c085df176cdb954254b4c167835" and "3f9d3b3399d50c42df20f28cb5b98a30283431ab" have entirely different histories.

5 changed files with 35 additions and 41 deletions

View File

@ -379,22 +379,15 @@ public class MarkdownWpfRenderer
if (text.StartsWith("<think>")) if (text.StartsWith("<think>"))
{ {
text = text.Replace("<think>", "").Replace("</think>", ""); text = text.Replace("<think>", "").Replace("</think>", "");
var htmlText = new SelectableTextBlock();
htmlText.Text = text;
var expander = new Expander();
var header = new StackPanel();
header.Children.Add(new ProgressBar() { IsIndeterminate = true, Width = 30 });
expander.Header = header;
expander.Content = htmlText;
return expander;
} }
else var htmlText = new SelectableTextBlock();
{ htmlText.Text = text;
var htmlText = new SelectableTextBlock(); var expander = new Expander();
htmlText.Text = text; var header = new StackPanel();
return htmlText; header.Children.Add(new ProgressBar() { IsIndeterminate = true,Width = 30 });
} expander.Header = header;
expander.Content = htmlText;
return expander;
} }
public FrameworkElement RenderMathBlock(MathBlock mathBlock, CancellationToken cancellationToken) public FrameworkElement RenderMathBlock(MathBlock mathBlock, CancellationToken cancellationToken)

View File

@ -50,6 +50,17 @@ class PromptUtil
5. 使 5. 使
<><>
<think>
[在此详细说明你的思考过程]
</think>
[在此给出你的回答]
"; ";
} }
} }

View File

@ -12,7 +12,7 @@
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" /> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" />
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" /> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" />
<mu:ControlsDictionary /> <mu:ControlsDictionary />
<mu:ThemeDictionary /> <mu:ThemeDictionary ColorMode="Light" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>

View File

@ -88,28 +88,18 @@
</TabItem> </TabItem>
</TabControl> </TabControl>
<DockPanel> <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<hc:ButtonGroup Margin="5,0"> <TextBlock
<Button Margin="0,5,5,0"
Height="20" FontSize="10"
hc:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" Foreground="#99000000"
Background="Transparent" Text="{Binding Content.Length, StringFormat='字数: {0}'}" />
FontSize="10" <TextBlock
Foreground="#99000000" /> Margin="0,5,0,0"
</hc:ButtonGroup> FontSize="10"
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> Foreground="#99000000"
<TextBlock Text="{Binding Timestamp, StringFormat='{}{0:HH:mm}'}" />
Margin="0,5,5,0" </StackPanel>
FontSize="10"
Foreground="#99000000"
Text="{Binding Content.Length, StringFormat='字数: {0}'}" />
<TextBlock
Margin="0,5,0,0"
FontSize="10"
Foreground="#99000000"
Text="{Binding Timestamp, StringFormat='{}{0:HH:mm}'}" />
</StackPanel>
</DockPanel>
<hc:Divider <hc:Divider
Height="10" Height="10"
Margin="0,3" Margin="0,3"

View File

@ -321,9 +321,8 @@ public partial class ImportViewModel : ObservableRecipient, IViewModel
}; };
Messages.Add(aiChat); Messages.Add(aiChat);
var promptedMsg = PromptUtil.UsePrompt(message,ExcelPromptString); #if !DEBUG
#if DEBUG var results = TEST_AI_CONTENT.Split('\n');
var results = promptedMsg.Split('\n');
foreach(var result in results) foreach(var result in results)
{ {
aiChat.Content += result; aiChat.Content += result;
@ -331,6 +330,7 @@ public partial class ImportViewModel : ObservableRecipient, IViewModel
await Task.Delay(5); await Task.Delay(5);
} }
#else #else
var promptedMsg = PromptUtil.UsePrompt(message,ExcelPromptString);
history.Add(new Microsoft.Extensions.AI.ChatMessage history.Add(new Microsoft.Extensions.AI.ChatMessage
{ {
Role = Microsoft.Extensions.AI.ChatRole.User, Role = Microsoft.Extensions.AI.ChatRole.User,