Repository navigation
Add a command to list the available inference models - #206
Conversation
Davidonium
left a comment
There was a problem hiding this comment.
Requesting changes because it got approved but I would like to understand the changes rather than requiring any changes.
| Config *config.Config | ||
| Logger *slog.Logger | ||
| client *qcloudapi.Client | ||
| unAuthenticatedClient *qcloudapi.Client |
There was a problem hiding this comment.
What is the reasoning for using an unauthenticated client?
I think authentication should be required in all commands used in the cli. Else commands can be automated very easily and abused.
There was a problem hiding this comment.
We want agents to be able to get this public information without any authentication. The APIs also are public and don't require authentication.
| - containedctx | ||
| - contextcheck | ||
| - errorlint | ||
| - goconst |
There was a problem hiding this comment.
what's the reasoning for dropping goconst?
There was a problem hiding this comment.
The new version created tons of new warnings to extract strings into constants that were not helpful.
|
|
||
| func newListCommand(s *state.State) *cobra.Command { | ||
| cmd := base.ListCmd[*bookingv1.ListPackagesResponse]{ | ||
| cmd := base.ListCmd[*bookingv1.ListGlobalPackagesResponse]{ |
There was a problem hiding this comment.
this seems to be unrelated to inference models, or is model pricing included here?
There was a problem hiding this comment.
True, it's unrelated, but we want to also have the packages to be fetched without authentication.
| // The API returns models in no particular order. | ||
| slices.SortFunc(resp.GetItems(), func(a, b *bookingv1.InferenceModel) int { | ||
| return cmp.Compare(a.GetName(), b.GetName()) | ||
| }) |
There was a problem hiding this comment.
Shouldn't the api order this? I don't think this needs to be changed but I guess this ordering has to be implemented in every client.
There was a problem hiding this comment.
Different clients, like the UI sort and group the models differently.
Uh oh!
There was an error while loading. Please reload this page.