# Create a basic promptprompt = Prompt( instruction="Evaluate if given answer {response} is same as expected answer {expected_answer}")# Add examples with dict inputs and dict outputsprompt.add_example( {"response": "You can get a full refund if you miss your flight.","expected_answer": "Refunds depend on ticket type; only refundable tickets qualify for full refunds." }, {"score": "fail"})prompt.add_example( {"response": "Each passenger gets 1 free checked bag up to 23kg.","expected_answer": "Each passenger gets 1 free checked bag up to 23kg." }, {"score": "pass"})print(prompt.format(response="You can get a full refund if you miss your flight.", expected_answer="Refunds depend on ticket type; only refundable tickets qualify for full refunds."))
Evaluate if given answer You can get a full refund if you miss your flight. is same as expected answer Refunds depend on ticket type; only refundable tickets qualify for full refunds.
Examples:
Example 1:
Input:
response: You can get a full refund if you miss your flight.
expected_answer: Refunds depend on ticket type; only refundable tickets qualify for full refunds.
Output:
score: fail
Example 2:
Input:
response: Each passenger gets 1 free checked bag up to 23kg.
expected_answer: Each passenger gets 1 free checked bag up to 23kg.
Output:
score: pass
print(str(prompt))
Prompt(instruction='Evaluate if given answer {response} is same as expected answer {expected_answer}',
examples=Examples:
Example 1:
Input:
response: You can get a full refund if you miss your flight.
expected_answer: Refunds depend on ticket type; only refundable tickets qualify for full refunds.
Output:
score: fail
Example 2:
Input:
response: Each passenger gets 1 free checked bag up to 23kg.
expected_answer: Each passenger gets 1 free checked bag up to 23kg.
Output:
score: pass)