Versions in this module Expand all Collapse all v0 v0.0.8 Nov 14, 2024 v0.0.7 Nov 14, 2024 v0.0.6 Oct 31, 2024 Changes in this version type Map + func (m Map) Completion(ctx context.Context, options ...Func) (map[string]string, error) v0.0.5 Oct 31, 2024 Changes in this version + func CompletionMany(ctx context.Context, m Map, options ...Func) (map[string]string, error) + type Map map[string]IProvider + func (m Map) String() string + func (m Map) ToSlice() []IProvider v0.0.4 Oct 19, 2024 v0.0.3 Oct 19, 2024 v0.0.2 Oct 19, 2024 Changes in this version type ClientFunc + func WithDefaulModel(model string) ClientFunc type ClientOptions + Model string type Func + func WithResponseBody(requestBody any) Func type Options + ResponseBody any type Provider + DefaultModel string v0.0.1 Oct 18, 2024 Changes in this version + const DefaultMetricCounterLabel + const Type + type ClientFunc func(o *ClientOptions) error + func WithEndpoint(endpoint string) ClientFunc + func WithToken(token string) ClientFunc + type ClientOptions struct + Endpoint string + Token string + type Func func(o *Options) error + func WithMaxToken(maxToken int) Func + func WithModel(model string) Func + func WithSeed(seed int) Func + func WithStream(stream bool) Func + func WithSystemMessages(systemMessage ...string) Func + func WithTemperature(temperature float64) Func + func WithTopK(topK int) Func + func WithTopP(topP float64) Func + func WithUserMessages(userMessage ...string) Func + type IMeta interface + GetClient func() any + GetLogger func() sypl.ISypl + GetName func() string + GetType func() string + type IMetrics interface + GetCounterCompletion func() *expvar.Int + GetCounterCompletionFailed func() *expvar.Int + type IProvider interface + Completion func(ctx context.Context, v any, options ...Func) error + type Options struct + MaxTokens int + Model string + Seed int + Stream bool + SystemMessages []string + Temperature float64 + TopK int + TopP float64 + UserMessages []string + func NewOptionsFrom(options ...Func) (*Options, error) + type Provider struct + Endpoint string + Logger sypl.ISypl + Name string + Token string + func New(name string, options ...ClientFunc) (*Provider, error) + func (s *Provider) GetCounterCompletion() *expvar.Int + func (s *Provider) GetCounterCompletionFailed() *expvar.Int + func (s *Provider) GetCounterCounted() *expvar.Int + func (s *Provider) GetLogger() sypl.ISypl + func (s *Provider) GetName() string + func (s *Provider) GetType() string