mirror of
https://github.com/tuxdotrs/highminded.git
synced 2025-08-23 16:11:02 +05:30
feat: add hot reload settings
This commit is contained in:
@@ -14,22 +14,11 @@ namespace highminded.ui.controls;
|
||||
public partial class ChatUserControl : UserControl
|
||||
{
|
||||
|
||||
// OpenAI
|
||||
private readonly OpenAI.Chat.ChatClient _client = null!;
|
||||
private readonly MarkdownPipeline _pipeline = null!;
|
||||
|
||||
public ChatUserControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_client = new ChatClient(
|
||||
model: InMemoryDb.Obj.settingsManager.Settings.Model,
|
||||
credential: new ApiKeyCredential(InMemoryDb.Obj.settingsManager.Settings.ApiKey),
|
||||
options: new OpenAIClientOptions
|
||||
{
|
||||
Endpoint = new Uri(InMemoryDb.Obj.settingsManager.Settings.ApiURL)
|
||||
});
|
||||
|
||||
_pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().UseColorCode().Build();
|
||||
}
|
||||
|
||||
@@ -44,7 +33,7 @@ public partial class ChatUserControl : UserControl
|
||||
PromptBox.Clear();
|
||||
|
||||
AsyncCollectionResult<StreamingChatCompletionUpdate> completionUpdates =
|
||||
_client.CompleteChatStreamingAsync(prompt);
|
||||
InMemoryDb.Obj.ChatClient.CompleteChatStreamingAsync(prompt);
|
||||
|
||||
var responseBuilder = new StringBuilder();
|
||||
|
||||
|
Reference in New Issue
Block a user