Skip to content

Conversation

yanxi0830
Copy link
Contributor

@yanxi0830 yanxi0830 commented Mar 7, 2025

What does this PR do?

  • re-gen to fix agents test
  • update test_custom_tool

Test Plan

LLAMA_STACK_CONFIG=fireworks pytest -v tests/integration/agents/test_agents.py --text-model meta-llama/Llama-3.3-70B-Instruct
image

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 7, 2025
@yanxi0830 yanxi0830 marked this pull request as ready for review March 7, 2025 02:05
@yanxi0830 yanxi0830 changed the title fix: fix agent test fix: fix agent test recorded responses Mar 7, 2025
Copy link
Collaborator

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any docs around how the recorded responses were generated/updated?

@yanxi0830
Copy link
Contributor Author

Is there any docs around how the recorded responses were generated/updated?

@terrytangyuan basically add --record-responses flag LLAMA_STACK_CONFIG=fireworks pytest -v tests/integration/agents/test_agents.py --text-model meta-llama/Llama-3.3-70B-Instruct --record-responses.

cc @ehhuang to add some quick docs

@terrytangyuan
Copy link
Collaborator

Will those get updated every time we run?

@ashwinb
Copy link
Contributor

ashwinb commented Mar 7, 2025

@terrytangyuan the model is that if inference responses need to change, you need to re-record. Otherwise you work off of recorded responses which are stored in files — in that mode, you don’t call inference APIs at all.

@ashwinb ashwinb merged commit 1e3be1e into main Mar 7, 2025
7 checks passed
@ashwinb ashwinb deleted the fix_agent_test branch March 7, 2025 03:37
@terrytangyuan
Copy link
Collaborator

Got it. Thanks! Still catching up with recent changes...

yanxi0830 added a commit to llamastack/llama-stack-client-python that referenced this pull request Mar 7, 2025
# 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants