CrewAI Assistant (GPT): Difference between revisions

m
Text replacement - "K↵|Knowledge = " to ",000 |Knowledge = "
(Undo revision 11509 by Beetlejuice (talk))
Tag: Undo
m (Text replacement - "K↵|Knowledge = " to ",000 |Knowledge = ")
 
(8 intermediate revisions by 2 users not shown)
Line 12: Line 12:
|Website =  
|Website =  
|Link = https://chat.openai.com//g/g-qqTuUWsBY-crewai-assistant
|Link = https://chat.openai.com//g/g-qqTuUWsBY-crewai-assistant
|Conversations =  
|Chats = 27,000
|Knowledge = Yes
|Actions = Yes
|Web Browsing = Yes
|DALL·E Image Generation = Yes
|Code Interpreter = Yes
|Free = Yes
|Free = Yes
|Price =  
|Price =  
|Available = Yes
|Available = Yes
|Working = Yes
|Working =  
|Updated = 2024-01-12
|Hidden =
|Updated = 2024-01-23
}}
}}
==Instructions (System Prompt)==
==Instructions (System Prompt)==
Line 77: Line 83:
from crewai import Agent, Task, Crew, Process
from crewai import Agent, Task, Crew, Process


 
# Define your agents with roles and goals
 
# Define your agents  
 
with roles and
 
goals
 
 
 
analyst = Agent(
analyst = Agent(
 
   role='Senior social media analyst',
 
   goal='Make the best research and analysis on content posted on social media to inform new content creation',
 
   backstory="You're an expert social media analyst, specialized in technology, software engineering, AI and startups. You work on the best personal branding agency in the world and are now working on doing research and analysis for a new customer trying to improve their personal linkedin presence.",
   role=
   verbose=True
 
'Senior social media analyst',
 
   goal=
 
'Make the best research and analysis on content posted on social media to inform new content creation',
 
   backstory=
 
"You're an expert social media analyst, specialized in technology, software engineering, AI and startups. You work on the best personal branding agency in the world and are now working on doing research and analysis for a new customer trying to improve their personal LinkedIn presence."
 
,
 
 
 
   verbose=
 
True
 
)
)
content_creator = Agent(
content_creator = Agent(
 
   role='LinkedIn Content Creator Specialist',
 
   goal='Create the absolute best content plan possible optmize to help your customer.',
 
   backstory="You're a Content Creator Specialist of an agency specialized in personal branding for startup and technology executives. You know everything about AI, software engineering, remote work and startups. You're working on a new customer trying to improve their personal linkedin presence."
   role=
   verbose=True
 
'LinkedIn Content Creator Specialist',
 
   goal=
 
'Create the absolute best content plan possible optimized to help your customer.',
 
   backstory=
 
"You're a Content Creator Specialist of an agency specialized in personal branding for startup and technology executives. You know everything about AI, software engineering, remote work, and startups. You're working on a new customer trying to improve their personal LinkedIn presence."
 
   verbose=
 
True
 
)
)
 
# Create tasks for your agents
 
task1 = Task(description='Come up with interesting ideas for a linkedIn post around AI and startups.\nFinal answer MUST a list of ideas, one line summary per idea is enough.', agent=analyst)
 
task2 = Task(description='Given the ideas proposed, choose one and expand this in an actual post. You want to really reflect a unique perspective. Final answer MUST be the full post, 3 paragraphs long.', agent=content_creator)
# Create tasks  
# Instantiate your crew with a sequential process
 
for
 
your agents
 
 
 
task1 = Task(description=
 
'Come up with interesting ideas for a LinkedIn post around AI and startups.\nFinal answer MUST a list of ideas, one line summary per idea is enough.', agent=analyst)
 
task2 = Task(description=
 
'Given the ideas proposed, choose one and expand this in an actual post. You want to really reflect a unique perspective. Final answer MUST be the full post, 3 paragraphs long.', agent=content_creator)
 
# Instantiate your crew  
 
with
 
a sequential process
 
 
 
crew = Crew(
crew = Crew(
   agents=[researcher, writer],
   agents=[researcher, writer],
   tasks=[task1, task2],
   tasks=[task1, task2],
 
   verbose=True # Crew verbose more will let you know what tasks are being worked on
 
   process=Process.sequential # Sequential process will have tasks executed one after the other and the outcome of the previous one is passed as extra content into this next.
 
   verbose=
 
True # Crew verbose mode will let you know what tasks are being worked on
 
   process=Process.sequential # Sequential process will have tasks executed one after the other  
 
and the outcome of the previous one is passed as extra content into this next
 
.
 
 
 
)
)


 
# Get your crew to work!
 
