Use admin-configured AI model and add GPT-5/o-series options
- Add getConfiguredModel() that reads ai_model from SystemSettings - AI assignment and mentor matching now use the admin-selected model - Remove duplicate OpenAI client in mentor-matching (use shared singleton) - Add GPT-5, GPT-5 Mini, o3, o3 Mini, o4 Mini to model dropdown Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* to generate optimal assignment suggestions.
|
||||
*/
|
||||
|
||||
import { getOpenAI, AI_MODELS } from '@/lib/openai'
|
||||
import { getOpenAI, getConfiguredModel } from '@/lib/openai'
|
||||
import {
|
||||
anonymizeForAI,
|
||||
deanonymizeResults,
|
||||
@@ -153,8 +153,10 @@ async function callAIForAssignments(
|
||||
// Build the user prompt
|
||||
const userPrompt = buildAssignmentPrompt(anonymizedData, constraints)
|
||||
|
||||
const model = await getConfiguredModel()
|
||||
|
||||
const response = await openai.chat.completions.create({
|
||||
model: AI_MODELS.ASSIGNMENT,
|
||||
model,
|
||||
messages: [
|
||||
{ role: 'system', content: ASSIGNMENT_SYSTEM_PROMPT },
|
||||
{ role: 'user', content: userPrompt },
|
||||
|
||||
Reference in New Issue
Block a user