quick bug fixes

This commit is contained in:
João Moura
2024-09-18 03:22:56 -03:00
parent e77442cf34
commit 2787c9b0ef
6 changed files with 27 additions and 21 deletions

View File

@@ -118,11 +118,15 @@ class Agent(BaseAgent):
@model_validator(mode="after")
def post_init_setup(self):
self.agent_ops_agent_name = self.role
self.llm = self.llm.model_name if hasattr(self.llm, "model_name") else self.llm
self.llm = (
getattr(self.llm, "model_name", None)
or getattr(self.llm, "deployment_name", None)
or self.llm
)
self.function_calling_llm = (
self.function_calling_llm.model_name
if hasattr(self.function_calling_llm, "model_name")
else self.function_calling_llm
getattr(self.function_calling_llm, "model_name", None)
or getattr(self.function_calling_llm, "deployment_name", None)
or self.function_calling_llm
)
if not self.agent_executor:
self._setup_agent_executor()