Skip to content

Commit 1f0dd15

Browse files
committed
fix: only o1-mini does not supports system prompt
Signed-off-by: leo <[email protected]>
1 parent 6a80e54 commit 1f0dd15

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Models/OpenAI.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public void Chat(string prompt, string question, CancellationToken cancellation,
9898
try
9999
{
100100
var updates = client.CompleteChatStreaming([
101-
ShouldUseDeveloperPrompt() ? new DeveloperChatMessage(prompt) : new SystemChatMessage(prompt),
101+
_model.Equals("o1-mini", StringComparison.Ordinal) ? new UserChatMessage(prompt) : new SystemChatMessage(prompt),
102102
new UserChatMessage(question),
103103
], null, cancellation);
104104

@@ -115,12 +115,6 @@ public void Chat(string prompt, string question, CancellationToken cancellation,
115115
}
116116
}
117117

118-
private bool ShouldUseDeveloperPrompt()
119-
{
120-
return _model.Equals("o1", StringComparison.Ordinal) ||
121-
_model.Equals("o1-mini", StringComparison.Ordinal);
122-
}
123-
124118
private string _name;
125119
private string _server;
126120
private string _apiKey;

0 commit comments

Comments
 (0)