Does the GPT API of Azure OpenAI support local function calls now?

吕泳寰 20 Reputation points
2023-07-17T01:01:38.43+00:00

I want to know this.

And if it support now,I want to know where can I find a REST API document.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,646 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ramr-msft 17,731 Reputation points
    2023-07-21T03:33:56.8333333+00:00

    @吕泳寰 Thanks for the question. Function calling is now available in Azure OpenAI Service and gives the latest 0613 versions of gpt-35-turbo and gpt-4 the ability to produce structured JSON outputs based on functions that you describe in the request. This provides a native way for these models to formulate API calls and structure data outputs, all based on the functions you specify. It’s important to note that while the models can generate these calls, it’s up to you to execute them, ensuring you remain in control.

    The latest versions of gpt-35-turbo and gpt-4 have been fine-tuned to learn how to work with functions. If one or more functions are specified in the request, the model will then determine if any of the functions should be called based on the context of the prompt. When the model determines that a function should be called, it will then respond with a JSON object including the arguments for the function.

    At a high level you can break down working with functions into three steps:

    Step #1 — Call the chat completions API with your functions and the user’s input

    Step #2 — Use the model’s response to call your API or function

    Step #3– Call the chat completions API again, including the response from your function to get a final response

    Check out the blog post here for examples of different scenarios where function calling could be helpful and how to use functions safely and securely.

    You can also check out our samples to try out an end-to-end example of function calling.

    Getting Started

    You can get started with function calling today if you have access to the Azure OpenAI Service.

    Here are some steps to help you get up and running:

    Make sure you’re using the latest model version for gpt-35-turbo and gpt-4 (see this docs page on how to deploy new model versions)

    Apply now for access to Azure OpenAI Service, if you don’t already have access.

    Review the new documentation on function calling.

    Check out our samples on working with function calling.

    Here is adapted code that retrieves stock price details from the actual live API endpoint:https://github.com/LazaUK/AOAI-GPTFunctionCalling-Stock/blob/main/AOAI_FunctionCalling.ipynb

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Ramr-msft 17,731 Reputation points
    2023-07-17T14:57:45.3666667+00:00


    吕泳寰
    Thanks for the question. This feature is on the roadmap to include in the azure open ai. We will have the plugins eventually but from what we have been seeing if they will do the exact same thing or not.

    0 comments No comments