fix: only o1-mini does not supports system prompt

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-02-08 11:57:10 +08:00
parent 6a80e54b47
commit 1f0dd15192
No known key found for this signature in database

View file

@ -98,7 +98,7 @@ namespace SourceGit.Models
try try
{ {
var updates = client.CompleteChatStreaming([ var updates = client.CompleteChatStreaming([
ShouldUseDeveloperPrompt() ? new DeveloperChatMessage(prompt) : new SystemChatMessage(prompt), _model.Equals("o1-mini", StringComparison.Ordinal) ? new UserChatMessage(prompt) : new SystemChatMessage(prompt),
new UserChatMessage(question), new UserChatMessage(question),
], null, cancellation); ], null, cancellation);
@ -115,12 +115,6 @@ namespace SourceGit.Models
} }
} }
private bool ShouldUseDeveloperPrompt()
{
return _model.Equals("o1", StringComparison.Ordinal) ||
_model.Equals("o1-mini", StringComparison.Ordinal);
}
private string _name; private string _name;
private string _server; private string _server;
private string _apiKey; private string _apiKey;