openaiwire

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilePartFromBase64

func FilePartFromBase64(filename, fileData string) lipapi.Part

FilePartFromBase64 builds a data-URL file part from base64 payload and optional filename.

func ImagePartFromURL

func ImagePartFromURL(imageURL string) (lipapi.Part, error)

ImagePartFromURL maps a URL or data-URL string to a canonical image part.

func MarshalBlock

func MarshalBlock(blk map[string]json.RawMessage) ([]byte, error)

func ModelFromExtensions

func ModelFromExtensions(c *lipapi.Call, extKey string) string

ModelFromExtensions returns the wire model string stored under extKey during decode.

func WriteErrorJSON

func WriteErrorJSON(w http.ResponseWriter, status int, message, errType, code string) error

WriteErrorJSON writes an OpenAI-shaped JSON error before any streamed bytes.

Types

type APIError

type APIError struct {
	Error struct {
		Message string  `json:"message"`
		Type    string  `json:"type"`
		Param   any     `json:"param"`
		Code    *string `json:"code,omitempty"`
	} `json:"error"`
}

Jump to

Keyboard shortcuts

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