Commit 060c9918 authored by Wade's avatar Wade

use rag

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