Skip to content
代码片段 群组 项目

tencent deepseek agent

已合并 振 黄请求将dev/hz_v1.0.12合并到main
比较
8 文件
+ 500
2
偏好设置
比较变更
文件
8
+ 35
0
package hunyuan_example
import (
"context"
"fmt"
"k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/json"
"resp.kaopuai.com/lib/kpllms"
"resp.kaopuai.com/lib/kpllms/hunyuan/app"
"testing"
)
func TestLLM_Stream(t *testing.T) {
ctx := context.Background()
llm, err := app.New(app.WithAppKey("ZnvnwPbv"))
if err != nil {
fmt.Println(err.Error())
return
}
resp, err := llm.Chat(ctx, "你好啊",
app.WithReasonStreamingFunc(func(ctx context.Context, content kpllms.ReasonContent, innerErr error) error {
fmt.Println("type: ", content.Type, "content: ", content.Content)
return nil
}))
if err != nil {
fmt.Println(err.Error())
return
}
b, err := json.Marshal(resp)
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(string(b))
}