You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# What does this PR do?
- Introduce `AsyncAgent` -- an async version of Agent wrapper using
AsyncLlamaStackClient
- Enable async def with client_tool decorator
- Closesllamastack/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)
0 commit comments