Merge branch 'function_calls' of https://github.com/openai/openai-cookbook into function_calls

pull/1077/head
Colin Jarvis 1 year ago
commit eb8f2e1e10

@ -269,7 +269,7 @@
}
],
"source": [
"# The model first prompts the user for the information it needs to use the weather tool\n",
"# The model first prompts the user for the information it needs to use the weather function\n",
"chat_response = chat_completion_request(\n",
" conversation.conversation_history, functions=functions\n",
")\n",
@ -428,7 +428,7 @@
"functions = [\n",
" {\n",
" \"name\": \"ask_database\",\n",
" \"description\": \"Use this tool to answer user questions about music. Output should be a fully formed SQL query.\",\n",
" \"description\": \"Use this function to answer user questions about music. Output should be a fully formed SQL query.\",\n",
" \"parameters\": {\n",
" \"type\": \"object\",\n",
" \"properties\": {\n",
@ -760,13 +760,13 @@
"id": "c282b9e3",
"metadata": {},
"source": [
"## Using Multiple Tools at Once\n",
"## Using Multiple Functions\n",
"\n",
"Now let's construct a scenario in which we provide a model with more than one function to call. We'll create an agent that uses data from arXiv to answer questions about academic subjects. It has two new functions at its disposal:\n",
"- **get_articles**: A function that gets arXiv articles on a subject and summarizes them for the user with links.\n",
"- **reader_tool**: This function takes one of the previously searched articles, reads it in its entirety and summarizes the core argument, evidence and conclusions.\n",
"- **read_article_and_summarize**: This function takes one of the previously searched articles, reads it in its entirety and summarizes the core argument, evidence and conclusions.\n",
"\n",
"This will get you comfortable with a multi-tool workflow that can choose from multiple services, and where some of the data from the first function is persisted to be used by the second."
"This will get you comfortable with a multi-function workflow that can choose from multiple services, and where some of the data from the first function is persisted to be used by the second."
]
},
{

Loading…
Cancel
Save