Skip to content

Commit 85233d4

Browse files
committed
add jsonref dep
1 parent 03cb47d commit 85233d4

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

Diff for: core/agents/convo.py

+2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ def remove_defs(d):
9797
else:
9898
return d
9999

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.
100102
schema_txt = json.dumps(remove_defs(jsonref.loads(json.dumps(model.model_json_schema()))))
101103
self.user(
102104
f"IMPORTANT: Your response MUST conform to this JSON schema:\n```\n{schema_txt}\n```."

Diff for: pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ httpx = "^0.27.0"
3838
alembic = "^1.13.1"
3939
python-dotenv = "^1.0.1"
4040
prompt-toolkit = "^3.0.45"
41+
jsonref = "^1.1.0"
4142

4243
[tool.poetry.group.dev.dependencies]
4344
pytest = "^8.1.1"

Diff for: requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ httpx==0.27.0
1818
huggingface-hub==0.23.2
1919
idna==3.7
2020
jinja2==3.1.4
21+
jsonref==1.1.0
2122
mako==1.3.5
2223
markupsafe==2.1.5
2324
openai==1.31.0

0 commit comments

Comments
 (0)