in Runtime_env/app/orchestration/server_utils.py [0:0]
def get_agent_from_config(
agent_orchestration_framework: str,
agent_foundation_model: str,
industry_type: str,
agent_engine_resource_id: str = None,
):
"""Returns the associated Agent Manager based on the defined selection"""
# Set up the agent backed on environment variables for user config
init_prompt = get_init_prompt(agent_orchestration_framework, industry_type)
# Set up agent type based on user config selection
if agent_orchestration_framework == OrchestrationFramework.LANGCHAIN_PREBUILT_AGENT.value:
agent_manager = LangChainPrebuiltAgentManager(
prompt=init_prompt,
industry_type=industry_type,
model_name=agent_foundation_model,
agent_engine_resource_id=agent_engine_resource_id
)
elif agent_orchestration_framework == OrchestrationFramework.LANGCHAIN_VERTEX_AI_AGENT_ENGINE_AGENT.value:
agent_manager = LangChainVertexAIAgentEngineAgentManager(
prompt=init_prompt,
industry_type=industry_type,
model_name=agent_foundation_model,
agent_engine_resource_id=agent_engine_resource_id
)
elif agent_orchestration_framework == OrchestrationFramework.LANGGRAPH_PREBUILT_AGENT.value:
agent_manager = LangGraphPrebuiltAgentManager(
prompt=init_prompt,
industry_type=industry_type,
model_name=agent_foundation_model,
agent_engine_resource_id=agent_engine_resource_id
)
elif agent_orchestration_framework == OrchestrationFramework.LANGGRAPH_VERTEX_AI_AGENT_ENGINE_AGENT.value:
agent_manager = LangGraphVertexAIAgentEngineAgentManager(
prompt=init_prompt,
industry_type=industry_type,
model_name=agent_foundation_model,
agent_engine_resource_id=agent_engine_resource_id
)
elif agent_orchestration_framework == OrchestrationFramework.LLAMAINDEX_AGENT.value:
agent_manager = LlamaIndexAgentManager(
prompt=init_prompt,
industry_type=industry_type,
model_name=agent_foundation_model,
agent_engine_resource_id=agent_engine_resource_id
)
else:
# default agent orchestration is LangGraphPrebuiltAgentManager
agent_manager = LangGraphPrebuiltAgentManager(
prompt=init_prompt,
industry_type=industry_type,
model_name=agent_foundation_model,
agent_engine_resource_id=agent_engine_resource_id
)
return agent_manager