Add openrouter
This commit is contained in:
parent
7c03c594c1
commit
36b686bbd4
8 changed files with 380 additions and 61 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue