Skip to content

Commit

Permalink
添加图标
Browse files Browse the repository at this point in the history
  • Loading branch information
mehaifeng committed May 5, 2023
1 parent 6bf13f0 commit 5589123
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ViewModels/VisualChatViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public partial class VisualChatViewModel : ObservableObject, INotifyPropertyChan
string historyChatPath = $"{System.Environment.CurrentDirectory}//HistoryChat.json";
//API地址
string urlAddress = $"https://api.openai.com/v1/chat/completions";
//是否处于发送状态
bool isSending = false;
//发送次数
int sendTimes = 0 ;
private List<HistoryMessage> historyMessages = new List<HistoryMessage>();
Expand Down Expand Up @@ -152,6 +154,7 @@ void InitLoad()
[RelayCommand]
async void Send(StackPanel o)
{
if(isSending) return;
if (!string.IsNullOrEmpty(UserConfig.Apikey)&&!string.IsNullOrEmpty(MyInput))
{
#region 控件生成流
Expand Down Expand Up @@ -205,6 +208,7 @@ async void Send(StackPanel o)
};
MyInput = string.Empty;
string inputJson = JsonConvert.SerializeObject(input);
isSending = true;
StringContent requestContent = new StringContent(inputJson, Encoding.UTF8, "application/json");
CancellationTokenSource tokenSource = new CancellationTokenSource();
var getApiRespond = GetAPIRespond(requestContent);
Expand Down Expand Up @@ -270,6 +274,7 @@ async void Send(StackPanel o)
ShowGenerateText(receivedViewModel);
//总结主要话题
SummarizeTitle();
isSending = false;
#endregion
}
if (string.IsNullOrEmpty(UserConfig.Apikey))
Expand Down
5 changes: 5 additions & 0 deletions VisualChatBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
<BaseOutputPath>bin\</BaseOutputPath>
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<ApplicationIcon>artificial-removebg-preview.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<None Remove="Assets\Fonts\iconfont.ttf" />
</ItemGroup>

<ItemGroup>
<Content Include="artificial-removebg-preview.ico" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0-preview3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
Expand Down
Binary file added artificial-removebg-preview.ico
Binary file not shown.

0 comments on commit 5589123

Please sign in to comment.