Skip to content

Commit fc9907c

Browse files
authored
feat: async agent wrapper (#169)
# What does this PR do? - Introduce `AsyncAgent` -- an async version of Agent wrapper using AsyncLlamaStackClient - Enable async def with client_tool decorator - Closes llamastack/llama-stack#1391 ```python class Agent: def create_session(...): ... def create_turn(...): ... class AsyncAgent async def create_session(...): ... async def create_turn(...): ... ``` > NOTE, there's some code duplication to keep the distinction and avoid too many if/else [//]: # (If resolving an issue, uncomment and update the line below) [//]: # (Closes #[issue-number]) ## Test Plan - test with script in: https://github.com/meta-llama/llama-stack-apps/blob/async_agent/examples/agents/async_agent.py - test with ReAct agent ``` pytest -v tests/client-sdk/agents/test_agents.py --inference-model meta-llama/Llama-3.1-8B-Instruct ``` <img width="843" alt="image" src="https://github.com/user-attachments/assets/29c08ff6-4e8e-4ca3-a017-e1445b1648d2" /> - TODO (follow up): add a test case in client-sdk agents test in llama-stack - sync agent test passing in: llamastack/llama-stack#1462 [//]: # (## Documentation) [//]: # (- [ ] Added a Changelog entry if the change is significant)
1 parent 458e207 commit fc9907c

File tree

2 files changed

+368
-70
lines changed

2 files changed

+368
-70
lines changed

0 commit comments

Comments
 (0)