Commit 060c9918 authored by Wade's avatar Wade

use rag

parent 96fa2c8b
......@@ -151,14 +151,13 @@ curl -X POST http://localhost:8000/indexDocuments \
curl -X POST http://localhost:8000/indexDocuments \
-H "Content-Type: application/json" \
-d '{"content": "What is the capital of UK?", "metadata": {"user_id": "user456", "username": "Bob"}}'
{"result": "Paris is the capital of France"}
-d '{"content": "Paris is the capital of France", "metadata": {"user_id": "user456", "username": "Bob"}}'
curl -X POST http://localhost:8000/indexDocuments \
-H "Content-Type: application/json" \
-d '{"content": "What is the capital of UK?", "metadata": {"user_id": "user456", "username": "Bob"}}'
{"result": "USA is the largest importer of coffee"}
-d '{"content": "USA is the largest importer of coffee", "metadata": {"user_id": "user456", "username": "Bob"}}'
......@@ -166,7 +165,7 @@ curl -X POST http://localhost:8000/indexDocuments \
curl -X POST http://localhost:8000/indexDocuments \
-H "Content-Type: application/json" \
-d '{"content": "Water exists in 3 states - solid, liquid and gas", "metadata": {"user_id": "user456", "username": "Bob"}}'
{"result": "USA is the largest importer of coffee"}
......
......@@ -104,7 +104,7 @@ func main() {
// Configure collection
cfg := milvus.CollectionConfig{
Collection: "knowledage",
Collection: "chatRag",
Dimension: 768, // Match mock embedder dimension
Embedder: embedder,
EmbedderOptions: map[string]interface{}{}, // Explicitly set as map
......@@ -209,6 +209,9 @@ func main() {
Query: input.Content,
Context: sb.String(),
}
fmt.Println("sb.String():",sb.String(),"input.Content:",input.Content)
resp, err := simpleQaPrompt.Execute(ctx, ai.WithInput(promptInput))
if err != nil {
......
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