artifact

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package artifact defines the extensible Artifact interface and common concrete types used throughout ore. The Artifact interface exposes a public Kind() method to allow custom artifact types to be defined in other packages.

Package artifact defines the extensible Artifact interface and common concrete types used throughout ore.

The Artifact interface exposes a public Kind() method to allow custom artifact types to be defined in other packages. Private marker methods would prevent cross-package extensibility because Go does not allow implementing unexported methods across package boundaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accumulable added in v0.1.0

type Accumulable interface {
	Delta
	AccumulatorKey() string
	MergeInto(acc Artifact) Artifact
}

Accumulable marks delta artifacts that can be merged into complete artifacts by a generic accumulator. Implementations must return a stable AccumulatorKey and define MergeInto to combine the delta with an existing accumulated artifact or seed a new one when acc is nil.

type Artifact

type Artifact interface {
	Kind() string
}

Artifact is the base interface for all LLM response artifacts.

type Delta

type Delta interface {
	Artifact
	IsDelta()
}

Delta marks artifacts that are ephemeral streaming fragments. These must never be persisted to state; only complete artifacts should be.

type Image

type Image struct {
	URL string
}

Image represents an image artifact referenced by URL.

func (Image) Kind

func (i Image) Kind() string

Kind returns the artifact kind identifier.

type Reasoning

type Reasoning struct {
	Content string
}

Reasoning represents a reasoning or thinking content artifact.

func (Reasoning) Kind

func (r Reasoning) Kind() string

Kind returns the artifact kind identifier.

type ReasoningDelta

type ReasoningDelta struct {
	Content string
}

ReasoningDelta represents a partial chunk of reasoning content for streaming.

func (ReasoningDelta) AccumulatorKey added in v0.1.0

func (d ReasoningDelta) AccumulatorKey() string

AccumulatorKey returns a stable routing key for the generic accumulator. ReasoningDelta accumulates into a single "reasoning" block.

func (ReasoningDelta) IsDelta

func (r ReasoningDelta) IsDelta()

IsDelta marks ReasoningDelta as an ephemeral streaming fragment.

func (ReasoningDelta) Kind

func (r ReasoningDelta) Kind() string

Kind returns the artifact kind identifier.

func (ReasoningDelta) MergeInto added in v0.1.0

func (d ReasoningDelta) MergeInto(acc Artifact) Artifact

MergeInto merges the delta into an existing Reasoning artifact or seeds a new one.

type Text

type Text struct {
	Content string
}

Text represents a text content artifact.

func (Text) Kind

func (t Text) Kind() string

Kind returns the artifact kind identifier.

type TextDelta

type TextDelta struct {
	Content string
}

TextDelta represents a partial chunk of text content for streaming.

func (TextDelta) AccumulatorKey added in v0.1.0

func (d TextDelta) AccumulatorKey() string

AccumulatorKey returns a stable routing key for the generic accumulator. TextDelta accumulates into a single "text" block.

func (TextDelta) IsDelta

func (t TextDelta) IsDelta()

IsDelta marks TextDelta as an ephemeral streaming fragment.

func (TextDelta) Kind

func (t TextDelta) Kind() string

Kind returns the artifact kind identifier.

func (TextDelta) MergeInto added in v0.1.0

func (d TextDelta) MergeInto(acc Artifact) Artifact

MergeInto merges the delta into an existing Text artifact or seeds a new one.

type ToolCall

type ToolCall struct {
	ID        string
	Name      string
	Arguments string
}

ToolCall represents a tool invocation artifact.

func (ToolCall) Kind

func (t ToolCall) Kind() string

Kind returns the artifact kind identifier.

type ToolCallDelta

type ToolCallDelta struct {
	Index     int
	ID        string
	Name      string
	Arguments string
}

ToolCallDelta represents a partial chunk of a tool invocation for streaming. Index identifies which parallel tool call in the current turn this fragment belongs to, enabling the generic accumulator to merge chunks independently.

func (ToolCallDelta) AccumulatorKey added in v0.1.0

func (d ToolCallDelta) AccumulatorKey() string

AccumulatorKey returns a stable routing key for the generic accumulator. ToolCallDelta accumulates per-index: "tool_call:0", "tool_call:1", etc.

func (ToolCallDelta) IsDelta

func (t ToolCallDelta) IsDelta()

IsDelta marks ToolCallDelta as an ephemeral streaming fragment.

func (ToolCallDelta) Kind

func (t ToolCallDelta) Kind() string

Kind returns the artifact kind identifier.

func (ToolCallDelta) MergeInto added in v0.1.0

func (d ToolCallDelta) MergeInto(acc Artifact) Artifact

MergeInto merges the delta into an existing ToolCall artifact or seeds a new one. ID uses latest-wins semantics; Name and Arguments are concatenated.

type ToolResult

type ToolResult struct {
	ToolCallID string
	Content    string
	IsError    bool
}

ToolResult represents the result of executing a tool call.

func (ToolResult) Kind

func (t ToolResult) Kind() string

Kind returns the artifact kind identifier.

type Usage

type Usage struct {
	PromptTokens     int
	CompletionTokens int
	TotalTokens      int
}

Usage represents token consumption metadata from a provider response.

func (Usage) Kind

func (u Usage) Kind() string

Kind returns the artifact kind identifier.

Jump to

Keyboard shortcuts

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