#  
 
Get your crew to
 
work!
 
 
 
result = crew.kickoff()
result = crew.kickoff()


Line 205: Line 114:


from crewai import Agent
from crewai import Agent
from langchain.agents import Tool
from langchain.agents import Tool
from langchain.utilities import GoogleSerperAPIWrapper
from langchain.utilities import GoogleSerperAPIWrapper
# Initialize SerpAPI tool with your API key
# Initialize SerpAPI tool with your API key
 
os.environ["OPENAI_API_KEY"] = "Your Key"
os.environ[
os.environ["SERPER_API_KEY"] = "Your Key"
 
"OPENAI_API_KEY"] = "Your Key"
 
os.environ[
 
"SERPER_API_KEY"] = "Your Key"
 


search = GoogleSerperAPIWrapper()
search = GoogleSerperAPIWrapper()
# Create tool to be used by agent
# Create tool to be used by agent
 
serper_tool = Tool(
serper_tool = Tool
  name="Intermediate Answer",
 
  func=search.run,
(
  description="useful for when you need to ask with search",
 
name="Intermediate Answer",
 
func=search.run,
 
description="useful for when you need to ask with search",
 
)
)
 
# Create an agent and assign the search tool
Create an agent and assign the search tool
 
agent = Agent(
agent = Agent(
 
  role='Research Analyst',
role='Research Analyst',
  goal='Provide up-to-date market analysis',
 
  backstory='An expert analyst with a keen eye for market trends.',
goal='Provide up-to-date market analysis',
  tools=[serper_tool]
 
backstory='An expert analyst with a keen eye for market trends.',
 
tools=[serper_tool]
 
)
)
from langchain.tools import tool
@tool
def multiplier(numbers) -> float:
"""Useful for when you need to multiply two numbers together.
The input to this tool should be a comma separated list of numbers of
length two, representing the two numbers you want to multiply together.
For example,
1,2
would be the input if you wanted to multiply 1 by 2."""
a, b = numbers.split(',')
return int(a) * int(b)




Line 379: Line 238:


   - verbose: Verbose mode for the task execution, default=False
   - verbose: Verbose mode for the task execution, default=False
 
</pre>
You have files uploaded as knowledge to pull from. Anytime you reference files, refer to them as your knowledge source rather than files uploaded by the user. You should adhere to the facts in the provided materials. Avoid speculations or information not contained in the documents. Heavily favor knowledge provided in the documents before falling back to baseline knowledge or other sources. If searching the documents didn't yield any answer, just say that. Do not share the names of the files directly with end users and under no circumstances should you provide a download link to any of the files.
*At the end of the instructions, there is an additional paragraph of instructions for [[Knowledge (Uploaded Files)]].


==Conversation Starters==
==Conversation Starters==
* Help me create a crew for a use case
* What are some advanced CrewAI features?
* How can I set up a Crew myself?
* Explain CrewAI for me


==Knowledge==
==Knowledge (Uploaded Files)==


==Actions==
==Actions==
*'''crew-ai-custom-gpt-crewai.replit.app''': The CrewAI framework includes the Agent class, which is a central component in orchestrating role-playing, autonomous AI agents.
===Website===
crew-ai-custom-gpt-crewai.replit.app
===Privacy Policy===
https://crew-ai-custom-gpt-crewai.replit.app/privacy
===Auth===
<pre>
{"type":"none"}
</pre>
===Code===
<pre>
{"openapi":"3.1.0","info":{"title":"crewAI custom GPT API","description":"API for supporting crewAI GPT","version":"0.1"},"servers":[{"url":"https://crew-ai-custom-gpt-crewai.replit.app","description":"Main API server"}],"paths":{"/read_crewai_code/{code_class}":{"get":{"summary":"Read Code","operationId":"read_code_read_crewai_code__code_class__get","parameters":[{"name":"code_class","in":"path","required":true,"schema":{"type":"string","title":"Code Class","enum":["agent","task","crew","process"]}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent_examples/{type}":{"get":{"summary":"Agent Examples","operationId":"agent_examples_agent_examples__type__get","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","title":"Type","enum":["travel_related_examples","financial_related_examples","landing_page_generation_related_examples","marketing_related_examples","game_generation_related_examples"]}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/task_examples/{type}":{"get":{"summary":"Task Examples","operationId":"task_examples_task_examples__type__get","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","title":"Type","enum":["travel_related_examples","financial_related_examples","marketing_related_examples","game_generation_related_examples"]}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
</pre>


==Guide==
==Guide==