Tree: Switch to Pydantic 2

Pydantic 2 has more modern methods and stability compared to Pydantic 1

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri
2023-12-17 01:06:10 -05:00
committed by Brian Dashore
parent f631dd6ff7
commit 51ca1ff396
8 changed files with 18 additions and 15 deletions

View File

@@ -26,7 +26,7 @@ def get_generator_error(message: str):
# Log and send the exception
print(f"\n{generator_error.error.trace}")
return get_sse_packet(generator_error.json(ensure_ascii = False))
return get_sse_packet(generator_error.model_dump_json())
def get_sse_packet(json_data: str):
return f"data: {json_data}\n\n"