Documentation
¶
Overview ¶
Package codex implements the OpenAI Plus (ChatGPT Codex) provider.
Index ¶
- type Client
- func (c *Client) Chat(ctx context.Context, req request.Request, fn stream.Func) (message.Message, usage.Usage, error)
- func (c *Client) Estimate(ctx context.Context, req request.Request, text string) (int, error)
- func (c *Client) Model(ctx context.Context, name string) (model.Model, error)
- func (c *Client) Models(ctx context.Context) (model.Models, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the OpenAI-compatible client with Codex-specific authentication and endpoints. Uses a private field (not embedding) to prevent OpenAI's Embed/Transcribe/Synthesize methods from being promoted — Codex does not support those capabilities.
func New ¶
New creates a Codex client using the given refresh token, optional auth file path for token rotation, and timeout.
func (*Client) Chat ¶
func (c *Client) Chat(ctx context.Context, req request.Request, fn stream.Func) (message.Message, usage.Usage, error)
Chat injects store: false and instructions before delegating to Fantasy. Codex backend requires the instructions field explicitly (unlike standard OpenAI which accepts system messages in the input array).