haseeb-heaven / langchain-coder

Web Application that can generate code and fix bugs and run using various LLM's (GPT,Gemini,PALM)
https://langchain-coder.streamlit.app
MIT License
112 stars 38 forks source link
chat-gpt codex cpp gemini-api gemini-pro google google-api google-palm gooogle-cloud gpt-3 gpt-35-turbo java javascript langchain langchain-js langchain-python open-ai openai python streamlit

LangChain Coder AI README

📌 Table of Contents

  1. Introduction
  2. AI Sections
  3. Features
  4. WebUI - Application Showcase
  5. Vertex AI Integration
  6. 📸 Image Showcase
  7. Packages Used
  8. 📚 Links and References
  9. Versioning
  10. Contributing
  11. License
  12. Author

Introduction

Features

LangChain Coder in Action

LangChain Coder in Action

Watch LangChain Coder in action in this video!

AI-Sections.

🤖 OpenAI

🌐 Vertex AI

WebUI - Application Showcase

🌆 This is the main screen of the application. Dive in with a text prompt, choose your language, and let the magic happen with buttons that feel just right.
langchain-main-screen-ui

🎨 Behold the canvas after the masterpiece is painted. Code generation was never this beautiful.
generated_code_ui

OpenAI Integration

LangChain Coder AI integrates with OpenAI to leverage its powerful machine learning models for code generation. OpenAI is an AI research and deployment company For more details on how LangChain integrates with OpenAI, refer to the official documentation.

You need Open AI API Key to use LangChain Coder AI. To get your key, follow these steps:

Get OpenAI API key

  1. Go to the OpenAI website.
  2. Fill out the form with your information and click “Create Account”.
  3. Once you are logged in, click on “API Keys” in the left-hand menu.
  4. Click on “Generate New Key” to create a new API key.
  5. Copy your API key – we will use it later in our Python code.

Vertex AI Integration

LangChain Coder AI integrates with Google Vertex AI to leverage its powerful machine learning models for code generation. Vertex AI offers a range of tools and services for ML and AI, and LangChain Coder AI taps into these resources to provide top-notch code suggestions. For more details on how LangChain integrates with Vertex AI, refer to the official documentation.

Additionally, the Vertex AI SDK for Python allows for automation of data ingestion, model training, and predictions on Vertex AI. It provides a programmatic way to access most of the functionalities available in the Google Cloud console. For more information, check out the Vertex AI SDK for Python.

You need Google Vertex Service Account Credentials to use LangChain Coder AI. To get your credentials, follow these steps:

Credentials for Google Vertex AI Service account

  1. Go to the Google Cloud Platform Console.
  2. Click the Menu button (three horizontal lines) in the top left corner of the page.
  3. Select IAM & Admin > Service accounts.
  4. Click the Create Service Account button.
  5. In the Service account name field, enter a name for your service account.
  6. Select the Editor role for the service account.
  7. Click the Create button.
  8. Click the Keys tab.
  9. Click the Add Key button.
  10. Select JSON as the key type.
  11. Click the Create button.

After downloading the file in JSON format you need to upload it in the application. To do so, follow these steps: Enter the project name and location of that project and you're all set to go.

Here is sample Service JSON file.

{
  "type": "service_account",
  "project_id": "my-project-id",
  "private_key_id": "my-private-key-id",
  "private_key": "-----BEGIN PRIVATE KEY-----\nmy-private-key\n-----END PRIVATE KEY-----\n",
  "client_email": "my-service-account@my-project-id.iam.gserviceaccount.com",
  "client_id": "my-client-id"
}

PALM AI Integration:

LangChain Coder AI integrates with PALM AI to leverage its powerful machine learning models for code generation.

Gemini AI Integration:

LangChain Coder AI integrates with GEMINI AI to leverage its powerful machine learning models for code generation.

Setup: Get PALM/GEMINI AI key

Step 1: Obtain the Google Palm/Gemini API key..
Step 2: Visit the following URL: https://makersuite.google.com/app/apikey.
Step 3: Click on the Create API Key button.
Step 4: The generated key is your API key.
Please make sure to copy it and paste it in the required field below.
Note: The API key is crucial for the functioning of Google AI models. Please ensure to keep it safe and do not share it with anyone.

📸 Image Showcase

Main Screen UI
The main screen of the application.
langchain-main-screen-ui

Generated Code UI
Displays the generated code in a user-friendly UI.
generated_code_ui

API Rates
Shows the API rates for OpenAi and Vertex AI.
langchain-api-rates

Dark Theme Code Editor
A dark-themed code editor for a comfortable coding experience.
langchain-code-editor-dark-theme

Coding Guidelines
Highlights the coding guidelines supported by LangChain Coder AI.
langchain-code-guidelines

Offline Compiler
Showcases the offline compiler mode for executing code.
langchain-offline-compiler

Online Compiler
The online compiler mode with support for multiple languages.
langchain-online-compiler

Swift Code Demo
A demonstration showcasing Swift code generation.
langchain-swift-code-demo

Vertex AI Code Gecko
Illustrates the code completion feature of Vertex AI Code Gecko. langchain-vertex-ai-code-gecko

Packages Used

📚 Links-and-References

Star History

Star History Chart

Versioning

Version 1.7 includes these features:

Version 1.6 includes these features:

Version 1.5 includes these features:

Version 1.4 includes these features:

Version 1.3 includes these features:

New in version 1.3: AI-powered code generation and completion using OpenAI and Vertex AI models.

Contributing

If you want to contribute to this project and make it better with new ideas, your pull request is very welcomed. If you find any issue just put it in the repository issue section, thank you.

License

This project is licensed under the MIT License so feel free to use it.

Code Execution License - OFFLINE:

Code Execution License - ONLINE/API:

Author

Crafted with ❤️ by HeavenHM.