components

package
v0.9.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 0 Imported by: 109

Documentation

Overview

Package components defines common interfaces that describe component types and callback capabilities used across Eino.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetType

func GetType(component any) (string, bool)

GetType returns the type name for a component that implements Typer.

func IsCallbacksEnabled

func IsCallbacksEnabled(i any) bool

IsCallbacksEnabled reports whether a component implements Checker and enables callbacks.

Types

type Checker

type Checker interface {
	IsCallbacksEnabled() bool
}

Checker controls whether the framework's automatic callback instrumentation is active for a component.

When IsCallbacksEnabled returns true, the framework skips its default OnStart/OnEnd wrapping and trusts the component to invoke callbacks itself at the correct points. Implement this when your component needs precise control over callback timing or content — for example, when streaming requires callbacks to fire mid-stream rather than only at completion.

type Component

type Component string

Component names representing the different categories of components.

const (
	// ComponentOfPrompt identifies chat template components.
	ComponentOfPrompt Component = "ChatTemplate"
	// ComponentOfAgenticPrompt identifies agentic template components.
	ComponentOfAgenticPrompt Component = "AgenticChatTemplate"
	// ComponentOfChatModel identifies chat model components.
	ComponentOfChatModel Component = "ChatModel"
	// ComponentOfAgenticModel identifies agentic model components.
	ComponentOfAgenticModel Component = "AgenticModel"
	// ComponentOfEmbedding identifies embedding components.
	ComponentOfEmbedding Component = "Embedding"
	// ComponentOfIndexer identifies indexer components.
	ComponentOfIndexer Component = "Indexer"
	// ComponentOfRetriever identifies retriever components.
	ComponentOfRetriever Component = "Retriever"
	// ComponentOfLoader identifies loader components.
	ComponentOfLoader Component = "Loader"
	// ComponentOfTransformer identifies document transformer components.
	ComponentOfTransformer Component = "DocumentTransformer"
	// ComponentOfTool identifies tool components.
	ComponentOfTool Component = "Tool"
)

type Typer

type Typer interface {
	GetType() string
}

Typer provides a human-readable type name for a component implementation.

When implemented, the component's full display name in DevOps tooling (visual debugger, IDE plugin, dashboards) becomes "{GetType()}{ComponentKind}" — e.g. "OpenAIChatModel". Use CamelCase naming.

Also used by [utils.InferTool] and similar constructors to set the display name of tool instances.

Directories

Path Synopsis
Package document defines the Loader and Transformer component interfaces for ingesting and processing documents in an eino pipeline.
Package document defines the Loader and Transformer component interfaces for ingesting and processing documents in an eino pipeline.
parser
Package parser defines the Parser interface for converting raw byte streams into schema.Document values.
Package parser defines the Parser interface for converting raw byte streams into schema.Document values.
Package embedding defines the Embedder component interface for converting text into vector representations.
Package embedding defines the Embedder component interface for converting text into vector representations.
Package indexer defines the Indexer component interface for storing documents and their vector representations in a backend store.
Package indexer defines the Indexer component interface for storing documents and their vector representations in a backend store.
Package model defines the ChatModel component interface for interacting with large language models (LLMs).
Package model defines the ChatModel component interface for interacting with large language models (LLMs).
Package prompt defines the ChatTemplate component interface for building structured message lists from templates and runtime variables.
Package prompt defines the ChatTemplate component interface for building structured message lists from templates and runtime variables.
Package retriever defines the Retriever component interface for fetching relevant documents from a document store given a query.
Package retriever defines the Retriever component interface for fetching relevant documents from a document store given a query.
Package tool defines the tool component interfaces that allow language models to invoke external capabilities, and helpers for interrupt/resume within tools.
Package tool defines the tool component interfaces that allow language models to invoke external capabilities, and helpers for interrupt/resume within tools.
utils
Package utils provides constructors for building tool implementations without writing boilerplate JSON serialization code.
Package utils provides constructors for building tool implementations without writing boilerplate JSON serialization code.

Jump to

Keyboard shortcuts

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