Welcome to the Enhanced API Code Generator! This Streamlit app leverages the Groq API to generate, explain, and improve API code based on user-provided prompts. It also visualizes workflows using Mermaid syntax.
-
Code Generation
Generate API code for various environments (e.g., local, production) based on user prompts. -
Workflow Diagram
Automatically create workflow diagrams in Mermaid syntax by analyzing generated API code. -
Code Explanation
Get detailed explanations for the generated code. -
Code Improvements
Receive suggestions to enhance the quality and structure of your generated code. -
Download Option
Save the generated code as a.jsor.pyfile. -
Prompt History
View and revisit previously generated code and prompts.
- Python 3.9+
- A
.envfile containing a validGROQ_API_KEY.
- Clone the repository:
git clone https://github.com/<your-username>/<repository-name>.git cd <repository-name>
- Install dependencies:
pip install -r requirements.txt
- Add your Groq API key to a .env file:
GROQ_API_KEY=your_api_key_here
- Run the application:
streamlit run app.py
- Enter a prompt describing the API you want to generate (e.g., "Create a WebSocket chat application with Redis, Kafka, and PostgreSQL in Node.js").
- Select the environment (local or production).
- Click Generate to:
- View the generated code.
- Download the code.
- Visualize the workflow as a Mermaid diagram.
- Get a detailed explanation.
- View improvement suggestions.
- Access previous prompts and code from the Prompt History section.