Spaces:
Runtime error
Runtime error
Commit
·
3a698b7
1
Parent(s):
a8ed030
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,11 +13,86 @@ GOOGLE_AI_STUDIO = os.environ.get('GOOGLE_AI_STUDIO2')
|
|
| 13 |
if not GOOGLE_AI_STUDIO:
|
| 14 |
raise ValueError("API key not found. Please set the GOOGLE_AI_STUDIO2 environment variable.")
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
from stock_analysis_agents import StockAnalysisAgents
|
| 22 |
from stock_analysis_tasks import StockAnalysisTasks
|
| 23 |
|
|
@@ -68,7 +143,7 @@ iface = gr.Interface(
|
|
| 68 |
#if __name__ == "__main__":
|
| 69 |
iface.launch()
|
| 70 |
|
| 71 |
-
|
| 72 |
|
| 73 |
|
| 74 |
# Therapy Group
|
|
|
|
| 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 researcher &
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def crewai_process(research_topic):
|
| 25 |
+
# Define your agents with roles and goals
|
| 26 |
+
researcher = Agent(
|
| 27 |
+
role='Senior Research Analyst',
|
| 28 |
+
goal=f'Uncover cutting-edge developments in AI and data science in {research_topic}',
|
| 29 |
+
backstory="""You are a Senior Research Analyst at a leading tech think tank.
|
| 30 |
+
Your expertise lies in identifying emerging trends and technologies in AI and
|
| 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(
|
| 38 |
+
role='Tech Content Strategist',
|
| 39 |
+
goal='Craft compelling content on tech advancements',
|
| 40 |
+
backstory="""You are a renowned Tech Content Strategist, known for your insightful
|
| 41 |
+
and engaging articles on technology and innovation. With a deep understanding of
|
| 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 |
+
|
| 48 |
+
# Create tasks for your agents
|
| 49 |
+
task1 = Task(
|
| 50 |
+
description=f"""Conduct a comprehensive analysis of the latest advancements in AI in 2024.
|
| 51 |
+
Identify key trends, breakthrough technologies, and potential industry impacts in {research_topic}.
|
| 52 |
+
Compile your findings in a detailed report. Your final answer MUST be a full analysis report""",
|
| 53 |
+
agent=researcher
|
| 54 |
+
)
|
| 55 |
+
|
| 56 |
+
task2 = Task(
|
| 57 |
+
description="""Using the insights from the researcher's report, develop an engaging blog
|
| 58 |
+
post that highlights the most significant AI advancements.
|
| 59 |
+
Your post should be informative yet accessible, catering to a tech-savvy audience.
|
| 60 |
+
Aim for a narrative that captures the essence of these breakthroughs and their
|
| 61 |
+
implications for the future. Your final answer MUST be the full blog post of at least 3 paragraphs.""",
|
| 62 |
+
agent=writer
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
# Instantiate your crew with a sequential process
|
| 66 |
+
crew = Crew(
|
| 67 |
+
agents=[researcher, writer],
|
| 68 |
+
tasks=[task1, task2],
|
| 69 |
+
verbose=2,
|
| 70 |
+
process=Process.sequential
|
| 71 |
+
)
|
| 72 |
+
|
| 73 |
+
# Get your crew to work!
|
| 74 |
+
result = crew.kickoff()
|
| 75 |
|
| 76 |
+
return result
|
| 77 |
+
|
| 78 |
+
# Create a Gradio interface
|
| 79 |
+
iface = gr.Interface(
|
| 80 |
+
fn=crewai_process,
|
| 81 |
+
inputs=gr.Textbox(lines=2, placeholder="Enter Research Topic Here..."),
|
| 82 |
+
outputs="text",
|
| 83 |
+
title="CrewAI Research and Writing Assistant",
|
| 84 |
+
description="Input a research topic to get a comprehensive analysis and a blog post draft."
|
| 85 |
+
)
|
| 86 |
|
| 87 |
+
# Launch the interface
|
| 88 |
+
iface.launch()
|
| 89 |
|
| 90 |
+
|
| 91 |
|
| 92 |
+
# Stock Evaluation
|
| 93 |
+
|
| 94 |
+
'''
|
| 95 |
+
|
| 96 |
from stock_analysis_agents import StockAnalysisAgents
|
| 97 |
from stock_analysis_tasks import StockAnalysisTasks
|
| 98 |
|
|
|
|
| 143 |
#if __name__ == "__main__":
|
| 144 |
iface.launch()
|
| 145 |
|
| 146 |
+
'''
|
| 147 |
|
| 148 |
|
| 149 |
# Therapy Group
|