Skier8402 commited on
Commit
3859eb1
·
verified ·
1 Parent(s): d2711a7

Update crewai/agent.py

Browse files

add environment variable for the api key

Files changed (1) hide show
  1. crewai/agent.py +1 -0
crewai/agent.py CHANGED
@@ -72,6 +72,7 @@ class Agent(BaseModel):
72
  default_factory=lambda: ChatOpenAI(
73
  temperature=0.7,
74
  model_name="gpt-4-1106-preview",
 
75
  ),
76
  description="Language model that will run the agent.",
77
  )
 
72
  default_factory=lambda: ChatOpenAI(
73
  temperature=0.7,
74
  model_name="gpt-4-1106-preview",
75
+ openai_api_key=os.getenv("OPENAI_API_KEY")
76
  ),
77
  description="Language model that will run the agent.",
78
  )