From 9305b4157e8777874a8e7e41bac5be5a21e18f3f Mon Sep 17 00:00:00 2001 From: ilya-kolchinsky Date: Tue, 11 Mar 2025 14:56:21 +0100 Subject: [PATCH] Updated the documentation to include the new API endpoints. --- docs/_static/llama-stack-spec.html | 523 +++++++++++++++++++++++++++++ docs/_static/llama-stack-spec.yaml | 327 ++++++++++++++++++ 2 files changed, 850 insertions(+) diff --git a/docs/_static/llama-stack-spec.html b/docs/_static/llama-stack-spec.html index 1a8169090..102198184 100644 --- a/docs/_static/llama-stack-spec.html +++ b/docs/_static/llama-stack-spec.html @@ -1293,6 +1293,88 @@ ] } }, + "/v1/preprocessors/{preprocessor_id}": { + "get": { + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Preprocessor" + }, + { + "type": "null" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Preprocessors" + ], + "description": "", + "parameters": [ + { + "name": "preprocessor_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "delete": { + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Preprocessors" + ], + "description": "", + "parameters": [ + { + "name": "preprocessor_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, "/v1/scoring-functions/{scoring_fn_id}": { "get": { "responses": { @@ -2527,6 +2609,80 @@ } } }, + "/v1/preprocessors": { + "get": { + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPreprocessorsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Preprocessors" + ], + "description": "", + "parameters": [] + }, + "post": { + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Preprocessor" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Preprocessors" + ], + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterPreprocessorRequest" + } + } + }, + "required": true + } + } + }, "/v1/inspect/providers": { "get": { "responses": { @@ -3046,6 +3202,49 @@ } } }, + "/v1/preprocess": { + "post": { + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PreprocessorResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "$ref": "#/components/responses/DefaultError" + } + }, + "tags": [ + "Preprocessing" + ], + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PreprocessRequest" + } + } + }, + "required": true + } + } + }, "/v1/tool-runtime/rag-tool/query": { "post": { "responses": { @@ -4600,6 +4799,12 @@ "CompletionResponse": { "type": "object", "properties": { + "metrics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetricEvent" + } + }, "content": { "type": "string", "description": "The generated completion text" @@ -4967,6 +5172,12 @@ "CompletionResponseStreamChunk": { "type": "object", "properties": { + "metrics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetricEvent" + } + }, "delta": { "type": "string", "description": "New content generated since last chunk. This can be one or more tokens." @@ -7023,6 +7234,58 @@ ], "title": "ModelType" }, + "Preprocessor": { + "type": "object", + "properties": { + "identifier": { + "type": "string" + }, + "provider_resource_id": { + "type": "string" + }, + "provider_id": { + "type": "string" + }, + "type": { + "type": "string", + "const": "preprocessor", + "default": "preprocessor" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + } + } + }, + "additionalProperties": false, + "required": [ + "identifier", + "provider_resource_id", + "provider_id", + "type" + ], + "title": "Preprocessor" + }, "PaginatedRowsResult": { "type": "object", "properties": { @@ -7679,6 +7942,44 @@ ], "title": "HealthInfo" }, + "PreprocessorChainElement": { + "type": "object", + "properties": { + "preprocessor_id": { + "type": "string" + }, + "options": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + } + } + }, + "additionalProperties": false, + "required": [ + "preprocessor_id" + ], + "title": "PreprocessorChainElement" + }, "RAGDocument": { "type": "object", "properties": { @@ -7755,6 +8056,12 @@ }, "chunk_size_in_tokens": { "type": "integer" + }, + "preprocessor_chain": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PreprocessorChainElement" + } } }, "additionalProperties": false, @@ -8004,6 +8311,22 @@ ], "title": "ListModelsResponse" }, + "ListPreprocessorsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Preprocessor" + } + } + }, + "additionalProperties": false, + "required": [ + "data" + ], + "title": "ListPreprocessorsResponse" + }, "ProviderInfo": { "type": "object", "properties": { @@ -8637,6 +8960,157 @@ ], "title": "PostTrainingJob" }, + "PreprocessingDataElement": { + "type": "object", + "properties": { + "data_element_id": { + "type": "string" + }, + "data_element_type": { + "type": "string", + "enum": [ + "document_uri", + "document_directory_uri", + "binary_document", + "raw_text_document", + "chunks" + ], + "title": "PreprocessingDataType" + }, + "data_element_format": { + "type": "string", + "enum": [ + "pdf", + "docx", + "xlsx", + "pptx", + "md", + "json", + "html", + "csv", + "txt" + ], + "title": "PreprocessingDataFormat" + }, + "data_element_path_or_content": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/InterleavedContentItem" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/InterleavedContentItem" + } + }, + { + "$ref": "#/components/schemas/URL" + }, + { + "type": "object", + "properties": { + "content": { + "$ref": "#/components/schemas/InterleavedContent" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + } + } + }, + "additionalProperties": false, + "required": [ + "content", + "metadata" + ], + "title": "Chunk" + } + ] + } + }, + "additionalProperties": false, + "required": [ + "data_element_id" + ], + "title": "PreprocessingDataElement" + }, + "PreprocessRequest": { + "type": "object", + "properties": { + "preprocessors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PreprocessorChainElement" + } + }, + "preprocessor_inputs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PreprocessingDataElement" + } + } + }, + "additionalProperties": false, + "required": [ + "preprocessors", + "preprocessor_inputs" + ], + "title": "PreprocessRequest" + }, + "PreprocessorResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "output_data_type": { + "type": "string", + "enum": [ + "document_uri", + "document_directory_uri", + "binary_document", + "raw_text_document", + "chunks" + ], + "title": "PreprocessingDataType" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PreprocessingDataElement" + } + } + }, + "additionalProperties": false, + "required": [ + "success", + "output_data_type" + ], + "title": "PreprocessorResponse" + }, "DefaultRAGQueryGeneratorConfig": { "type": "object", "properties": { @@ -9172,6 +9646,47 @@ ], "title": "RegisterModelRequest" }, + "RegisterPreprocessorRequest": { + "type": "object", + "properties": { + "preprocessor_id": { + "type": "string" + }, + "provider_id": { + "type": "string" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + } + } + }, + "additionalProperties": false, + "required": [ + "preprocessor_id" + ], + "title": "RegisterPreprocessorRequest" + }, "RegisterScoringFunctionRequest": { "type": "object", "properties": { @@ -9966,6 +10481,12 @@ { "name": "PostTraining (Coming Soon)" }, + { + "name": "Preprocessing" + }, + { + "name": "Preprocessors" + }, { "name": "Safety" }, @@ -10012,6 +10533,8 @@ "Inspect", "Models", "PostTraining (Coming Soon)", + "Preprocessing", + "Preprocessors", "Safety", "Scoring", "ScoringFunctions", diff --git a/docs/_static/llama-stack-spec.yaml b/docs/_static/llama-stack-spec.yaml index d6001c00d..e235d8ee7 100644 --- a/docs/_static/llama-stack-spec.yaml +++ b/docs/_static/llama-stack-spec.yaml @@ -879,6 +879,59 @@ paths: required: true schema: type: string + /v1/preprocessors/{preprocessor_id}: + get: + responses: + '200': + description: OK + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Preprocessor' + - type: 'null' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Preprocessors + description: '' + parameters: + - name: preprocessor_id + in: path + required: true + schema: + type: string + delete: + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Preprocessors + description: '' + parameters: + - name: preprocessor_id + in: path + required: true + schema: + type: string /v1/scoring-functions/{scoring_fn_id}: get: responses: @@ -1702,6 +1755,57 @@ paths: schema: $ref: '#/components/schemas/RegisterModelRequest' required: true + /v1/preprocessors: + get: + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListPreprocessorsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Preprocessors + description: '' + parameters: [] + post: + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Preprocessor' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Preprocessors + description: '' + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterPreprocessorRequest' + required: true /v1/inspect/providers: get: responses: @@ -2059,6 +2163,35 @@ paths: schema: $ref: '#/components/schemas/PreferenceOptimizeRequest' required: true + /v1/preprocess: + post: + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PreprocessorResponse' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - Preprocessing + description: '' + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PreprocessRequest' + required: true /v1/tool-runtime/rag-tool/query: post: responses: @@ -3133,6 +3266,10 @@ components: CompletionResponse: type: object properties: + metrics: + type: array + items: + $ref: '#/components/schemas/MetricEvent' content: type: string description: The generated completion text @@ -3451,6 +3588,10 @@ components: CompletionResponseStreamChunk: type: object properties: + metrics: + type: array + items: + $ref: '#/components/schemas/MetricEvent' delta: type: string description: >- @@ -4846,6 +4987,36 @@ components: - llm - embedding title: ModelType + Preprocessor: + type: object + properties: + identifier: + type: string + provider_resource_id: + type: string + provider_id: + type: string + type: + type: string + const: preprocessor + default: preprocessor + metadata: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + additionalProperties: false + required: + - identifier + - provider_resource_id + - provider_id + - type + title: Preprocessor PaginatedRowsResult: type: object properties: @@ -5260,6 +5431,25 @@ components: required: - status title: HealthInfo + PreprocessorChainElement: + type: object + properties: + preprocessor_id: + type: string + options: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + additionalProperties: false + required: + - preprocessor_id + title: PreprocessorChainElement RAGDocument: type: object properties: @@ -5302,6 +5492,10 @@ components: type: string chunk_size_in_tokens: type: integer + preprocessor_chain: + type: array + items: + $ref: '#/components/schemas/PreprocessorChainElement' additionalProperties: false required: - documents @@ -5455,6 +5649,17 @@ components: required: - data title: ListModelsResponse + ListPreprocessorsResponse: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Preprocessor' + additionalProperties: false + required: + - data + title: ListPreprocessorsResponse ProviderInfo: type: object properties: @@ -5875,6 +6080,103 @@ components: required: - job_uuid title: PostTrainingJob + PreprocessingDataElement: + type: object + properties: + data_element_id: + type: string + data_element_type: + type: string + enum: + - document_uri + - document_directory_uri + - binary_document + - raw_text_document + - chunks + title: PreprocessingDataType + data_element_format: + type: string + enum: + - pdf + - docx + - xlsx + - pptx + - md + - json + - html + - csv + - txt + title: PreprocessingDataFormat + data_element_path_or_content: + oneOf: + - type: string + - $ref: '#/components/schemas/InterleavedContentItem' + - type: array + items: + $ref: '#/components/schemas/InterleavedContentItem' + - $ref: '#/components/schemas/URL' + - type: object + properties: + content: + $ref: '#/components/schemas/InterleavedContent' + metadata: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + additionalProperties: false + required: + - content + - metadata + title: Chunk + additionalProperties: false + required: + - data_element_id + title: PreprocessingDataElement + PreprocessRequest: + type: object + properties: + preprocessors: + type: array + items: + $ref: '#/components/schemas/PreprocessorChainElement' + preprocessor_inputs: + type: array + items: + $ref: '#/components/schemas/PreprocessingDataElement' + additionalProperties: false + required: + - preprocessors + - preprocessor_inputs + title: PreprocessRequest + PreprocessorResponse: + type: object + properties: + success: + type: boolean + output_data_type: + type: string + enum: + - document_uri + - document_directory_uri + - binary_document + - raw_text_document + - chunks + title: PreprocessingDataType + results: + type: array + items: + $ref: '#/components/schemas/PreprocessingDataElement' + additionalProperties: false + required: + - success + - output_data_type + title: PreprocessorResponse DefaultRAGQueryGeneratorConfig: type: object properties: @@ -6197,6 +6499,27 @@ components: required: - model_id title: RegisterModelRequest + RegisterPreprocessorRequest: + type: object + properties: + preprocessor_id: + type: string + provider_id: + type: string + metadata: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + additionalProperties: false + required: + - preprocessor_id + title: RegisterPreprocessorRequest RegisterScoringFunctionRequest: type: object properties: @@ -6707,6 +7030,8 @@ tags: - name: Inspect - name: Models - name: PostTraining (Coming Soon) + - name: Preprocessing + - name: Preprocessors - name: Safety - name: Scoring - name: ScoringFunctions @@ -6731,6 +7056,8 @@ x-tagGroups: - Inspect - Models - PostTraining (Coming Soon) + - Preprocessing + - Preprocessors - Safety - Scoring - ScoringFunctions