Fix agents tests

This commit is contained in:
Ashwin Bharambe 2024-11-11 22:31:09 -08:00
parent 38257a9cbe
commit abe1cc6303
7 changed files with 51 additions and 24 deletions

View file

@ -16,15 +16,12 @@ from llama_stack.providers.datatypes import * # noqa: F403
# pytest -v -s llama_stack/providers/tests/agents/test_agents.py
# -m "meta_reference"
from .fixtures import pick_inference_model
@pytest.fixture
def common_params(inference_model):
# This is not entirely satisfactory. The fixture `inference_model` can correspond to
# multiple models when you need to run a safety model in addition to normal agent
# inference model. We filter off the safety model by looking for "Llama-Guard"
if isinstance(inference_model, list):
inference_model = next(m for m in inference_model if "Llama-Guard" not in m)
assert inference_model is not None
inference_model = pick_inference_model(inference_model)
return dict(
model=inference_model,