Documentation
¶
Index ¶
Constants ¶
View Source
const ( SmallModel = "jina-embeddings-v2-small-en" BaseModel = "jina-embeddings-v2-base-en" LargeModel = "jina-embeddings-v2-large-en" APIBaseURL = "https://api.jina.ai/v1/embeddings" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmbeddingRequest ¶
type EmbeddingResponse ¶
type EmbeddingResponse struct {
Model string `json:"model"`
Object string `json:"object"`
Usage struct {
TotalTokens int `json:"total_tokens"`
PromptTokens int `json:"prompt_tokens"`
} `json:"usage"`
Data []struct {
Object string `json:"object"`
Index int `json:"index"`
Embedding []float32 `json:"embedding"`
} `json:"data"`
}
type Jina ¶
type Jina struct {
Model string
InputText []string
StripNewLines bool
BatchSize int
APIBaseURL string
APIKey string
}
func (*Jina) CreateEmbedding ¶
CreateEmbedding sends texts to the Jina API and retrieves their embeddings.
func (*Jina) EmbedDocuments ¶
type Option ¶
type Option func(p *Jina)
Option is a function type that can be used to modify the client.
func WithAPIBaseURL ¶
WithAPIBaseURL is an option for specifying the API base URL.
func WithAPIKey ¶
WithAPIKey is an option for specifying the API key.
func WithBatchSize ¶
WithBatchSize is an option for specifying the batch size.
func WithStripNewLines ¶
WithStripNewLines is an option for specifying the should it strip new lines.
Click to show internal directories.
Click to hide internal directories.