Skip to content

armgit / ax

Public Imported from GitHub
0

Agent Executor (AX) is Google's open agentic orchestration runtime

Go

Turn GeminiConfig into a proto message (#116)

Jaana Dogan8fce5d2a8a40
diff --git a/cmd/ax/serve.go b/cmd/ax/serve.go
index e76d1ff..e06eb63 100644
--- a/cmd/ax/serve.go
+++ b/cmd/ax/serve.go
@@ -21,13 +21,16 @@ import (
"os"
"os/signal"
"syscall"
+ "time"
"github.com/google/ax/agent"
"github.com/google/ax/internal/config"
"github.com/google/ax/internal/controller"
"github.com/google/ax/internal/controller/task"
"github.com/google/ax/internal/server"
+ "github.com/google/ax/proto"
"github.com/spf13/cobra"
+ "google.golang.org/protobuf/types/known/durationpb"
)
var (
@@ -99,11 +102,15 @@ func newControllerFromConfig(ctx context.Context, cfg *config.Config) (*controll
// Currently, it uses the Gemini planner.
// Gemini config can be customized via environment variables (GEMINI_API_KEY, AX_GEMINI_MODEL)
// TODO(lhuan): allow other planners based on cfg.PlannerType
+ timeout, err := time.ParseDuration(cfg.Planner.Gemini.Timeout)
+ if err != nil {
+ return nil, fmt.Errorf("failed to parse duration: %v", err)
+ }
return controller.NewGeminiPlannerAgent(ctx, r, controller.GeminiPlannerConfig{
- GeminiConfig: controller.GeminiConfig{
+ GeminiConfig: &proto.GeminiConfig{
Model: cfg.Planner.Gemini.Model,
MaxTokens: cfg.Planner.Gemini.MaxTokens,
- Timeout: cfg.Planner.Gemini.Timeout,
+ Timeout: durationpb.New(timeout),
SystemPrompt: cfg.Planner.Gemini.SystemPrompt,
},
SkillsDir: cfg.Planner.Gemini.SkillsDir,
diff --git a/go.mod b/go.mod
index e344060..07bff05 100644
--- a/go.mod
+++ b/go.mod
@@ -5,6 +5,7 @@ go 1.25.0
require (
github.com/charmbracelet/huh v0.8.0
github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834
+ github.com/golang/protobuf v1.5.4
github.com/google/uuid v1.6.0
github.com/spf13/cobra v1.10.2
golang.org/x/net v0.48.0
diff --git a/internal/config/config.go b/internal/config/config.go
index 6cab520..39fa712 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -68,12 +68,12 @@ type PlannerConfig struct {
// Note: API key is not configurable here for security reasons.
// Set GEMINI_API_KEY environment variable instead.
type GeminiPlannerConfig struct {
- Model string `yaml:"model,omitempty"` // Model name
- Temperature float32 `yaml:"temperature,omitempty"`
- MaxTokens int32 `yaml:"max_tokens,omitempty"`
- Timeout time.Duration `yaml:"timeout,omitempty"`
- SystemPrompt string `yaml:"system_prompt,omitempty"`
- SkillsDir string `yaml:"skills_dir,omitempty"` // Directory to discover skills from
+ Model string `yaml:"model,omitempty"` // Model name
+ Temperature float32 `yaml:"temperature,omitempty"`
+ MaxTokens int32 `yaml:"max_tokens,omitempty"`
+ Timeout string `yaml:"timeout,omitempty"`
+ SystemPrompt string `yaml:"system_prompt,omitempty"`
+ SkillsDir string `yaml:"skills_dir,omitempty"` // Directory to discover skills from
}
// RemoteAgentConfig configures a remote agent to register on startup.
diff --git a/internal/controller/controller.go b/internal/controller/controller.go
index 66a2a2e..af2732b 100644
--- a/internal/controller/controller.go
+++ b/internal/controller/controller.go
@@ -108,13 +108,7 @@ func (d *Controller) Exec(ctx context.Context, id string, agentID string, agentC
}
registry := d.registry.Map()
registry[plannerAgentID] = planner
- registry["gemini"], err = NewGeminiAgent(ctx, GeminiConfig{})
- if err != nil {
- return err
- }
- o := func(resp *proto.ProcessResponse) error {
- return handler(resp)
- }
+ registry["gemini"] = NewGeminiAgent()
// For testing only! Remove this once the project is stable.
// TODO(jbd): Remove this before the release.
@@ -136,7 +130,7 @@ func (d *Controller) Exec(ctx context.Context, id string, agentID string, agentC
AgentID: agentID,
Inputs: incoming.Contents,
Config: agentConfig,
- }, o)
+ }, handler)
}
// Fork forks an execution from a source execution.
diff --git a/internal/controller/gemini.go b/internal/controller/gemini.go
index 288228f..d2147ee 100644
--- a/internal/controller/gemini.go
+++ b/internal/controller/gemini.go
@@ -20,67 +20,63 @@ import (
"fmt"
"os"
"runtime"
- "time"
+ "github.com/golang/protobuf/ptypes/duration"
"github.com/google/ax/agent"
"github.com/google/ax/proto"
"google.golang.org/genai"
)
-// GeminiConfig configures the Gemini agent.
-type GeminiConfig struct {
- APIKey string // Google AI API key (for programmatic use only; if empty, uses GEMINI_API_KEY env var - recommended)
- Model string // Model name (default: gemini-3-flash-preview)
- MaxTokens int32 // Max output tokens (default: 8192)
- Timeout time.Duration // Request timeout (default: 60s)
- SystemPrompt string // Custom system prompt (optional)
-}
-
// GeminiAgent implements task.Agent using Gemini.
type GeminiAgent struct {
- config GeminiConfig
- client *genai.Client
}
// NewGeminiAgent creates a new Gemini agent.
-func NewGeminiAgent(ctx context.Context, config GeminiConfig) (*GeminiAgent, error) {
- if config.Timeout == 0 {
- config.Timeout = 30 * time.Second
+func NewGeminiAgent() *GeminiAgent {
+ return &GeminiAgent{}
+}
+
+func (a *GeminiAgent) config(t *agent.Task) (*proto.GeminiConfig, error) {
+ if t.Config == nil {
+ return &proto.GeminiConfig{
+ Model: "gemini-3-flash-preview",
+ Timeout: &duration.Duration{Seconds: 30},
+ }, nil
}
- if config.Model == "" {
- config.Model = "gemini-3-flash-preview"
+
+ var cfg proto.GeminiConfig
+ if err := t.Config.UnmarshalTo(&cfg); err != nil {
+ return nil, fmt.Errorf("failed to unmarshal Gemini config: %w", err)
}
- if config.APIKey == "" {
- config.APIKey = os.Getenv("GEMINI_API_KEY")
- if config.APIKey == "" {
- return nil, fmt.Errorf("GEMINI_API_KEY not set and no API key provided in config")
- }
+ return &cfg, nil
+}
+
+func (a *GeminiAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskExecutor, handler agent.OutputHandler) error {
+ cfg, err := a.config(t)
+ if err != nil {
+ return err
}
+
client, err := genai.NewClient(ctx, &genai.ClientConfig{
- APIKey: config.APIKey,
+ APIKey: os.Getenv("GEMINI_API_KEY"),
+ // TODO(jbd): Support Vertex credentials.
})
if err != nil {
- return nil, fmt.Errorf("failed to create Gemini client: %w", err)
+ return fmt.Errorf("failed to create Gemini client: %w", err)
}
- return &GeminiAgent{
- config: config,
- client: client,
- }, nil
-}
-func (a *GeminiAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskExecutor, handler agent.OutputHandler) error {
inputs := t.Inputs
contents := protoToContents(inputs)
- ctx, cancel := context.WithTimeout(ctx, a.config.Timeout)
+ ctx, cancel := context.WithTimeout(ctx, cfg.Timeout.AsDuration())
defer cancel()
var systemPrompt *genai.Content
- if a.config.SystemPrompt != "" {
- systemPrompt = genai.Text(a.config.SystemPrompt)[0]
+ if cfg.SystemPrompt != "" {
+ systemPrompt = genai.Text(cfg.SystemPrompt)[0]
}
- resp, err := a.client.Models.GenerateContent(ctx, a.config.Model, contents, &genai.GenerateContentConfig{
+ resp, err := client.Models.GenerateContent(ctx, cfg.Model, contents, &genai.GenerateContentConfig{
SystemInstruction: systemPrompt,
- MaxOutputTokens: a.config.MaxTokens,
+ MaxOutputTokens: cfg.MaxTokens,
CandidateCount: 1,
})
if err != nil {
diff --git a/internal/controller/gemini_planner.go b/internal/controller/gemini_planner.go
index b4d6e1e..9326042 100644
--- a/internal/controller/gemini_planner.go
+++ b/internal/controller/gemini_planner.go
@@ -7,8 +7,8 @@ import (
"os/exec"
"runtime"
"strings"
- "time"
+ "github.com/golang/protobuf/ptypes/duration"
"github.com/google/ax/agent"
"github.com/google/ax/internal/skills"
"github.com/google/ax/proto"
@@ -19,7 +19,7 @@ import (
// GeminiPlannerConfig configures the Gemini-based planner.
type GeminiPlannerConfig struct {
- GeminiConfig GeminiConfig
+ GeminiConfig *proto.GeminiConfig
SkillsDir string // Directory for discovering skills (optional)
MaxSteps int // Max steps (default: 100)
}
@@ -35,8 +35,11 @@ type geminiPlannerAgent struct {
// NewGeminiPlannerAgent creates a new Gemini-based agent.
func NewGeminiPlannerAgent(ctx context.Context, registry *Registry, config GeminiPlannerConfig) (agent.Agent, error) {
- if config.GeminiConfig.Timeout == 0 {
- config.GeminiConfig.Timeout = 30 * time.Second
+ if config.GeminiConfig == nil {
+ config.GeminiConfig = &proto.GeminiConfig{}
+ }
+ if config.GeminiConfig.Timeout == nil {
+ config.GeminiConfig.Timeout = &duration.Duration{Seconds: 30}
}
if config.GeminiConfig.Model == "" {
config.GeminiConfig.Model = os.Getenv("AX_GEMINI_MODEL")
@@ -44,12 +47,6 @@ func NewGeminiPlannerAgent(ctx context.Context, registry *Registry, config Gemin
config.GeminiConfig.Model = "gemini-3-flash-preview"
}
}
- if config.GeminiConfig.APIKey == "" {
- config.GeminiConfig.APIKey = os.Getenv("GEMINI_API_KEY")
- if config.GeminiConfig.APIKey == "" {
- return nil, fmt.Errorf("GEMINI_API_KEY not set and no API key provided in config")
- }
- }
if config.MaxSteps == 0 {
config.MaxSteps = 5
@@ -78,7 +75,7 @@ Guidelines:
}
client, err := genai.NewClient(ctx, &genai.ClientConfig{
- APIKey: config.GeminiConfig.APIKey,
+ APIKey: os.Getenv("GEMINI_API_KEY"),
})
if err != nil {
return nil, fmt.Errorf("failed to create Gemini client: %w", err)
@@ -157,7 +154,7 @@ func (p *geminiPlannerAgent) process(ctx context.Context, t *agent.Task, handler
}
contents := protoToContents(inputs)
- ctx, cancel := context.WithTimeout(ctx, p.config.GeminiConfig.Timeout)
+ ctx, cancel := context.WithTimeout(ctx, p.config.GeminiConfig.Timeout.AsDuration())
defer cancel()
resp, err := p.client.Models.GenerateContent(ctx, p.config.GeminiConfig.Model, contents, &genai.GenerateContentConfig{
diff --git a/proto/ax.pb.go b/proto/ax.pb.go
index 3847291..7f32e25 100644
--- a/proto/ax.pb.go
+++ b/proto/ax.pb.go
@@ -24,6 +24,7 @@ import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
anypb "google.golang.org/protobuf/types/known/anypb"
+ durationpb "google.golang.org/protobuf/types/known/durationpb"
structpb "google.golang.org/protobuf/types/known/structpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
@@ -1257,6 +1258,76 @@ func (*RegisterAgentResponse) Descriptor() ([]byte, []int) {
return file_proto_ax_proto_rawDescGZIP(), []int{18}
}
+// GeminiConfig is the configuration for a Gemini agent.
+type GeminiConfig struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"` // e.g. "gemini-3-flash-preview"
+ SystemPrompt string `protobuf:"bytes,2,opt,name=system_prompt,json=systemPrompt,proto3" json:"system_prompt,omitempty"` // System prompt for the agent
+ MaxTokens int32 `protobuf:"varint,3,opt,name=max_tokens,json=maxTokens,proto3" json:"max_tokens,omitempty"` // Maximum number of tokens to generate
+ Timeout *durationpb.Duration `protobuf:"bytes,4,opt,name=timeout,proto3" json:"timeout,omitempty"` // e.g. "10s"
+}
+
+func (x *GeminiConfig) Reset() {
+ *x = GeminiConfig{}
+ mi := &file_proto_ax_proto_msgTypes[19]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *GeminiConfig) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GeminiConfig) ProtoMessage() {}
+
+func (x *GeminiConfig) ProtoReflect() protoreflect.Message {
+ mi := &file_proto_ax_proto_msgTypes[19]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use GeminiConfig.ProtoReflect.Descriptor instead.
+func (*GeminiConfig) Descriptor() ([]byte, []int) {
+ return file_proto_ax_proto_rawDescGZIP(), []int{19}
+}
+
+func (x *GeminiConfig) GetModel() string {
+ if x != nil {
+ return x.Model
+ }
+ return ""
+}
+
+func (x *GeminiConfig) GetSystemPrompt() string {
+ if x != nil {
+ return x.SystemPrompt
+ }
+ return ""
+}
+
+func (x *GeminiConfig) GetMaxTokens() int32 {
+ if x != nil {
+ return x.MaxTokens
+ }
+ return 0
+}
+
+func (x *GeminiConfig) GetTimeout() *durationpb.Duration {
+ if x != nil {
+ return x.Timeout
+ }
+ return nil
+}
+
var File_proto_ax_proto protoreflect.FileDescriptor
var file_proto_ax_proto_rawDesc = []byte{
@@ -1267,6 +1338,8 @@ var file_proto_ax_proto_rawDesc = []byte{
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
+ 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0x3c, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f,
@@ -1406,6 +1479,16 @@ var file_proto_ax_proto_rawDesc = []byte{
0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x08, 0x0a,
0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x17, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73,
0x74, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x22, 0x9d, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x43, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x79, 0x73, 0x74, 0x65,
+ 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
+ 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x1d, 0x0a, 0x0a,
+ 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
+ 0x52, 0x09, 0x6d, 0x61, 0x78, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x07, 0x74,
+ 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44,
+ 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
0x2a, 0x58, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41,
0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e,
@@ -1451,7 +1534,7 @@ func file_proto_ax_proto_rawDescGZIP() []byte {
}
var file_proto_ax_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
-var file_proto_ax_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
+var file_proto_ax_proto_msgTypes = make([]protoimpl.MessageInfo, 21)
var file_proto_ax_proto_goTypes = []any{
(State)(0), // 0: proto.State
(*ProcessRequest)(nil), // 1: proto.ProcessRequest
@@ -1473,18 +1556,20 @@ var file_proto_ax_proto_goTypes = []any{
(*RemoteAgentConfig)(nil), // 17: proto.RemoteAgentConfig
(*RegisterAgentRequest)(nil), // 18: proto.RegisterAgentRequest
(*RegisterAgentResponse)(nil), // 19: proto.RegisterAgentResponse
- nil, // 20: proto.RegisterAgentRequest.MetadataEntry
- (*structpb.Struct)(nil), // 21: google.protobuf.Struct
- (*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp
- (*anypb.Any)(nil), // 23: google.protobuf.Any
+ (*GeminiConfig)(nil), // 20: proto.GeminiConfig
+ nil, // 21: proto.RegisterAgentRequest.MetadataEntry
+ (*structpb.Struct)(nil), // 22: google.protobuf.Struct
+ (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp
+ (*anypb.Any)(nil), // 24: google.protobuf.Any
+ (*durationpb.Duration)(nil), // 25: google.protobuf.Duration
}
var file_proto_ax_proto_depIdxs = []int32{
9, // 0: proto.ProcessRequest.contents:type_name -> proto.Content
9, // 1: proto.ProcessResponse.contents:type_name -> proto.Content
4, // 2: proto.ConfirmationContent.approval:type_name -> proto.ApprovalDecision
5, // 3: proto.ConfirmationContent.decline:type_name -> proto.DeclineDecision
- 21, // 4: proto.FunctionCallContent.args:type_name -> google.protobuf.Struct
- 21, // 5: proto.FunctionResponseContent.response:type_name -> google.protobuf.Struct
+ 22, // 4: proto.FunctionCallContent.args:type_name -> google.protobuf.Struct
+ 22, // 5: proto.FunctionResponseContent.response:type_name -> google.protobuf.Struct
3, // 6: proto.Content.text:type_name -> proto.TextContent
6, // 7: proto.Content.confirmation:type_name -> proto.ConfirmationContent
7, // 8: proto.Content.function_call:type_name -> proto.FunctionCallContent
@@ -1492,28 +1577,29 @@ var file_proto_ax_proto_depIdxs = []int32{
9, // 10: proto.ExecutionEvent.inputs:type_name -> proto.Content
9, // 11: proto.ExecutionEvent.outputs:type_name -> proto.Content
0, // 12: proto.ExecutionEvent.state:type_name -> proto.State
- 22, // 13: proto.ExecutionEvent.timestamp:type_name -> google.protobuf.Timestamp
- 23, // 14: proto.ExecRequest.agent_config:type_name -> google.protobuf.Any
+ 23, // 13: proto.ExecutionEvent.timestamp:type_name -> google.protobuf.Timestamp
+ 24, // 14: proto.ExecRequest.agent_config:type_name -> google.protobuf.Any
9, // 15: proto.ExecRequest.inputs:type_name -> proto.Content
9, // 16: proto.ExecResponse.outputs:type_name -> proto.Content
0, // 17: proto.ExecResponse.state:type_name -> proto.State
- 20, // 18: proto.RegisterAgentRequest.metadata:type_name -> proto.RegisterAgentRequest.MetadataEntry
+ 21, // 18: proto.RegisterAgentRequest.metadata:type_name -> proto.RegisterAgentRequest.MetadataEntry
17, // 19: proto.RegisterAgentRequest.remote:type_name -> proto.RemoteAgentConfig
- 1, // 20: proto.AgentService.Process:input_type -> proto.ProcessRequest
- 11, // 21: proto.AgentService.HealthCheck:input_type -> proto.HealthCheckRequest
- 13, // 22: proto.AXService.Exec:input_type -> proto.ExecRequest
- 15, // 23: proto.AXService.Fork:input_type -> proto.ForkRequest
- 18, // 24: proto.AXService.RegisterAgent:input_type -> proto.RegisterAgentRequest
- 2, // 25: proto.AgentService.Process:output_type -> proto.ProcessResponse
- 12, // 26: proto.AgentService.HealthCheck:output_type -> proto.HealthCheckResponse
- 14, // 27: proto.AXService.Exec:output_type -> proto.ExecResponse
- 16, // 28: proto.AXService.Fork:output_type -> proto.ForkResponse
- 19, // 29: proto.AXService.RegisterAgent:output_type -> proto.RegisterAgentResponse
- 25, // [25:30] is the sub-list for method output_type
- 20, // [20:25] is the sub-list for method input_type
- 20, // [20:20] is the sub-list for extension type_name
- 20, // [20:20] is the sub-list for extension extendee
- 0, // [0:20] is the sub-list for field type_name
+ 25, // 20: proto.GeminiConfig.timeout:type_name -> google.protobuf.Duration
+ 1, // 21: proto.AgentService.Process:input_type -> proto.ProcessRequest
+ 11, // 22: proto.AgentService.HealthCheck:input_type -> proto.HealthCheckRequest
+ 13, // 23: proto.AXService.Exec:input_type -> proto.ExecRequest
+ 15, // 24: proto.AXService.Fork:input_type -> proto.ForkRequest
+ 18, // 25: proto.AXService.RegisterAgent:input_type -> proto.RegisterAgentRequest
+ 2, // 26: proto.AgentService.Process:output_type -> proto.ProcessResponse
+ 12, // 27: proto.AgentService.HealthCheck:output_type -> proto.HealthCheckResponse
+ 14, // 28: proto.AXService.Exec:output_type -> proto.ExecResponse
+ 16, // 29: proto.AXService.Fork:output_type -> proto.ForkResponse
+ 19, // 30: proto.AXService.RegisterAgent:output_type -> proto.RegisterAgentResponse
+ 26, // [26:31] is the sub-list for method output_type
+ 21, // [21:26] is the sub-list for method input_type
+ 21, // [21:21] is the sub-list for extension type_name
+ 21, // [21:21] is the sub-list for extension extendee
+ 0, // [0:21] is the sub-list for field type_name
}
func init() { file_proto_ax_proto_init() }
@@ -1540,7 +1626,7 @@ func file_proto_ax_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_ax_proto_rawDesc,
NumEnums: 1,
- NumMessages: 20,
+ NumMessages: 21,
NumExtensions: 0,
NumServices: 2,
},
diff --git a/proto/ax.proto b/proto/ax.proto
index 2be0fe3..9632f07 100644
--- a/proto/ax.proto
+++ b/proto/ax.proto
@@ -19,6 +19,7 @@ package proto;
import "google/protobuf/timestamp.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/any.proto";
+import "google/protobuf/duration.proto";
option go_package = "github.com/google/ax/proto";
@@ -187,3 +188,11 @@ service AXService {
// RegisterAgent registers a new agent with the controller
rpc RegisterAgent(RegisterAgentRequest) returns (RegisterAgentResponse);
}
+
+// GeminiConfig is the configuration for a Gemini agent.
+message GeminiConfig {
+ string model = 1; // e.g. "gemini-3-flash-preview"
+ string system_prompt = 2; // System prompt for the agent
+ int32 max_tokens = 3; // Maximum number of tokens to generate
+ google.protobuf.Duration timeout = 4; // e.g. "10s"
+}