go_dreamfactory/cmd/v2/service/assistant_test.go
2022-12-06 09:28:37 +08:00

29 lines
509 B
Go

package service
import (
"go_dreamfactory/cmd/v2/lib"
"testing"
"time"
)
func TestStart(t *testing.T) {
wsAddr := "ws://10.0.5.215:7891/gateway"
param := lib.ParamMgr{
Caller: NewWsCli(wsAddr),
Timeout: 2 * time.Second,
Lps: uint32(10),
Duration: 3 * time.Second,
ResultCh: make(chan *lib.CallResult, 50),
}
a, err := lib.NewAssistant(param)
if err != nil {
t.Fatalf("AI助手初始化错误: %v", err)
t.FailNow()
}
t.Log("AI助手启动...")
a.Start()
a.ShowResult()
}