Documentation
¶
Index ¶
- Variables
- type Config
- type LLM
- type Option
- type PolyLLM
- func (p *PolyLLM) ChatCompletion(ctx context.Context, req llms.ChatCompletionRequest, ...)
- func (p *PolyLLM) GetLLMByModel(model string) (LLM, error)
- func (p *PolyLLM) GetMCPClientByToolName(ctx context.Context, toolName string) (mcpclient.MCPClient, string, error)
- func (p *PolyLLM) GetMCPTools(ctx context.Context, modelInfo string) []llms.Tool
- func (p *PolyLLM) ListModels(ctx context.Context) ([]llms.Model, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrProviderNotFound is returned when a provider is not found ErrProviderNotFound = errors.New("provider not found") // ErrModelNotFound is returned when a model is not found ErrModelNotFound = errors.New("model not found") // ErrInvalidConfiguration is returned when the configuration is invalid ErrInvalidConfiguration = errors.New("invalid configuration") // ErrAPIKeyNotSet is returned when an API key is not set ErrAPIKeyNotSet = errors.New("API key not set") // ErrRequestFailed is returned when a request to a provider fails ErrRequestFailed = errors.New("request failed") // ErrUnsupportedOperation is returned when an operation is not supported ErrUnsupportedOperation = errors.New("unsupported operation") )
Common error types
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.2.0
type Config struct {
LLMProvides []llms.Provider `json:"llms"`
MCPProviders map[string]mcps.Provider `json:"mcps"`
}
func LoadConfig ¶ added in v0.2.0
type LLM ¶ added in v0.2.0
type LLM interface {
GetProvider() *llms.Provider
ListModels(ctx context.Context) ([]llms.Model, error)
ChatCompletion(ctx context.Context, req llms.ChatCompletionRequest, streamingFunc func(resp llms.StreamingChatCompletionResponse), options ...llms.RequestOption)
}
type PolyLLM ¶ added in v0.1.3
type PolyLLM struct {
Config
// contains filtered or unexported fields
}
func NewFromConfig ¶ added in v0.2.0
func (*PolyLLM) ChatCompletion ¶ added in v0.1.3
func (p *PolyLLM) ChatCompletion(ctx context.Context, req llms.ChatCompletionRequest, streamingFunc func(resp llms.StreamingChatCompletionResponse), options ...llms.RequestOption)
func (*PolyLLM) GetLLMByModel ¶ added in v0.2.0
func (*PolyLLM) GetMCPClientByToolName ¶ added in v0.2.0
func (*PolyLLM) GetMCPTools ¶ added in v0.2.0
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
polyllm-cli
command
|
|
|
polyllm-server
command
|
|
|
examples
|
|
|
polyllm-server
module
|
|
|
internal
|
|
|
https://github.com/sashabaranov/go-openai/blob/master/chat.go
|
https://github.com/sashabaranov/go-openai/blob/master/chat.go |
Click to show internal directories.
Click to hide internal directories.