openai 套件
最後更新
本頁列出
core/openai 的公開 API,也就是 ToriiDB 向量操作所用的 embedding client。Client
- type Client struct {
- APIKey string
- Dim int
- Model string
- }
- func New(apiKey string) (*Client, error)
- func (c *Client) Embed(ctx context.Context, text string) ([]float32, error)
Embed 拒絕空白文字,非 200 回應回傳 <status>: <body>,向量長度與 Dim 不同時失敗。