agent

package
v0.137.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	Run(ctx context.Context, prompt string, opts RunOpts) (*Stream, error)
	Health() error
	ContextWindow() int
}

type Chunk

type Chunk struct {
	Text string
}

type Claude

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

func NewClaude

func NewClaude(contextWindow int) *Claude

func (*Claude) ContextWindow

func (c *Claude) ContextWindow() int

func (*Claude) Health

func (c *Claude) Health() error

func (*Claude) Run

func (c *Claude) Run(ctx context.Context, prompt string, opts RunOpts) (_ *Stream, err error)

type CmdFactory

type CmdFactory func(ctx context.Context, name string, args []string) (*exec.Cmd, error)

CmdFactory creates an exec.Cmd that may run inside a sandbox. When nil, agents fall back to exec.CommandContext.

type Codex

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

func NewCodex

func NewCodex(ctxWindow int) *Codex

func (*Codex) ContextWindow

func (c *Codex) ContextWindow() int

func (*Codex) Health

func (c *Codex) Health() error

func (*Codex) Run

func (c *Codex) Run(ctx context.Context, prompt string, opts RunOpts) (_ *Stream, err error)

type Cursor

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

func NewCursor

func NewCursor(ctxWindow int) *Cursor

func (*Cursor) ContextWindow

func (c *Cursor) ContextWindow() int

func (*Cursor) Health

func (c *Cursor) Health() error

func (*Cursor) Run

func (c *Cursor) Run(ctx context.Context, prompt string, opts RunOpts) (_ *Stream, err error)

type Gemini

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

func NewGemini

func NewGemini(model string, ctxWindow int) *Gemini

func (*Gemini) ContextWindow

func (g *Gemini) ContextWindow() int

func (*Gemini) Health

func (g *Gemini) Health() error

func (*Gemini) Run

func (g *Gemini) Run(ctx context.Context, prompt string, opts RunOpts) (_ *Stream, err error)

type Ollama

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

func NewOllama

func NewOllama(model string, ctxWindow int) *Ollama

func (*Ollama) ContextWindow

func (o *Ollama) ContextWindow() int

func (*Ollama) Health

func (o *Ollama) Health() error

func (*Ollama) Run

func (o *Ollama) Run(ctx context.Context, prompt string, opts RunOpts) (_ *Stream, err error)

type OpenCode added in v0.121.0

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

func NewOpenCode added in v0.121.0

func NewOpenCode(ctxWindow int) *OpenCode

func (*OpenCode) ContextWindow added in v0.121.0

func (o *OpenCode) ContextWindow() int

func (*OpenCode) Health added in v0.121.0

func (o *OpenCode) Health() error

func (*OpenCode) Run added in v0.121.0

func (o *OpenCode) Run(ctx context.Context, prompt string, opts RunOpts) (_ *Stream, err error)

type RunOpts

type RunOpts struct {
	AllowedTools        []string
	SystemPrompt        string
	ReplaceSystemPrompt bool
	Timeout             time.Duration
	CmdFactory          CmdFactory
}

type Stream

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

func NewTestStream

func NewTestStream(text string) *Stream

NewTestStream creates a Stream pre-loaded with the given text, for testing.

func (*Stream) Err

func (s *Stream) Err() error

func (*Stream) Next

func (s *Stream) Next() (Chunk, bool)

func (*Stream) SetTokens

func (s *Stream) SetTokens(input, output int)

func (*Stream) Text

func (s *Stream) Text() string

func (*Stream) Tokens

func (s *Stream) Tokens() (input, output int)

Jump to

Keyboard shortcuts

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