Topview Logo
  • Create viral videos with
    GPT-4o + Ads library
    Use GPT-4o to edit video empowered by Youtube & Tiktok & Facebook ads library. Turns your links or media assets into viral videos in one click.
    Try it free
    gpt video

    Create Advanced AI Assistants with Azure Open AI Assistant

    blog thumbnail

    Introduction

    With the recent addition of the Assistance API on Azure, developers can now create complex co-pilots that go beyond simply generating text. This innovative API allows you to intelligently trigger your functions, codes, or APIs while leveraging any type of data you may have. Let’s dive into this exciting capability.

    What is the Azure OpenAI Assistance API?

    Launched just recently, the Assistance API is currently in preview mode. This new API aims to address some limitations of conventional LLM (Large Language Model) APIs, like OpenAI's, which are stateless. Conventional LLM APIs do not retain memory of past interactions, making it challenging for developers to manage conversation threads and context.

    The Assistance API, on the other hand, is stateful, meaning it retains context across interactions. Moreover, it allows developers to connect their LLMs to execute tasks effectively—not just responding to queries or generating content, but also triggering actions, processing files, and even calling other APIs.

    Creating a Housing Assistant

    As an example, let’s create a housing assistant that can answer questions about houses listed in a dataset. We will use the Boston housing dataset from Cyler. The assistant will assist users in finding housing information and also have the ability to connect users to agents for inquiries.

    Setting Up the Assistant

    To create the assistant, navigate to the Azure portal, specifically under the Assistance API section. Start by generating a new assistant, which requires specifying a name and model (for instance, GPT-4). Develop the necessary function definitions that the assistant will utilize to trigger relevant actions based on user inputs.

    Once you’ve defined the assistant, you can also upload relevant files (like CSV or text metadata files) for the assistant to access, allowing it to use this data in its responses.

    For our housing assistant, I created a function designed to trigger when a user expresses interest in contacting a real estate agent. This function will require specific inputs—like the average number of rooms and the age of the house.

    Utilizing the Code Interpreter

    An exciting feature of the Assistance API is the code interpreter. By enabling it, Azure provisions a Python sandbox where the assistant can execute code. This allows for dynamic responses based on analyses performed on the uploaded datasets.

    For instance, I instructed the assistant to conduct exploratory data analysis (EDA) on the housing dataset. The assistant executed the command by generating Python code, conducting statistical analyses, and even creating plots of the data.

    Triggering Functions Based on User Input

    As users interact with the assistant, it can handle follow-up questions, such as providing information on the newest listed house by age. Upon a user expressing interest in a specific listing, the assistant can intelligently trigger the agent contact function, using previously gathered information such as the age of the house and the average room count.

    Code Implementation

    If you prefer to work with code rather than the Azure UI, you can programmatically create and manage your assistant, perform file uploads, and define instructions. Microsoft provides example code snippets in their documentation, allowing you to seamlessly build and implement various AI functionalities.

    Conclusion

    The Azure OpenAI Assistance API provides an advanced framework for creating sophisticated AI assistants capable of memory retention and functional execution. This capability opens the door for developing personalized co-pilot applications that can assist users effectively.


    Keywords

    • Azure OpenAI
    • Assistance API
    • Large Language Models (LLM)
    • Stateful Interaction
    • Python Code Interpreter
    • Housing Assistant
    • Exploratory Data Analysis (EDA)

    FAQ

    Q: What is the Azure OpenAI Assistance API?
    A: It is a stateful API that allows developers to create advanced co-pilots that can interact intelligently and trigger functions beyond simple text generation.

    Q: How does the Assistance API differ from traditional LLM APIs?
    A: Unlike traditional LLM APIs, which are stateless and do not retain conversation history, the Assistance API retains context, making it easier to manage user interactions.

    Q: Can I use my own datasets with the Assistance API?
    A: Yes, you can upload your datasets, such as CSV or text files, to provide the assistant with the relevant information needed to respond accurately.

    Q: What is meant by the code interpreter feature?
    A: The code interpreter feature allows the assistant to execute Python code in a sandbox environment, enabling dynamic analysis and response generation based on users' queries.

    Q: How can I create an assistant programmatically?
    A: You can connect to your Azure OpenAI endpoint using your credentials, define assistant settings, upload files, and create functions using provided code snippets from Azure's documentation.

    One more thing

    In addition to the incredible tools mentioned above, for those looking to elevate their video creation process even further, Topview.ai stands out as a revolutionary online AI video editor.

    TopView.ai provides two powerful tools to help you make ads video in one click.

    Materials to Video: you can upload your raw footage or pictures, TopView.ai will edit video based on media you uploaded for you.

    Link to Video: you can paste an E-Commerce product link, TopView.ai will generate a video for you.

    You may also like