From 113f3a259c91bd74881be7434a55e36f860f7e33 Mon Sep 17 00:00:00 2001 From: ehhuang Date: Wed, 19 Mar 2025 10:16:00 -0700 Subject: [PATCH] docs: add documentation for RAGDocument (#1693) # What does this PR do? ## Test Plan --- docs/_static/llama-stack-spec.html | 15 ++++++++++----- docs/_static/llama-stack-spec.yaml | 6 ++++++ llama_stack/apis/tools/rag_tool.py | 9 +++++++++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/docs/_static/llama-stack-spec.html b/docs/_static/llama-stack-spec.html index 2362dfa53..b32b7cfdf 100644 --- a/docs/_static/llama-stack-spec.html +++ b/docs/_static/llama-stack-spec.html @@ -7787,7 +7787,8 @@ "type": "object", "properties": { "document_id": { - "type": "string" + "type": "string", + "description": "The unique identifier for the document." }, "content": { "oneOf": [ @@ -7806,10 +7807,12 @@ { "$ref": "#/components/schemas/URL" } - ] + ], + "description": "The content of the document." }, "mime_type": { - "type": "string" + "type": "string", + "description": "The MIME type of the document." }, "metadata": { "type": "object", @@ -7834,7 +7837,8 @@ "type": "object" } ] - } + }, + "description": "Additional metadata for the document." } }, "additionalProperties": false, @@ -7843,7 +7847,8 @@ "content", "metadata" ], - "title": "RAGDocument" + "title": "RAGDocument", + "description": "A document to be used for document ingestion in the RAG Tool." }, "InsertRequest": { "type": "object", diff --git a/docs/_static/llama-stack-spec.yaml b/docs/_static/llama-stack-spec.yaml index 38e08e41c..eb5d9722e 100644 --- a/docs/_static/llama-stack-spec.yaml +++ b/docs/_static/llama-stack-spec.yaml @@ -5375,6 +5375,7 @@ components: properties: document_id: type: string + description: The unique identifier for the document. content: oneOf: - type: string @@ -5383,8 +5384,10 @@ components: items: $ref: '#/components/schemas/InterleavedContentItem' - $ref: '#/components/schemas/URL' + description: The content of the document. mime_type: type: string + description: The MIME type of the document. metadata: type: object additionalProperties: @@ -5395,12 +5398,15 @@ components: - type: string - type: array - type: object + description: Additional metadata for the document. additionalProperties: false required: - document_id - content - metadata title: RAGDocument + description: >- + A document to be used for document ingestion in the RAG Tool. InsertRequest: type: object properties: diff --git a/llama_stack/apis/tools/rag_tool.py b/llama_stack/apis/tools/rag_tool.py index 2b9ef10d8..671e19619 100644 --- a/llama_stack/apis/tools/rag_tool.py +++ b/llama_stack/apis/tools/rag_tool.py @@ -17,6 +17,15 @@ from llama_stack.schema_utils import json_schema_type, register_schema, webmetho @json_schema_type class RAGDocument(BaseModel): + """ + A document to be used for document ingestion in the RAG Tool. + + :param document_id: The unique identifier for the document. + :param content: The content of the document. + :param mime_type: The MIME type of the document. + :param metadata: Additional metadata for the document. + """ + document_id: str content: InterleavedContent | URL mime_type: str | None = None