This repository showcases a suite of interactive demos leveraging Google's Gemini AI models to revolutionize software development workflows. Built with Streamlit, these demos cover various aspects of the development lifecycle, providing practical examples of AI-assisted software engineering.
- Code Intelligence: Repo inspection, image-to-code generation, and legacy code migration.
- Test Automation: Selenium, Firebase Robo Script, and Appium automation.
- UX/UI Design: Heuristic analysis, friction log generation, and accessibility testing.
- User Story Automation: Generating code, data models, and APIs from user stories.
- DataOps: Dataform ELT generation.
-
Clone the repository:
git clone https://github.com/your-username/generative-ai-demos.git cd generative-ai-demos -
Install dependencies:
pip install -r requirements.txt
-
Set up Google Cloud Project:
- Create or select a project in the Google Cloud Console.
- Enable required APIs: Vertex AI, Cloud Run, Cloud Build, Artifact Registry, IAM, and Cloud Storage.
- Create a service account with necessary permissions and download the JSON key file.
-
Configure environment variables:
export GCP_PROJECT="your-project-id" export GCP_REGION="your-preferred-region" export GOOGLE_APPLICATION_CREDENTIALS="path/to/your/service-account-key.json"
To run the demos locally:
streamlit run home.pyThis will start the Streamlit server and open the home page in your default web browser. Navigate through the sidebar to explore different demo categories and individual demos.
A Dockerfile is provided for containerizing the application. To build and run the Docker container:
-
Build the Docker image:
docker build -t generative-ai-demos . -
Run the container:
docker run -p 8080:8080 -e GCP_PROJECT=your-project-id -e GCP_REGION=your-region generative-ai-demos
Access the application at http://localhost:8080 in your web browser.
This project includes a cloudbuild.yaml file for automated builds and deployments using Google Cloud Build. Here's how to use it:
-
Set up Artifact Registry: Create a Docker repository in Artifact Registry:
gcloud artifacts repositories create dev-lifecycle --repository-format=docker --location=us-central1 --description="Gemini Developer Lifecycle Demo" -
Trigger a build: Submit a build to Cloud Build:
gcloud builds submit . --config=./cloudbuild.yaml --substitutions SHORT_SHA=1.0 -
Customizing the build: The
cloudbuild.yamlfile defines the following steps:- Install Python dependencies
- Build a Docker image
- Push the image to Artifact Registry
- Deploy the image to Cloud Run
You can customize the build by modifying the
cloudbuild.yamlfile. Key substitution variables include:_ARTIFACT_REGISTRY_REPO: Name of your Artifact Registry repository_REPO_LOCATION: Location of your Artifact Registry_SERVICE_NAME: Name of your Cloud Run service_SERVICE_REGION: Region for your Cloud Run service
-
Environment Variables: The Cloud Run deployment step sets the following environment variables:
GCP_PROJECT: Set to your project IDGCP_REGION: Set to the specified service region
Ensure you have the necessary permissions in your Google Cloud project to use Cloud Build, Artifact Registry, and Cloud Run.
- API Errors: Ensure your Google Cloud Project has the necessary APIs enabled and your service account has appropriate permissions.
- Model Unavailable: Check if the selected Gemini model is available in your region. Some models may have limited availability.
- Memory Issues: If encountering out-of-memory errors, try running the demos on a machine with more RAM or reduce the input size for large repositories or videos.
- Docker Issues: Make sure Docker is installed and running on your system. Check Docker logs for any error messages.
- Cloud Build Issues: Verify that you have the correct permissions and that all required APIs are enabled in your Google Cloud project.
We welcome contributions to improve and expand these demos! Please refer to our Contribution Guidelines for detailed information on how to contribute to this project.
This project uses Google Cloud services. Ensure that you follow best practices for securing your Google Cloud environment:
- Use the principle of least privilege when setting up service accounts.
- Regularly rotate service account keys.
- Keep your
GOOGLE_APPLICATION_CREDENTIALSsecure and never commit them to version control.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Google Cloud Platform and the Gemini AI team for their cutting-edge AI models
- Streamlit for their excellent framework for building interactive data applications
- The open-source community for various libraries and tools used in this project
For questions, issues, or feature requests, please open an issue in the GitHub repository or contact the maintainers.