Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
30
backend/sdk/cliproxy/model_registry.go
Normal file
30
backend/sdk/cliproxy/model_registry.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package cliproxy
|
||||
|
||||
import "github.com/router-for-me/CLIProxyAPI/v7/internal/registry"
|
||||
|
||||
// ModelInfo re-exports the registry model info structure.
|
||||
type ModelInfo = registry.ModelInfo
|
||||
|
||||
// ModelRegistryHook re-exports the registry hook interface for external integrations.
|
||||
type ModelRegistryHook = registry.ModelRegistryHook
|
||||
|
||||
// ModelRegistry describes registry operations consumed by external callers.
|
||||
type ModelRegistry interface {
|
||||
RegisterClient(clientID, clientProvider string, models []*ModelInfo)
|
||||
UnregisterClient(clientID string)
|
||||
SetModelQuotaExceeded(clientID, modelID string)
|
||||
ClearModelQuotaExceeded(clientID, modelID string)
|
||||
ClientSupportsModel(clientID, modelID string) bool
|
||||
GetAvailableModels(handlerType string) []map[string]any
|
||||
GetAvailableModelsByProvider(provider string) []*ModelInfo
|
||||
}
|
||||
|
||||
// GlobalModelRegistry returns the shared registry instance.
|
||||
func GlobalModelRegistry() ModelRegistry {
|
||||
return registry.GetGlobalRegistry()
|
||||
}
|
||||
|
||||
// SetGlobalModelRegistryHook registers an optional hook on the shared global registry instance.
|
||||
func SetGlobalModelRegistryHook(hook ModelRegistryHook) {
|
||||
registry.GetGlobalRegistry().SetHook(hook)
|
||||
}
|
||||
Loading…
Reference in a new issue