Lashtw commited on
Commit
ddd34e5
·
verified ·
1 Parent(s): 7c62f3e

Upload 10 files

Browse files
Files changed (1) hide show
  1. src/services/gemini.js +3 -3
src/services/gemini.js CHANGED
@@ -5,7 +5,7 @@ import { db } from "./firebase.js";
5
  import { doc, getDoc } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-firestore.js";
6
 
7
  let apiKey = null;
8
- const MODEL_NAME = "gemini-pro"; // Fallback to stable Pro model
9
 
10
  // System Instructions for the Socratic Tutor
11
  const TUTOR_INSTRUCTION = `
@@ -58,8 +58,8 @@ export async function initGemini(key) {
58
  async function callGeminiAPI(messages, jsonMode = false) {
59
  if (!apiKey) throw new Error("API Key not set");
60
 
61
- // Use v1 for gemini-pro (most stable)
62
- const endpoint = `https://generativelanguage.googleapis.com/v1/models/${MODEL_NAME}:generateContent?key=${apiKey}`;
63
 
64
  const payload = {
65
  contents: messages,
 
5
  import { doc, getDoc } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-firestore.js";
6
 
7
  let apiKey = null;
8
+ const MODEL_NAME = "gemini-1.5-pro"; // Use latest Pro model
9
 
10
  // System Instructions for the Socratic Tutor
11
  const TUTOR_INSTRUCTION = `
 
58
  async function callGeminiAPI(messages, jsonMode = false) {
59
  if (!apiKey) throw new Error("API Key not set");
60
 
61
+ // Use v1beta for gemini-1.5-pro
62
+ const endpoint = `https://generativelanguage.googleapis.com/v1beta/models/${MODEL_NAME}:generateContent?key=${apiKey}`;
63
 
64
  const payload = {
65
  contents: messages,