artifact

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 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) DeleteThreadArtifacts

func (s *MemoryStore) DeleteThreadArtifacts(_ context.Context, threadID string) error

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)
	DeleteThreadArtifacts(context.Context, string) error
}

type ToolOutputArtifact

type ToolOutputArtifact struct {
	RunID         string         `json:"run_id,omitempty"`
	ThreadID      string         `json:"thread_id,omitempty"`
	TurnID        string         `json:"turn_id,omitempty"`
	PromptScopeID string         `json:"prompt_scope_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