llama-stack-mirror/src/llama_stack/core
Francisco Javier Arceo 62005dc1a9
feat: Making static prompt values in Rag/File Search configurable in Vector Store Config (#4368)
# What does this PR do?

- Enables users to configure prompts used throughout the File Search /
Vector Retrieval
- Configuration is defined in the Vector Stores Config so they can be
modified at runtime
- Backwards compatible, which means the fields are optional and default
to the previously used values

This is the summary of the new options in the `run.yaml`
```yaml
vector_stores:
  file_search_params:
    header_template: 'knowledge_search tool found {num_chunks} chunks:\nBEGIN of knowledge_search tool results.\n'
    footer_template: 'END of knowledge_search tool results.\n'
  context_prompt_params:
    chunk_annotation_template: 'Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n'
    context_template: 'The above results were retrieved to help answer the user\'s query: "{query}". Use them as supporting information only in answering this query.{annotation_instruction}\n'
  annotation_prompt_params:
    enable_annotations: true
    annotation_instruction_template: 'Cite sources immediately at the end of sentences before punctuation, using `<|file-id|>` format like \'This is a fact <|file-Cn3MSNn72ENTiiq11Qda4A|>.\'. Do not add
extra punctuation. Use only the file IDs provided, do not invent new ones.'
    chunk_annotation_template: '[{index}] {metadata_text} cite as <|{file_id}|>\n{chunk_text}\n'
```

<!-- If resolving an issue, uncomment and update the line below -->
<!-- Closes #[issue-number] -->

## Test Plan
Added tests.

---------

Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
2025-12-15 11:39:01 -05:00
..
access_control fix: access control to fail-closed when owner attributes are missing (#4273) 2025-12-04 08:38:32 -08:00
conversations feat: remove usage of build yaml (#4192) 2025-12-10 10:12:12 +01:00
prompts feat: remove usage of build yaml (#4192) 2025-12-10 10:12:12 +01:00
routers feat!: Implement include parameter specifically for adding logprobs in the output message (#4261) 2025-12-11 11:11:21 -08:00
routing_tables feat: Add support for query rewrite in vector_store.search (#4171) 2025-12-10 10:06:19 -05:00
server feat: convert Benchmarks API to use FastAPI router (#4309) 2025-12-10 15:04:27 +01:00
storage fix: access control to fail-closed when owner attributes are missing (#4273) 2025-12-04 08:38:32 -08:00
store refactor(storage): make { kvstore, sqlstore } as llama stack "internal" APIs (#4181) 2025-11-18 13:15:16 -08:00
utils feat: remove usage of build yaml (#4192) 2025-12-10 10:12:12 +01:00
__init__.py chore(package): migrate to src/ layout (#3920) 2025-10-27 12:02:21 -07:00
build.py feat: remove usage of build yaml (#4192) 2025-12-10 10:12:12 +01:00
client.py fix: rename llama_stack_api dir (#4155) 2025-11-13 15:04:36 -08:00
common.sh chore(package): migrate to src/ layout (#3920) 2025-10-27 12:02:21 -07:00
configure.py feat: remove usage of build yaml (#4192) 2025-12-10 10:12:12 +01:00
datatypes.py feat: Making static prompt values in Rag/File Search configurable in Vector Store Config (#4368) 2025-12-15 11:39:01 -05:00
distribution.py feat(api): add readonly connectors API (#4258) 2025-12-11 10:19:55 -08:00
external.py feat: remove usage of build yaml (#4192) 2025-12-10 10:12:12 +01:00
id_generation.py chore(package): migrate to src/ layout (#3920) 2025-10-27 12:02:21 -07:00
inspect.py feat: convert Benchmarks API to use FastAPI router (#4309) 2025-12-10 15:04:27 +01:00
library_client.py feat: convert Benchmarks API to use FastAPI router (#4309) 2025-12-10 15:04:27 +01:00
providers.py feat: remove usage of build yaml (#4192) 2025-12-10 10:12:12 +01:00
request_headers.py chore(package): migrate to src/ layout (#3920) 2025-10-27 12:02:21 -07:00
resolver.py feat: Making static prompt values in Rag/File Search configurable in Vector Store Config (#4368) 2025-12-15 11:39:01 -05:00
stack.py feat: Making static prompt values in Rag/File Search configurable in Vector Store Config (#4368) 2025-12-15 11:39:01 -05:00
start_stack.sh chore(package): migrate to src/ layout (#3920) 2025-10-27 12:02:21 -07:00
testing_context.py chore(package): migrate to src/ layout (#3920) 2025-10-27 12:02:21 -07:00