Help us shape the future of Go! Take the 2026 Go Developer Survey

openai

package
v0.2.50 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MPL-2.0 Imports: 12 Imported by: 0

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