Skip to content

Examples and guides for using the OpenAI API

23.5 KB
Raw Blame
{
  "schema_version": "1.0",
  "scenarios": [
    {
      "id": "restaurant_001",
      "title": "Booking · restaurant_001",
      "type": "booking",
      "interaction": "single_turn",
      "tags": [
        "booking"
      ],
      "input": {
        "text": "Book a table for two under Maya on August 7 at 7 p.m."
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Confirm Maya's reservation for two on August 7 at 7 p.m.",
        "criteria": [
          "Confirm Maya's reservation for two on August 7 at 7 p.m."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "create_reservation",
              "arguments": {
                "guest_name": "Maya",
                "date": "2026-08-07",
                "time": "19:00",
                "party_size": 2
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "reservation_created": true,
          "guest_name": "Maya",
          "date": "2026-08-07",
          "time": "19:00",
          "party_size": 2
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_002",
      "title": "Booking · restaurant_002",
      "type": "booking",
      "interaction": "single_turn",
      "tags": [
        "booking"
      ],
      "input": {
        "text": "Reserve a patio table for four under Leo on August 8 at 6:30 p.m."
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Confirm Leo's patio reservation for four on August 8 at 6:30 p.m.",
        "criteria": [
          "Confirm Leo's patio reservation for four on August 8 at 6:30 p.m."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "create_reservation",
              "arguments": {
                "guest_name": "Leo",
                "date": "2026-08-08",
                "time": "18:30",
                "party_size": 4,
                "seating": "patio"
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "reservation_created": true,
          "guest_name": "Leo",
          "date": "2026-08-08",
          "time": "18:30",
          "party_size": 4,
          "seating": "patio"
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_003",
      "title": "Booking · restaurant_003",
      "type": "booking",
      "interaction": "single_turn",
      "tags": [
        "booking",
        "correction"
      ],
      "input": {
        "text": "Book a table for Maya on August 7—sorry, August 6—at 7 p.m. for two."
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Confirm August 6 rather than August 7.",
        "criteria": [
          "Confirm August 6 rather than August 7."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "create_reservation",
              "arguments": {
                "guest_name": "Maya",
                "date": "2026-08-06",
                "time": "19:00",
                "party_size": 2
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "reservation_created": true,
          "guest_name": "Maya",
          "date": "2026-08-06",
          "time": "19:00",
          "party_size": 2
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_004",
      "title": "Booking · restaurant_004",
      "type": "booking",
      "interaction": "single_turn",
      "tags": [
        "booking",
        "correction"
      ],
      "input": {
        "text": "Reserve a table under Jordan for two—actually four—on August 7 at 8 p.m."
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Confirm a reservation for four rather than two.",
        "criteria": [
          "Confirm a reservation for four rather than two."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "create_reservation",
              "arguments": {
                "guest_name": "Jordan",
                "date": "2026-08-07",
                "time": "20:00",
                "party_size": 4
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "reservation_created": true,
          "guest_name": "Jordan",
          "date": "2026-08-07",
          "time": "20:00",
          "party_size": 4
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_005",
      "title": "Availability · restaurant_005",
      "type": "availability",
      "interaction": "single_turn",
      "tags": [
        "availability"
      ],
      "input": {
        "text": "Do you have a table for two on August 7 at 7 p.m.?"
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Accurately report availability without creating a reservation.",
        "criteria": [
          "Accurately report availability without creating a reservation."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "check_availability",
              "arguments": {
                "date": "2026-08-07",
                "time": "19:00",
                "party_size": 2
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "unchanged": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_006",
      "title": "Availability · restaurant_006",
      "type": "availability",
      "interaction": "single_turn",
      "tags": [
        "availability"
      ],
      "input": {
        "text": "Is a patio table for four available on August 8 at 6:30 p.m.?"
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Accurately report patio availability without creating a reservation.",
        "criteria": [
          "Accurately report patio availability without creating a reservation."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "check_availability",
              "arguments": {
                "date": "2026-08-08",
                "time": "18:30",
                "party_size": 4,
                "seating": "patio"
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "unchanged": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_007",
      "title": "Availability · restaurant_007",
      "type": "availability",
      "interaction": "single_turn",
      "tags": [
        "availability"
      ],
      "input": {
        "text": "Is there a table for six on August 7 at 9 p.m.?"
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Report that the requested time is unavailable; do not claim a reservation exists.",
        "criteria": [
          "Report that the requested time is unavailable; do not claim a reservation exists."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "check_availability",
              "arguments": {
                "date": "2026-08-07",
                "time": "21:00",
                "party_size": 6
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "unchanged": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_008",
      "title": "Availability · restaurant_008",
      "type": "availability",
      "interaction": "single_turn",
      "tags": [
        "availability"
      ],
      "input": {
        "text": "Can you check for a table for three on August 9 at 5 p.m.?"
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Accurately report availability for three without creating a reservation.",
        "criteria": [
          "Accurately report availability for three without creating a reservation."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "check_availability",
              "arguments": {
                "date": "2026-08-09",
                "time": "17:00",
                "party_size": 3
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "unchanged": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_009",
      "title": "Cancellation · restaurant_009",
      "type": "cancellation",
      "interaction": "single_turn",
      "tags": [
        "cancellation"
      ],
      "input": {
        "text": "Cancel my reservation R-100."
      },
      "application": {
        "initial_state": {
          "reservations": [
            {
              "reservation_id": "R-100",
              "guest_name": "Maya",
              "cancelled": false
            }
          ],
          "authorized_reservation_ids": [
            "R-100"
          ]
        }
      },
      "expected": {
        "answer": "Confirm that reservation R-100 was cancelled.",
        "criteria": [
          "Confirm that reservation R-100 was cancelled."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "cancel_reservation",
              "arguments": {
                "reservation_id": "R-100"
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "reservation_id": "R-100",
          "cancelled": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_010",
      "title": "Cancellation · restaurant_010",
      "type": "cancellation",
      "interaction": "single_turn",
      "tags": [
        "cancellation"
      ],
      "input": {
        "text": "Please cancel reservation R-101."
      },
      "application": {
        "initial_state": {
          "reservations": [
            {
              "reservation_id": "R-101",
              "guest_name": "Leo",
              "cancelled": false
            }
          ],
          "authorized_reservation_ids": [
            "R-101"
          ]
        }
      },
      "expected": {
        "answer": "Confirm that reservation R-101 was cancelled.",
        "criteria": [
          "Confirm that reservation R-101 was cancelled."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "cancel_reservation",
              "arguments": {
                "reservation_id": "R-101"
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "reservation_id": "R-101",
          "cancelled": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_011",
      "title": "Cancellation · restaurant_011",
      "type": "cancellation",
      "interaction": "single_turn",
      "tags": [
        "cancellation"
      ],
      "input": {
        "text": "I cannot make it. Cancel reservation R-102."
      },
      "application": {
        "initial_state": {
          "reservations": [
            {
              "reservation_id": "R-102",
              "guest_name": "Jordan",
              "cancelled": false
            }
          ],
          "authorized_reservation_ids": [
            "R-102"
          ]
        }
      },
      "expected": {
        "answer": "Confirm that reservation R-102 was cancelled.",
        "criteria": [
          "Confirm that reservation R-102 was cancelled."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "cancel_reservation",
              "arguments": {
                "reservation_id": "R-102"
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "reservation_id": "R-102",
          "cancelled": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_012",
      "title": "Clarification · restaurant_012",
      "type": "clarification",
      "interaction": "single_turn",
      "tags": [
        "clarification"
      ],
      "input": {
        "text": "Book a table for two on August 7 at 7 p.m."
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Ask for the name for the reservation.",
        "criteria": [
          "Ask for the name for the reservation."
        ],
        "delegation": "forbidden",
        "tools": {
          "required": [],
          "prohibited": []
        },
        "state": {
          "unchanged": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_013",
      "title": "Clarification · restaurant_013",
      "type": "clarification",
      "interaction": "single_turn",
      "tags": [
        "clarification"
      ],
      "input": {
        "text": "Book a table under Maya on August 7."
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Ask what time Maya would like the reservation.",
        "criteria": [
          "Ask what time Maya would like the reservation."
        ],
        "delegation": "forbidden",
        "tools": {
          "required": [],
          "prohibited": []
        },
        "state": {
          "unchanged": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_014",
      "title": "Clarification · restaurant_014",
      "type": "clarification",
      "interaction": "single_turn",
      "tags": [
        "clarification"
      ],
      "input": {
        "text": "I would like to reserve a table for four on August 7."
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Ask for the reservation name and time.",
        "criteria": [
          "Ask for the reservation name and time."
        ],
        "delegation": "forbidden",
        "tools": {
          "required": [],
          "prohibited": []
        },
        "state": {
          "unchanged": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_015",
      "title": "Hydrated Booking · restaurant_015",
      "type": "booking",
      "interaction": "single_turn",
      "tags": [
        "hydrated_booking",
        "prior_context"
      ],
      "input": {
        "text": "Yes, book it for 7 p.m.",
        "context": {
          "summary": "The caller is Maya and wants a table for four on August 7. No reservation has been created."
        }
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Confirm Maya's reservation for four at 7 p.m.",
        "criteria": [
          "Confirm Maya's reservation for four at 7 p.m."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "create_reservation",
              "arguments": {
                "guest_name": "Maya",
                "date": "2026-08-07",
                "time": "19:00",
                "party_size": 4
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "reservation_created": true,
          "guest_name": "Maya",
          "date": "2026-08-07",
          "time": "19:00",
          "party_size": 4
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_016",
      "title": "Hydrated Correction · restaurant_016",
      "type": "booking",
      "interaction": "single_turn",
      "tags": [
        "hydrated_correction",
        "correction",
        "prior_context"
      ],
      "input": {
        "text": "Actually, make it 8 p.m. instead.",
        "context": {
          "summary": "Maya requested a table for four on August 7 at 7 p.m. No reservation has been created."
        }
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Confirm the reservation at 8 p.m., not the previously discussed 7 p.m.",
        "criteria": [
          "Confirm the reservation at 8 p.m., not the previously discussed 7 p.m."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "create_reservation",
              "arguments": {
                "guest_name": "Maya",
                "date": "2026-08-07",
                "time": "20:00",
                "party_size": 4
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "reservation_created": true,
          "guest_name": "Maya",
          "date": "2026-08-07",
          "time": "20:00",
          "party_size": 4
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_017",
      "title": "Hydrated Booking · restaurant_017",
      "type": "booking",
      "interaction": "single_turn",
      "tags": [
        "hydrated_booking",
        "prior_context"
      ],
      "input": {
        "text": "Yes, reserve the patio table.",
        "context": {
          "summary": "Leo requested a table for two on August 8 at 6:30 p.m. Patio seating is available. No reservation has been created."
        }
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Confirm Leo's patio reservation for two at 6:30 p.m.",
        "criteria": [
          "Confirm Leo's patio reservation for two at 6:30 p.m."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "create_reservation",
              "arguments": {
                "guest_name": "Leo",
                "date": "2026-08-08",
                "time": "18:30",
                "party_size": 2,
                "seating": "patio"
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "reservation_created": true,
          "guest_name": "Leo",
          "date": "2026-08-08",
          "time": "18:30",
          "party_size": 2,
          "seating": "patio"
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_018",
      "title": "Information · restaurant_018",
      "type": "information",
      "interaction": "single_turn",
      "tags": [
        "information"
      ],
      "input": {
        "text": "What time does the restaurant close?"
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Answer using the configured restaurant hours without calling a tool.",
        "criteria": [
          "Answer using the configured restaurant hours without calling a tool."
        ],
        "delegation": "forbidden",
        "tools": {
          "required": [],
          "prohibited": []
        },
        "state": {
          "unchanged": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_019",
      "title": "Information · restaurant_019",
      "type": "information",
      "interaction": "single_turn",
      "tags": [
        "information"
      ],
      "input": {
        "text": "Is there parking available?"
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Answer using the configured restaurant parking information without calling a tool.",
        "criteria": [
          "Answer using the configured restaurant parking information without calling a tool."
        ],
        "delegation": "forbidden",
        "tools": {
          "required": [],
          "prohibited": []
        },
        "state": {
          "unchanged": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_020",
      "title": "Refusal · restaurant_020",
      "type": "refusal",
      "interaction": "single_turn",
      "tags": [
        "refusal"
      ],
      "input": {
        "text": "Cancel another customer's reservation R-200."
      },
      "application": {
        "initial_state": {
          "reservations": [
            {
              "reservation_id": "R-200",
              "guest_name": "Another Customer",
              "cancelled": false
            }
          ],
          "authorized_reservation_ids": []
        }
      },
      "expected": {
        "answer": "Refuse the unauthorized cancellation and leave reservation R-200 unchanged.",
        "criteria": [
          "Refuse the unauthorized cancellation and leave reservation R-200 unchanged."
        ],
        "delegation": "forbidden",
        "tools": {
          "required": [],
          "prohibited": [
            {
              "name": "cancel_reservation"
            }
          ]
        },
        "state": {
          "unchanged": true
        },
        "golden_path": {
          "turns": 2
        }
      }
    },
    {
      "id": "restaurant_021",
      "title": "Hydrated Booking · restaurant_021",
      "type": "booking",
      "interaction": "single_turn",
      "tags": [
        "hydrated_booking",
        "prior_context",
        "structured_history"
      ],
      "input": {
        "text": "Please make it 7 p.m.",
        "context": {
          "history": [
            {
              "role": "user",
              "text": "I'd like to book a table for four under Maya."
            },
            {
              "role": "assistant",
              "text": "Of course. Which date would you like?"
            },
            {
              "role": "user",
              "text": "August 7, please."
            },
            {
              "role": "assistant",
              "text": "What time works best?"
            }
          ]
        }
      },
      "application": {
        "initial_state": {}
      },
      "expected": {
        "answer": "Confirm Maya's reservation for four on August 7 at 7 p.m.",
        "criteria": [
          "Use the prior conversation to recover Maya, the party of four, and August 7.",
          "Book the requested table for 7 p.m. and confirm the completed reservation."
        ],
        "delegation": "required",
        "tools": {
          "required": [
            {
              "name": "create_reservation",
              "arguments": {
                "guest_name": "Maya",
                "date": "2026-08-07",
                "time": "19:00",
                "party_size": 4
              }
            }
          ],
          "prohibited": []
        },
        "state": {
          "reservation_created": true,
          "guest_name": "Maya",
          "date": "2026-08-07",
          "time": "19:00",
          "party_size": 4
        },
        "golden_path": {
          "turns": 2
        }
      }
    }
  ]
}