Skip to content

🤖✨🗺 charites-ai - AI that can generate json files according to MapLibre style specification based on natural language instructions

License

Notifications You must be signed in to change notification settings

yuiseki/charites-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

charites-ai

Open in StackBlitz Edit in CodeSandbox

What Is This?

  • charites-ai is an AI that can generate JSON files that follow the Maplibre style specification based on natural language instructions.
  • This AI builds on @unvt/charites.

Demo

Image from Gyazo

Environment Setup

  • Node.js must be installed.
  • npm must also be installed.
  • Run the following commands:
export OPENAI_API_KEY=*****
git clone ...
cd charites-ai
npm ci
npm run dev
  • Open a browser and go to http://localhost:5173/.
  • Confirm that the map appears.

How to Use charites-ai

  • Keep npm run dev running and execute commands like the following:
npm run instruct -- "Render country names in yellow"
  • Visit http://localhost:5173/ in your browser.
  • Confirm that the map shows country names in yellow.
  • Next, run a command such as:
npm run instruct -- "Render country names in blue"
  • Refresh http://localhost:5173/ in the browser.
  • Confirm that the country names have changed to blue on the map.

How charites-ai Works

  • JSON files that comply with the Maplibre style specification are extremely large, which makes them difficult for LLMs to handle as of December 2023.
  • charites can combine multiple YAML fragments to generate a JSON file that follows the Maplibre style specification.
  • charites-ai leverages charites to edit each YAML file based on natural language instructions.
  • To enable this, detailed comments were added to every YAML file.
  • A process was implemented to analyze those comments.
  • When natural language instructions are provided, charites-ai selects the most suitable YAML file and edits it.
  • charites then merges the edited YAML files and generates a JSON file that follows the Maplibre style specification.

About

🤖✨🗺 charites-ai - AI that can generate json files according to MapLibre style specification based on natural language instructions

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •