openai

package
v0.2.60 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MPL-2.0 Imports: 12 Imported by: 1 module, 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

Overview

Package openai is the hosted ai://embed backend: OpenAI's /v1/embeddings endpoint. It's the production counterpart to the local ollama backend — reachable from any node and authenticated, so prod nodes (which have no local Ollama) embed via `WITH provider = "openai"`.

The cleartext API key (OPENAI_KEY) is read from the secrets.SecretBag once per call, placed in the Authorization header, and never stored on the backend, logged, or traced. A 401 body is discarded (providers occasionally echo a key prefix in error messages).

`WITH dimensions = N` is forwarded to OpenAI's `dimensions` parameter, which the text-embedding-3 models honour (e.g. text-embedding-3-large → 1536).

Jump to

Keyboard shortcuts

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