v0.7.0

openai 套件

最後更新


本頁列出 core/openai 的公開 API,也就是 ToriiDB 向量操作所用的 embedding client。

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 拒絕空白文字,非 200 回應回傳 <status>: <body>,向量長度與 Dim 不同時失敗。

相關頁面


EN