mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-28 03:21:59 +00:00
swapping to configuring the entire chunk template
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
parent
2e70782e63
commit
66f7b42795
7 changed files with 58 additions and 28 deletions
8
docs/_static/llama-stack-spec.html
vendored
8
docs/_static/llama-stack-spec.html
vendored
|
|
@ -11134,9 +11134,9 @@
|
|||
"type": "integer",
|
||||
"default": 5
|
||||
},
|
||||
"include_metadata_in_content": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
"chunk_template": {
|
||||
"type": "string",
|
||||
"default": "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
|
|
@ -11144,7 +11144,7 @@
|
|||
"query_generator_config",
|
||||
"max_tokens_in_context",
|
||||
"max_chunks",
|
||||
"include_metadata_in_content"
|
||||
"chunk_template"
|
||||
],
|
||||
"title": "RAGQueryConfig"
|
||||
},
|
||||
|
|
|
|||
13
docs/_static/llama-stack-spec.yaml
vendored
13
docs/_static/llama-stack-spec.yaml
vendored
|
|
@ -7690,15 +7690,20 @@ components:
|
|||
max_chunks:
|
||||
type: integer
|
||||
default: 5
|
||||
include_metadata_in_content:
|
||||
type: boolean
|
||||
default: false
|
||||
chunk_template:
|
||||
type: string
|
||||
default: >
|
||||
Result {index}
|
||||
|
||||
Content: {chunk.content}
|
||||
|
||||
Metadata: {metadata}
|
||||
additionalProperties: false
|
||||
required:
|
||||
- query_generator_config
|
||||
- max_tokens_in_context
|
||||
- max_chunks
|
||||
- include_metadata_in_content
|
||||
- chunk_template
|
||||
title: RAGQueryConfig
|
||||
RAGQueryGeneratorConfig:
|
||||
oneOf:
|
||||
|
|
|
|||
|
|
@ -99,14 +99,14 @@ results = client.tool_runtime.rag_tool.query(
|
|||
)
|
||||
```
|
||||
|
||||
You can configure adding metadata to the context if you find it useful for your application. Simply add:
|
||||
You can configure how the RAG tool adds metadata to the context if you find it useful for your application. Simply add:
|
||||
```python
|
||||
# Query documents
|
||||
results = client.tool_runtime.rag_tool.query(
|
||||
vector_db_ids=[vector_db_id],
|
||||
content="What do you know about...",
|
||||
query_config={
|
||||
"include_metadata_in_content": True,
|
||||
"chunk_template": "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n",
|
||||
},
|
||||
)
|
||||
```
|
||||
|
|
@ -131,7 +131,7 @@ agent = Agent(
|
|||
"query_config": {
|
||||
"chunk_size_in_tokens": 512,
|
||||
"chunk_overlap_in_tokens": 0,
|
||||
"include_metadata_in_content": False,
|
||||
"chunk_template": "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue