Documentation
¶
Overview ¶
Package virtual implements the virtual-model provider backend: a virtual model routes each request to its models in list order (fall-through) and fails only when every model failed.
Index ¶
- type Adapter
- func (a *Adapter) Complete(ctx context.Context, creds []*models.Credential, ...) (*models.ChatCompletionResponse, error)
- func (a *Adapter) CompleteStream(ctx context.Context, creds []*models.Credential, ...) error
- func (a *Adapter) GetModelInfos(ctx context.Context, cred *models.Credential, _ map[string]any) ([]models.ModelInfo, error)
- func (a *Adapter) NeedsRefresh(cred *models.Credential) bool
- func (a *Adapter) RefreshCredential(ctx context.Context, cred *models.Credential) (map[string]any, error)
- func (a *Adapter) TypeKey() string
- func (a *Adapter) ValidateCredentials(data map[string]any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements the provider.GoAdapter interface for virtual models.
func New ¶ added in v0.1.2
New constructs an Adapter with all dependencies. The router dependency enters as the narrow provider.Completer port, so construction order is explicit and no setter injection is needed.
func (*Adapter) Complete ¶
func (a *Adapter) Complete( ctx context.Context, creds []*models.Credential, req *models.ChatCompletionRequest, _ map[string]any, ) (*models.ChatCompletionResponse, error)
func (*Adapter) CompleteStream ¶
func (*Adapter) GetModelInfos ¶
func (*Adapter) NeedsRefresh ¶
func (a *Adapter) NeedsRefresh(cred *models.Credential) bool
func (*Adapter) RefreshCredential ¶
Click to show internal directories.
Click to hide internal directories.