Documentation
¶
Index ¶
- type CloudflareClient
- type CloudflareEmbeddingFunction
- func (e *CloudflareEmbeddingFunction) EmbedDocuments(ctx context.Context, documents []string) ([]*types.Embedding, error)
- func (e *CloudflareEmbeddingFunction) EmbedQuery(ctx context.Context, document string) (*types.Embedding, error)
- func (e *CloudflareEmbeddingFunction) EmbedRecords(ctx context.Context, records []*types.Record, force bool) error
- type CreateEmbeddingRequest
- type CreateEmbeddingResponse
- type Option
- func WithAPIToken(apiToken string) Option
- func WithAccountID(accountID string) Option
- func WithDefaultHeaders(headers map[string]string) Option
- func WithDefaultModel(model string) Option
- func WithEnvAPIToken() Option
- func WithEnvAccountID() Option
- func WithEnvGatewayEndpoint() Option
- func WithGatewayEndpoint(endpoint string) Option
- func WithHTTPClient(client *http.Client) Option
- func WithMaxBatchSize(size int) Option
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudflareClient ¶
type CloudflareClient struct { BaseAPI string APIToken string AccountID string DefaultModel string IsGateway bool MaxBatchSize int DefaultHeaders map[string]string Client *http.Client // contains filtered or unexported fields }
func NewCloudflareClient ¶
func NewCloudflareClient(opts ...Option) (*CloudflareClient, error)
func (*CloudflareClient) CreateEmbedding ¶
func (c *CloudflareClient) CreateEmbedding(ctx context.Context, req *CreateEmbeddingRequest) (*CreateEmbeddingResponse, error)
type CloudflareEmbeddingFunction ¶
type CloudflareEmbeddingFunction struct {
// contains filtered or unexported fields
}
func NewCloudflareEmbeddingFunction ¶
func NewCloudflareEmbeddingFunction(opts ...Option) (*CloudflareEmbeddingFunction, error)
func (*CloudflareEmbeddingFunction) EmbedDocuments ¶
func (*CloudflareEmbeddingFunction) EmbedQuery ¶
func (*CloudflareEmbeddingFunction) EmbedRecords ¶
type CreateEmbeddingRequest ¶
type CreateEmbeddingRequest struct {
Text []string `json:"text"`
}
func (*CreateEmbeddingRequest) JSON ¶
func (c *CreateEmbeddingRequest) JSON() (string, error)
type CreateEmbeddingResponse ¶
type Option ¶
type Option func(p *CloudflareClient) error
func WithAPIToken ¶
func WithAccountID ¶
func WithDefaultHeaders ¶
func WithDefaultModel ¶
func WithEnvAPIToken ¶
func WithEnvAPIToken() Option
func WithEnvAccountID ¶
func WithEnvAccountID() Option
func WithEnvGatewayEndpoint ¶
func WithEnvGatewayEndpoint() Option
func WithGatewayEndpoint ¶
func WithHTTPClient ¶
func WithMaxBatchSize ¶
Click to show internal directories.
Click to hide internal directories.