fix: harden model catalog projections
This commit is contained in:
@@ -119,9 +119,10 @@ func Run(request Request) error {
|
||||
if !filepath.IsAbs(request.InstallationPath) || filepath.Base(request.InstallationPath) != "thothii-installation.yaml" {
|
||||
return errors.New("installation migration requires an absolute thothii-installation.yaml path")
|
||||
}
|
||||
if !filepath.IsAbs(request.OutputPath) || filepath.Base(request.OutputPath) != "thothii-installation.yaml" ||
|
||||
outputExtension := strings.ToLower(filepath.Ext(request.OutputPath))
|
||||
if !filepath.IsAbs(request.OutputPath) || outputExtension != ".yaml" && outputExtension != ".yml" ||
|
||||
filepath.Clean(request.OutputPath) == filepath.Clean(request.InstallationPath) {
|
||||
return errors.New("installation migration output must be a different absolute thothii-installation.yaml path")
|
||||
return errors.New("installation migration output must be a different absolute YAML path")
|
||||
}
|
||||
if request.SessionDefault == "" || request.EmbeddingID == "" || request.EmbeddingDimensions <= 0 {
|
||||
return errors.New("installation migration requires session default, embedding id, and positive embedding dimensions")
|
||||
|
||||
Reference in New Issue
Block a user