feat: add image generation sub-agent with confirmation and organize ADK example

This commit is contained in:
loveuer committed 2026-11-17 16:50:49 +08:00
1 parent 86e86bc9fa
commit dab8cbb55d
21 files changed
+1402 -181

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
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)
}
}