Documentation
¶
Index ¶
- Constants
- func ConvertMemoryBlocksToAgent(blocks []types.MessageBlock) ([]*tooltypes.ToolCall, []*tooltypes.ToolResult, error)
- func ConvertMemoryMessageBlocksToModel(blocks []types.MessageBlock) ([]model.ContentBlock, error)
- func ConvertMemoryMessageSourceToModel(source types.MessageSource) (model.MessageSource, error)
- func ConvertMemoryMessageToModel(m *memory.Message) (*model.Message, error)
- func ConvertModelContentBlocksToMemory(blocks []model.ContentBlock) (*types.MessageContent, error)
- func ConvertModelContentBlocksToMemoryWithProvider(blocks []model.ContentBlock, providerKind string) (*types.MessageContent, error)
- func ConvertModelMessageSourceToMemory(source model.MessageSource) types.MessageSource
- func ConvertModelMessageToMemory(m *model.Message) (*memory.Message, error)
- func ConvertModelUsageToMemory(usage *model.Usage) *types.MessageUsage
- func LogComponentShutdown(logger *slog.Logger, component string, shutdownStart time.Time, ...)
- func LogComponentStartup(logger *slog.Logger, component string, keyValues ...any)
- func LogError(logger *slog.Logger, operation string, err error, keyValues ...any)
- func LogOperationEnd(logger *slog.Logger, operation string, start time.Time, keyValues ...any)
- func LogOperationStart(logger *slog.Logger, operation string, keyValues ...any)
- func LogPhaseTransition(logger *slog.Logger, taskID string, from, to string, keyValues ...any)
- func LogTokenUsage(logger *slog.Logger, level slog.Level, ...)
- func NewAssistantMessage(taskID uuid.UUID, options ...func(*v1.Message)) *v1.Message
- func NewMessage(taskID uuid.UUID, options ...func(*v1.Message)) *v1.Message
- func NewSystemMessage(taskID uuid.UUID, options ...func(*v1.Message)) *v1.Message
- func NewUserMessage(taskID uuid.UUID, options ...func(*v1.Message)) *v1.Message
- func ProjectStructure(root string) (string, error)
- func WithContent(content *v1.MessagePart) func(*v1.Message)
- func WithRole(role v1.MessageRole) func(*v1.Message)
- type DevTools
- type LoggerConfig
- type ModelProviderFactory
- type Result
- type Runtime
- type RuntimeOption
- type RuntimeOptions
- type Shell
- type SyncMap
- type TaskPhase
- type TaskReconciler
- type TaskStatus
- type TitleGenerator
Constants ¶
View Source
const ( // Task and agent identifiers KeyTaskID = "task_id" KeyAgentID = "agent_id" KeyMessageID = "message_id" // Model and provider information KeyModel = "model" KeyProvider = "provider" KeyModelProvider = "model_provider" // Timing and performance KeyDuration = "duration_ms" KeyStartTime = "start_time" KeyEndTime = "end_time" KeyLatency = "latency_ms" KeyThroughput = "throughput" // Token and cost tracking KeyInputTokens = "input_tokens" KeyOutputTokens = "output_tokens" KeyTotalTokens = "total_tokens" KeyCacheWriteTokens = "cache_write_tokens" KeyCacheReadTokens = "cache_read_tokens" KeyCost = "cost" KeyTokensPerSecond = "tokens_per_second" KeyCacheHitRatio = "cache_hit_ratio" // Tool and execution information KeyTool = "tool" KeyToolCount = "tool_count" KeyToolName = "tool_name" KeyToolDuration = "tool_duration_ms" KeyToolResult = "tool_result" KeyToolStats = "tool_stats" // Message and queue information KeyMessageCount = "message_count" KeyProcessedCount = "processed_count" KeyUnprocessedCount = "unprocessed_count" KeyQueueDepth = "queue_depth" KeyActiveTaskCount = "active_task_count" KeyPhase = "phase" KeyNextPhase = "next_phase" // Configuration and environment KeyConcurrency = "concurrency" KeyToolsRegistered = "tools_registered" KeyListenerAddress = "listener_address" KeyListenerType = "listener_type" // Error and retry information KeyRetryable = "retryable" KeyRetryAfter = "retry_after_ms" KeyRetryCount = "retry_count" KeyErrorType = "error_type" KeyError = "error" // Operations and components KeyOperation = "operation" KeyComponent = "component" )
Log key constants for consistency across the codebase
View Source
const ( MaxTitleLength = 80 // characters MaxRetries = 2 // attempts to get shorter title )
View Source
const DefaultServerPort = 29333
View Source
const ToolExecutionInProgressMarker = "__TOOL_EXECUTION_IN_PROGRESS__"
Variables ¶
This section is empty.
Functions ¶
func ConvertMemoryBlocksToAgent ¶
func ConvertMemoryBlocksToAgent(blocks []types.MessageBlock) ([]*tooltypes.ToolCall, []*tooltypes.ToolResult, error)
ConvertMemoryBlocksToAgent converts memory blocks to agent-typed blocks with parsed Input/Output.
func ConvertMemoryMessageBlocksToModel ¶
func ConvertMemoryMessageBlocksToModel(blocks []types.MessageBlock) ([]model.ContentBlock, error)
func ConvertMemoryMessageSourceToModel ¶
func ConvertMemoryMessageSourceToModel(source types.MessageSource) (model.MessageSource, error)
func ConvertModelContentBlocksToMemory ¶
func ConvertModelContentBlocksToMemory(blocks []model.ContentBlock) (*types.MessageContent, error)
func ConvertModelContentBlocksToMemoryWithProvider ¶
func ConvertModelContentBlocksToMemoryWithProvider(blocks []model.ContentBlock, providerKind string) (*types.MessageContent, error)
func ConvertModelMessageSourceToMemory ¶
func ConvertModelMessageSourceToMemory(source model.MessageSource) types.MessageSource
func ConvertModelUsageToMemory ¶
func ConvertModelUsageToMemory(usage *model.Usage) *types.MessageUsage
func LogComponentShutdown ¶
func LogComponentShutdown(logger *slog.Logger, component string, shutdownStart time.Time, keyValues ...any)
LogComponentShutdown logs component shutdown
func LogComponentStartup ¶
LogComponentStartup logs component initialization
func LogOperationEnd ¶
LogOperationEnd logs the end of a significant operation
func LogOperationStart ¶
LogOperationStart logs the start of a significant operation
func LogPhaseTransition ¶
LogPhaseTransition logs task phase transitions
func LogTokenUsage ¶
func LogTokenUsage(logger *slog.Logger, level slog.Level, inputTokens, outputTokens, cacheWrite, cacheRead int64, cost float64, duration time.Duration, keyValues ...any)
LogTokenUsage logs token usage from an API call
func NewAssistantMessage ¶
func NewSystemMessage ¶
func NewUserMessage ¶
func ProjectStructure ¶
func WithContent ¶
func WithContent(content *v1.MessagePart) func(*v1.Message)
Types ¶
type DevTools ¶
type DevTools struct {
VersionControl []string
PackageManagers []string
LanguageRuntimes []string
BuildTools []string
Testing []string
Database []string
ContainerOrchestration []string
CloudInfrastructure []string
TextProcessing []string
FileOperations []string
NetworkHTTP []string
SystemMonitoring []string
}
func AvailableDevTools ¶
func AvailableDevTools() *DevTools
type LoggerConfig ¶
LoggerConfig holds logging configuration
func DefaultLoggerConfig ¶
func DefaultLoggerConfig() *LoggerConfig
DefaultLoggerConfig returns default logging configuration
type ModelProviderFactory ¶
type ModelProviderFactory struct {
// contains filtered or unexported fields
}
func NewModelProviderFactory ¶
func NewModelProviderFactory(encryption *secret.Encryption, memory *memory.Client) *ModelProviderFactory
func (*ModelProviderFactory) CreateClient ¶
func (f *ModelProviderFactory) CreateClient( ctx context.Context, modelProviderID uuid.UUID, ) (providerClient model.ModelProvider, err error)
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime(memory *memory.Client, encryption *secret.Encryption, listener net.Listener, opts ...RuntimeOption) (*Runtime, error)
func (*Runtime) Encryption ¶
func (rt *Runtime) Encryption() *secret.Encryption
type RuntimeOption ¶
type RuntimeOption func(*RuntimeOptions)
func WithAnalytics ¶
func WithAnalytics(analytics analytics.Client) RuntimeOption
func WithCodeActTools ¶
func WithCodeActTools(tools ...codeact.Tool) RuntimeOption
func WithConcurrency ¶
func WithConcurrency(concurrency int) RuntimeOption
func WithLoggerConfig ¶
func WithLoggerConfig(config *LoggerConfig) RuntimeOption
type RuntimeOptions ¶
type RuntimeOptions struct {
Tools []codeact.Tool
Concurrency int
Analytics analytics.Client
LoggerConfig *LoggerConfig
}
func DefaultRuntimeOptions ¶
func DefaultRuntimeOptions() *RuntimeOptions
type Shell ¶
func DefaultShell ¶
type SyncMap ¶
type SyncMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewSyncMap ¶
func NewSyncMap[K comparable, V any]() *SyncMap[K, V]
type TaskReconciler ¶
type TaskReconciler struct {
// contains filtered or unexported fields
}
func NewTaskReconciler ¶
func NewTaskReconciler( memory *memory.Client, interpreter *codeact.Interpreter, concurrency int, eventRouter *event.EventRouter, providerFactory *ModelProviderFactory, metricsRegistry prometheus.Registerer, ) *TaskReconciler
type TaskStatus ¶
type TitleGenerator ¶
type TitleGenerator struct {
// contains filtered or unexported fields
}
func NewTitleGenerator ¶
func NewTitleGenerator(memory *memory.Client, providerFactory *ModelProviderFactory) *TitleGenerator
func (*TitleGenerator) GenerateTitle ¶
Click to show internal directories.
Click to hide internal directories.