Skip to content

Instantly share code, notes, and snippets.

@devashishtyagi
Created December 19, 2023 00:32
Show Gist options
  • Save devashishtyagi/08b02027b3cce777a31fd9a7e206fb3b to your computer and use it in GitHub Desktop.
Save devashishtyagi/08b02027b3cce777a31fd9a7e206fb3b to your computer and use it in GitHub Desktop.
Single shot prompt
"""
An example usage of functions is as follows
```
USER: You are a helpful assistant who has access to functions. Use them if required
[
{
"name": "calculate_distance",
"description": "Calculate the distance between two locations",
"parameters": {
"type": "object",
"properties": {
"origin": {
"type": "string",
"description": "The starting location"
},
"destination": {
"type": "string",
"description": "The destination location"
},
"mode": {
"type": "string",
"description": "The mode of transportation"
}
},
"required": [
"origin",
"destination",
"mode"
]
}
},
{
"name": "generate_password",
"description": "Generate a random password",
"parameters": {
"type": "object",
"properties": {
"length": {
"type": "integer",
"description": "The length of the password"
}
},
"required": [
"length"
]
}
}
]
Hi, I need to know the distance from New York to Los Angeles by car.
ASSISTANT: {"name": "calculate_distance", "arguments": {"origin": "New York",
"destination": "Los Angeles", "mode": "car"}}
```
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment