Home Artificial Intelligence Function calling and other API updates

Function calling and other API updates

2
Function calling and other API updates

Developers can now describe functions to gpt-4-0613 and gpt-3.5-turbo-0613, and have the model intelligently decide to output a JSON object containing arguments to call those functions. This can be a recent strategy to more reliably connect GPT’s capabilities with external tools and APIs.

These models have been fine-tuned to each detect when a function must be called (depending on the user’s input) and to reply with JSON that adheres to the function signature. Function calling allows developers to more reliably get structured data back from the model. For instance, developers can:

  • Create chatbots that answer questions by calling external tools (e.g., like ChatGPT Plugins)

Convert queries similar to “Email Anya to see if she desires to get coffee next Friday” to a function call like send_email(to: string, body: string), or “What’s the weather like in Boston?” to get_current_weather(location: string, unit: 'celsius' | 'fahrenheit').

  • Convert natural language into API calls or database queries

Convert “Who’re my top ten customers this month?” to an internal API call similar to get_customers_by_revenue(start_date: string, end_date: string, limit: int), or “What number of orders did Acme, Inc. place last month?” to a SQL query using sql_query(query: string).

  • Extract structured data from text

Define a function called extract_people_data(people: [{name: string, birthday: string, location: string}]), to extract all people mentioned in a Wikipedia article.

These use cases are enabled by recent API parameters in our /v1/chat/completions endpoint, functions and function_call, that allow developers to explain functions to the model via JSON Schema, and optionally ask it to call a particular function. Start with our developer documentation and add evals in the event you find cases where function calling might be improved

2 COMMENTS

  1. Untuk mereka yang ingin menguruskan badan tanpa diet, pola hidup sehat melalui olahraga teratur, tidur yang cukup, makan seimbang, hingga teknik mindfulness bisa menjadi solusi. Jangan lupakan juga faktor stres dan pentingnya hidrasi. Akar rambut yang kuat adalah kunci untuk mencegah kerontokan, dan ini bisa didukung dengan cara alami seperti menggunakan ramuan tradisional, minyak zaitun, makanan yang kaya nutrisi, pijat kepala, dan juga memperhatikan kebiasaan sehari-hari seperti penggunaan cat rambut.

LEAVE A REPLY

Please enter your comment!
Please enter your name here