Skip to main content

Embedding functions

openai_embedding

  • Added in v2.5.0.
  • Since v2.6.0, openai_embedding function has been updated to accept a single config argument as a constant JSONB value containing the embedding configuration, instead of separate api_key and model arguments.
Get the text embedding vector for a given text. The config argument must be a constant JSONB value containing the embedding configuration.
Syntax
The config parameter is a JSONB object that supports the following options:
Example

Retry behavior

If an OpenAI embedding request fails, RisingWave retries it with exponential backoff. The delay starts at 100 milliseconds and is capped at 10 seconds. There is no built-in retry limit. If OpenAI continues returning errors, RisingWave continues retrying until it receives a valid embedding response.

Metrics

RisingWave exposes the following Prometheus metrics for openai_embedding. Each metric has model and api_base labels. For information about accessing Prometheus metrics, see Prometheus metrics reference.