agent

package
v0.1.61 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentMessage

type AgentMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

AgentMessage represents a single message in the conversation context.

type AgentRequest

type AgentRequest struct {
	SessionID    string         `json:"session_id"`
	ForkSession  bool           `json:"fork_session,omitempty"`
	Messages     []AgentMessage `json:"messages"`
	SystemPrompt string         `json:"system_prompt"`
	ChannelID    string         `json:"channel_id"`
	AuthorID     string         `json:"author_id,omitempty"`
	DirPath      string         `json:"dir_path,omitempty"`
	Prompt       string         `json:"prompt,omitempty"`
	// OnTurn is called for each assistant turn's text content during streaming.
	// When set, the runner follows container logs in real-time instead of waiting
	// for the container to exit. When nil, the runner uses the existing
	// wait-then-read behavior.
	OnTurn func(text string) `json:"-"`
}

AgentRequest is the input sent to the agent runner.

func (*AgentRequest) BuildPrompt added in v0.1.49

func (r *AgentRequest) BuildPrompt() string

BuildPrompt returns the prompt text for this request. When resuming a session, only the latest message is sent to avoid redundancy.

type AgentResponse

type AgentResponse struct {
	Response  string `json:"response"`
	SessionID string `json:"session_id"`
	Error     string `json:"error,omitempty"`
}

AgentResponse is the output from the agent runner.

Jump to

Keyboard shortcuts

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