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
- OpenAI Chat Model
- Window Buffer Memory
- Generate a chart
- Execute "Generate a chart" tool
- OpenAI - Generate Chart definition with Structured Output
- Set response
- AI Agent
- When chat message received
Similar automations
AI Agents & AssistantsGet Reliable Structured Output from OpenAI Agents10 stepsReports, Analytics & DashboardsCreate Charts in Chat with an OpenAI Agent8 stepsAI Agents & AssistantsAdd Chart Generation to an OpenAI Agent19 stepsBuilding Blocks & UtilitiesGenerate JSON Output Formats for AI Agents with Mistral19 steps