adithaf7 commited on
Commit
1311a64
·
1 Parent(s): 6fd796e

Fix Planner Agent for google-generativeai 0.3.2 compatibility

Browse files
Files changed (1) hide show
  1. backend/app/agents/planner.py +4 -7
backend/app/agents/planner.py CHANGED
@@ -80,11 +80,8 @@ class PlannerAgent:
80
  settings = get_settings()
81
  genai.configure(api_key=settings.gemini_api_key)
82
 
83
- # Use Gemini 2.5 Flash for better reasoning and planning
84
- self.model = genai.GenerativeModel(
85
- model_name="gemini-2.5-flash",
86
- system_instruction=PLANNER_SYSTEM_PROMPT,
87
- )
88
 
89
  async def create_plan(
90
  self,
@@ -103,8 +100,8 @@ class PlannerAgent:
103
  Returns:
104
  Step-by-step execution plan as a string
105
  """
106
- # Build the prompt
107
- prompt_parts = []
108
 
109
  # Add context if available
110
  if context and context != "No previous conversation context.":
 
80
  settings = get_settings()
81
  genai.configure(api_key=settings.gemini_api_key)
82
 
83
+ # Use Gemini Pro (compatible with older API)
84
+ self.model = genai.GenerativeModel(model_name="gemini-pro")
 
 
 
85
 
86
  async def create_plan(
87
  self,
 
100
  Returns:
101
  Step-by-step execution plan as a string
102
  """
103
+ # Build the prompt with system instruction prepended
104
+ prompt_parts = [PLANNER_SYSTEM_PROMPT, ""]
105
 
106
  # Add context if available
107
  if context and context != "No previous conversation context.":