Skip to content

Commit

Permalink
修改api设置
Browse files Browse the repository at this point in the history
  • Loading branch information
xk6338062 committed Mar 31, 2023
1 parent 8fdcb90 commit 8303c6f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ChatRevit/ChatRevitViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,16 @@ public ChatRevitViewModel(IDataContext dataContext, IExternalEventService extern
[RelayCommand]
private void AddAPIKEY()
{
ChatRevit.Default.GPT_API_KEY = input;
ChatRevit.Default.Save();
if (input != string.Empty)
{
ChatRevit.Default.GPT_API_KEY = input;
ChatRevit.Default.Save();
MessageBox.Show("保存成功", "提示");
}
else
{
MessageBox.Show("未发现填写的APK_KEY", "提示");
}
}

[ObservableProperty]
Expand All @@ -44,7 +52,6 @@ private void AddAPIKEY()
[RelayCommand]
private async void Enter()
{
//const string OPENAI_TOKEN = "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";
if (ChatRevit.Default.GPT_API_KEY == string.Empty)
{
MessageBox.Show("请先填写API_KEY", "提示");
Expand Down

0 comments on commit 8303c6f

Please sign in to comment.