in Runtime_env/app/orchestration/agent.py [0:0]
def create_agent_executor(self):
"""
Creates a Vertex AI Agent Engine Langchain Agent executor.
"""
# If agent_engine_resource_id is provided, use the deployed Agent Engine
if self.agent_engine_resource_id:
langchain_agent = reasoning_engines.ReasoningEngine(self.agent_engine_resource_id)
else:
langchain_agent = reasoning_engines.LangchainAgent(
# prompt=self.prompt, # Custom prompt seems to have an issue for some reason
model=self.model_name,
tools=self.tools,
agent_executor_kwargs={
"return_intermediate_steps": self.return_steps,
"verbose": self.verbose
},
enable_tracing=True
)
langchain_agent.set_up()
return langchain_agent