faizee07 commited on
Commit
3a617f5
·
verified ·
1 Parent(s): 04f9dad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -1,17 +1,20 @@
1
  import os
2
  import gradio as gr
3
- from crewai import Agent, Task, Crew, Process
4
  # CORRECTED IMPORTS FOR LATEST VERSIONS
5
  from crewai_tools import SerperDevTool, FileWriterTool
6
- # ---
7
- from langchain_google_genai import ChatGoogleGenerativeAI
 
8
 
9
  # --- 1. SET UP THE GEMINI LLM ---
10
  try:
11
- llm = ChatGoogleGenerativeAI(model="gemini-2.5-flash",
12
- verbose=True,
13
- temperature=0.6,
14
- google_api_key=os.environ.get("GOOGLE_API_KEY"))
 
 
15
  except Exception as e:
16
  print("\n\n---")
17
  print("Error initializing Gemini LLM. Make sure you have set your GOOGLE_API_KEY.")
 
1
  import os
2
  import gradio as gr
3
+ from crewai import Agent, Task, Crew, Process, LLM
4
  # CORRECTED IMPORTS FOR LATEST VERSIONS
5
  from crewai_tools import SerperDevTool, FileWriterTool
6
+ from dotenv import load_dotenv
7
+
8
+ load_dotenv()
9
 
10
  # --- 1. SET UP THE GEMINI LLM ---
11
  try:
12
+ # Use CrewAI's LLM class with proper format for Gemini
13
+ llm = LLM(
14
+ model="gemini/gemini-1.5-flash",
15
+ temperature=0.6,
16
+ api_key=os.environ.get("GOOGLE_API_KEY")
17
+ )
18
  except Exception as e:
19
  print("\n\n---")
20
  print("Error initializing Gemini LLM. Make sure you have set your GOOGLE_API_KEY.")