constant

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package constant centralizes string keys and default values used across the Agent Runtime so they are declared once instead of scattered as literals.

Index

Constants

View Source
const (
	MetaKeyTraceID       = "x-trace-id"
	MetaKeyTraceparent   = "traceparent"
	MetaKeyAPIKey        = "x-api-key"
	MetaKeyAuthorization = "authorization"
)

gRPC metadata (header) keys used to resolve trace/auth context.

View Source
const (
	RoleSystem    = "system"
	RoleUser      = "user"
	RoleAssistant = "assistant"
	RoleTool      = "tool"
)

Chat message roles.

View Source
const (
	StreamProtocolGRPC = "grpc"
	StreamProtocolSSE  = "sse"
)

Stream protocol identifiers reported in MetaEvent.stream_protocol.

View Source
const (
	EventMeta        = "meta"
	EventDelta       = "delta"
	EventToolCall    = "tool_call"
	EventTool        = "tool"
	EventInterrupted = "interrupted"
	EventError       = "error"
	EventDone        = "done"
	EventMessage     = "message"
)

SSE event names emitted by the HTTP gateway (mirror StreamEvent oneof).

View Source
const (
	EnvGRPCAddr       = "GRPC_ADDR"
	EnvHTTPAddr       = "HTTP_ADDR"
	EnvDefaultModel   = "DEFAULT_MODEL"
	EnvDefaultAPIKey  = "DEFAULT_API_KEY"
	EnvDefaultAPIBase = "DEFAULT_API_BASE"
	// EnvConfigPath points to the YAML config file (db + memory sections).
	EnvConfigPath = "AGENT_RUNTIME_CONFIG"
)

Environment variable names for server configuration.

View Source
const (
	DefaultGRPCAddr   = ":18080"
	DefaultHTTPAddr   = ":18081"
	DefaultConfigPath = "config.yaml"
)

Default listen addresses and config path.

View Source
const (
	ContextKeySessionID  = "session_id"
	ContextKeyUserID     = "user_id"
	ContextKeyAgentID    = "agent_id"
	ContextKeyProjectDir = "project_dir"
)

Context keys carried in RunRequest/AgentRequest.context (google.protobuf.Struct) used to scope memory to a session/user/agent.

View Source
const (
	RouteHealth         = "/healthz"
	RouteRun            = "/run"
	RouteAgent          = "/agent"
	HeaderTraceID       = "X-Trace-Id"
	HeaderRequestID     = "X-Request-Id"
	HeaderCorrelationID = "X-Correlation-Id"
	HeaderTraceparent   = "Traceparent"
)

HTTP gateway routes and headers.

View Source
const (
	AgentName        = "main_agent"
	AgentDescription = "Main agent backed by an eino chat model"
)

Agent identity used when constructing the ADK ChatModelAgent.

View Source
const (
	Version              = "0.1.0"
	DefaultMaxIterations = 20
)

Runtime defaults.

View Source
const (
	EnvAgentRuntimeHome = "AGENT_RUNTIME_HOME"
	EnvBaseDir          = "XQL_BASE_DIR"
	EnvSkillsDir        = "SKILLS_DIR"
	EnvGlobalSkillsDir  = "GLOBAL_SKILLS_DIR"
	EnvSkillsConfigPath = "SKILLS_CONFIG_PATH"
	EnvSandboxImage     = "SANDBOX_IMAGE"
)

Environment variable names for skill/sandbox directory resolution.

View Source
const (
	DefaultBaseDirName  = ".agent-runtime"
	DirSkills           = "skills"
	DirDataReports      = "data/reports"
	SkillsConfigRelPath = "config/skills-config.yaml"
	FallbackReportsDir  = "/tmp/reports"
	FallbackReportsURL  = "/reports"
	SkillMDFileName     = "SKILL.md"
	SkillScriptsDir     = "scripts"
	AutoDataFileName    = ".auto_data.json"
	SkillScopeBoth      = "both"
)

Base directory layout used for skills, reports and other runtime data.

View Source
const (
	DefaultSandboxImage         = "alpine:latest"
	DefaultPptxImage            = "node:18-alpine"
	SandboxWorkdir              = "/workspace"
	DefaultSandboxTimeoutMs     = 120000
	DefaultSandboxExecTimeoutMs = 60000
)

Sandbox execution defaults.

View Source
const (
	DefaultBashTimeoutSec         = 30
	DefaultSkillExecTimeoutSec    = 120
	DefaultWebRequestTimeoutSec   = 30
	DefaultWebFetchCacheTTLMin    = 15
	DefaultSubAgentWaitTimeoutSec = 30
	MaxSubAgentWaitTimeoutSec     = 300
	DefaultParallelTaskTimeoutSec = 60
	DefaultPoolTimeoutSec         = 300
)

Timeout defaults (seconds unless noted).

View Source
const (
	DefaultSkillMaxIterations = 30
	DefaultMaxReviewMemory    = 10
)

Miscellaneous runtime magic numbers.

View Source
const (
	DefaultOpenAIAPIBase    = "https://api.openai.com/v1"
	DefaultOllamaAPIBase    = "http://127.0.0.1:11434"
	DuckDuckGoHTMLSearchURL = "https://html.duckduckgo.com/html/?q=%s"
)

External service endpoints.

View Source
const (
	ProviderOllama    = "ollama"
	ProviderDiffusers = "diffusers"

	RuntimeModeAlwaysOn = "always_on"
	RuntimeModeOnDemand = "on_demand"
	RuntimeModeOff      = "off"
)

Local model providers and lifecycle modes.

View Source
const (
	RiskLevelLow    = "low"
	RiskLevelMedium = "medium"
	RiskLevelHigh   = "high"
)

Risk levels used by the approval engine.

View Source
const (
	ToolTypeBuiltin = "builtin"
	ToolTypeSkill   = "skill"
	ToolTypeMCP     = "mcp"
	ToolTypeA2A     = "a2a"
	ToolTypeHTTP    = "http"
)

Tool type identifiers used for approval wrapping and diagnostics.

View Source
const (
	ModelRoleDefault = "default"
)

Model routing role keys (map keys in RunRequest.models).

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL