engine

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capability

type Capability struct {
	MediaTypes   []string // e.g. ["image", "video", "audio"]
	Models       []string
	Sizes        []string // e.g. ["1024x1024", "1280x720"]
	Voices       []string // supported voice identifiers for TTS engines
	MaxDuration  int      // max video/audio duration in seconds; 0 = not applicable
	SupportsSync bool
	SupportsPoll bool
}

Capability describes what an engine can do.

type ConfigField added in v0.9.0

type ConfigField struct {
	Key         string `json:"key"`   // field identifier, e.g. "apiKey", "appId"
	Label       string `json:"label"` // human-readable label, e.g. "API Key"
	Type        string `json:"type"`  // "string", "secret", "url"
	Required    bool   `json:"required"`
	EnvVar      string `json:"envVar,omitempty"` // fallback environment variable name
	Description string `json:"description,omitempty"`
	Default     string `json:"default,omitempty"`
}

ConfigField describes a single configuration parameter for an engine provider. Engine packages expose a package-level ConfigSchema() []ConfigField function so that UIs can dynamically render configuration forms.

type Describer

type Describer interface {
	Capabilities() Capability
}

Describer is an optional interface that engines can implement to advertise capabilities.

type Discoverer added in v0.7.0

type Discoverer interface {
	ModelsByCapability() map[string][]string
}

Discoverer is a package-level interface for providers that can enumerate all known models grouped by capability (e.g. "image", "video", "tts"). Unlike Engine (per-instance), Discoverer is a static catalog of models the provider SDK knows how to handle.

type DryRunResult

type DryRunResult struct {
	WillPoll      bool
	EstimatedTime string   // human-readable estimate, e.g. "30s-2m"
	Warnings      []string // potential issues with the request
}

DryRunResult is the outcome of a dry-run estimation.

type DryRunner

type DryRunner interface {
	DryRun(graph workflow.Graph) (DryRunResult, error)
}

DryRunner is an optional interface for engines that support dry-run estimation.

type Engine

type Engine interface {
	Execute(ctx context.Context, graph workflow.Graph) (Result, error)
}

Engine executes a workflow graph against a concrete backend.

type OutputKind

type OutputKind int

OutputKind classifies the string returned by an engine.

const (
	OutputUnknown OutputKind = iota
	OutputURL
	OutputDataURI
	OutputJSON
	OutputPlainText
)

func ClassifyOutput added in v0.8.0

func ClassifyOutput(s string) OutputKind

ClassifyOutput heuristically classifies a raw output string.

type Result

type Result struct {
	Value string
	Kind  OutputKind
}

Result is the structured output of Engine.Execute.

Directories

Path Synopsis
Package aigoerr provides structured, classifiable errors for aigo engines.
Package aigoerr provides structured, classifiable errors for aigo engines.
Package aliyun 对接阿里云百炼(DashScope)多模态 API。
Package aliyun 对接阿里云百炼(DashScope)多模态 API。
internal/async
Package async 封装百炼异步任务创建与轮询(图生图、文生视频等共用)。
Package async 封装百炼异步任务创建与轮询(图生图、文生视频等共用)。
internal/audiogen
Package audiogen 实现阿里云百炼「语音合成 / 声音设计」类能力。
Package audiogen 实现阿里云百炼「语音合成 / 声音设计」类能力。
internal/graphx
Package graphx 从 workflow.Graph 抽取各域(图/视频/音频)共用字段。
Package graphx 从 workflow.Graph 抽取各域(图/视频/音频)共用字段。
internal/imggen
Package imggen 实现阿里云百炼「图片生成」类能力(文生图等)。
Package imggen 实现阿里云百炼「图片生成」类能力(文生图等)。
internal/vidgen
Package vidgen 实现阿里云百炼「视频生成 / 编辑」类能力(Wan 系列异步接口)。
Package vidgen 实现阿里云百炼「视频生成 / 编辑」类能力(Wan 系列异步接口)。
Package ark implements the Volcengine Ark (火山方舟) video generation engine, supporting Seedance 2.0 and other Ark content generation models.
Package ark implements the Volcengine Ark (火山方舟) video generation engine, supporting Seedance 2.0 and other Ark content generation models.
Package embed defines the EmbedEngine interface for vector embedding backends.
Package embed defines the EmbedEngine interface for vector embedding backends.
aliyun
Package aliyun implements the Alibaba Cloud DashScope (Bailian) embedding backend.
Package aliyun implements the Alibaba Cloud DashScope (Bailian) embedding backend.
gemini
Package gemini implements the Gemini Embedding 2 backend.
Package gemini implements the Gemini Embedding 2 backend.
jina
Package jina implements the Jina AI embedding backend.
Package jina implements the Jina AI embedding backend.
openai
Package openai implements the OpenAI text embedding backend.
Package openai implements the OpenAI text embedding backend.
voyage
Package voyage implements the Voyage AI embedding backend.
Package voyage implements the Voyage AI embedding backend.
Package httpx 提供各引擎共用的 HTTP Client 默认值(超时等)。
Package httpx 提供各引擎共用的 HTTP Client 默认值(超时等)。
Package minimax implements engine.Engine for MiniMax music generation.
Package minimax implements engine.Engine for MiniMax music generation.
Package newapi 对接 New API 文档中的大模型 HTTP 接口(图像 / 视频 / 语音等)。
Package newapi 对接 New API 文档中的大模型 HTTP 接口(图像 / 视频 / 语音等)。
internal/rt
Package rt 提供网关 BaseURL 规范化与路径拼接。
Package rt 提供网关 BaseURL 规范化与路径拼接。
Package openrouter implements an aigo engine for the OpenRouter API.
Package openrouter implements an aigo engine for the OpenRouter API.
Package volcvoice implements engine.Engine for Volcengine Speech (火山语音 / openspeech.bytedance.com) TTS and ASR.
Package volcvoice implements engine.Engine for Volcengine Speech (火山语音 / openspeech.bytedance.com) TTS and ASR.

Jump to

Keyboard shortcuts

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