Public Access
feat: add AI grading test endpoint and update connection logic
This commit is contained in:
1 parent
993265318b
commit
201d21a678
4 files changed
+52
-16
No files matched your search
@@ -135,7 +135,12 @@ export default function AdminDashboard({ onExit }: Readonly<Props>) {
|
||||
setTestAiSending(true);
|
||||
setTestAiMsg(null);
|
||||
try {
|
||||
await adminApi.testAiConnection();
|
||||
await adminApi.testAiConnection({
|
||||
provider: settingsDraft.ai_provider,
|
||||
apiKey: settingsDraft.ai_api_key,
|
||||
model: settingsDraft.ai_model || 'gpt-4o-mini',
|
||||
baseURL: settingsDraft.ai_base_url || undefined,
|
||||
});
|
||||
setTestAiMsg({ ok: true, text: t("admin.aiGrading.testSuccess") });
|
||||
} catch (e) {
|
||||
setTestAiMsg({ ok: false, text: (e as Error).message });
|
||||
|
||||
Reference in new issue
Block a user