Skip to content

Commit

Permalink
update deprecated warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyng committed Aug 28, 2024
1 parent d9d50c4 commit 8e6da3c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ linters:
linters-settings:
gci:
sections: [standard, default, localmodule]
staticcheck:
checks:
- all
- -SA1019 # omit Deprecated check
severity:
default-severity: error
rules:
Expand Down
16 changes: 9 additions & 7 deletions api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,23 +296,25 @@ type EmbeddingResponse struct {
// CreateRequest is the request passed to [Client.Create].
type CreateRequest struct {
Model string `json:"model"`
Path string `json:"path"`
Modelfile string `json:"modelfile"`
Stream *bool `json:"stream,omitempty"`
Quantize string `json:"quantize,omitempty"`

// Name is deprecated, see Model
// Deprecated: set the model name with Model instead
Name string `json:"name"`

// Quantization is deprecated, see Quantize
// Deprecated: set the file content with Modelfile instead
Path string `json:"path"`

// Deprecated: use Quantize instead
Quantization string `json:"quantization,omitempty"`
}

// DeleteRequest is the request passed to [Client.Delete].
type DeleteRequest struct {
Model string `json:"model"`

// Name is deprecated, see Model
// Deprecated: set the model name with Model instead
Name string `json:"name"`
}

Expand All @@ -327,7 +329,7 @@ type ShowRequest struct {

Options map[string]interface{} `json:"options"`

// Name is deprecated, see Model
// Deprecated: set the model name with Model instead
Name string `json:"name"`
}

Expand Down Expand Up @@ -359,7 +361,7 @@ type PullRequest struct {
Password string `json:"password"`
Stream *bool `json:"stream,omitempty"`

// Name is deprecated, see Model
// Deprecated: set the model name with Model instead
Name string `json:"name"`
}

Expand All @@ -380,7 +382,7 @@ type PushRequest struct {
Password string `json:"password"`
Stream *bool `json:"stream,omitempty"`

// Name is deprecated, see Model
// Deprecated: set the model name with Model instead
Name string `json:"name"`
}

Expand Down

0 comments on commit 8e6da3c

Please sign in to comment.