JSON validation working

This commit is contained in:
Nicholas Albion
2023-09-26 19:38:24 +10:00
parent 8a024c2ff2
commit e5e0f56d2e
5 changed files with 44 additions and 15 deletions

View File

@@ -140,7 +140,7 @@ class JsonPrompter:
return "\n".join(
self.function_descriptions(functions, function_to_call)
+ [
"The response should be a JSON object matching this schema:",
"The response MUST be a JSON object matching this schema:",
"```json",
self.function_parameters(functions, function_to_call),
"```",
@@ -195,7 +195,7 @@ class JsonPrompter:
"Help choose the appropriate function to call to answer the user's question."
if function_to_call is None
else f"Define the arguments for {function_to_call} to answer the user's question."
) + "\nThe response should contain only the JSON object, with no additional text or explanation."
) + "\nThe response must contain ONLY the JSON object, with NO additional text or explanation."
data = (
self.function_data(functions, function_to_call)