cloudflareworkers

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package cloudflareworkers provides Cloudflare Workers AI's documented OpenAI-compatible AI Gateway route.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(selected model.Model, key auth.APIKey, options ...Option) (inference.Client, error)

Types

type ConfigurationError

type ConfigurationError struct {
	Reason ConfigurationReason
}

func (*ConfigurationError) Error

func (e *ConfigurationError) Error() string

type ConfigurationReason

type ConfigurationReason string
const AccountMissing ConfigurationReason = "account ID is missing"

type Option

type Option func(*config)

func WithAccountID

func WithAccountID(account string) Option

WithAccountID sets the Cloudflare account used when Model.BaseURL is empty.

func WithGatewayID

func WithGatewayID(gateway string) Option

WithGatewayID selects an AI Gateway when Workers AI is routed through one.

func WithHeader

func WithHeader(name, value string) Option

Jump to

Keyboard shortcuts

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