From e8e3617ba63e2114b818f684ab3f1755c46dff2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moura?= Date: Mon, 12 Feb 2024 13:24:01 -0800 Subject: [PATCH] allowing to set model naem through env var --- src/crewai/agent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crewai/agent.py b/src/crewai/agent.py index 9984e2096..2e4d79940 100644 --- a/src/crewai/agent.py +++ b/src/crewai/agent.py @@ -1,3 +1,4 @@ +import os import uuid from typing import Any, List, Optional @@ -93,7 +94,7 @@ class Agent(BaseModel): i18n: I18N = Field(default=I18N(), description="Internationalization settings.") llm: Any = Field( default_factory=lambda: ChatOpenAI( - model="gpt-4", + model=os.environ.get("OPENAI_MODEL_NAME", "gpt-4") ), description="Language model that will run the agent.", )