Skip to content

Commit ca12b89

Browse files
authored
feat: add veadk-go templates (#47)
2 parents 0b01315 + c4a8268 commit ca12b89

11 files changed

Lines changed: 904 additions & 0 deletions

File tree

agentkit/toolkit/executors/init_executor.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,22 @@
105105
"type": "Stream App",
106106
"extra_requirements": ["langchain", "langchain-litellm"],
107107
},
108+
"basic_go": {
109+
"filepath": "veadk_go_basic",
110+
"name": "Basic Go Agent App",
111+
"language": "Golang",
112+
"language_version": "1.24",
113+
"description": "Basic Agent App Based on the VeADK-Go Framework",
114+
"type": "Basic App",
115+
},
116+
"a2a_go": {
117+
"filepath": "veadk_go_a2a",
118+
"name": "A2A Go Agent App",
119+
"language": "Golang",
120+
"language_version": "1.24",
121+
"description": "A2A Application Based on the VeADK-Go Framework",
122+
"type": "A2A App",
123+
},
108124
}
109125

110126

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package main
16+
17+
import (
18+
veagent "github.com/volcengine/veadk-go/agent/llmagent"
19+
"google.golang.org/adk/agent"
20+
"google.golang.org/adk/agent/llmagent"
21+
)
22+
23+
func buildSampleAgent() (agent.Agent, error) {
24+
agentName := "{{ agent_name | default('VeADK-Go-Agent') }}"
25+
var description string
26+
{% if description %}description = `{{ description }}`{% else %}description = ""{% endif %}
27+
28+
var instruction string
29+
{% if system_prompt %}instruction = `{{ system_prompt }}`{% else %}instruction = ""{% endif %}
30+
31+
cfg := &veagent.Config{
32+
Config: llmagent.Config{
33+
Name: agentName,
34+
Description: description,
35+
Instruction: instruction,
36+
},
37+
ModelExtraConfig: map[string]any{
38+
"extra_body": map[string]any{
39+
"thinking": map[string]string{
40+
"type": "disabled",
41+
},
42+
},
43+
},
44+
}
45+
return veagent.New(cfg)
46+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
# Generic build script for Go projects used inside the builder image.
5+
# Environment variables expected (builder sets BUILD_OUTPUT_DIR, BUILD_BINARY_NAME):
6+
# BUILD_OUTPUT_DIR - where to place the binary (default: /app)
7+
# BUILD_BINARY_NAME - binary name (fallback to current dir name)
8+
# Optional:
9+
# ENTRY - go build target (file, dir or package); default is '.'
10+
11+
OUTPUT_DIR=${BUILD_OUTPUT_DIR:-/app}
12+
BIN_NAME=${BUILD_BINARY_NAME:-${BINARY_NAME:-$(basename "$(pwd)")}}
13+
ENTRY=${ENTRY:-.}
14+
15+
mkdir -p "${OUTPUT_DIR}"
16+
17+
# Prefer module-aware builds if go.mod exists
18+
if [ -f go.mod ]; then
19+
echo "Building module-aware: ENTRY='${ENTRY}' BIN='${BIN_NAME}'"
20+
export GOPROXY=${GOPROXY:-https://goproxy.cn}
21+
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o "${OUTPUT_DIR}/${BIN_NAME}" ${ENTRY}
22+
else
23+
echo "No go.mod found, using standard go build: ENTRY='${ENTRY}' BIN='${BIN_NAME}'"
24+
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o "${OUTPUT_DIR}/${BIN_NAME}" ${ENTRY}
25+
fi
26+
27+
echo "Built ${OUTPUT_DIR}/${BIN_NAME}"
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
module veadk_go_a2a/simple-agent
2+
3+
go 1.24.4
4+
5+
require (
6+
github.com/volcengine/veadk-go v0.0.3
7+
google.golang.org/adk v0.3.1-0.20251223085414-415e39855752
8+
)
9+
10+
require (
11+
cloud.google.com/go v0.123.0 // indirect
12+
cloud.google.com/go/auth v0.17.0 // indirect
13+
cloud.google.com/go/compute/metadata v0.9.0 // indirect
14+
github.com/a2aproject/a2a-go v0.3.3 // indirect
15+
github.com/bytedance/sonic v1.14.2 // indirect
16+
github.com/bytedance/sonic/loader v0.4.0 // indirect
17+
github.com/cloudwego/base64x v0.1.6 // indirect
18+
github.com/felixge/httpsnoop v1.0.4 // indirect
19+
github.com/go-logr/logr v1.4.3 // indirect
20+
github.com/go-logr/stdr v1.2.2 // indirect
21+
github.com/google/go-cmp v0.7.0 // indirect
22+
github.com/google/jsonschema-go v0.3.0 // indirect
23+
github.com/google/s2a-go v0.1.9 // indirect
24+
github.com/google/safehtml v0.1.0 // indirect
25+
github.com/google/uuid v1.6.0 // indirect
26+
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
27+
github.com/googleapis/gax-go/v2 v2.15.0 // indirect
28+
github.com/gorilla/mux v1.8.1 // indirect
29+
github.com/gorilla/websocket v1.5.3 // indirect
30+
github.com/jmespath/go-jmespath v0.4.0 // indirect
31+
github.com/joho/godotenv v1.5.1 // indirect
32+
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
33+
github.com/modelcontextprotocol/go-sdk v0.7.0 // indirect
34+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
35+
github.com/volcengine/ve-tos-golang-sdk/v2 v2.7.26 // indirect
36+
github.com/volcengine/volc-sdk-golang v1.0.23 // indirect
37+
github.com/volcengine/volcengine-go-sdk v1.1.53 // indirect
38+
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
39+
go.mongodb.org/mongo-driver v1.17.6 // indirect
40+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
41+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect
42+
go.opentelemetry.io/otel v1.38.0 // indirect
43+
go.opentelemetry.io/otel/metric v1.38.0 // indirect
44+
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
45+
go.opentelemetry.io/otel/trace v1.38.0 // indirect
46+
go.uber.org/multierr v1.10.0 // indirect
47+
go.uber.org/zap v1.27.1 // indirect
48+
golang.org/x/arch v0.11.0 // indirect
49+
golang.org/x/crypto v0.45.0 // indirect
50+
golang.org/x/net v0.47.0 // indirect
51+
golang.org/x/oauth2 v0.32.0 // indirect
52+
golang.org/x/sync v0.18.0 // indirect
53+
golang.org/x/sys v0.38.0 // indirect
54+
golang.org/x/text v0.31.0 // indirect
55+
google.golang.org/genai v1.40.0 // indirect
56+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251014184007-4626949a642f // indirect
57+
google.golang.org/grpc v1.76.0 // indirect
58+
google.golang.org/protobuf v1.36.10 // indirect
59+
gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
60+
gopkg.in/yaml.v2 v2.4.0 // indirect
61+
gopkg.in/yaml.v3 v3.0.1 // indirect
62+
gorm.io/gorm v1.31.0 // indirect
63+
rsc.io/omap v1.2.0 // indirect
64+
rsc.io/ordered v1.1.1 // indirect
65+
)

0 commit comments

Comments
 (0)