mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-13 07:33:48 +00:00
Improved profile and system prompt handling (#241)
This commit is contained in:
1 parent
caec3bfd2c
commit
38a45955fb
15 files changed
+113
-46
No files matched your search
@@ -4,6 +4,7 @@ using System.Text;
|
||||
using System.Text.Json;
|
||||
|
||||
using AIStudio.Chat;
|
||||
using AIStudio.Settings;
|
||||
|
||||
namespace AIStudio.Provider.OpenAI;
|
||||
|
||||
@@ -26,7 +27,7 @@ public sealed class ProviderOpenAI(ILogger logger) : BaseProvider("https://api.o
|
||||
public override string InstanceName { get; set; } = "OpenAI";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override async IAsyncEnumerable<string> StreamChatCompletion(Model chatModel, ChatThread chatThread, [EnumeratorCancellation] CancellationToken token = default)
|
||||
public override async IAsyncEnumerable<string> StreamChatCompletion(Model chatModel, ChatThread chatThread, SettingsManager settingsManager, [EnumeratorCancellation] CancellationToken token = default)
|
||||
{
|
||||
// Get the API key:
|
||||
var requestedSecret = await RUST_SERVICE.GetAPIKey(this);
|
||||
@@ -62,7 +63,7 @@ public sealed class ProviderOpenAI(ILogger logger) : BaseProvider("https://api.o
|
||||
var systemPrompt = new Message
|
||||
{
|
||||
Role = systemPromptRole,
|
||||
Content = chatThread.SystemPrompt,
|
||||
Content = chatThread.PrepareSystemPrompt(settingsManager, chatThread, this.logger),
|
||||
};
|
||||
|
||||
// Prepare the OpenAI HTTP chat request:
|
||||
|
||||
Reference in new issue
Block a user