rag snippet生成入库和写rag

This commit is contained in:
zhaoawd
2025-12-09 00:15:22 +08:00
parent ebd79b75bd
commit 3218e51bad
11 changed files with 1231 additions and 8 deletions

57
doc/rag-api.md Normal file
View File

@ -0,0 +1,57 @@
#添加RAG
curl --location --request POST 'http://127.0.0.1:8000/rag/add' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ' \
--data-raw '{
"id": 0,
"workspaceId": 0,
"name": "string",
"embeddingData": "string",
"type": "METRIC"
}'
#批量添加RAG
curl --location --request POST 'http://127.0.0.1:8000/rag/addBatch' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ' \
--data-raw '[
{
"id": 0,
"workspaceId": 0,
"name": "string",
"embeddingData": "string",
"type": "METRIC"
}
]'
#更新RAG
curl --location --request POST 'http://127.0.0.1:8000/rag/update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ' \
--data-raw '{
"id": 0,
"workspaceId": 0,
"name": "string",
"embeddingData": "string",
"type": "METRIC"
}'
#删除RAG
curl --location --request POST 'http://127.0.0.1:8000/rag/delete' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ' \
--data-raw '{
"id": 0,
"type": "METRIC"
}'
#检索RAG
curl --location --request POST 'http://127.0.0.1:8000/rag/retrieve' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ' \
--data-raw '{
"query": "string",
"num": 0,
"workspaceId": 0,
"type": "METRIC"
}'