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
80e1d112
Commit
80e1d112
authored
Jun 02, 2025
by
Wade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update grap param
parent
786b69d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
main.go
main.go
+9
-2
No files found.
main.go
View file @
80e1d112
...
...
@@ -130,13 +130,20 @@ func main() {
UserName
:
input
.
Username
,
}
if
_
,
ok
:=
input
.
Metadata
[
graphrag
.
DocNameKey
];
!
ok
{
resDocName
:=
""
if
v
,
ok
:=
input
.
Metadata
[
graphrag
.
DocNameKey
];
!
ok
{
// Generate random docName.
docName
,
err
:=
graphrag
.
GenerateRandomDocName
(
8
)
if
err
!=
nil
{
return
""
,
fmt
.
Errorf
(
"generate random docName for document %w"
,
err
)
}
input
.
Metadata
[
graphrag
.
DocNameKey
]
=
docName
resDocName
=
docName
}
else
{
if
str
,
isString
:=
v
.
(
string
);
isString
{
resDocName
=
str
}
}
doc
:=
ai
.
DocumentFromText
(
input
.
Content
,
input
.
Metadata
)
...
...
@@ -147,7 +154,7 @@ func main() {
if
err
!=
nil
{
return
""
,
fmt
.
Errorf
(
"index document: %w"
,
err
)
}
return
"Document indexed successfully"
,
nil
return
fmt
.
Sprintf
(
"Document indexed successfully, docname %s"
,
resDocName
)
,
nil
})
// Define a simple flow that generates jokes about a given topic
...
...
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