mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-02 02:51:17 +02:00
add in backwards compatibility for older clients with incorrect json_schema passing
This commit is contained in:
@@ -2333,6 +2333,15 @@ ws ::= | " " | "\n" [ \t]{0,20}
|
||||
# In case of any issues, just do normal gen
|
||||
print("Structured Output not valid - discarded")
|
||||
pass
|
||||
elif 'json_schema' in genparams:
|
||||
try:
|
||||
schema = genparams.get('json_schema')
|
||||
decoded = convert_json_to_gbnf(schema)
|
||||
if decoded:
|
||||
genparams["grammar"] = decoded
|
||||
except Exception:
|
||||
print("Structured Output (old format) not valid - discarded")
|
||||
pass
|
||||
|
||||
message_index = 0
|
||||
for message in messages_array:
|
||||
|
||||
Reference in New Issue
Block a user