Skip to content

Commit

Permalink
improve description for routing
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdai committed Aug 4, 2024
1 parent ec93b5d commit 35bb8b3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def perform_price_aggregation(json_str: str) -> str:
agent_server = AgentService(
agent=agent,
message_queue=message_queue,
description="Gets the time series data for a good from the database.",
description="Gets the time series price data for a good from the database.",
service_name="time_series_getter_agent",
host=agent_host,
port=int(agent_port) if agent_port else None,
Expand Down
21 changes: 15 additions & 6 deletions snowflake_cybersyn_demo/core_services/control_plane.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import asyncio

import uvicorn
from llama_agents import ControlPlaneServer, PipelineOrchestrator, OrchestratorRouter
from llama_agents import (
ControlPlaneServer,
OrchestratorRouter,
PipelineOrchestrator,
)
from llama_agents.message_queues.rabbitmq import RabbitMQMessageQueue
from llama_index.core.query_pipeline import QueryPipeline, RouterComponent
from llama_index.core.query_pipeline import QueryPipeline
from llama_index.core.selectors import PydanticSingleSelector
from llama_index.llms.openai import OpenAI

Expand Down Expand Up @@ -40,17 +44,22 @@
time_series_getter_agent_component,
],
)
timeseries_pipeline_orchestrator = PipelineOrchestrator(timeseries_task_pipeline)
timeseries_task_pipeline_desc = (
"Only used for getting timeseries data from the database."
timeseries_pipeline_orchestrator = PipelineOrchestrator(
timeseries_task_pipeline
)
timeseries_task_pipeline_desc = """Only used for getting historical price
(timeseries) data for a specified good from the database.
"""

general_pipeline = QueryPipeline(chain=[funny_agent_component])
general_pipeline_orchestrator = PipelineOrchestrator(general_pipeline)

pipeline_orchestrator = OrchestratorRouter(
selector=PydanticSingleSelector.from_defaults(llm=OpenAI()),
orchestrators=[timeseries_pipeline_orchestrator, general_pipeline_orchestrator],
orchestrators=[
timeseries_pipeline_orchestrator,
general_pipeline_orchestrator,
],
choices=[timeseries_task_pipeline_desc, funny_agent_server.description],
)

Expand Down

0 comments on commit 35bb8b3

Please sign in to comment.