You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain-hub/prompts/pal/colored_objects.json

8 lines
2.6 KiB
JSON

{
"input_variables": [
"question"
],
"output_parser": null,
"template": "# Generate Python3 Code to solve problems\n# Q: On the nightstand, there is a red pencil, a purple mug, a burgundy keychain, a fuchsia teddy bear, a black plate, and a blue stress ball. What color is the stress ball?\n# Put objects into a dictionary for quick look up\nobjects = dict()\nobjects['pencil'] = 'red'\nobjects['mug'] = 'purple'\nobjects['keychain'] = 'burgundy'\nobjects['teddy bear'] = 'fuchsia'\nobjects['plate'] = 'black'\nobjects['stress ball'] = 'blue'\n\n# Look up the color of stress ball\nstress_ball_color = objects['stress ball']\nanswer = stress_ball_color\n\n\n# Q: On the table, you see a bunch of objects arranged in a row: a purple paperclip, a pink stress ball, a brown keychain, a green scrunchiephone charger, a mauve fidget spinner, and a burgundy pen. What is the color of the object directly to the right of the stress ball?\n# Put objects into a list to record ordering\nobjects = []\nobjects += [('paperclip', 'purple')] * 1\nobjects += [('stress ball', 'pink')] * 1\nobjects += [('keychain', 'brown')] * 1\nobjects += [('scrunchiephone charger', 'green')] * 1\nobjects += [('fidget spinner', 'mauve')] * 1\nobjects += [('pen', 'burgundy')] * 1\n\n# Find the index of the stress ball\nstress_ball_idx = None\nfor i, object in enumerate(objects):\n if object[0] == 'stress ball':\n stress_ball_idx = i\n break\n\n# Find the directly right object\ndirect_right = objects[i+1]\n\n# Check the directly right object's color\ndirect_right_color = direct_right[1]\nanswer = direct_right_color\n\n\n# Q: On the nightstand, you see the following items arranged in a row: a teal plate, a burgundy keychain, a yellow scrunchiephone charger, an orange mug, a pink notebook, and a grey cup. How many non-orange items do you see to the left of the teal item?\n# Put objects into a list to record ordering\nobjects = []\nobjects += [('plate', 'teal')] * 1\nobjects += [('keychain', 'burgundy')] * 1\nobjects += [('scrunchiephone charger', 'yellow')] * 1\nobjects += [('mug', 'orange')] * 1\nobjects += [('notebook', 'pink')] * 1\nobjects += [('cup', 'grey')] * 1\n\n# Find the index of the teal item\nteal_idx = None\nfor i, object in enumerate(objects):\n if object[1] == 'teal':\n teal_idx = i\n break\n\n# Find non-orange items to the left of the teal item\nnon_orange = [object for object in objects[:i] if object[1] != 'orange']\n\n# Count number of non-orange objects\nnum_non_orange = len(non_orange)\nanswer = num_non_orange\n\n\n# Q: {question}\n",
"template_format": "f-string"
}