Skip to content

Instantly share code, notes, and snippets.

@paztek
Created December 17, 2023 13:28
Show Gist options
  • Save paztek/06f9cffa6535a393117b131a152d9843 to your computer and use it in GitHub Desktop.
Save paztek/06f9cffa6535a393117b131a152d9843 to your computer and use it in GitHub Desktop.
Basic chat completions call with tools
{
"model": "gpt-4",
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather at a specific location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The location for which we want the weather"
}
},
"required": ["location"]
}
}
}
],
"messages": [
{
"role": "system",
"content": "You're a helpful assistant"
},
{
"role": "user",
"content": "What is the weather in Nantes, France?"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment