describer

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConnector

func GetConnector(ctx context.Context, handler *CohereAIAPIHandler, connectorID string) (*models.Resource, error)

func GetDataset

func GetDataset(ctx context.Context, handler *CohereAIAPIHandler, datasetID string) (*models.Resource, error)

func GetEmbedJob

func GetEmbedJob(ctx context.Context, handler *CohereAIAPIHandler, embedJobID string) (*models.Resource, error)

func GetFineTunedModel

func GetFineTunedModel(ctx context.Context, handler *CohereAIAPIHandler, fineTunedModelID string) (*models.Resource, error)

func GetLoggerFromContext

func GetLoggerFromContext(ctx context.Context) *zap.Logger

func GetModel

func GetModel(ctx context.Context, handler *CohereAIAPIHandler, modelName string) (*models.Resource, error)

func GetParameterFromContext

func GetParameterFromContext(ctx context.Context, key string) any

func GetTriggerTypeFromContext

func GetTriggerTypeFromContext(ctx context.Context) enums.DescribeTriggerType

func ListConnectors

func ListConnectors(ctx context.Context, handler *CohereAIAPIHandler, stream *models.StreamSender) ([]models.Resource, error)

func ListDatasets

func ListDatasets(ctx context.Context, handler *CohereAIAPIHandler, stream *models.StreamSender) ([]models.Resource, error)

func ListEmbedJobs

func ListEmbedJobs(ctx context.Context, handler *CohereAIAPIHandler, stream *models.StreamSender) ([]models.Resource, error)

func ListFineTunedModels

func ListFineTunedModels(ctx context.Context, handler *CohereAIAPIHandler, stream *models.StreamSender) ([]models.Resource, error)

func ListModels

func ListModels(ctx context.Context, handler *CohereAIAPIHandler, stream *models.StreamSender) ([]models.Resource, error)

func WithLogger

func WithLogger(ctx context.Context, logger *zap.Logger) context.Context

Types

type CohereAIAPIHandler

type CohereAIAPIHandler struct {
	Client       *http.Client
	APIKey       string
	RateLimiter  *rate.Limiter
	Semaphore    chan struct{}
	MaxRetries   int
	RetryBackoff time.Duration
	ClientName   string
}

func NewCohereAIAPIHandler

func NewCohereAIAPIHandler(APIKey string, rateLimit rate.Limit, burst int, maxConcurrency int, maxRetries int, retryBackoff time.Duration, clientName string) *CohereAIAPIHandler

func (*CohereAIAPIHandler) DoRequest

func (h *CohereAIAPIHandler) DoRequest(ctx context.Context, req *http.Request, requestFunc func(req *http.Request) (*http.Response, error)) error

DoRequest executes the openai API request with rate limiting, retries, and concurrency control.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL