Documentation
¶
Index ¶
- Constants
- Variables
- func AccumulateCodex(input []byte, messageID, model string) (map[string]any, error)
- func CodexToAnthropicSSE(input []byte, messageID, model string) ([][]byte, error)
- func EncodeSSE(event string, data any) []byte
- func ReduceCodexSSE(input []byte) ([]map[string]any, error)
- func Snippet(value string, maxBytes int) string
- func TranslateAnthropic(request map[string]any, options TranslateOptions) (map[string]any, error)
- func WebSocketHeaders(input http.Header) http.Header
- func WebSocketPayload(body map[string]any) []byte
- func WebSocketURL(raw string) (string, error)
- type AuthManager
- type AuthSnapshot
- type Config
- type Diagnostics
- type DiagnosticsConfig
- type ModelMap
- type ProxyModel
- type Running
- type SSEEvent
- type Server
- type TranslateOptions
- type Transport
- type UpstreamAuth
- type WebSocketSetupError
Constants ¶
View Source
const WebSocketProtocolHeader = "responses_websockets=2026-02-06"
Variables ¶
View Source
var AllowedModels = []string{"gpt-5.2", "gpt-5.3-codex", "gpt-5.3-codex-spark", "gpt-5.4", "gpt-5.4-mini", "gpt-5.5"}
Functions ¶
func AccumulateCodex ¶
func CodexToAnthropicSSE ¶
func TranslateAnthropic ¶
func WebSocketPayload ¶
func WebSocketURL ¶
Types ¶
type AuthManager ¶
type AuthManager interface {
Snapshot() (AuthSnapshot, error)
}
type AuthSnapshot ¶
type AuthSnapshot struct{ AccessToken, AccountID, EndpointURL string }
type Config ¶
type Config struct {
Port int
ClientToken string
Transport Transport
RequestTimeout, ConnectTimeout, WebSocketIdleTimeout time.Duration
Models ModelMap
Diagnostics DiagnosticsConfig
}
func ConfigFromEnvironment ¶
type Diagnostics ¶
type Diagnostics struct {
// contains filtered or unexported fields
}
func NewDiagnostics ¶
func NewDiagnostics(config DiagnosticsConfig) (*Diagnostics, error)
func (*Diagnostics) Close ¶
func (diagnostics *Diagnostics) Close()
type DiagnosticsConfig ¶
type ModelMap ¶
type ModelMap struct{ Big, Middle, Small string }
func DefaultModelMap ¶
func DefaultModelMap() ModelMap
func ModelMapFromEnvironment ¶
func ModelMapFromEnvironment() ModelMap
func (ModelMap) Resolve ¶
func (models ModelMap) Resolve(requested string) ProxyModel
type ProxyModel ¶
type ProxyModel struct{ Requested, Upstream, ServiceTier string }
type TranslateOptions ¶
type TranslateOptions struct {
SessionID, ServiceTier, ServiceTierOverride, EffortOverride string
}
type UpstreamAuth ¶
type UpstreamAuth struct {
// contains filtered or unexported fields
}
func LoadUpstreamAuth ¶
func LoadUpstreamAuth() (*UpstreamAuth, error)
func (*UpstreamAuth) DefaultTransport ¶
func (auth *UpstreamAuth) DefaultTransport() Transport
func (*UpstreamAuth) RefreshAfterUnauthorized ¶
func (auth *UpstreamAuth) RefreshAfterUnauthorized() (bool, error)
func (*UpstreamAuth) Snapshot ¶
func (auth *UpstreamAuth) Snapshot() (AuthSnapshot, error)
type WebSocketSetupError ¶
type WebSocketSetupError struct {
Message string
Status int
Code, RetryAfter string
RequestSent bool
}
func (*WebSocketSetupError) Error ¶
func (err *WebSocketSetupError) Error() string
Click to show internal directories.
Click to hide internal directories.