We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79d378e commit 65ec6b2Copy full SHA for 65ec6b2
src/services/apis/openai-api.mjs
@@ -130,10 +130,11 @@ export async function generateAnswersWithChatgptApiCompat(
130
false,
131
)
132
133
- // Filter out system messages for reasoning models (only user and assistant are allowed)
+ // Always filter out system messages; for reasoning models, only allow user and assistant
134
+ const promptWithoutSystem = prompt.filter((msg) => msg.role !== 'system')
135
const filteredPrompt = isReasoningModel
- ? prompt.filter((msg) => msg.role === 'user' || msg.role === 'assistant')
136
- : prompt
+ ? promptWithoutSystem.filter((msg) => msg.role === 'user' || msg.role === 'assistant')
137
+ : promptWithoutSystem
138
139
filteredPrompt.push({ role: 'user', content: question })
140
0 commit comments