components

package
v0.7.19 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 0 Imported by: 73

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 tells callback aspect status of component's implementation When the Checker interface is implemented and returns true, the framework will not start the default aspect. Instead, the component will decide the callback execution location and the information to be injected.

type Component

type Component string

Component names representing the different categories of components.

const (
	// ComponentOfPrompt identifies chat template components.
	ComponentOfPrompt Component = "ChatTemplate"
	// ComponentOfChatModel identifies chat model components.
	ComponentOfChatModel Component = "ChatModel"
	// 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 get the type name of one component's implementation if Typer exists, the full name of the component instance will be {Typer}{Component} by default recommend using Camel Case Naming Style for Typer

Directories

Path Synopsis
Package document defines callback payloads used by document loaders.
Package document defines callback payloads used by document loaders.
parser
Package parser provides document parsers and helpers, including a simple text parser and extension-aware parser.
Package parser provides document parsers and helpers, including a simple text parser and extension-aware parser.
Package embedding defines callback payloads for embedding components.
Package embedding defines callback payloads for embedding components.
Package indexer defines callback payloads used by indexers.
Package indexer defines callback payloads used by indexers.
Package model defines callback payloads and configuration types for chat models.
Package model defines callback payloads and configuration types for chat models.
Package prompt defines callback payloads for prompt components.
Package prompt defines callback payloads for prompt components.
Package retriever defines callback payloads for retrieval components.
Package retriever defines callback payloads for retrieval components.
Package tool defines callback inputs and outputs for tool execution.
Package tool defines callback inputs and outputs for tool execution.
utils
Package utils provides helper utilities for tools.
Package utils provides helper utilities for tools.

Jump to

Keyboard shortcuts

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