embed

package
v0.0.0-...-7f52054 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package embed implements the small OpenAI-compatible surface mdidx needs.

The package keeps mdidx's embedding-facing API small while delegating HTTP, request encoding, and retry behavior to the official OpenAI Go SDK.

Index

Constants

View Source
const (
	DefaultBatchSize      = 64
	DefaultRequestTimeout = 60 * time.Second
	DefaultMaxRetries     = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL        string
	Model          string
	APIKey         string
	HTTPClient     *http.Client
	RequestTimeout time.Duration
	MaxRetries     int
}

func New

func New(baseURL, model, apiKey string) *Client

func (*Client) Embed

func (c *Client) Embed(ctx context.Context, inputs []string) ([][]float32, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL