openai

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingPrompt = errors.New("openai: prompt not found in workflow graph")

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey     string
	BaseURL    string
	Model      string
	Quality    string
	Style      string
	HTTPClient *http.Client
}

Config configures the OpenAI image engine.

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine compiles a workflow graph into an OpenAI image request.

func New

func New(cfg Config) *Engine

New creates an OpenAI engine instance.

func (*Engine) Capabilities

func (e *Engine) Capabilities() engine.Capability

Capabilities implements engine.Describer.

func (*Engine) Compile

func (e *Engine) Compile(graph workflow.Graph) (Request, error)

Compile extracts prompt and size from a graph into an OpenAI request.

func (*Engine) Execute

func (e *Engine) Execute(ctx context.Context, graph workflow.Graph) (engine.Result, error)

Execute compiles the workflow and calls the OpenAI images API.

type Request

type Request struct {
	Model   string
	Prompt  string
	Size    string
	Quality string
	Style   string
}

Request is the flattened image generation payload derived from a graph.

Jump to

Keyboard shortcuts

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