codex

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Name = "openai-codex"

Variables

View Source
var (
	ErrSnapshotRefreshRequired       = errors.New("codex snapshot refresh required")
	ErrCredentialPersistenceDegraded = errors.New("codex credential persistence degraded")
)

Functions

func Register

func Register(reg *adapter.Registry, client *http.Client, sink CredentialSink, refresh SnapshotRefreshTrigger, options Options) error

Types

type Adapter

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

func New

func New(client *http.Client, sink CredentialSink, refresh SnapshotRefreshTrigger, options Options) *Adapter

func (*Adapter) Execute

func (a *Adapter) Execute(ctx context.Context, ex adapter.Execution) (*adapter.Result, error)

func (*Adapter) Operate

type CodexModel

type CodexModel struct {
	Slug                  string          `json:"slug"`
	DisplayName           string          `json:"display_name,omitempty"`
	Description           string          `json:"description,omitempty"`
	Visibility            string          `json:"visibility,omitempty"`
	SupportedInAPI        bool            `json:"supported_in_api"`
	ContextWindow         int64           `json:"context_window,omitempty"`
	WebSearchToolType     string          `json:"web_search_tool_type,omitempty"`
	SupportsSearchTool    *bool           `json:"supports_search_tool,omitempty"`
	InputModalities       []string        `json:"input_modalities,omitempty"`
	ToolMode              string          `json:"tool_mode,omitempty"`
	SupportsParallelCalls *bool           `json:"supports_parallel_tool_calls,omitempty"`
	AvailableInPlans      []string        `json:"available_in_plans,omitempty"`
	Capabilities          json.RawMessage `json:"capabilities,omitempty"`
}

type CodexRateLimitObservation

type CodexRateLimitObservation struct {
	Account     string
	PublicModel string
	Header      http.Header
	JSON        json.RawMessage
}

type ControlPlaneSink

type ControlPlaneSink struct{ Client *controlplane.Client }

func (ControlPlaneSink) Persist

func (s ControlPlaneSink) Persist(ctx context.Context, accountID string, expectedRevision int64, credential config.Credential) (CredentialPersistResult, error)

type CredentialPersistResult

type CredentialPersistResult struct {
	Revision int64
	Digest   string
}

type CredentialSink

type CredentialSink interface {
	Persist(context.Context, string, int64, config.Credential) (CredentialPersistResult, error)
}

type ModelDiscovery

type ModelDiscovery struct {
	Models []CodexModel `json:"models"`
}

type Options

type Options struct {
	TestMode               bool
	AuthBaseURL            string
	BackendBaseURL         string
	ClientVersion          string
	Now                    func() time.Time
	CodexRateLimitObserver func(context.Context, CodexRateLimitObservation)
}

type SnapshotRefreshTrigger

type SnapshotRefreshTrigger interface {
	TriggerSnapshotRefresh(reason string)
}

Jump to

Keyboard shortcuts

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