Documentation ¶
Index ¶
- Constants
- type APIVersion
- type CohereClient
- type CohereModel
- type Option
- func NoOp() Option
- func WithAPIKey(apiKey string) Option
- func WithAPIVersion(version APIVersion) Option
- func WithBaseURL(baseURL string) Option
- func WithDefaultModel(model CohereModel) Option
- func WithEnvAPIKey() Option
- func WithHTTPClient(client *http.Client) Option
- func WithRetryStrategy(retryStrategy httpc.RetryStrategy) Option
Constants ¶
View Source
const ( APIKeyEnv = "COHERE_API_KEY" DefaultBaseURL = "https://api.cohere.ai" APIVersionV1 APIVersion = "v1" DefaultAPIVersion = APIVersionV1 ClientName = "chroma-go-client" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIVersion ¶
type APIVersion string
type CohereClient ¶
type CohereClient struct { BaseURL string `validate:"required"` APIVersion APIVersion `validate:"required"` Client *http.Client DefaultModel CohereModel `validate:"required"` RetryStrategy httpc.RetryStrategy // contains filtered or unexported fields }
CohereClient is a common struct for various Cohere integrations - Embeddings, Rerank etc.
func NewCohereClient ¶
func NewCohereClient(opts ...Option) (*CohereClient, error)
func (*CohereClient) GetAPIEndpoint ¶
func (c *CohereClient) GetAPIEndpoint(endpoint string) string
type CohereModel ¶
type CohereModel string // generic type for Cohere models
func (CohereModel) String ¶
func (m CohereModel) String() string
type Option ¶
type Option func(p *CohereClient) error
func WithAPIKey ¶
func WithAPIVersion ¶
func WithAPIVersion(version APIVersion) Option
func WithBaseURL ¶
func WithDefaultModel ¶
func WithDefaultModel(model CohereModel) Option
WithDefaultModel sets the default model for the Cohere client
func WithEnvAPIKey ¶
func WithEnvAPIKey() Option
func WithHTTPClient ¶
WithHTTPClient sets the HTTP client for the Cohere client
func WithRetryStrategy ¶
func WithRetryStrategy(retryStrategy httpc.RetryStrategy) Option
WithRetryStrategy sets the retry strategy for the Cohere client
Click to show internal directories.
Click to hide internal directories.