runtime

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompactionHook

type CompactionHook struct {
	ID                      string         `json:"id"`
	ConversationID          string         `json:"conversation_id"`
	CompactedConversationID string         `json:"compacted_conversation_id"`
	EventType               hook.EventType `json:"event_type"`
	AgentName               string         `json:"agent_name"`
	LastResponse            string         `json:"last_response,omitempty"`
}

type ConversationInstance added in v0.2.4

type ConversationInstance struct {
	*agent.Conversation
	// contains filtered or unexported fields
}

func (*ConversationInstance) AddAssistantToolCall added in v0.2.4

func (ci *ConversationInstance) AddAssistantToolCall(toolCall types.ToolCall)

func (*ConversationInstance) AddMessage added in v0.2.4

func (ci *ConversationInstance) AddMessage(role types.MessageRole, content string)

func (*ConversationInstance) AddToolMessage added in v0.2.4

func (ci *ConversationInstance) AddToolMessage(toolName, toolCallID, content string)

func (*ConversationInstance) LatestAssistantMessage added in v0.2.4

func (ci *ConversationInstance) LatestAssistantMessage() (*types.Message, bool)

func (*ConversationInstance) RunConversationEndedHook added in v0.2.4

func (ci *ConversationInstance) RunConversationEndedHook(ctx context.Context) error

func (*ConversationInstance) RunConversationStartedHook added in v0.2.4

func (ci *ConversationInstance) RunConversationStartedHook(ctx context.Context) error

func (*ConversationInstance) RunPostContextCompactionHook added in v0.2.4

func (ci *ConversationInstance) RunPostContextCompactionHook(ctx context.Context, compactedConversationID uuid.UUID) error

func (*ConversationInstance) RunPostToolUseHook added in v0.2.4

func (ci *ConversationInstance) RunPostToolUseHook(ctx context.Context, toolCall *types.ToolCall, toolCallResponse string) error

func (*ConversationInstance) RunPreContextCompactionHook added in v0.2.4

func (ci *ConversationInstance) RunPreContextCompactionHook(ctx context.Context, compactedConversationID uuid.UUID) error

func (*ConversationInstance) RunPreToolUseHook added in v0.2.4

func (ci *ConversationInstance) RunPreToolUseHook(ctx context.Context, toolCall *types.ToolCall, toolCallResponse string) error

type ConversationStateHook

type ConversationStateHook struct {
	ID             string         `json:"id"`
	ConversationID string         `json:"conversation_id"`
	EventType      hook.EventType `json:"event_type"`
	AgentName      string         `json:"agent_name"`
	LastResponse   string         `json:"last_response,omitempty"`
}

type HookResult

type HookResult struct {
	ExitCode int
	Stdout   []byte
	Stderr   []byte
}

func RunHook

func RunHook(ctx context.Context, hook hook.Hook, stdin []byte) (HookResult, error)

type Options added in v0.2.8

type Options struct {
	ShellRoot string
}

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

func New

func New(rootCtx context.Context, ctrl *controller.Controller, sch *scheduler.Scheduler, opts Options) (*Runtime, error)

func (*Runtime) NewConversationInstance added in v0.2.4

func (rt *Runtime) NewConversationInstance(ctx context.Context, conversationID uuid.UUID) (*ConversationInstance, error)

func (*Runtime) NewConversationInstanceFromSpec added in v0.2.4

func (rt *Runtime) NewConversationInstanceFromSpec(ctx context.Context, agentSpecID uuid.UUID, sessionID string, metadata map[string]any, shellRoot string) (*ConversationInstance, error)

func (*Runtime) RunConversationInstance added in v0.2.4

func (rt *Runtime) RunConversationInstance(ci *ConversationInstance, prompt string) error

func (*Runtime) SetOpenAIClient

func (rt *Runtime) SetOpenAIClient() error

func (*Runtime) ValidateModel

func (rt *Runtime) ValidateModel(ctx context.Context, provider agent.LLMProvider, model string) error

type ToolUseHook

type ToolUseHook struct {
	ID             string         `json:"id"`
	ConversationID string         `json:"conversation_id"`
	EventType      hook.EventType `json:"event_type"`
	AgentName      string         `json:"agent_name"`
	LastResponse   string         `json:"last_response,omitempty"`
	ToolName       string         `json:"tool_name,omitempty"`
	ToolArguments  string         `json:"tool_arguments,omitempty"`
	ToolResponse   string         `json:"tool_response,omitempty"`
}

Directories

Path Synopsis
providers

Jump to

Keyboard shortcuts

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