Spaces:
Build error
Build error
Commit
·
bfb2154
1
Parent(s):
4e6748b
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,23 +3,16 @@ import gradio as gr
|
|
| 3 |
from textwrap import dedent
|
| 4 |
from dotenv import load_dotenv
|
| 5 |
|
|
|
|
|
|
|
| 6 |
from crewai import Agent, Task, Crew, Process
|
| 7 |
|
| 8 |
os.environ["OPENAI_API_KEY"] = "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"
|
| 9 |
|
| 10 |
-
GOOGLE_AI_STUDIO = os.environ.get('GOOGLE_AI_STUDIO2')
|
| 11 |
-
|
| 12 |
-
# Ensure the API key is available
|
| 13 |
-
if not GOOGLE_AI_STUDIO:
|
| 14 |
-
raise ValueError("API key not found. Please set the GOOGLE_AI_STUDIO2 environment variable.")
|
| 15 |
-
|
| 16 |
-
|
| 17 |
# Crew Bot: https://chat.openai.com/g/g-qqTuUWsBY-crewai-assistant
|
| 18 |
|
| 19 |
|
| 20 |
-
# Base Example
|
| 21 |
-
|
| 22 |
-
|
| 23 |
|
| 24 |
def crewai_process(research_topic):
|
| 25 |
# Define your agents with roles and goals
|
|
@@ -31,7 +24,11 @@ def crewai_process(research_topic):
|
|
| 31 |
data science. You have a knack for dissecting complex data and presenting
|
| 32 |
actionable insights.""",
|
| 33 |
verbose=True,
|
| 34 |
-
allow_delegation=False
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
# Add tools and other optional parameters as needed
|
| 36 |
)
|
| 37 |
writer = Agent(
|
|
@@ -42,6 +39,7 @@ def crewai_process(research_topic):
|
|
| 42 |
the tech industry, you transform complex concepts into compelling narratives.""",
|
| 43 |
verbose=True,
|
| 44 |
allow_delegation=True
|
|
|
|
| 45 |
# Add tools and other optional parameters as needed
|
| 46 |
)
|
| 47 |
|
|
|
|
| 3 |
from textwrap import dedent
|
| 4 |
from dotenv import load_dotenv
|
| 5 |
|
| 6 |
+
from crewai.tools import GeminiSearchTools
|
| 7 |
+
|
| 8 |
from crewai import Agent, Task, Crew, Process
|
| 9 |
|
| 10 |
os.environ["OPENAI_API_KEY"] = "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"
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
# Crew Bot: https://chat.openai.com/g/g-qqTuUWsBY-crewai-assistant
|
| 13 |
|
| 14 |
|
| 15 |
+
# Base Example with Gemini Search
|
|
|
|
|
|
|
| 16 |
|
| 17 |
def crewai_process(research_topic):
|
| 18 |
# Define your agents with roles and goals
|
|
|
|
| 24 |
data science. You have a knack for dissecting complex data and presenting
|
| 25 |
actionable insights.""",
|
| 26 |
verbose=True,
|
| 27 |
+
allow_delegation=False,
|
| 28 |
+
tools=[
|
| 29 |
+
GeminiSearchTools.gemini_search_internet
|
| 30 |
+
]
|
| 31 |
+
|
| 32 |
# Add tools and other optional parameters as needed
|
| 33 |
)
|
| 34 |
writer = Agent(
|
|
|
|
| 39 |
the tech industry, you transform complex concepts into compelling narratives.""",
|
| 40 |
verbose=True,
|
| 41 |
allow_delegation=True
|
| 42 |
+
|
| 43 |
# Add tools and other optional parameters as needed
|
| 44 |
)
|
| 45 |
|