vision

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, provider Provider)

Register ...

Types

type Hook

type Hook interface {
	OnBeforeInvoke(context.Context) context.Context
	OnAfterInvoke(ctx context.Context, err error)
	OnFirstChunk(context.Context, error) context.Context
}

Hook ...

func NewOtelHook

func NewOtelHook(opts ...HookOption) Hook

NewOtelHook ...

type HookOption

type HookOption func(*OtelHook)

HookOption ...

type Instance

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

Instance ...

func NewInstance

func NewInstance(provider string, opts ...Option) *Instance

NewInstance ...

func (*Instance) GenerateImage

func (mi *Instance) GenerateImage(ctx context.Context,
	prompt string, options ...InvokeOption) (string, error)

Invoke ...

type InvokeOption

type InvokeOption func(*InvokeOptions)

InvokeOption is a function that configures a InvokeOptions.

func WithApiKey

func WithApiKey(apiKey string) InvokeOption

WithApiKey ...

type InvokeOptions

type InvokeOptions struct {
	ApiKey string
}

InvokeOptions ...

type Option

type Option func(*Options)

Option ...

type Options

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

Options ...

type OtelHook

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

OtelHook ...

func (*OtelHook) OnAfterInvoke

func (h *OtelHook) OnAfterInvoke(ctx context.Context, err error)

OnAfterInvoke ...

func (*OtelHook) OnBeforeInvoke

func (h *OtelHook) OnBeforeInvoke(ctx context.Context) context.Context

OnBeforeInvoke ...

func (*OtelHook) OnFirstChunk

func (h *OtelHook) OnFirstChunk(ctx context.Context, _ error) context.Context

OnFirstChunk ...

type Provider

type Provider interface {
	GenerateImage(context.Context, string, ...InvokeOption) (string, error)
}

Provider ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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