File tree 3 files changed +4
-0
lines changed
3 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ def remove_defs(d):
97
97
else :
98
98
return d
99
99
100
+ # We want to make the schema as simple as possible to avoid confusing the LLM,
101
+ # so we remove (dereference) all the refs we can and show the "final" schema version.
100
102
schema_txt = json .dumps (remove_defs (jsonref .loads (json .dumps (model .model_json_schema ()))))
101
103
self .user (
102
104
f"IMPORTANT: Your response MUST conform to this JSON schema:\n ```\n { schema_txt } \n ```."
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ httpx = "^0.27.0"
38
38
alembic = " ^1.13.1"
39
39
python-dotenv = " ^1.0.1"
40
40
prompt-toolkit = " ^3.0.45"
41
+ jsonref = " ^1.1.0"
41
42
42
43
[tool .poetry .group .dev .dependencies ]
43
44
pytest = " ^8.1.1"
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ httpx==0.27.0
18
18
huggingface-hub == 0.23.2
19
19
idna == 3.7
20
20
jinja2 == 3.1.4
21
+ jsonref == 1.1.0
21
22
mako == 1.3.5
22
23
markupsafe == 2.1.5
23
24
openai == 1.31.0
You can’t perform that action at this time.
0 commit comments