Thursday, March 7, 2024

Perform calling and different API updates

Must read


Builders can now describe capabilities to gpt-4-0613 and gpt-3.5-turbo-0613, and have the mannequin intelligently select to output a JSON object containing arguments to name these capabilities. This can be a new technique to extra reliably join GPT’s capabilities with exterior instruments and APIs.

These fashions have been fine-tuned to each detect when a operate must be referred to as (relying on the person’s enter) and to reply with JSON that adheres to the operate signature. Perform calling permits builders to extra reliably get structured knowledge again from the mannequin. For instance, builders can:

  • Create chatbots that reply questions by calling exterior instruments (e.g., like ChatGPT Plugins)

Convert queries similar to “Electronic mail Anya to see if she needs to get espresso subsequent Friday” to a operate name like send_email(to: string, physique: string), or “What’s the climate like in Boston?” to get_current_weather(location: string, unit: 'celsius' | 'fahrenheit').

  • Convert pure language into API calls or database queries

Convert “Who’re my prime ten clients this month?” to an inside API name similar to get_customers_by_revenue(start_date: string, end_date: string, restrict: int), or “What number of orders did Acme, Inc. place final month?” to a SQL question utilizing sql_query(question: string).

  • Extract structured knowledge from textual content

Outline a operate referred to as extract_people_data(individuals: [{name: string, birthday: string, location: string}]), to extract all individuals talked about in a Wikipedia article.

These use circumstances are enabled by new API parameters in our /v1/chat/completions endpoint, capabilities and function_call, that enable builders to explain capabilities to the mannequin by way of JSON Schema, and optionally ask it to name a particular operate. Get began with our developer documentation and add evals in case you discover circumstances the place operate calling may very well be improved



Supply hyperlink

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article