Help us shape the future of Go! Take the 2026 Go Developer Survey

host

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

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

func NewHost

func NewHost() *Host

func (*Host) Close

func (h *Host) Close() error

func (*Host) Execute

func (h *Host) Execute(ctx context.Context, c *execx.Cmd) (*ToolProcess, error)

func (*Host) Tools

func (h *Host) Tools() []openai.ChatCompletionToolParam

type HostedToolHandler

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

func (*HostedToolHandler) Execute

func (h *HostedToolHandler) Execute(ctx context.Context) (any, error)

type ToolProcess

type ToolProcess struct {
	Tools map[string]openai.ChatCompletionToolParam

	Info *ToolProcessInfo
	// contains filtered or unexported fields
}

func (*ToolProcess) Pid

func (p *ToolProcess) Pid() int

func (*ToolProcess) Post

func (*ToolProcess) Terminate

func (p *ToolProcess) Terminate(status ToolStatus, message string)

func (*ToolProcess) Wait

func (p *ToolProcess) Wait() ToolStatus

type ToolProcessInfo

type ToolProcessInfo struct {
	Status        ToolStatus
	StatusMessage string
}

type ToolStatus

type ToolStatus int
const (
	TsInitializing ToolStatus // Host application is reading headers
	TsRunning                 // Host application is reading messages
	TsCompleted               // Process has exited normally
	TsFailed                  // Process was terminated or exited with non-zero code
)

func (ToolStatus) String

func (s ToolStatus) String() string

Jump to

Keyboard shortcuts

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