mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 21:29:11 +00:00
Limit to json enforcement via json object with DeepInfra hosted models
DeepInfra based models do not seem to support json schema. See https://deepinfra.com/docs/advanced/json_mode for reference
This commit is contained in:
@@ -247,4 +247,6 @@ def get_openai_api_json_support(model_name: str, api_base_url: str = None) -> Js
|
|||||||
host = urlparse(api_base_url).hostname
|
host = urlparse(api_base_url).hostname
|
||||||
if host and host.endswith(".ai.azure.com"):
|
if host and host.endswith(".ai.azure.com"):
|
||||||
return JsonSupport.OBJECT
|
return JsonSupport.OBJECT
|
||||||
|
if host == "api.deepinfra.com":
|
||||||
|
return JsonSupport.OBJECT
|
||||||
return JsonSupport.SCHEMA
|
return JsonSupport.SCHEMA
|
||||||
|
|||||||
Reference in New Issue
Block a user