I want the chatbot to give me graph output including the text, but I don't see a way to do that. Could you help me with that?

Kirti Rattan 0 Reputation points
2023-12-12T05:26:54.49+00:00

I am creating a chatbot by using Azure OpenAI service in Azure Open AI Studio and when the chatbot is providing me the output, it is providing the output in the form of text, I also want graphs in the output. I tried exploring the integration of graphs from the Azure Open AI Service and Power BI, but I could not find a way. I want to integrate graphs in the chatbot provided by Azure. Please help me with that.

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
751 questions
Azure Cloud Services
Azure Cloud Services
An Azure platform as a service offer that is used to deploy web and cloud applications.
647 questions
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,222 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,419 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Azar 19,400 Reputation points
    2023-12-12T06:40:11.15+00:00

    Hi Kirti Rattan

    I guess azure OpenAI service primarily focuses on natural language processing and generation, and it doesn't support graph generation or visualization. you can try adding the graph as an image and try it as below

    Use a different service to generate the graphs based on the data you want to visualize. Tools like Matplotlib, Plotly, or Seaborn in Python are popular for creating graphs. You can run this code in your Azure environment that supports your preferred graphing library. Once you have the graph, you can embed it in your chatbot's response. This depends on the platform where your chatbot is deployed. If it's a web-based chatbot, you can include image URLs or embed HTML containing the graph. If it's a different type of interface, you'll need to find a way to display images or visualizations.

    The code below will convert ur graph to image.

    import matplotlib.pyplot as plt
    import numpy as np
    
    # Generate data
    x = np.linspace(0, 10, 100)
    y = np.sin(x)
    
    # Create a plot
    plt.plot(x, y)
    plt.title('Sin Wave')
    
    # Save the plot as an image
    plt.savefig('sin_wave.png')
    
    
    

    If this helps kindly accept the answer thanks much.