mirror of
https://github.com/run-llama/llama_deploy.git
synced 2026-08-24 21:01:26 -04:00
[PR #191] [MERGED] Introduce session concept to the control plane #308
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/run-llama/llama_deploy/pull/191
Author: @logan-markewich
Created: 8/16/2024
Status: ✅ Merged
Merged: 8/20/2024
Merged by: @logan-markewich
Base:
v0.1.0← Head:logan/session_state📝 Commits (5)
012d12erefactor control plane to account for sessions07285f6introduce sessions251f085exclude examples from lint (temp)dd4f4b9remove docstring0a969ccremove print📊 Changes
19 files changed (+345 additions, -904 deletions)
View changed files
📝
.pre-commit-config.yaml(+1 -0)📝
llama_agents/__init__.py(+1 -9)📝
llama_agents/control_plane/base.py(+91 -24)📝
llama_agents/control_plane/server.py(+116 -130)📝
llama_agents/orchestrators/__init__.py(+0 -6)➖
llama_agents/orchestrators/agent.py(+0 -190)📝
llama_agents/orchestrators/base.py(+2 -6)➖
llama_agents/orchestrators/orchestrator_router.py(+0 -109)➖
llama_agents/orchestrators/pipeline.py(+0 -276)📝
llama_agents/orchestrators/simple.py(+5 -5)📝
llama_agents/services/agent.py(+3 -1)📝
llama_agents/services/component.py(+4 -3)📝
llama_agents/services/human.py(+3 -1)📝
llama_agents/services/workflow.py(+5 -5)📝
llama_agents/types.py(+35 -3)➖
tests/orchestrators/test_agent_orchestrator.py(+0 -133)➕
tests/orchestrators/test_simple_orchestrator.py(+75 -0)📝
tests/services/test_human_service.py(+2 -1)📝
tests/services/test_workflow_service.py(+2 -2)📄 Description
This PR turned out to be a decent refactor.
Basically, the idea is to link tasks together in a session, and have the session manage the state rather than the task itself.
The usecase here is the services can be stateful (like a workflow implementation of a react agent), and you need to maintain the state between runs.
So in order to let the service scale, the state is managed externally from the service in the control plane.
The UX here is that the user creates a session, and then can have several back/forths with the service, with the state for those interactions being managed by the session.
A (mostly?) full changelist
stateattribute forTaskDefinitionSessionDefinitionto hold the state and task ids for that sessionNewTaskto handle passing state + task to services (since the state is not directly attached to the task now)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.