fix: accept nullable teacher default reasoning effort
This commit is contained in:
@@ -39,11 +39,16 @@ export async function prepareTeacherModel(account: TeacherAccount, definition: T
|
||||
'老师所用模型暂不可用,请联系运营调整。'
|
||||
);
|
||||
}
|
||||
const savedChoice = definition.model.reasoning_choice;
|
||||
// Published definitions serialize an unspecified effort as null.
|
||||
const choice = savedChoice.mode === 'enabled'
|
||||
? { mode: savedChoice.mode, ...(savedChoice.effort == null ? {} : { effort: savedChoice.effort }) }
|
||||
: { mode: savedChoice.mode };
|
||||
let fields: Record<string, unknown>;
|
||||
try {
|
||||
fields = buildManagedModelRequest(
|
||||
modelId,
|
||||
definition.model.reasoning_choice,
|
||||
choice,
|
||||
capability
|
||||
).reasoningFields;
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user