allowing to set model naem through env var

This commit is contained in:
João Moura
2024-02-12 13:24:01 -08:00
parent c11b7f0413
commit 830ddb18d9

View File

@@ -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.",
)