artifact

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKind              = "tool_output"
	DefaultMIME              = "text/plain; charset=utf-8"
	DefaultSafeLabelMaxChars = 80
)

Variables

This section is empty.

Functions

func SafeLabel

func SafeLabel(value string, maxChars int) string

Types

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore() *MemoryStore

func (*MemoryStore) PutToolOutput

func (s *MemoryStore) PutToolOutput(_ context.Context, output ToolOutputArtifact) (Ref, error)

func (*MemoryStore) Ref

func (s *MemoryStore) Ref(id string) (Ref, bool)

func (*MemoryStore) Text

func (s *MemoryStore) Text(id string) (string, bool)

type Ref

type Ref struct {
	ID        string `json:"id,omitempty"`
	SafeLabel string `json:"safe_label,omitempty"`
	URL       string `json:"url,omitempty"`
	Kind      string `json:"kind,omitempty"`
	MIME      string `json:"mime,omitempty"`
	SizeBytes int64  `json:"size_bytes,omitempty"`
	SHA256    string `json:"sha256,omitempty"`
}

type Store

type Store interface {
	PutToolOutput(context.Context, ToolOutputArtifact) (Ref, error)
}

type ToolOutputArtifact

type ToolOutputArtifact struct {
	RunID     string         `json:"run_id,omitempty"`
	SessionID string         `json:"session_id,omitempty"`
	Step      int            `json:"step,omitempty"`
	CallID    string         `json:"call_id,omitempty"`
	ToolName  string         `json:"tool_name,omitempty"`
	Text      string         `json:"text,omitempty"`
	MIME      string         `json:"mime,omitempty"`
	Kind      string         `json:"kind,omitempty"`
	Metadata  map[string]any `json:"metadata,omitempty"`
}

Jump to

Keyboard shortcuts

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