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
a0086259
Commit
a0086259
authored
Jun 07, 2025
by
Wade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deepseek define model
parent
89fcd46e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
502 additions
and
340 deletions
+502
-340
agent_chat.log
agent_chat.log
+0
-115
go.mod
go.mod
+4
-1
main.go
main.go
+10
-1
deepseek.go
plugins/deepseek/deepseek.go
+488
-174
main.go
plugins/knowledge/example/main.go
+0
-49
No files found.
agent_chat.log
deleted
100644 → 0
View file @
89fcd46e
This diff is collapsed.
Click to expand it.
go.mod
View file @
a0086259
...
@@ -92,4 +92,7 @@ require (
...
@@ -92,4 +92,7 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
)
replace github.com/firebase/genkit/go => github.com/wade-liwei/genkit-web/go v0.0.0-20250605093206-aab2d64e9700
replace github.com/firebase/genkit/go => ../genkit/go
//replace github.com/firebase/genkit/go => github.com/wade-liwei/genkit-web/go v0.0.0-20250605093206-aab2d64e9700
main.go
View file @
a0086259
...
@@ -145,6 +145,8 @@ func main() {
...
@@ -145,6 +145,8 @@ func main() {
log
.
Fatal
()
.
Msg
(
err
.
Error
())
log
.
Fatal
()
.
Msg
(
err
.
Error
())
}
}
embedder
:=
googlegenai
.
GoogleAIEmbedder
(
g
,
"embedding-001"
)
embedder
:=
googlegenai
.
GoogleAIEmbedder
(
g
,
"embedding-001"
)
if
embedder
==
nil
{
if
embedder
==
nil
{
log
.
Fatal
()
.
Msg
(
err
.
Error
())
log
.
Fatal
()
.
Msg
(
err
.
Error
())
...
@@ -242,7 +244,9 @@ func main() {
...
@@ -242,7 +244,9 @@ func main() {
})
})
simpleQaPrompt
,
err
:=
genkit
.
DefinePrompt
(
g
,
"simpleQaPrompt"
,
simpleQaPrompt
,
err
:=
genkit
.
DefinePrompt
(
g
,
"simpleQaPrompt"
,
ai
.
WithModelName
(
"googleai/gemini-2.0-flash"
),
// ai.WithModelName("googleai/gemini-2.0-flash"),
// deepseek
ai
.
WithModelName
(
"deepseek/deepseek-chat"
),
ai
.
WithPrompt
(
simpleQaPromptTemplate
),
ai
.
WithPrompt
(
simpleQaPromptTemplate
),
ai
.
WithInputType
(
simpleQaPromptInput
{}),
ai
.
WithInputType
(
simpleQaPromptInput
{}),
ai
.
WithOutputFormat
(
ai
.
OutputFormatText
),
ai
.
WithOutputFormat
(
ai
.
OutputFormatText
),
...
@@ -269,6 +273,11 @@ func main() {
...
@@ -269,6 +273,11 @@ func main() {
// Define a simple flow that generates jokes about a given topic
// Define a simple flow that generates jokes about a given topic
genkit
.
DefineFlow
(
g
,
"chat"
,
func
(
ctx
context
.
Context
,
input
*
ChatInput
)
(
Response
,
error
)
{
genkit
.
DefineFlow
(
g
,
"chat"
,
func
(
ctx
context
.
Context
,
input
*
ChatInput
)
(
Response
,
error
)
{
ctxAsJson
,
_
:=
json
.
Marshal
(
ctx
)
log
.
Info
()
.
Msgf
(
"input----ctxAsJson----%s"
,
string
(
ctxAsJson
))
inputAsJson
,
err
:=
json
.
Marshal
(
input
)
inputAsJson
,
err
:=
json
.
Marshal
(
input
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
plugins/deepseek/deepseek.go
View file @
a0086259
This diff is collapsed.
Click to expand it.
plugins/knowledge/example/main.go
deleted
100644 → 0
View file @
89fcd46e
package
main
import
(
"fmt"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
lkeap
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/lkeap/v20240522"
)
func
main
()
{
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密
// 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性
// 以下代码示例仅供参考,建议采用更安全的方式来使用密钥
// 请参见:https://cloud.tencent.com/document/product/1278/85305
// 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
//os.Setenv("TENCENTCLOUD_SECRET_ID", "AKID64oLfmfLtESUJ6i8LPSM4gCVbiniQuBF")
//os.Setenv("TENCENTCLOUD_SECRET_KEY", "rX2JMBnBMJ2YqulOo37xa5OUMSN4Xnpd")
credential
:=
common
.
NewCredential
(
"AKID64oLfmfLtESUJ6i8LPSM4gCVbiniQuBF"
,
"rX2JMBnBMJ2YqulOo37xa5OUMSN4Xnpd"
,
)
// 使用临时密钥示例
// credential := common.NewTokenCredential("SecretId", "SecretKey", "Token")
// 实例化一个client选项,可选的,没有特殊需求可以跳过
cpf
:=
profile
.
NewClientProfile
()
cpf
.
HttpProfile
.
Endpoint
=
"lkeap.tencentcloudapi.com"
// 实例化要请求产品的client对象,clientProfile是可选的
client
,
_
:=
lkeap
.
NewClient
(
credential
,
"ap-guangzhou"
,
cpf
)
// 实例化一个请求对象,每个接口都会对应一个request对象
request
:=
lkeap
.
NewQueryRewriteRequest
()
request
.
Model
=
common
.
StringPtr
(
"*"
)
// 返回的resp是一个QueryRewriteResponse的实例,与请求对象对应
response
,
err
:=
client
.
QueryRewrite
(
request
)
if
_
,
ok
:=
err
.
(
*
errors
.
TencentCloudSDKError
);
ok
{
fmt
.
Printf
(
"An API error has returned: %s"
,
err
)
return
}
if
err
!=
nil
{
panic
(
err
)
}
// 输出json格式的字符串回包
fmt
.
Printf
(
"%s"
,
response
.
ToJsonString
())
}
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