Skip to content

CodevAI is multi-powered AI-asistent writen on python | The project is not ready for general publicity, but we will try to make frequent updates.

License

Notifications You must be signed in to change notification settings

Bogdan11212/CodevAI

Repository files navigation

CodevAI: Programming Assistant with AI Thinking

CodevAI Logo

An AI-powered programming assistant that explains its thought process

FeaturesDemoAPIInstallationUsageArchitectureContributingLicense

License Stars Forks Issues

Introduction

CodevAI is a powerful programming assistant that not only generates code but also provides insights into its thinking process. It's designed to help developers understand the reasoning behind code suggestions, offering a more educational experience than traditional code completion tools.

The system leverages advanced AI models via Cloudflare AI Workers to provide intelligent assistance across multiple programming languages, with continuous learning capabilities that improve over time based on user feedback.

Features

  • AI Thinking Process: See how the AI approaches problems, reasons through solutions, and explains its thought process
  • Code Completion: Get intelligent code suggestions across multiple programming languages
  • Error Detection: Identify and fix errors with detailed correction suggestions
  • Interactive Editor: Edit code with real-time AI assistance and syntax highlighting
  • Web Search Integration: Search for programming solutions and incorporate examples
  • Continuous Learning: System learns from feedback to improve suggestions over time
  • Language Support: Python, JavaScript, Java, C++, and Go

Demo

Visit our live demo to experience CodevAI's capabilities without creating an account.

The demo showcases:

  • AI thinking visualization
  • Code completion
  • Error detection
  • Interactive coding

API Documentation

CodevAI provides a RESTful API for integration into your development workflow.

Base URL

https://api.codevai.example.com/v1

Authentication

API requests require an API key passed in the header:

Authorization: Bearer your_api_key

Key Endpoints

AI Thinking

POST /ai-thinking
Content-Type: application/json

{
  "prompt": "Write a function to find the GCD of two numbers",
  "language": "python",
  "max_thoughts": 5
}

Code Completion

POST /code-completion
Content-Type: application/json

{
  "code": "def fibonacci(n):",
  "language": "python",
  "max_tokens": 100
}

Error Checking

POST /error-check
Content-Type: application/json

{
  "code": "def fibonacci(n):\n    if n <= 0:\n        return 0\n    elif n == 1\n        return 1\n    else:\n        return fibonacci(n-1) + fibonacci(n-2)",
  "language": "python"
}

Language Detection

POST /detect-language
Content-Type: application/json

{
  "code": "function factorial(n) {\n  if (n === 0 || n === 1) {\n    return 1;\n  }\n  return n * factorial(n - 1);\n}"
}

Web Search

POST /web-search
Content-Type: application/json

{
  "query": "Python recursive sorting",
  "language": "python"
}

Web Content

POST /web-content
Content-Type: application/json

{
  "url": "https://example.com/python-tutorial"
}

Installation

Prerequisites

  • Python 3.8+
  • Flask
  • SQLAlchemy
  • Cloudflare API access (for AI Workers)

Setup

  1. Clone the repository
git clone https://github.com/Bogdan11212/CodevAI.git
cd CodevAI
  1. Install dependencies
pip install -r requirements.txt
  1. Set up environment variables
cp .env.example .env
# Edit .env with your Cloudflare credentials and other settings
  1. Initialize the database
flask db init
flask db migrate
flask db upgrade
  1. Start the server
flask run

Usage

Web Interface

Once installed, access the web interface at http://localhost:5000 with the following sections:

  • Home: Overview of CodevAI's capabilities
  • AI Thinking: Visualize AI thought processes
  • Code Generator: Generate code with continuous learning
  • Interactive Editor: Code with real-time AI assistance
  • Demo: Try all features without an account
  • Documentation: Comprehensive API documentation

Programmatic Usage

Using the Python client:

from codevai import CodevAIClient

client = CodevAIClient(api_key="your_api_key")

# Get AI thinking for a coding problem
response = client.ai_thinking(
    prompt="Write a function to sort a list using quicksort", 
    language="python"
)

# Print the thought process and solution
for thought in response["thoughts"]:
    print(f"Thought: {thought}")
print(f"\nSolution:\n{response['solution']}")

Architecture

CodevAI follows a modular architecture with several key components:

Core Components

  1. Brain

    • ai_processor.py: Main processing logic
    • cloudflare_ai.py: Integration with Cloudflare AI
    • thinking_patterns.py: Templates for AI thinking
    • web_access.py: Internet data access for learning
  2. API

    • RESTful endpoints for different functionalities
    • Authentication and rate limiting
    • Request validation and processing
  3. Models

    • Database models for storing examples, feedback, etc.
    • Versioning system for tracking AI improvements
  4. Web Interface

    • Interactive demos
    • Documentation
    • Code editor with real-time suggestions

Technology Stack

  • Backend: Flask (Python)
  • Database: SQLAlchemy with SQLite
  • AI Processing: Cloudflare AI Workers
  • Frontend: Bootstrap, Modern JS, Monaco Editor
  • Authentication: Flask-Login

Contributing

We welcome contributions from the community! See CONTRIBUTING.md for guidelines.

Development Setup

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • Cloudflare AI Workers for providing the AI capabilities
  • Flask for the web framework
  • All contributors who have helped shape this project

Made with ❤️ by the CodevAI Team

GitHubTwitter

About

CodevAI is multi-powered AI-asistent writen on python | The project is not ready for general publicity, but we will try to make frequent updates.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •