aitransformer

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

Init registers the ai_transformer middleware to the global middleware factory.

Types

type Middleware

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

Middleware handles the Ingress/Egress translation for AI requests.

func NewMiddleware

func NewMiddleware(opts Options) *Middleware

NewMiddleware creates a new ai_transformer middleware instance.

func (*Middleware) ServeHTTP

func (m *Middleware) ServeHTTP(ctx context.Context, c *app.RequestContext)

ServeHTTP implements the core logic for translating AI requests and intercepting errors.

type Options

type Options struct {
	Format string `mapstructure:"format"` // e.g., "openai-chat", "anthropic", "gemini"
}

Options defines the configuration for the ai_transformer middleware.

Jump to

Keyboard shortcuts

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