🚀 feat: add explicit response format

This commit is contained in:
Joschka Braun
2023-05-08 15:40:08 +02:00
parent fdc8d0414c
commit 5377b214dc
2 changed files with 21 additions and 10 deletions

View File

@@ -330,6 +330,12 @@ After thinking about the possible solutions, output them as JSON ranked from bes
)
response_format_was_error_seen_before = '''**was_error_seen_before.json**
```json
{{"was_error_seen_before": "<yes/no>"}}
```'''
template_was_error_seen_before = PromptTemplate.from_template(
'''Previously encountered error messages:
{previous_errors}
@@ -338,15 +344,18 @@ Now encountered error message: "{summarized_error}"
Was this error message encountered before?
Write down your final answer as json in the following format:
**was_error_seen_before.json**
```json
{{"was_error_seen_before": "<yes/no>"}}
```
''' + response_format_was_error_seen_before + '''
Note that you must obey the double asterisk and triple backtick syntax from above.
'''
)
response_format_was_solution_tried_before = '''**will_lead_to_different_actions.json**
```json
{{"will_lead_to_different_actions": "<yes/no>"}}
```'''
template_was_solution_tried_before = PromptTemplate.from_template(
'''Previously tried solutions:
{tried_solutions}
@@ -356,10 +365,7 @@ Suggested solution: "{suggested_solution}"
Will the suggested solution lead to different actions than the previously tried solutions?
Write down your final answer as json in the following format:
**will_lead_to_different_actions.json**
```json
{{"will_lead_to_different_actions": "<yes/no>"}}
```
''' + response_format_was_solution_tried_before + '''
Note that you must obey the double asterisk and triple backtick syntax from above.'''
)