add jsonref dep

This commit is contained in:
Senko Rasic
2024-06-27 18:24:20 +02:00
parent 7bda7f1786
commit e4cfc00b1e
3 changed files with 4 additions and 0 deletions

View File

@@ -97,6 +97,8 @@ class AgentConvo(Convo):
else:
return d
# We want to make the schema as simple as possible to avoid confusing the LLM,
# so we remove (dereference) all the refs we can and show the "final" schema version.
schema_txt = json.dumps(remove_defs(jsonref.loads(json.dumps(model.model_json_schema()))))
self.user(
f"IMPORTANT: Your response MUST conform to this JSON schema:\n```\n{schema_txt}\n```."

View File

@@ -38,6 +38,7 @@ httpx = "^0.27.0"
alembic = "^1.13.1"
python-dotenv = "^1.0.1"
prompt-toolkit = "^3.0.45"
jsonref = "^1.1.0"
[tool.poetry.group.dev.dependencies]
pytest = "^8.1.1"

View File

@@ -18,6 +18,7 @@ httpx==0.27.0
huggingface-hub==0.23.2
idna==3.7
jinja2==3.1.4
jsonref==1.1.0
mako==1.3.5
markupsafe==2.1.5
openai==1.31.0