Giter Club home page Giter Club logo

chatgpt-plugin-plantuml's Introduction

PlantUML Plugin for ChatGPT.

Makes PlantUML diagrams.

How it works:

  • ChatGPT generates text in PlantUML notation and posts it to the plugin's API.
  • The API returns a link to a statically hosted PNG file with the PlantUML diagram.
  • ChatGPT downloads the PNG file and displays it.

Example:

ChatGPTScreenshot.png

As you can see, the results are somewhat hit and miss, depending on the prompt. It's best to iterate and maybe use the the generated PlantUML as a starting point for manual editing. You can get the PlantUML text by using a Can you show me the PlantUML you generated for this? prompt. Syntax errors happen occasionally. I've had reasonably good luck with asking ChatGPT to fix them.

OpenAPI spec: openapi.yaml

HOWTO

Run the API in a Docker container

 docker build -t chatgpt-plugin-plantuml .
 docker run -p 5003:5003 chatgpt-plugin-plantuml

This exposes the API on port 5003 on localhost. To use the plugin: Follow the instructions in the OpenAI Plugin documentation.

Run the API locally

  1. Ensure you have Python: python --version . Install it if necessary.
  2. Install Java. To check if you have it already: java --version Java is needed to generate .png images from PlantUML.
  3. Download the plantuml.jar: wget "https://sourceforge.net/projects/plantuml/files/plantuml.jar/download" -O plantuml.jar
  4. Run python main.py
  5. Follow the instructions in the OpenAI Plugin documentation on how to use a plugin running on localhost.

Test the API

curl --location --request POST 'http://localhost:5003/generate-diagram' \
--header 'Content-Type: application/json' \
--data-raw '{
 "umlCode": "@startuml\nstart\n:Initialize;\n:Process Data;\nif (Is Valid?) then (yes)\n  :Continue Processing;\nelse (no)\n  :Stop;\nendif\n:Finalize;\nstop\n@enduml"
}'

To view the generated diagram: E.g. eog output.png or any other image viewer/editor.

chatgpt-plugin-plantuml's People

Contributors

robertreppel avatar

Stargazers

EdenChen avatar pzxy avatar  avatar Dmitry Nikolaev avatar Eugenek avatar

Watchers

 avatar

chatgpt-plugin-plantuml's Issues

PlantUML Firefox extension

It might be a hell of a lot to ask for, but would you be willing to create a firefox extension that can render PlantUML (outputted after the PlantUML description, not instead) directly in the website?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.