Skip to content

Instantly share code, notes, and snippets.

@hansvdam
Created July 20, 2023 11:30
Show Gist options
  • Save hansvdam/193b1a2ef2415825b33ed2800876cc51 to your computer and use it in GitHub Desktop.
Save hansvdam/193b1a2ef2415825b33ed2800876cc51 to your computer and use it in GitHub Desktop.
openai function calling prompt for train trip planning
{
"messages": [
{
"role": "system",
"content": "The current date and time is 2023-07-20T13:25:20+02:00. Be very assumptive when guessing the values of function parameters."
},
{
"role": "user",
"content": "am ut 6"
}
],
"model": "gpt-4-0613",
"max_tokens": null,
"stream": false,
"n": 1,
"temperature": 0.0,
"functions": [
{
"name": "custom_search",
"description": "answer all questions about NS",
"parameters": {
"title": "QAToolInput",
"type": "object",
"properties": {
"question": {
"title": "Question",
"description": "question about NS",
"type": "string"
}
},
"required": [
"question"
]
}
},
{
"name": "plan_plublic_transport_trip",
"description": "Plan a public transport trip from A to B in the Netherlands.",
"parameters": {
"type": "object",
"properties": {
"origin": {
"description": "origin station name in the Netherlands for the trip. Be assumptive and accept very short shorthands.",
"type": "string"
},
"destination": {
"description": "destination station name in the Netherlands for the trip. Be assumptive and accept very short shorthands.",
"type": "string"
},
"another_day_reference": {
"description": "True is the request refers to another day than today.",
"type": "boolean"
},
"trip_date_time": {
"description": "Requested DateTime for the departure or arrival of the trip in 'YYYY-MM-DDTHH:MM:SS+02:00' format. Do not use the current date en time, if a time or number is provided by the user. Use the number in the last user message.",
"type": "string"
},
"day_part_mentioned_next_to_time": {
"description": "True if the day part is mentioned next to the time, False otherwise.",
"type": "boolean"
},
"explicit_day_part_reference": {
"description": "Always prefer None! None if the request refers to the current day, otherwise the part of the day the request refers to.",
"enum": [
"none",
"morning",
"afternoon",
"evening",
"night"
],
"type": "string"
},
"departure": {
"description": "True to depart at the given time, False to arrive at the given time",
"type": "boolean"
},
"language": {
"description": "Language of the input text",
"type": "string"
}
},
"required": [
"origin",
"destination",
"another_day_reference",
"trip_date_time",
"day_part_mentioned_next_to_time",
"explicit_day_part_reference",
"departure",
"language"
]
}
}
]
}
I added all kinds of part-of day references to repair the time of the day, but recently I also seem to have some succes with just the following:
"trip_date_time": {
"description": "Requested DateTime for the departure or arrival of the trip in 'YYYY-MM-DDTHH:MM:SS+02:00' format. The user will use a time in a 12 hour system, make an intelligent guess about what the user is most likely to mean in terms of a 24 hour system, e.g. not planning for the past.",
"type": "string"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment