Skip to content

Commit

Permalink
fix: allow no object type for model list
Browse files Browse the repository at this point in the history
The generic OpenAI compatible model provider requires that
the models list returned have an Object parameter with value
"list." This parameter is not included in some otherwise
compatible model providers and it seems reasonable to not
require this field.

Signed-off-by: Donnie Adams <[email protected]>
  • Loading branch information
thedadams committed Feb 15, 2025
1 parent 69f458f commit 8b97cd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openai-model-provider/proxy/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ func (cfg *Config) Validate(toolPath string) error {
return handleValidationError(toolPath, "Invalid Response Format")
}

if modelsResp.Object != "list" || len(modelsResp.Data) == 0 {
return handleValidationError(toolPath, "Invalid Models Response")
if modelsResp.Object != "" && modelsResp.Object != "list" || len(modelsResp.Data) == 0 {
return handleValidationError(toolPath, fmt.Sprintf("Invalid Models Response: %d models", len(modelsResp.Data)))
}

return nil
Expand Down

0 comments on commit 8b97cd2

Please sign in to comment.