Skip to content

CodeStral-Code-Assistant is a chatbot designed to assist users with code-related questions. It provides code solutions, including descriptions, programming language details, imports, functional code blocks, and sample input/output.

Notifications You must be signed in to change notification settings

rahul2002m/CodeStral-Code-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 

Repository files navigation

CodeStral Code Assistant

CodeStral-Code-Assistant is a chatbot designed to assist users with code-related questions. It provides code solutions, including descriptions, programming language details, imports, functional code blocks, and sample input/output.

Developed with the software and tools below.

Python StreamLit


Coming Soon

Self-Correcting Code Agent

In the upcoming update, I am implementing a self-correcting code agent. This feature will allow the agent to self-execute and evaluate the code before presenting it to the user, ensuring higher accuracy and reliability.

Streamlit Frontend Updates

I am also planning to update the Streamlit frontend to improve user experience and add new interactive features.


πŸ”— Quick Links


πŸ“ Overview

Code-Bot is an interactive chatbot designed to assist users with programming-related queries. By leveraging the Codestral API, Code-Bot provides comprehensive code solutions that include:

  • Descriptions of the code solutions.
  • Programming language specifics.
  • Necessary import statements.
  • Fully functional code blocks.
  • Sample input and output for the provided code.

The application is built using Streamlit for the web interface and integrates seamlessly with external APIs to generate accurate and executable code snippets. Whether you need help with sorting algorithms, API calls, or any other programming task, Code-Bot is here to help streamline your coding process.


πŸ”‘ Obtaining Codestral API Key

To use Code-Bot, you need to obtain an API key from Codestral. Follow these steps to get your API key:

  1. Visit the Codestral Official Website:

  2. Login or Sign Up:

    • If you already have an account, log in.
    • If you are new to Codestral, sign up for a new account.
  3. Request Access:

    • Once logged in, click on the Request Access button.
  4. Verify Your Phone Number:

    • You will be prompted to verify your phone number. Follow the instructions to complete the verification process.
  5. Wait for Approval:

    • After verifying your phone number, you will receive a request granted email. (In my case, it took 2 hours)
  6. Generate Your API Key:

    • Once you receive the approval email, return to the Codestral official website.
    • Follow the instructions to generate your API key.

Note: The Codestral API is free to use until August 1st, 2024.

By following these steps, you will be able to obtain and set up your Codestral API key to start using Code-Bot.


πŸ“¦ Features

Code-Bot comes with a variety of features designed to make it a robust and versatile tool for programmers:

Code Solutions

  • Comprehensive Descriptions: Provides detailed explanations of the code solutions to help users understand the logic and implementation.
  • Multi-Language Support: Capable of generating code in multiple programming languages based on user queries.

Import Statements

  • Automatic Import Detection: Identifies and includes necessary import statements for the generated code, ensuring it runs without additional configuration.

Functional Code Blocks

  • Executable Code: Generates fully functional code snippets that can be executed directly, saving users time on debugging and syntax errors.
  • Formatted Output: Ensures the generated code is well-formatted and readable, using appropriate indentation and line breaks.

Sample Input/Output

  • Example Scenarios: Provides sample input and output for the generated code, helping users test and understand the code better.

API Integration

  • Codestral API: Integrates with the Codestral API to leverage powerful code generation capabilities.
  • Real-Time Responses: Fetches and returns code solutions in real-time, providing quick assistance to user queries.

User-Friendly Interface

  • Streamlit Integration: Built using Streamlit to provide an intuitive and interactive web interface, making it easy for users to input their queries and receive responses.
  • Customizable: Allows users to configure the API key and other settings to suit their specific needs.

These features make Code-Bot a comprehensive tool for programmers, whether they are beginners seeking guidance or experienced developers looking for quick code snippets.


πŸ“‚ Repository Structure

└── CodeStral-Code-Assistant/
    β”œβ”€β”€ README.md
    └── app.py

πŸš€ Getting Started

Requirements

Ensure you have the following dependencies installed on your system:

pip install requests
pip install streamlit

βš™οΈ Installation

  1. Clone the CodeStral-Code-Assistant repository:
git clone https://github.com/rahul2002m/CodeStral-Code-Assistant
  1. Change to the project directory:
cd CodeStral-Code-Assistant
  1. Install the dependencies:
pip install -r requirements.txt

βš™οΈ Configuration

Before running the application, you need to set up your Mistral Codestral API key.

  • Open the app.py file
  • Replace the placeholder in the following line with your actual API key:
os.environ["MISTRAL_API_KEY"] = "your_api_key_here"

πŸ€– Running CodeStral-Code-Assistant

Use the following command to run CodeStral-Code-Assistant:

streamlit run app.py

🀝 Contributing

Contributions are welcome! Here are several ways you can contribute:

Contributing Guidelines

  1. Fork the Repository: Start by forking the project repository to your GitHub account.
  2. Clone Locally: Clone the forked repository to your local machine using a Git client.
    git clone https://github.com/rahul2002m/CodeStral-Code-Assistant
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to GitHub: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.

Once your PR is reviewed and approved, it will be merged into the main branch.


About

CodeStral-Code-Assistant is a chatbot designed to assist users with code-related questions. It provides code solutions, including descriptions, programming language details, imports, functional code blocks, and sample input/output.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages