Documentation
¶
Index ¶
- Constants
- type Client
- type CreateEmbeddingRequest
- type CreateEmbeddingResponse
- type NomicEmbeddingFunction
- func (e *NomicEmbeddingFunction) EmbedDocuments(ctx context.Context, documents []string) ([]*types.Embedding, error)
- func (e *NomicEmbeddingFunction) EmbedQuery(ctx context.Context, document string) (*types.Embedding, error)
- func (e *NomicEmbeddingFunction) EmbedRecords(ctx context.Context, records []*types.Record, force bool) error
- type Option
- type TaskType
Constants ¶
View Source
const ( DefaultEmbeddingModel = NomicEmbedTextV1 ModelContextVar = "model" DimensionalityContextVar = "dimensionality" TaskTypeContextVar = "task_type" APIKeyEnvVar = "NOMIC_API_KEY" DefaultBaseURL = "https://api-atlas.nomic.ai/v1/embedding" TextEmbeddingsEndpoint = "/text" DefaultMaxBatchSize = 100 TaskTypeSearchQuery TaskType = "search_query" // TaskTypeSearchDocument TaskType = "search_document" TaskTypeClustering TaskType = "clustering" TaskTypeClassification TaskType = "classification" NomicEmbedTextV1 = "nomic-embed-text-v1" NomicEmbedTextV15 = "nomic-embed-text-v1.5" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { DefaultModel string Client *http.Client DefaultContext *context.Context MaxBatchSize int EmbeddingEndpoint string DefaultHeaders map[string]string DefaultTaskType *TaskType DefaultDimensionality *int BaseURL string EmbeddingsEndpointSuffix string // contains filtered or unexported fields }
func NewNomicClient ¶
func (*Client) CreateEmbedding ¶
type CreateEmbeddingRequest ¶
type CreateEmbeddingRequest struct { Model string `json:"model"` Texts []string `json:"texts"` TaskType *TaskType `json:"task_type,omitempty"` Dimensionality *int `json:"dimensionality,omitempty"` }
func (*CreateEmbeddingRequest) JSON ¶
func (c *CreateEmbeddingRequest) JSON() (string, error)
type CreateEmbeddingResponse ¶
type NomicEmbeddingFunction ¶
type NomicEmbeddingFunction struct {
// contains filtered or unexported fields
}
func NewNomicEmbeddingFunction ¶
func NewNomicEmbeddingFunction(opts ...Option) (*NomicEmbeddingFunction, error)
func (*NomicEmbeddingFunction) EmbedDocuments ¶
func (*NomicEmbeddingFunction) EmbedQuery ¶
func (*NomicEmbeddingFunction) EmbedRecords ¶
type Option ¶
func WithBaseURL ¶
WithBaseURL sets the base URL for the client
func WithDefaultModel ¶
WithDefaultModel sets the default model for the client
func WithEnvAPIKey ¶
func WithEnvAPIKey() Option
WithEnvAPIKey sets the API key for the client from the environment variable GOOGLE_API_KEY
func WithHTTPClient ¶
WithHTTPClient sets the generative AI client for the client
func WithMaxBatchSize ¶
WithMaxBatchSize sets the max batch size for the client - this acts as a limit for the number of embeddings that can be sent in a single request
func WithTextEmbeddings ¶
func WithTextEmbeddings() Option
WithTextEmbeddings sets the endpoint to text embeddings
Click to show internal directories.
Click to hide internal directories.