Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateEmbeddingRequest ¶
type CreateEmbeddingRequest struct {
Model string `json:"model"`
Input *EmbeddingInputs `json:"input"`
}
func (*CreateEmbeddingRequest) JSON ¶
func (c *CreateEmbeddingRequest) JSON() (string, error)
type CreateEmbeddingResponse ¶
type CreateEmbeddingResponse struct {
Object string `json:"object"`
Data []EmbeddingResult `json:"data"`
Model string `json:"model"`
RequestID string `json:"request_id"`
}
type EmbeddingInputs ¶
func (*EmbeddingInputs) MarshalJSON ¶
func (e *EmbeddingInputs) MarshalJSON() ([]byte, error)
type EmbeddingResult ¶
type Option ¶
type Option func(p *TogetherAIClient) error
func WithAPIToken ¶
func WithDefaultHeaders ¶
func WithDefaultModel ¶
func WithDefaultModel(model embeddings.EmbeddingModel) Option
func WithEnvAPIKey ¶
func WithEnvAPIKey() Option
func WithHTTPClient ¶
func WithMaxBatchSize ¶
type TogetherAIClient ¶
type TogetherAIClient struct {
BaseAPI string
APIToken string
DefaultModel embeddings.EmbeddingModel
MaxBatchSize int
DefaultHeaders map[string]string
Client *http.Client
}
func NewTogetherClient ¶
func NewTogetherClient(opts ...Option) (*TogetherAIClient, error)
func (*TogetherAIClient) CreateEmbedding ¶
func (c *TogetherAIClient) CreateEmbedding(ctx context.Context, req *CreateEmbeddingRequest) (*CreateEmbeddingResponse, error)
type TogetherEmbeddingFunction ¶
type TogetherEmbeddingFunction struct {
// contains filtered or unexported fields
}
func NewTogetherEmbeddingFunction ¶
func NewTogetherEmbeddingFunction(opts ...Option) (*TogetherEmbeddingFunction, error)
func (*TogetherEmbeddingFunction) EmbedDocuments ¶
func (e *TogetherEmbeddingFunction) EmbedDocuments(ctx context.Context, documents []string) ([]embeddings.Embedding, error)
func (*TogetherEmbeddingFunction) EmbedQuery ¶
func (e *TogetherEmbeddingFunction) EmbedQuery(ctx context.Context, document string) (embeddings.Embedding, error)
Click to show internal directories.
Click to hide internal directories.