Skip to content

Commit

Permalink
feat(inference): update inference models ordering (#2137)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Jul 8, 2024
1 parent c9ab4e9 commit 45ed7a0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions api/inference/v1beta1/inference_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,24 @@ func (enum *ListDeploymentsRequestOrderBy) UnmarshalJSON(data []byte) error {
type ListModelsRequestOrderBy string

const (
ListModelsRequestOrderByCreatedAtAsc = ListModelsRequestOrderBy("created_at_asc")
ListModelsRequestOrderByCreatedAtDesc = ListModelsRequestOrderBy("created_at_desc")
ListModelsRequestOrderByNameAsc = ListModelsRequestOrderBy("name_asc")
ListModelsRequestOrderByNameDesc = ListModelsRequestOrderBy("name_desc")
ListModelsRequestOrderByDisplayRankAsc = ListModelsRequestOrderBy("display_rank_asc")
ListModelsRequestOrderByCreatedAtAsc = ListModelsRequestOrderBy("created_at_asc")
ListModelsRequestOrderByCreatedAtDesc = ListModelsRequestOrderBy("created_at_desc")
ListModelsRequestOrderByNameAsc = ListModelsRequestOrderBy("name_asc")
ListModelsRequestOrderByNameDesc = ListModelsRequestOrderBy("name_desc")
)

func (enum ListModelsRequestOrderBy) String() string {
if enum == "" {
// return default value if empty
return "created_at_asc"
return "display_rank_asc"
}
return string(enum)
}

func (enum ListModelsRequestOrderBy) Values() []ListModelsRequestOrderBy {
return []ListModelsRequestOrderBy{
"display_rank_asc",
"created_at_asc",
"created_at_desc",
"name_asc",
Expand Down Expand Up @@ -672,7 +674,7 @@ type ListModelsRequest struct {
Region scw.Region `json:"-"`

// OrderBy: order in which to return results.
// Default value: created_at_asc
// Default value: display_rank_asc
OrderBy ListModelsRequestOrderBy `json:"-"`

// Page: page number to return.
Expand Down

0 comments on commit 45ed7a0

Please sign in to comment.