mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-16 22:51:24 +00:00
feat(core): Support multi round conversation operator (#986)
This commit is contained in:
@@ -31,3 +31,13 @@ else:
|
||||
validator,
|
||||
PrivateAttr,
|
||||
)
|
||||
|
||||
|
||||
def model_to_json(model, **kwargs):
|
||||
"""Convert a pydantic model to json"""
|
||||
if PYDANTIC_VERSION == 1:
|
||||
return model.json(**kwargs)
|
||||
else:
|
||||
if "ensure_ascii" in kwargs:
|
||||
del kwargs["ensure_ascii"]
|
||||
return model.model_dump_json(**kwargs)
|
||||
|
Reference in New Issue
Block a user