responsesapi

package
v0.0.0-...-0a5f1a1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxAttempts = primitives.DefaultRemoteMaxAttempts

Variables

This section is empty.

Functions

func NewAdapter

func NewAdapter(remote *primitives.RemoteClient, config Config) (llm.Adapter, error)

Types

type APIError

type APIError struct {
	StatusCode int
	Code       string
	Message    string
	Param      string
	Type       string
}

func (*APIError) Error

func (err *APIError) Error() string

type CacheKeyPlacement

type CacheKeyPlacement struct {
	Header                 string
	UsePromptCacheKeyField bool
}

type Config

type Config struct {
	Endpoint          string
	Headers           map[string][]string
	CacheKeyPlacement CacheKeyPlacement
	// Nil uses DefaultMaxAttempts.
	MaxAttempts *int
	// Trace borrows read-only bodies: request JSON and terminal response JSON or HTTP error.
	Trace func(Exchange)
	// Extensions are provider-specific top-level fields merged into every request
	// body, such as OpenRouter's automatic prompt caching and upstream routing.
	// A key that names a standard Responses API field is rejected per request.
	Extensions map[string]jsontext.Value
}

type Exchange

type Exchange struct {
	RequestBody  []byte
	StatusCode   int
	ResponseBody []byte
}

Jump to

Keyboard shortcuts

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