chat

package
v2026.1114.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 13 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 BufferChatCompletionFromCodexSSE

func BufferChatCompletionFromCodexSSE(body io.Reader, model string) ([]byte, error)

func BuildCodexInput

func BuildCodexInput(chat map[string]any) []any

func ChatCompletionToCodexBody

func ChatCompletionToCodexBody(chat map[string]any) ([]byte, error)

func ChatGPTSubUpstreamError

func ChatGPTSubUpstreamError(statusCode int, body []byte, model string) error

func CodexSessionID added in v2026.1030.0

func CodexSessionID(chat map[string]any) string

func DrainUpstreamError

func DrainUpstreamError(resp *http.Response) ([]byte, error)

func RewriteCodexSSEStream

func RewriteCodexSSEStream(r io.Reader, w io.Writer, model string) error

Types

type UpstreamError added in v2026.1031.0

type UpstreamError struct {
	StatusCode int
	Message    string
	Payload    json.RawMessage
}

func (*UpstreamError) DiagnosticFields added in v2026.1031.0

func (e *UpstreamError) DiagnosticFields() map[string]any

func (*UpstreamError) Error added in v2026.1031.0

func (e *UpstreamError) Error() string

func (*UpstreamError) Unwrap added in v2026.1031.0

func (e *UpstreamError) Unwrap() error

Jump to

Keyboard shortcuts

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