v0.7.0

openai Package

Last updated


This page lists the exported API of core/openai, the embedding client used for ToriiDB vector operations.

Client


  1. type Client struct {
  2. APIKey string
  3. Dim int
  4. Model string
  5. }
  6. func New(apiKey string) (*Client, error)
  7. func (c *Client) Embed(ctx context.Context, text string) ([]float32, error)

Embed rejects blank text, returns <status>: <body> for non-200 responses, and fails when the vector length differs from Dim.

中文