llama-stack-mirror/docs/_static
Mark Campbell 618ccea090
feat: add input validation for search mode of rag query config (#2275)
# What does this PR do?
Adds input validation for mode in RagQueryConfig
This will prevent users from inputting search modes other than `vector`
and `keyword` for the time being with `hybrid` to follow when that
functionality is implemented.

## Test Plan
[Describe the tests you ran to verify your changes with result
summaries. *Provide clear instructions so the plan can be easily
re-executed.*]
```
# Check out this PR and enter the LS directory
uv sync --extra dev
```
Run the quickstart
[example](https://llama-stack.readthedocs.io/en/latest/getting_started/#step-3-run-the-demo)
Alter the Agent to include a query_config
```
agent = Agent(
    client,
    model=model_id,
    instructions="You are a helpful assistant",
    tools=[
        {
            "name": "builtin::rag/knowledge_search",
            "args": {
                "vector_db_ids": [vector_db_id],
                "query_config": {
                    "mode": "i-am-not-vector", # Test for non valid search mode
                    "max_chunks": 6
                }
            },
        }
    ],
)
```
Ensure you get the following error:
```
400: {'errors': [{'loc': ['mode'], 'msg': "Value error, mode must be either 'vector' or 'keyword' if supported by the vector_io provider", 'type': 'value_error'}]}
```

## Running unit tests
```
uv sync --extra dev
uv run pytest tests/unit/rag/test_rag_query.py -v
```

[//]: # (## Documentation)
2025-07-14 09:11:34 -04:00
..
css fix: improve Mermaid diagram visibility in dark mode (#2092) 2025-05-02 13:09:45 -07:00
js chore: Fix to persist the theme preference across page navigation. (#1974) 2025-04-16 13:58:25 -07:00
providers/vector_io docs: Document sqlite-vec faiss comparison (#1821) 2025-03-28 17:41:33 +01:00
llama-stack-logo.png first version of readthedocs (#278) 2024-10-22 10:15:58 +05:30
llama-stack-spec.html feat: add input validation for search mode of rag query config (#2275) 2025-07-14 09:11:34 -04:00
llama-stack-spec.yaml feat: add input validation for search mode of rag query config (#2275) 2025-07-14 09:11:34 -04:00
llama-stack.png Make a new llama stack image 2024-11-22 23:49:22 -08:00
remote_or_local.gif [docs] update documentations (#356) 2024-11-04 16:52:38 -08:00
safety_system.webp [Docs] Zero-to-Hero notebooks and quick start documentation (#368) 2024-11-08 17:16:44 -08:00