Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocumentRequest ¶ added in v1.0.0
type DocumentRequest struct {
Ctx context.Context `json:"-"`
Model Model `json:"model"`
DocumentChunks []string `json:"document_chunks"`
}
func NewDocumentRequest ¶ added in v1.0.0
func NewDocumentRequest(ctx context.Context, model Model, chunks []string) *DocumentRequest
type DocumentResponse ¶ added in v1.0.0
type DocumentResponse struct {
Embeddings [][]float64 `json:"embeddings"`
Metadata models.Metadata `json:"metadata,omitempty"`
}
func (*DocumentResponse) AsFloat32 ¶ added in v1.0.0
func (r *DocumentResponse) AsFloat32() [][]float32
func (*DocumentResponse) AsFloat64 ¶ added in v1.0.0
func (r *DocumentResponse) AsFloat64() [][]float64
type Embeder ¶
type Embeder interface {
Provider() string
Embed(req *Request) (*Response, error)
EmbedDocument(req *DocumentRequest) (*DocumentResponse, error)
}
type Model ¶
type Model struct {
Provider string `json:"provider"`
Name string `json:"name"`
Type Type `json:"type,omitempty"`
Description string `json:"description,omitempty"`
InputMaxTokens int `json:"input_max_tokens,omitempty"`
OutputDimensions int `json:"output_dimensions,omitempty"`
Config map[string]any `json:"config,omitempty"`
}
type Request ¶
type Request struct {
Ctx context.Context `json:"-"`
Model Model `json:"model"`
Texts []string `json:"texts"`
}
func NewManyRequest ¶ added in v1.0.0
func NewSingleRequest ¶ added in v1.0.0
type Response ¶
type Response struct {
Embeddings [][]float64 `json:"embeddings"`
Metadata models.Metadata `json:"metadata,omitempty"`
}
func (*Response) SingleAsFloat32 ¶ added in v1.0.0
func (*Response) SingleAsFloat64 ¶ added in v1.0.0
Click to show internal directories.
Click to hide internal directories.