Skip to content

Instantly share code, notes, and snippets.

@tgfjt
Created June 14, 2023 02:00
Show Gist options
  • Save tgfjt/b55e6ac5ba5f6592b8278ee07e78e983 to your computer and use it in GitHub Desktop.
Save tgfjt/b55e6ac5ba5f6592b8278ee07e78e983 to your computer and use it in GitHub Desktop.
{
"model": "gpt-3.5-turbo-0613",
"messages": [
{
"role": "user",
"content": "1. give a good 'tip' in 10-15 words.\n2. generate a name for a science fiction universe"
}
],
"functions": [
{
"name": "get_great_message",
"description": "Get the good tip & the write name",
"parameters": {
"type": "object",
"properties": {
"tip": {
"type": "string",
"description": "a good tip. e.g. Expect the Unexpected"
},
"writer": {
"type": "string",
"description": "a name of writer. e.g. Joey, Ramone, Michael"
}
},
"required": [
"tip",
"writer"
]
}
}
],
"function_call": { "name": "get_great_message" }
}
@tgfjt
Copy link
Author

tgfjt commented Jun 14, 2023

response:

{

  "model": "gpt-3.5-turbo-0613",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": null,
        "function_call": {
          "name": "get_great_message",
          "arguments": "{\n  \"tip\": \"Embrace the unknown and discover endless possibilities.\",\n  \"writer\": \"Galaxy Explorer\"\n}"
        }
      },
      "finish_reason": "stop"
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment