Documentation
¶
Overview ¶
Package codex provides a subscription-backed OpenAI OAuth vendor that talks to the private Codex backend for supported models.
Index ¶
- type Client
- func (c *Client) ListModels(ctx context.Context) ([]string, error)
- func (c *Client) LoadEnvSettings(env map[string]string)
- func (c *Client) Send(ctx context.Context, msgs []*chat.ChatCompletionMessage, ...) (string, error)
- func (c *Client) SendStream(ctx context.Context, msgs []*chat.ChatCompletionMessage, ...) error
- func (c *Client) Setup() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
*openaivendor.Client
AccessToken *plugins.Setting
RefreshToken *plugins.Setting
AccountID *plugins.Setting
AuthBaseURL *plugins.SetupQuestion
// TokenPersist writes current tokens after refresh. Nil skips. Error fails the refresh.
TokenPersist func() error
// WithStoreLock, when set, wraps refresh+persist (reload tokens inside the lock).
WithStoreLock func(func() error) error
// contains filtered or unexported fields
}
Client implements the Codex-backed AI vendor.
func (*Client) ListModels ¶
ListModels returns the Codex models available to the configured account.
func (*Client) LoadEnvSettings ¶ added in v1.4.471
LoadEnvSettings copies non-empty Codex token values from env.
func (*Client) Send ¶
func (c *Client) Send(ctx context.Context, msgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions) (string, error)
Send sends a request to Codex and returns the final text output.
func (*Client) SendStream ¶
func (c *Client) SendStream( ctx context.Context, msgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions, channel chan domain.StreamUpdate, ) error
SendStream sends a request to Codex and streams the response text updates.
Click to show internal directories.
Click to hide internal directories.