From 8b97cd2f4c7c33c65bc30d3e01417b0eae81a767 Mon Sep 17 00:00:00 2001 From: Donnie Adams Date: Sat, 15 Feb 2025 14:30:30 -0500 Subject: [PATCH] fix: allow no object type for model list 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 --- openai-model-provider/proxy/validate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openai-model-provider/proxy/validate.go b/openai-model-provider/proxy/validate.go index 30e55f5d..87193858 100644 --- a/openai-model-provider/proxy/validate.go +++ b/openai-model-provider/proxy/validate.go @@ -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