fix: add omitempty where needed (#671)

renovate/github.com-imdario-mergo-1.x
Ettore Di Giacinto 2 years ago committed by GitHub
parent 53f8d73101
commit 6213da330a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      pkg/gallery/models.go
  2. 26
      pkg/gallery/request.go

@ -42,7 +42,8 @@ prompt_templates:
content: ""
*/
// Config is the model configuration which contains all the model details
// This configuration is read from the gallery endpoint and is used to download and install the model
type Config struct {
Description string `yaml:"description"`
License string `yaml:"license"`

@ -9,15 +9,25 @@ import (
"gopkg.in/yaml.v2"
)
// endpoints
// GalleryModel is the struct used to represent a model in the gallery returned by the endpoint.
// It is used to install the model by resolving the URL and downloading the files.
// The other fields are used to override the configuration of the model.
type GalleryModel struct {
URL string `json:"url" yaml:"url"`
Name string `json:"name" yaml:"name"`
Overrides map[string]interface{} `json:"overrides" yaml:"overrides"`
AdditionalFiles []File `json:"files" yaml:"files"`
Gallery Gallery `json:"gallery" yaml:"gallery"`
Installed bool `json:"installed" yaml:"installed"`
URL string `json:"url,omitempty" yaml:"url,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
License string `json:"license,omitempty" yaml:"license,omitempty"`
URLs []string `json:"urls,omitempty" yaml:"urls,omitempty"`
Icon string `json:"icon,omitempty" yaml:"icon,omitempty"`
// Overrides are used to override the configuration of the model
Overrides map[string]interface{} `json:"overrides,omitempty" yaml:"overrides,omitempty"`
// AdditionalFiles are used to add additional files to the model
AdditionalFiles []File `json:"files,omitempty" yaml:"files,omitempty"`
// Gallery is a reference to the gallery which contains the model
Gallery Gallery `json:"gallery,omitempty" yaml:"gallery,omitempty"`
// Installed is used to indicate if the model is installed or not
Installed bool `json:"installed,omitempty" yaml:"installed,omitempty"`
}
const (

Loading…
Cancel
Save