Test: AI Client 生成测试

This commit is contained in:
2026-03-20 21:19:39 +08:00
parent 673de053db
commit 5294d94604
+25
View File
@@ -0,0 +1,25 @@
package ai
import (
"testing"
)
func TestGenerate(t *testing.T) {
client := NewClient(Config{
Endpoint: `https://api.siliconflow.cn/v1`,
Model: `Pro/deepseek-ai/DeepSeek-V3.2`,
Timeout: 120,
MaxRetries: 3,
ApiKey: `sk-rrizhcztbcpqvzszpsosxbylpuaajjropmzrcdzlqynhopzm`,
})
ans, err := client.Generate("你好")
if err != nil {
t.Fatalf("%v", err)
}
if ans == "" {
t.Fatalf("无输出")
}
t.Log(ans)
}