Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
agentchat
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李伟@五瓣科技
agentchat
Commits
060c9918
Commit
060c9918
authored
Jun 03, 2025
by
Wade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use rag
parent
96fa2c8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
README.md
README.md
+4
-5
main.go
main.go
+4
-1
No files found.
README.md
View file @
060c9918
...
...
@@ -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"}
...
...
main.go
View file @
060c9918
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment