11from crewai import Agent
2- from langchain_openai import ChatOpenAI
32from langchain_anthropic import ChatAnthropic
43from langchain_cohere import ChatCohere
54from langchain_ollama import ChatOllama
5+ from langchain_openai import ChatOpenAI
66
77
88class PoetryAgents :
99 def __init__ (self ):
10- self .open_ai = ChatOpenAI (
11- model_name = "gpt-4" , temperature = 0.7 , stream_usage = True
12- )
10+ self .open_ai = ChatOpenAI (model_name = "gpt-4" , temperature = 0.7 )
1311 self .anthropic = ChatAnthropic (
1412 model_name = "claude-3-5-sonnet-20240620" , temperature = 0.7
1513 )
@@ -30,3 +28,28 @@ def create_poet_agent(self):
3028 verbose = True ,
3129 llm = self .open_ai ,
3230 )
31+
32+ def poet_agent_2 (self ):
33+ return Agent (
34+ role = "Renaissance Poet" ,
35+ backstory = """
36+ I am a Renaissance Poet. I am well-versed in the art of poetry and have a deep appreciation for the beauty of language and expression.
37+ """ ,
38+ goal = """Create a poem that is inspired by the works of the Renaissance poets""" ,
39+ allow_delegation = False ,
40+ verbose = True ,
41+ llm = self .open_ai ,
42+ )
43+
44+ def poet_agent_3 (self ):
45+ return Agent (
46+ role = "William Shakespeare" ,
47+ backstory = """
48+ I am william shakespeare. I am an Expert in poetry writing and creative expression.
49+ I have been writing poetry for over 10 years and have published several collections.
50+ """ ,
51+ goal = """Create a poem that is inspired by the works of William Shakespeare""" ,
52+ allow_delegation = False ,
53+ verbose = True ,
54+ llm = self .open_ai ,
55+ )
0 commit comments