CoTPrompt
FewshotCoTPrompt
build_prompt
build_prompt(
self, prompt: str,
in_context_examples: List[Dict] = None,
n_shots: int = 2
)from easyinstruct import FewshotCoTPrompt
question = "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?"
in_context_examples = [{"question": "Weng earns $12 an hour for babysitting. Yesterday, she just did 50 minutes of babysitting. How much did she earn?",
"answer": "Weng earns 12/60 = $<<12/60=0.2>>0.2 per minute.\nWorking 50 minutes, she earned 0.2 x 50 = $<<0.2*50=10>>10.\n#### 10"}]
fewshot_prompts = FewshotCoTPrompt()
fewshot_prompts.build_prompt(
question,
in_context_examples = in_context_examples,
n_shots = 1yP
)ZeroshotCoTPrompt
build_prompt
Last updated