Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateEmbeddingRequest ¶
type CreateEmbeddingRequest struct {
Input []string `json:"input"`
Model string `json:"model"`
Dimensions uint `json:"dimensions,omitempty"`
EncodingFormat string `json:"encoding_format"`
}
func (*CreateEmbeddingRequest) JSON ¶
func (c *CreateEmbeddingRequest) JSON() (string, error)
type CreateEmbeddingResponse ¶
type CreateEmbeddingResponse struct {
Embeddings [][]float32 `json:"embeddings"`
}
type Option ¶
type Option func(client *VLLMClient) error
func WithAPIKey ¶
func WithBaseURL ¶
func WithDimensions ¶
func WithEnvAPIKey ¶
type VLLMClient ¶
type VLLMClient struct {
BaseURL string
APIKey string
Model string
Client *http.Client
Dimensions uint
}
func NewVLLMClient ¶
func NewVLLMClient(apiKey string, model string) *VLLMClient
func NewVLLMClientFromOptions ¶
func NewVLLMClientFromOptions(opts ...Option) (*VLLMClient, error)
func (*VLLMClient) CreateEmbedding ¶
func (vc *VLLMClient) CreateEmbedding(ctx context.Context, req *CreateEmbeddingRequest) (*CreateEmbeddingResponse, error)
type VLLMEmbedding ¶
type VLLMEmbeddingFunction ¶
type VLLMEmbeddingFunction struct {
// contains filtered or unexported fields
}
func NewVLLMEmbeddingFunction ¶
func NewVLLMEmbeddingFunction(apiKey string, model string) *VLLMEmbeddingFunction
func NewVLLMEmbeddingFunctionFromOptions ¶
func NewVLLMEmbeddingFunctionFromOptions(options ...Option) (*VLLMEmbeddingFunction, error)
func (*VLLMEmbeddingFunction) EmbedDocuments ¶
func (ef *VLLMEmbeddingFunction) EmbedDocuments(ctx context.Context, documents []string) ([]embeddings.Embedding, error)
func (*VLLMEmbeddingFunction) EmbedQuery ¶
func (ef *VLLMEmbeddingFunction) EmbedQuery(ctx context.Context, query string) (embeddings.Embedding, error)
type VLLMEmbeddingResponse ¶
type VLLMEmbeddingResponse struct {
Id string `json:"id"`
Object string `json:"object"`
Created uint `json:"created"`
Model string `json:"model"`
Data []VLLMEmbedding `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.