Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EngineInfoProvider ¶
type EngineInfoProvider interface {
// GetVersion returns the engine's version information
GetVersion(ctx context.Context, resp *sdktypes.EngineVersionResponse) (*sdktypes.EngineVersionResponse, error)
// GetOperateStatus returns the current operational status (0: stopped, 1: running, 2: error)
GetOperateStatus() int
// SetOperateStatus updates the operational status
SetOperateStatus(status int)
}
EngineInfoProvider defines informational operations
type EngineInstaller ¶
type EngineInstaller interface {
// CheckEngine verifies if the engine binary is installed
CheckEngine() (bool, error)
// InstallEngine downloads and installs the engine binary
InstallEngine(ctx context.Context) error
// InitEnv sets up the environment variables required by the engine
InitEnv() error
// UpgradeEngine updates the engine to the latest compatible version
UpgradeEngine(ctx context.Context) error
}
EngineInstaller defines engine installation and setup operations
type EngineLifecycleManager ¶
type EngineLifecycleManager interface {
// StartEngine initializes and starts the engine process
StartEngine(mode string) error
// StopEngine gracefully stops the engine process
StopEngine() error
// HealthCheck verifies the engine is operational
HealthCheck(ctx context.Context) error
// GetConfig returns the engine's recommended runtime configuration
GetConfig(ctx context.Context) (*sdktypes.EngineRecommendConfig, error)
}
EngineLifecycleManager defines core engine lifecycle operations
type ModelManager ¶
type ModelManager interface {
// PullModel downloads a model from the repository with progress tracking
PullModel(ctx context.Context, req *sdktypes.PullModelRequest, fn sdktypes.PullProgressFunc) (*sdktypes.ProgressResponse, error)
// PullModelStream downloads a model with streaming progress updates
PullModelStream(ctx context.Context, req *sdktypes.PullModelRequest) (chan []byte, chan error)
// DeleteModel removes a model from local storage
DeleteModel(ctx context.Context, req *sdktypes.DeleteRequest) error
// ListModels returns all available models in the local repository
ListModels(ctx context.Context) (*sdktypes.ListResponse, error)
// LoadModel preloads a model into memory for faster inference
LoadModel(ctx context.Context, req *sdktypes.LoadRequest) error
// UnloadModel removes a model from memory to free resources
UnloadModel(ctx context.Context, req *sdktypes.UnloadModelRequest) error
// GetRunningModels returns the list of currently loaded models
GetRunningModels(ctx context.Context) (*sdktypes.ListResponse, error)
}
ModelManager defines model management operations
type ModelServiceProvider ¶
type ModelServiceProvider interface {
EngineLifecycleManager
EngineInstaller
ModelManager
EngineInfoProvider
ServiceInvoker
}
ModelServiceProvider defines the complete interface for AI model service providers This unified interface is implemented by both built-in engines and plugins
type ServiceInvoker ¶
type ServiceInvoker interface {
// InvokeService executes a service request and returns the response
// serviceName: "chat", "embed", "text-to-image" etc.
// request: JSON formatted request data
// returns: JSON formatted response data
InvokeService(ctx context.Context, serviceName string, authInfo string, request []byte) ([]byte, error)
}
ServiceInvoker defines service invocation operations
Click to show internal directories.
Click to hide internal directories.