tool -> function in a few places

This commit is contained in:
Ted Sanders 2023-06-13 09:56:56 -07:00
parent a066826827
commit 43b9a5abdc

View File

@ -273,7 +273,7 @@
} }
], ],
"source": [ "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", "chat_response = chat_completion_request(\n",
" conversation.conversation_history, functions=functions\n", " conversation.conversation_history, functions=functions\n",
")\n", ")\n",
@ -436,7 +436,7 @@
"functions = [\n", "functions = [\n",
" {\n", " {\n",
" \"name\": \"ask_database\",\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", " \"parameters\": {\n",
" \"type\": \"object\",\n", " \"type\": \"object\",\n",
" \"properties\": {\n", " \"properties\": {\n",
@ -753,13 +753,13 @@
"id": "c282b9e3", "id": "c282b9e3",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Using Multiple Tools at Once\n", "## Using Multiple Functions\n",
"\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", "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", "- **get_articles**: A function that gets arXiv articles on a subject and summarizes them for the user with links.\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", "- **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", "\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."
] ]
}, },
{ {