Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAIClosed = errors.New("AI client is nil or already closed")
Functions ¶
func ApplyModelConfig ¶ added in v1.0.6
func ApplyModelConfig(ai AI, cfg ModelConfig)
func NewLimiter ¶
Types ¶
type ChatResponse ¶
type ChatResponse interface { Results() []string TokenCount() TokenCount }
type ChatSession ¶ added in v1.0.2
type ChatStream ¶
type ChatStream interface { Next() (ChatResponse, error) Close() error }
type Chatbot ¶
type Chatbot interface { Chat(context.Context, ...string) (ChatResponse, error) ChatStream(context.Context, ...string) (ChatStream, error) }
type ClientConfig ¶ added in v1.0.6
type ClientOption ¶ added in v1.0.6
type ClientOption interface {
Apply(*ClientConfig)
}
func WithAPIKey ¶ added in v1.0.6
func WithAPIKey(apiKey string) ClientOption
func WithEndpoint ¶ added in v1.0.6
func WithEndpoint(endpoint string) ClientOption
func WithLimit ¶ added in v1.0.6
func WithLimit(rpm int64) ClientOption
func WithModel ¶ added in v1.0.7
func WithModel(model string) ClientOption
func WithModelConfig ¶ added in v1.0.6
func WithModelConfig(config ModelConfig) ClientOption
func WithProxy ¶ added in v1.0.6
func WithProxy(proxy string) ClientOption
type LLMs ¶ added in v1.0.6
type LLMs string
func (LLMs) MarshalText ¶ added in v1.0.6
func (*LLMs) UnmarshalText ¶ added in v1.0.6
type ModelConfig ¶ added in v1.0.6
type TokenCount ¶ added in v1.0.13
Click to show internal directories.
Click to hide internal directories.