Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSRS Atlas Visualization Agent-Module

Project Overview

A FastAPI-based visualization agent that receives a dict containing a user query and a dataset, and returns a json schema containing recommended visualization data, including recommended chart type, x-axis, y-axis, and rows of data pertaining to the visualization to best optimize fulfilling the query.

Users often need to meticulously inspect datasets to figure out how to visualize them, which not only requires time, but requires knowledge of data visualization. The system automates this process by recommending the appropriate data visualization, while providing the rows of data for easy convertibility from json to a graph for easy integration with common visualization libraries.

Tech Stack

  • FastAPI
  • OpenAI API
  • Redis
  • Pandas
  • Pytest

3 terminal set up:

Replace input1.json with input2.json, input3.json, input4.json, or input5.json to see how the agent behaves to different expected inpute, whose outputs are below.

- Terminal 1: start Redis by using
redis-server

- Terminal 2: Start FastAPI app by using
uvicorn fastapimodule.module:app --reload

- Terminal 3: Test endpoint by making POST request to endpoint
curl -X POST "http://127.0.0.1:8000/visualization_agent" \
-H "Content-Type: application/json" \
-d @./fastapimodule/input.json

curl -X POST "http://127.0.0.1:8000/visualization_agent" \
-H "Content-Type: application/json" \
-d @./testing/testinputs/input1.json

To run unit tests with mock responses:

In project_root, run
PYTHONPATH=. pytest -v

Json Inputs Expected Output

input1.json Expected Output:

  • chart_type: bar
  • x_axis: region
  • y_axis: sales
  • aggregation: sum

input2.json Expected Output:

  • chart_type: line
  • x_axis: Data
  • y_axis: sales
  • aggregation: none

input3.json Expected Output:

  • chart_type: scatter
  • x_axis: ad spend
  • y_axis: sales
  • aggregation: none

input4.json Expected Output:

  • status: unrelated

input4.json Expected Output:

  • status: Impossible

ALL PASSED

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages