Hi,
As always, thanks for the code and open source apps!
Any good examples using the new openai functions? Or good source material with organized functions?
Thanks a lot!!
Sully
June 29, 2023, 10:06pm
2
I’ve found all the content in the openai-cookbook repo to be fantastic for learning these concepts. Here is a good notebook they have on using the function calling API:
{
"cells": [
{
"cell_type": "markdown",
"id": "3e67f200",
"metadata": {},
"source": [
"# How to call functions with chat models\n",
"\n",
"This notebook covers how to use the Chat Completions API in combination with external functions to extend the capabilities of GPT models.\n",
"\n",
"`functions` is an optional parameter in the Chat Completion API which can be used to provide function specifications. The purpose of this is to enable models to generate function arguments which adhere to the provided specifications. Note that the API will not actually execute any function calls. It is up to developers to execute function calls using model outputs.\n",
"\n",
"If the `functions` parameter is provided then by default the model will decide when it is appropriate to use one of the functions. The API can be forced to use a specific function by setting the `function_call` parameter to `{\"name\": \"<insert-function-name>\"}`. The API can also be forced to not use any function by setting the `function_call` parameter to `\"none\"`. If a function is used, the output will contain `\"finish_reason\": \"function_call\"` in the response, as well as a `function_call` object that has the name of the function and the generated function arguments.\n",
"\n",
"### Overview\n",
"\n",
"This notebook contains the following 2 sections:\n",
"\n",
"- **How to generate function arguments:** Specify a set of functions and use the API to generate function arguments.\n",
This file has been truncated. show original
1 Like
Thank you! Will give it a look