To avoid JSONDecodeError:

Remove comments in output json str, after json value content, maybe start with #, maybe start with //, particularly, it is not inside the string value

Addtionly, if you do not want JSONDecodeError to occur, you can add 'Delete comments in json' after FORMAT_CONSTRAINT in action_node.py
This commit is contained in:
huzixia 2024-01-26 22:59:10 +08:00
parent 59afc5301f
commit ed54f6b86a
2 changed files with 29 additions and 4 deletions

View file

@ -24,6 +24,8 @@ TAG = "CONTENT"
LANGUAGE_CONSTRAINT = "Language: Please use the same language as Human INPUT."
FORMAT_CONSTRAINT = f"Format: output wrapped inside [{TAG}][/{TAG}] like format example, nothing else."
# Delete comments in json
# If you don't want JSONDecodeError to occur, you can add Delete comments in json after FORMAT_CONSTRAINT
SIMPLE_TEMPLATE = """