TheK3R1M commited on
Commit
7f17645
·
verified ·
1 Parent(s): ad903a6

Switch models to gemini-1.5-pro and gemini-1.5-flash for max compatibility

Browse files
Files changed (2) hide show
  1. App.tsx +2 -2
  2. services/geminiService.ts +5 -5
App.tsx CHANGED
@@ -622,9 +622,9 @@ const App: React.FC = () => {
622
  // 4. Trigger Content Generation for Children sequentially
623
  await generateChildrenContent(plan.title, plan.steps, childIds, newNotes);
624
 
625
- } catch (error) {
626
  console.error(error);
627
- setAlertMessage("An error occurred while creating the plan. Please try again.");
628
  setIsPlanning(false);
629
  }
630
  };
 
622
  // 4. Trigger Content Generation for Children sequentially
623
  await generateChildrenContent(plan.title, plan.steps, childIds, newNotes);
624
 
625
+ } catch (error: any) {
626
  console.error(error);
627
+ setAlertMessage(`Plan Error: ${error?.message || JSON.stringify(error)}`);
628
  setIsPlanning(false);
629
  }
630
  };
services/geminiService.ts CHANGED
@@ -104,7 +104,7 @@ const isQuotaError = (error: any): boolean => {
104
  export const boostPrompt = async (prompt: string): Promise<string> => {
105
  try {
106
  const response = await getAI().models.generateContent({
107
- model: 'gemini-2.5-flash',
108
  contents: `Rewrite and enrich the following text to be a perfect command (prompt) or a great project idea to be given to an AI assistant.
109
  - If it's a short and simple idea, detail it and add depth.
110
  - If it's complex and messy, structure and clarify it.
@@ -155,7 +155,7 @@ export const createProjectPlan = async (userPrompt: string, memories: StyleMemor
155
  : "";
156
 
157
  const response = await getAI().models.generateContent({
158
- model: 'gemini-2.5-pro',
159
  contents: userPrompt + memoryContext,
160
  config: {
161
  systemInstruction: PLANNER_SYSTEM_INSTRUCTION,
@@ -246,7 +246,7 @@ Use Markdown format.
246
  return "--- Image could not be generated ---\n" + stepDescription;
247
  } else if (stepType === NoteType.TEXT) {
248
  const textPromise = getAI().models.generateContent({
249
- model: 'gemini-2.5-flash',
250
  contents: contextPrompt,
251
  }).catch(e => {
252
  console.error("Text content generation error:", e);
@@ -296,7 +296,7 @@ Use Markdown format.
296
  // Code generation
297
  try {
298
  const response = await getAI().models.generateContent({
299
- model: 'gemini-2.5-flash',
300
  contents: contextPrompt,
301
  });
302
  return response.text || "Content could not be generated.";
@@ -333,7 +333,7 @@ export const chatWithStep = async (
333
  ];
334
 
335
  const response = await getAI().models.generateContent({
336
- model: 'gemini-2.5-flash',
337
  contents: contents,
338
  config: {
339
  systemInstruction: `You are an expert in the "MindSpark" project.
 
104
  export const boostPrompt = async (prompt: string): Promise<string> => {
105
  try {
106
  const response = await getAI().models.generateContent({
107
+ model: 'gemini-1.5-flash',
108
  contents: `Rewrite and enrich the following text to be a perfect command (prompt) or a great project idea to be given to an AI assistant.
109
  - If it's a short and simple idea, detail it and add depth.
110
  - If it's complex and messy, structure and clarify it.
 
155
  : "";
156
 
157
  const response = await getAI().models.generateContent({
158
+ model: 'gemini-1.5-pro',
159
  contents: userPrompt + memoryContext,
160
  config: {
161
  systemInstruction: PLANNER_SYSTEM_INSTRUCTION,
 
246
  return "--- Image could not be generated ---\n" + stepDescription;
247
  } else if (stepType === NoteType.TEXT) {
248
  const textPromise = getAI().models.generateContent({
249
+ model: 'gemini-1.5-flash',
250
  contents: contextPrompt,
251
  }).catch(e => {
252
  console.error("Text content generation error:", e);
 
296
  // Code generation
297
  try {
298
  const response = await getAI().models.generateContent({
299
+ model: 'gemini-1.5-flash',
300
  contents: contextPrompt,
301
  });
302
  return response.text || "Content could not be generated.";
 
333
  ];
334
 
335
  const response = await getAI().models.generateContent({
336
+ model: 'gemini-1.5-flash',
337
  contents: contents,
338
  config: {
339
  systemInstruction: `You are an expert in the "MindSpark" project.