Merge pull request #904 from endolith/typos

Fix some typos
This commit is contained in:
Richard Beales
2023-04-12 08:50:06 +01:00
committed by GitHub
5 changed files with 10 additions and 10 deletions

View File

@@ -67,22 +67,22 @@ def fix_and_parse_json(
else:
# This allows the AI to react to the error message,
# which usually results in it correcting its ways.
print("Failed to fix ai output, telling the AI.")
print("Failed to fix AI output, telling the AI.")
return json_str
else:
raise e
def fix_json(json_str: str, schema: str) -> str:
"""Fix the given JSON string to make it parseable and fully complient with the provided schema."""
"""Fix the given JSON string to make it parseable and fully compliant with the provided schema."""
# Try to fix the JSON using gpt:
# Try to fix the JSON using GPT:
function_string = "def fix_json(json_str: str, schema:str=None) -> str:"
args = [f"'''{json_str}'''", f"'''{schema}'''"]
description_string = "Fixes the provided JSON string to make it parseable"\
" and fully complient with the provided schema.\n If an object or"\
" and fully compliant with the provided schema.\n If an object or"\
" field specified in the schema isn't contained within the correct"\
" JSON, it is ommited.\n This function is brilliant at guessing"\
" JSON, it is omitted.\n This function is brilliant at guessing"\
" when the format is incorrect."
# If it doesn't already start with a "`", add one: