[PR #5] [MERGED] WIP init control plane #200

Closed
opened 2026-02-16 01:16:26 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/llama_deploy/pull/5
Author: @logan-markewich
Created: 6/7/2024
Status: Merged
Merged: 6/7/2024
Merged by: @logan-markewich

Base: mainHead: logan/init_control_plane


📝 Commits (3)

📊 Changes

16 files changed (+434 additions, -107 deletions)

View changed files

📝 agentfile/agent_server/__init__.py (+1 -3)
📝 agentfile/agent_server/base.py (+18 -0)
📝 agentfile/agent_server/fastapi.py (+58 -16)
📝 agentfile/agent_server/types.py (+1 -17)
📝 agentfile/control_plane/base.py (+39 -23)
agentfile/control_plane/fastapi.py (+187 -0)
agentfile/control_plane/fastapi_control_plane.py (+0 -45)
agentfile/launchers/__init__.py (+0 -0)
agentfile/launchers/local.py (+82 -0)
📝 agentfile/message_queues/simple.py (+0 -2)
📝 agentfile/messages/base.py (+3 -0)
agentfile/storage/__init__.py (+0 -0)
agentfile/storage/keyval_client.py (+0 -0)
agentfile/storage/keyval_server.py (+0 -0)
agentfile/types.py (+39 -0)
📝 tests/test_agent_server.py (+6 -1)

📄 Description

very WIP

Things to refactor

  • make ActionType a string
  • improve the pattern for setting up consumers
  • the message queue is extremely coupled. Probably, we need a message queue client (which could be the message queue itself, or something that makes API calls?)

Some code to test this

from agentfile.launchers.local import LocalLauncher
from agentfile.agent_server.fastapi import FastAPIAgentServer
from agentfile.control_plane.fastapi import FastAPIControlPlane
from agentfile.message_queues.simple import SimpleMessageQueue

from llama_index.core.agent import FunctionCallingAgentWorker
from llama_index.core.tools import FunctionTool
from llama_index.llms.openai import OpenAI

# create an agent
def get_the_secret_fact() -> str:
    """Returns the secret fact."""
    return "The secret fact is: A baby llama is called a 'Cria'."

tool = FunctionTool.from_defaults(fn=get_the_secret_fact)

worker = FunctionCallingAgentWorker.from_tools([tool], llm=OpenAI())
agent = worker.as_agent()

# create our multi-agent framework components
message_queue = SimpleMessageQueue()
control_plane = FastAPIControlPlane(message_queue=message_queue)
agent_server = FastAPIAgentServer(agent, message_queue)

# launch it
launcher = LocalLauncher([agent_server], control_plane, message_queue)
launcher.launch_single("What is the secret fact?")

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/llama_deploy/pull/5 **Author:** [@logan-markewich](https://github.com/logan-markewich) **Created:** 6/7/2024 **Status:** ✅ Merged **Merged:** 6/7/2024 **Merged by:** [@logan-markewich](https://github.com/logan-markewich) **Base:** `main` ← **Head:** `logan/init_control_plane` --- ### 📝 Commits (3) - [`cdb1339`](https://github.com/run-llama/llama_deploy/commit/cdb1339f8260c031981ee69248c81e4d2f213414) WIP init control plane - [`548fab7`](https://github.com/run-llama/llama_deploy/commit/548fab704e035b37a31e1db689a7d8ce917ffe3b) tests - [`5496788`](https://github.com/run-llama/llama_deploy/commit/5496788cb538873c7d3935ca2ba0cc7a9cf601b4) fix tests ### 📊 Changes **16 files changed** (+434 additions, -107 deletions) <details> <summary>View changed files</summary> 📝 `agentfile/agent_server/__init__.py` (+1 -3) 📝 `agentfile/agent_server/base.py` (+18 -0) 📝 `agentfile/agent_server/fastapi.py` (+58 -16) 📝 `agentfile/agent_server/types.py` (+1 -17) 📝 `agentfile/control_plane/base.py` (+39 -23) ➕ `agentfile/control_plane/fastapi.py` (+187 -0) ➖ `agentfile/control_plane/fastapi_control_plane.py` (+0 -45) ➕ `agentfile/launchers/__init__.py` (+0 -0) ➕ `agentfile/launchers/local.py` (+82 -0) 📝 `agentfile/message_queues/simple.py` (+0 -2) 📝 `agentfile/messages/base.py` (+3 -0) ➕ `agentfile/storage/__init__.py` (+0 -0) ➕ `agentfile/storage/keyval_client.py` (+0 -0) ➕ `agentfile/storage/keyval_server.py` (+0 -0) ➕ `agentfile/types.py` (+39 -0) 📝 `tests/test_agent_server.py` (+6 -1) </details> ### 📄 Description very WIP Things to refactor - make ActionType a string - improve the pattern for setting up consumers - the message queue is extremely coupled. Probably, we need a message queue client (which could be the message queue itself, or something that makes API calls?) Some code to test this ```python from agentfile.launchers.local import LocalLauncher from agentfile.agent_server.fastapi import FastAPIAgentServer from agentfile.control_plane.fastapi import FastAPIControlPlane from agentfile.message_queues.simple import SimpleMessageQueue from llama_index.core.agent import FunctionCallingAgentWorker from llama_index.core.tools import FunctionTool from llama_index.llms.openai import OpenAI # create an agent def get_the_secret_fact() -> str: """Returns the secret fact.""" return "The secret fact is: A baby llama is called a 'Cria'." tool = FunctionTool.from_defaults(fn=get_the_secret_fact) worker = FunctionCallingAgentWorker.from_tools([tool], llm=OpenAI()) agent = worker.as_agent() # create our multi-agent framework components message_queue = SimpleMessageQueue() control_plane = FastAPIControlPlane(message_queue=message_queue) agent_server = FastAPIAgentServer(agent, message_queue) # launch it launcher = LocalLauncher([agent_server], control_plane, message_queue) launcher.launch_single("What is the secret fact?") ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 01:16:26 -05:00
yindo closed this issue 2026-02-16 01:16:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_deploy#200