oai

package
v0.2.42 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 26 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

This section is empty.

Variables

This section is empty.

Functions

func AuthFilePathIn

func AuthFilePathIn(workspace, runtimeDir string) (string, error)

func HasTokenIn added in v0.0.42

func HasTokenIn(workspace, runtimeDir, provider string) (bool, error)

func NewChatGPTClientIn

func NewChatGPTClientIn(workspace, runtimeDir, provider string, logger *slog.Logger, opts ...option.RequestOption) (*openai.Client, error)

func RemoveTokenIn added in v0.0.42

func RemoveTokenIn(workspace, runtimeDir, provider string) error

func SaveTokenIn

func SaveTokenIn(workspace, runtimeDir, provider string, token Token) error

func WithResponseObserver added in v0.2.32

func WithResponseObserver(ctx context.Context, observer ResponseObserver) context.Context

Types

type InertResponseObserver added in v0.2.33

type InertResponseObserver struct{}

func (InertResponseObserver) BeginResponse added in v0.2.33

func (InertResponseObserver) BeginResponse(context.Context) error

func (InertResponseObserver) ObserveResponse added in v0.2.33

type MissingTokenError added in v0.1.30

type MissingTokenError struct {
	Provider string
}

func (*MissingTokenError) Error added in v0.1.30

func (e *MissingTokenError) Error() string

func (*MissingTokenError) Unwrap added in v0.1.30

func (e *MissingTokenError) Unwrap() error

type ResponseObserver added in v0.2.32

type ResponseObserver interface {
	BeginResponse(context.Context) error
	ObserveResponse(context.Context, *responses.ResponseStreamEventUnion) error
}

type Token

type Token struct {
	Refresh   string `json:"refresh"`
	Access    string `json:"access"`
	Expires   int64  `json:"expires"`
	AccountID string `json:"account_id,omitempty"`
}

func AcquireBrowserToken added in v0.0.42

func AcquireBrowserToken(ctx context.Context, out io.Writer) (Token, error)

func AcquireDeviceToken added in v0.0.42

func AcquireDeviceToken(ctx context.Context, out io.Writer) (Token, error)

func FreshTokenIn added in v0.1.30

func FreshTokenIn(ctx context.Context, workspace, runtimeDir, provider string, rejected Token) (Token, error)

func LoadTokenIn

func LoadTokenIn(workspace, runtimeDir, provider string) (Token, error)

Jump to

Keyboard shortcuts

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