How to get the Charts using the Azure AI Assitance?

Koteshwara R 60 Reputation points
2024-08-29T05:48:02.72+00:00

Hi Team,

I need to get the charts using Azure AI Assistance.

I need the javascript code as a response. Which should I pass to my HTML where charts should be displayed?

I want to display the Pie chart, bar charts and graph charts.

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

Accepted answer
  1. Laziz 185 Reputation points Microsoft Employee
    2024-09-06T11:52:34.23+00:00

    Hi Koteshwara R, in the current implementation above, system doesn't understand the format of submitted tools options. It should be fed to Assistants API as a list of Python functions and then a dictionary, if you want to use it through Python SDK. When doing RESTful calls, it requires more efforts as the backend has to rely on something to identify required tool to use.

    Simple implementation of tools / functions with Python SDK can be found on my GitHun repo here: https://github.com/LazaUK/AOAI-ParallelFunctionCalling-SDKv1.

    In your scenario if you require a chart, rather then asking for a JavaScript code generation, you can enable "Code Interpreter" tool. It would use then Python in its sandbox environment to generate an image of chart, that you can feed to your Web page. Sample code of such chart generation can be found in AOAI Assistants doc page here: https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/assistant#download-image.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Laziz 185 Reputation points Microsoft Employee
    2024-09-06T11:36:37.0166667+00:00

    Hello Koteshwara R, functions or tools should be defined in specific format, so that they can be re-used by GPT-x models or their implementation through Assistants API.

    You can find an example on simple tooling in my GitHub repo here https://github.com/LazaUK/AOAI-ParallelFunctionCalling-SDKv1.

    If you want to produce charts, then you should use "Code Interpreter" as a tool. It would use then Python in its internal sandbox to generate a chart, that can be returned to you as an image. Rather than using a JavaScript code, you can feed that image to your Web site with Assistant generated chart. You can find some samples on its use in AOAI Assistants documentation page here: https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/assistant#download-image.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.