Commit e8b9115a authored by Wade's avatar Wade

milvus swagger

parent 39af445c
......@@ -59,21 +59,10 @@ paths:
type: string
description: The response from the chat workflow
example: "The capital of the UK is London."
'400':
description: Invalid input
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Error message
example: "Invalid request body"
/idx/milvus:
/index/document:
post:
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:
- Indexing
requestBody:
......@@ -83,29 +72,27 @@ paths:
schema:
type: object
properties:
question:
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:
content:
type: string
description: The summary of the Q&A
example: "AI overview"
description: The content to store for indexing
example: "The moon is Earth's only natural satellite."
username:
type: string
description: The username of the requester
example: "john_doe"
example: "bob"
user_id:
type: string
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:
- question
- answer
- content
responses:
'200':
description: Successful storage of Milvus index data
......@@ -118,28 +105,6 @@ paths:
type: integer
description: The ID of the stored record
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:
post:
summary: Store GraphRAG index data
......@@ -186,27 +151,5 @@ paths:
type: integer
description: The ID of the stored record
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:
schemas: {}
......@@ -122,7 +122,7 @@ func main() {
_ = 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{
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