Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / AI Agents & Assistants

AI Agents & Assistants

Build OpenAI Chat Agent That Generates Charts with Structured Output

Chat agent that calls a sub-workflow to turn a request into a QuickChart definition using OpenAI structured output and returns the chart in the reply. Runs on chat messages when called by another workflow.

What it does

## Workflow: AI Agent with charts capabilities using OpenAI Structured Output Overview - This workflow is a experiment to integrate charts into an AI Agent - The AI Agent has normal AI conversation and can invoke a tool to integrate a graph in the conversation. - It uses OpenAI Structured Output to generate a chart definition according to Quickchart specifications. How it works - Activate the workflow - Start chatting with the AI Agent. - When the AI Agent detects that the user needs a chat, it calls the tool - The tool calls the sub-workflow with a query. - The sub-workflow calls the HTTP Request node (calling OpenAI) to retrieve a chart definition - In the "set response" node, he chat definition is added at the end of a quickchart.io url - the URL to the chart image. It is sent back to the AI Agent. - The AI Agent uses this image in its response. - For example, you can ask the AI Agent to generate a chart about the top 5 movies at the box office Notes - The full Quickchart.io specifications have not been integrated, thus there are some possible glitches (e.g due to the size of the graph, radar graphs are not displayed properly) - This could be provided to any automation, not only AI Agents.

The steps

  1. OpenAI Chat Model
  2. Window Buffer Memory
  3. Generate a chart
  4. Execute "Generate a chart" tool
  5. OpenAI - Generate Chart definition with Structured Output
  6. Set response
  7. AI Agent
  8. When chat message received

Similar automations