mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-22 09:01:09 +03:00
Feature/Add new doc store upsert and refresh API (#3556)
add new doc store upsert and refresh API
This commit is contained in:
@@ -305,6 +305,10 @@ paths:
|
||||
type: string
|
||||
format: binary
|
||||
description: Files to be uploaded
|
||||
base64:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Return contents of the files in base64 format
|
||||
required:
|
||||
- files
|
||||
required: true
|
||||
@@ -618,171 +622,109 @@ paths:
|
||||
'500':
|
||||
description: Internal server error
|
||||
|
||||
/document-store/loader/preview:
|
||||
/document-store/upsert/{id}:
|
||||
post:
|
||||
tags:
|
||||
- document-store
|
||||
security:
|
||||
- bearerAuth: []
|
||||
summary: Preview document chunks
|
||||
description: Preview document chunks from loader
|
||||
operationId: previewChunking
|
||||
summary: Upsert new document to document store
|
||||
description: Upsert new document to document store
|
||||
operationId: upsertDocument
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Document store ID
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DocumentStoreLoaderForPreview'
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully preview chunks
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
chunks:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Document'
|
||||
totalChunks:
|
||||
type: integer
|
||||
example: 10
|
||||
previewChunkCount:
|
||||
type: integer
|
||||
example: 5
|
||||
'400':
|
||||
description: Invalid request body
|
||||
'500':
|
||||
description: Internal server error
|
||||
|
||||
/document-store/loader/process:
|
||||
post:
|
||||
tags:
|
||||
- document-store
|
||||
security:
|
||||
- bearerAuth: []
|
||||
summary: Process loading & chunking operation
|
||||
description: Process loading & chunking operation of document from loader
|
||||
operationId: processChunking
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
$ref: '#/components/schemas/DocumentStoreLoaderForUpsert'
|
||||
multipart/form-data:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- storeId
|
||||
- id
|
||||
properties:
|
||||
storeId:
|
||||
files:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
format: binary
|
||||
description: Files to be uploaded
|
||||
loader:
|
||||
type: string
|
||||
description: Document store ID
|
||||
example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766'
|
||||
id:
|
||||
nullable: true
|
||||
example: '{"name":"plainText","config":{"text":"why the sky is blue"}}'
|
||||
description: Loader configurations
|
||||
splitter:
|
||||
type: string
|
||||
description: Document loader ID. If your URL is /document-stores/{storeId}/{id}, then id is the last part of the URL
|
||||
example: 'c427e569-b81a-469a-b14c-fa73dd5bae49'
|
||||
nullable: true
|
||||
example: '{"name":"recursiveCharacterTextSplitter","config":{"chunkSize":2000}}'
|
||||
description: Splitter configurations
|
||||
embedding:
|
||||
type: string
|
||||
nullable: true
|
||||
example: '{"name":"openAIEmbeddings","config":{"modelName":"text-embedding-ada-002"}}'
|
||||
description: Embedding configurations
|
||||
vectorStore:
|
||||
type: string
|
||||
nullable: true
|
||||
example: '{"name":"faiss"}'
|
||||
description: Vector Store configurations
|
||||
recordManager:
|
||||
type: string
|
||||
nullable: true
|
||||
example: '{"name":"postgresRecordManager"}'
|
||||
description: Record Manager configurations
|
||||
required:
|
||||
- files
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully process chunking operation
|
||||
description: Successfully execute upsert operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse'
|
||||
$ref: '#/components/schemas/VectorUpsertResponse'
|
||||
|
||||
'400':
|
||||
description: Invalid request body
|
||||
'500':
|
||||
description: Internal server error
|
||||
|
||||
/document-store/vectorstore/save:
|
||||
/document-store/refresh/{id}:
|
||||
post:
|
||||
tags:
|
||||
- document-store
|
||||
security:
|
||||
- bearerAuth: []
|
||||
summary: Save upsert configuration of document store
|
||||
description: Save upsert configuration of document store
|
||||
operationId: saveVectorStoreConfig
|
||||
summary: Re-process and upsert all documents in document store
|
||||
description: Re-process and upsert all existing documents in document store
|
||||
operationId: refreshDocument
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Document store ID
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- storeId
|
||||
properties:
|
||||
storeId:
|
||||
type: string
|
||||
description: Document store ID
|
||||
example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766'
|
||||
embeddingName:
|
||||
type: string
|
||||
description: Name of the embedding
|
||||
example: 'openAIEmbeddings'
|
||||
embeddingConfig:
|
||||
type: object
|
||||
description: Configuration of the embedding
|
||||
example: { 'model': 'text-embedding-ada-002', 'credential': '1eba5808-c55b-4817-a285-b0c92846a7ad' }
|
||||
vectorStoreName:
|
||||
type: string
|
||||
description: Name of the vector store
|
||||
example: 'faiss'
|
||||
vectorStoreConfig:
|
||||
type: object
|
||||
description: Configuration of the embedding
|
||||
example: { 'basePath': './faiss' }
|
||||
recordManagerName:
|
||||
type: string
|
||||
description: Name of the record manager
|
||||
example: 'SQLiteRecordManager'
|
||||
recordManagerConfig:
|
||||
type: object
|
||||
description: Configuration of the embedding
|
||||
example: { 'databaseFilePath': './recordManager.db' }
|
||||
$ref: '#/components/schemas/DocumentStoreLoaderForRefresh'
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully save upsert configuration of document store
|
||||
description: Successfully execute refresh operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DocumentStore'
|
||||
|
||||
'400':
|
||||
description: Invalid request body
|
||||
'500':
|
||||
description: Internal server error
|
||||
|
||||
/document-store/vectorstore/insert:
|
||||
post:
|
||||
tags:
|
||||
- document-store
|
||||
security:
|
||||
- bearerAuth: []
|
||||
summary: Upsert chunks from document store
|
||||
description: Upsert chunks from document store using the saved configuration
|
||||
operationId: insertIntoVectorStore
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- storeId
|
||||
properties:
|
||||
storeId:
|
||||
type: string
|
||||
description: Document store ID
|
||||
example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766'
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully save upsert configuration of document store
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/VectorUpsertResponse'
|
||||
|
||||
'400':
|
||||
@@ -2220,6 +2162,72 @@ components:
|
||||
description:
|
||||
type: string
|
||||
|
||||
DocumentStoreLoaderForUpsert:
|
||||
type: object
|
||||
properties:
|
||||
docId:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Document ID within the store. If provided, existing configuration from the document will be used for the new document
|
||||
loader:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
example: plainText
|
||||
description: Name of the loader (camelCase)
|
||||
config:
|
||||
type: object
|
||||
description: Configuration for the loader
|
||||
splitter:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
example: recursiveCharacterTextSplitter
|
||||
description: Name of the text splitter (camelCase)
|
||||
config:
|
||||
type: object
|
||||
description: Configuration for the text splitter
|
||||
embedding:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
example: openAIEmbeddings
|
||||
description: Name of the embedding generator (camelCase)
|
||||
config:
|
||||
type: object
|
||||
description: Configuration for the embedding generator
|
||||
vectorStore:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
example: faiss
|
||||
description: Name of the vector store (camelCase)
|
||||
config:
|
||||
type: object
|
||||
description: Configuration for the vector store
|
||||
recordManager:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
example: postgresRecordManager
|
||||
description: Name of the record manager (camelCase)
|
||||
config:
|
||||
type: object
|
||||
description: Configuration for the record manager
|
||||
|
||||
DocumentStoreLoaderForRefresh:
|
||||
type: object
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/DocumentStoreLoaderForUpsert'
|
||||
|
||||
ChatMessageFeedback:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
Reference in New Issue
Block a user