mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-01 16:24:44 +00:00
adding comment into docstring with default value example
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
parent
3faaeb0bba
commit
38f6b6ff9e
4 changed files with 7 additions and 5 deletions
2
docs/_static/llama-stack-spec.html
vendored
2
docs/_static/llama-stack-spec.html
vendored
|
@ -11310,7 +11310,7 @@
|
|||
"chunk_template": {
|
||||
"type": "string",
|
||||
"default": "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n",
|
||||
"description": "Template for formatting each retrieved chunk in the context."
|
||||
"description": "Template for formatting each retrieved chunk in the context. Available placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk content string), {metadata} (chunk metadata dict). Default: \"Result {index}\\nContent: {chunk.content}\\nMetadata: {metadata}\\n\""
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
|
|
5
docs/_static/llama-stack-spec.yaml
vendored
5
docs/_static/llama-stack-spec.yaml
vendored
|
@ -7812,7 +7812,10 @@ components:
|
|||
|
||||
Metadata: {metadata}
|
||||
description: >-
|
||||
Template for formatting each retrieved chunk in the context.
|
||||
Template for formatting each retrieved chunk in the context. Available
|
||||
placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk
|
||||
content string), {metadata} (chunk metadata dict). Default: "Result {index}\nContent:
|
||||
{chunk.content}\nMetadata: {metadata}\n"
|
||||
additionalProperties: false
|
||||
required:
|
||||
- query_generator_config
|
||||
|
|
|
@ -74,6 +74,8 @@ class RAGQueryConfig(BaseModel):
|
|||
:param max_tokens_in_context: Maximum number of tokens in the context.
|
||||
:param max_chunks: Maximum number of chunks to retrieve.
|
||||
:param chunk_template: Template for formatting each retrieved chunk in the context.
|
||||
Available placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk content string), {metadata} (chunk metadata dict).
|
||||
Default: "Result {index}\\nContent: {chunk.content}\\nMetadata: {metadata}\\n"
|
||||
"""
|
||||
|
||||
# This config defines how a query is generated using the messages
|
||||
|
@ -81,8 +83,6 @@ class RAGQueryConfig(BaseModel):
|
|||
query_generator_config: RAGQueryGeneratorConfig = Field(default=DefaultRAGQueryGeneratorConfig())
|
||||
max_tokens_in_context: int = 4096
|
||||
max_chunks: int = 5
|
||||
# Optional template for formatting each retrieved chunk in the context.
|
||||
# Available placeholders: {index} (1-based chunk ordinal), {metadata} (chunk metadata dict), {chunk.content} (chunk content string).
|
||||
chunk_template: str = "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n"
|
||||
|
||||
@field_validator("chunk_template")
|
||||
|
|
|
@ -93,7 +93,6 @@ class TestVectorStore:
|
|||
chunks = make_overlapped_chunks(document_id, text, window_len, overlap_len, original_metadata)
|
||||
|
||||
assert len(chunks) == expected_chunks
|
||||
print(len(chunks), expected_chunks)
|
||||
|
||||
# Check that each chunk has the right metadata
|
||||
for chunk in chunks:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue