Commit e8b9115a authored by Wade's avatar Wade

milvus swagger

parent 39af445c
...@@ -59,21 +59,10 @@ paths: ...@@ -59,21 +59,10 @@ paths:
type: string type: string
description: The response from the chat workflow description: The response from the chat workflow
example: "The capital of the UK is London." example: "The capital of the UK is London."
'400': /index/document:
description: Invalid input
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Error message
example: "Invalid request body"
/idx/milvus:
post: post:
summary: Store Milvus index data summary: Store Milvus index data
description: Stores question, answer, and summary data for Milvus indexing. description: Stores content data for Milvus indexing, including user information and optional metadata.
tags: tags:
- Indexing - Indexing
requestBody: requestBody:
...@@ -83,29 +72,27 @@ paths: ...@@ -83,29 +72,27 @@ paths:
schema: schema:
type: object type: object
properties: properties:
question: content:
type: string
description: The question to store
example: "What is AI?"
answer:
type: string
description: The answer to store
example: "AI is artificial intelligence..."
summary:
type: string type: string
description: The summary of the Q&A description: The content to store for indexing
example: "AI overview" example: "The moon is Earth's only natural satellite."
username: username:
type: string type: string
description: The username of the requester description: The username of the requester
example: "john_doe" example: "bob"
user_id: user_id:
type: string type: string
description: The unique identifier for the user description: The unique identifier for the user
example: "user_12345" example: "user456"
metadata:
type: object
description: Additional metadata for the content
additionalProperties: true
example:
source: "user_input"
timestamp: "2025-06-04T17:10:00+08:00"
required: required:
- question - content
- answer
responses: responses:
'200': '200':
description: Successful storage of Milvus index data description: Successful storage of Milvus index data
...@@ -118,28 +105,6 @@ paths: ...@@ -118,28 +105,6 @@ paths:
type: integer type: integer
description: The ID of the stored record description: The ID of the stored record
example: 1 example: 1
'400':
description: Invalid input
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Error message
example: "Invalid request body"
'500':
description: Server error
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Error message
example: "Failed to store data"
/index/graph: /index/graph:
post: post:
summary: Store GraphRAG index data summary: Store GraphRAG index data
...@@ -186,27 +151,5 @@ paths: ...@@ -186,27 +151,5 @@ paths:
type: integer type: integer
description: The ID of the stored record description: The ID of the stored record
example: 1 example: 1
'400':
description: Invalid input
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Error message
example: "Invalid request body"
'500':
description: Server error
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Error message
example: "Failed to store data"
components: components:
schemas: {} schemas: {}
...@@ -122,7 +122,7 @@ func main() { ...@@ -122,7 +122,7 @@ func main() {
_ = retriever _ = retriever
// 定义文档索引流 // 定义文档索引流
genkit.DefineFlow(g, "indexDocuments", func(ctx context.Context, input *DocumentInput) (string, error) { genkit.DefineFlow(g, "index/document", func(ctx context.Context, input *DocumentInput) (string, error) {
if input.Metadata == nil{ if input.Metadata == nil{
input.Metadata =make(map[string]any) input.Metadata =make(map[string]any)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment