Include chat, weather, image, travel, streaming ASR and text examples, shared model initialization, documentation, and existing tests. Co-authored-by: TRAE CLI <traecli@bytedance.com>
20 lines
479 B
Go
20 lines
479 B
Go
package tool
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func TestImageArguments(t *testing.T) {
|
|
image := NewImage(nil)
|
|
for _, arguments := range []string{`{`, `{}`, `{"prompt":" "}`} {
|
|
if _, err := image.InvokableRun(context.Background(), arguments); err == nil {
|
|
t.Fatalf("应拒绝无效参数: %s", arguments)
|
|
}
|
|
}
|
|
info, err := image.Info(context.Background())
|
|
if err != nil || info.Name != "generate_image" {
|
|
t.Fatalf("工具定义 = %+v,错误 = %v", info, err)
|
|
}
|
|
}
|