Skip to content

armgit / ax

Public Imported from GitHub
0

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

Go

Don't hardcode "no_action" agent

JBDcc8c540ef86b
diff --git a/internal/controller/gemini.go b/internal/controller/gemini.go
index 4d602d7..19332dd 100644
--- a/internal/controller/gemini.go
+++ b/internal/controller/gemini.go
@@ -12,6 +12,8 @@ import (
"google.golang.org/api/option"
)
+const noActionAgentID = "no_action_agent"
+
// GeminiPlannerConfig configures the Gemini-based planner.
type GeminiPlannerConfig struct {
APIKey string // Google AI API key (for programmatic use only; if empty, uses GEMINI_API_KEY env var - recommended)
@@ -97,7 +99,7 @@ Guidelines:
tools = append(tools, &genai.Tool{
FunctionDeclarations: []*genai.FunctionDeclaration{
{
- Name: "no_action",
+ Name: noActionAgentID,
Description: "Call this when no further action is needed and the task is complete",
Parameters: &genai.Schema{
Type: genai.TypeObject,
@@ -145,7 +147,7 @@ Guidelines:
for _, part := range resp.Candidates[0].Content.Parts {
if fc, ok := part.(genai.FunctionCall); ok {
// Check if it's the no_action function
- if fc.Name == "no_action" {
+ if fc.Name == noActionAgentID {
return nil, nil // No more tasks
}