runtime

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentInstance

type AgentInstance struct {
	ID uuid.UUID
	// contains filtered or unexported fields
}

func (*AgentInstance) AddAssistantToolCall

func (ai *AgentInstance) AddAssistantToolCall(toolCall types.ToolCall)

func (*AgentInstance) AddMessage

func (ai *AgentInstance) AddMessage(role types.MessageRole, content string)

func (*AgentInstance) AddToolMessage

func (ai *AgentInstance) AddToolMessage(toolName, toolCallID, content string)

func (*AgentInstance) LatestAssistantMessage

func (ai *AgentInstance) LatestAssistantMessage() (*types.Message, bool)

func (*AgentInstance) RunConversationEndedHook

func (ai *AgentInstance) RunConversationEndedHook(ctx context.Context) error

func (*AgentInstance) RunConversationStartedHook

func (ai *AgentInstance) RunConversationStartedHook(ctx context.Context) error

func (*AgentInstance) RunPostContextCompactionHook

func (ai *AgentInstance) RunPostContextCompactionHook(ctx context.Context, compactedConversationID uuid.UUID) error

func (*AgentInstance) RunPostToolUseHook

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

func (*AgentInstance) RunPreContextCompactionHook

func (ai *AgentInstance) RunPreContextCompactionHook(ctx context.Context, compactedConversationID uuid.UUID) error

func (*AgentInstance) RunPreToolUseHook

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

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 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 Runtime

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

func New

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

func (*Runtime) NewAgentInstanceFromConversation

func (rt *Runtime) NewAgentInstanceFromConversation(ctx context.Context, conversationID uuid.UUID) (*AgentInstance, error)

func (*Runtime) NewAgentInstanceFromSpec

func (rt *Runtime) NewAgentInstanceFromSpec(ctx context.Context, agentSpecID uuid.UUID) (*AgentInstance, error)

func (*Runtime) RunAgentInstance

func (rt *Runtime) RunAgentInstance(ai *AgentInstance, 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