Add openrouter

This commit is contained in:
Joey Yakimowich-Payne 2026-01-15 12:28:51 -07:00
commit 36b686bbd4
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
8 changed files with 380 additions and 61 deletions

View file

@ -600,7 +600,15 @@ export const useGame = () => {
return response.json();
};
const startQuizGen = async (options: { topic?: string; questionCount?: number; files?: File[]; useOcr?: boolean }) => {
const startQuizGen = async (options: {
topic?: string;
questionCount?: number;
files?: File[];
useOcr?: boolean;
aiProvider?: 'gemini' | 'openrouter';
apiKey?: string;
openRouterModel?: string;
}) => {
try {
setGameState('GENERATING');
setError(null);
@ -616,7 +624,10 @@ export const useGame = () => {
const generateOptions: GenerateQuizOptions = {
topic: options.topic,
questionCount: options.questionCount,
documents
documents,
aiProvider: options.aiProvider,
apiKey: options.apiKey,
openRouterModel: options.openRouterModel,
};
const generatedQuiz = await generateQuiz(generateOptions);