add new list command (#97)

This commit is contained in:
Patrick Devine
2023-07-18 09:09:45 -07:00
committed by GitHub
parent da7ddbb4dc
commit 5bea29f610
10 changed files with 450 additions and 11 deletions

View File

@@ -7,6 +7,19 @@ import (
"time"
)
type StatusError struct {
StatusCode int
Status string
Message string
}
func (e StatusError) Error() string {
if e.Message != "" {
return fmt.Sprintf("%s: %s", e.Status, e.Message)
}
return e.Status
}
type GenerateRequest struct {
Model string `json:"model"`
Prompt string `json:"prompt"`
@@ -52,6 +65,16 @@ type PushProgress struct {
Percent float64 `json:"percent,omitempty"`
}
type ListResponse struct {
Models []ListResponseModel `json:"models"`
}
type ListResponseModel struct {
Name string `json:"name"`
ModifiedAt time.Time `json:"modified_at"`
Size int `json:"size"`
}
type GenerateResponse struct {
Model string `json:"model"`
CreatedAt time.Time `json:"created_at"`