Skip to main content

CodeFabric is an AI-powered code generation framework that spins up full projects from natural language requirements using LangGraph workflows.

Project description

🚀 CodeFabric: AI Code Generation Package

Welcome to CodeFabric, your AI-powered coding assistant that generates projects faster than you can say "pip install"! 🚀 Feed it your project idea, and it’ll craft code like a digital artisan 🧙‍♂️. Powered by LangGraph, it’s automation with a touch of brilliance ✨.

This README covers installation and usage to kickstart your projects. Let’s get coding! 😎


Features 🌟

  • Project Generator: Creates any project from your requirements (web apps, AI agents, or your wildest ideas!).
  • Tech Flexibility: Supports multiple tech stacks via the Technologies enum.
  • Smart Workflow: LangGraph orchestrates the process like a master conductor 🎶.
  • Custom LLM Support: Use your own LLM with structured output support, or stick with OpenAI.
  • Logging: Tracks progress, so you’re never lost in the code jungle 🌴.

Prerequisites 🛠️

  • Python 3.8+ 🐍
  • pip for package installation
  • Project-specific tools (e.g., Node.js for Node projects)
  • A sprinkle of coding enthusiasm 😄

Installation 📦

Install CodeFabric using pip:

pip install codefabric

Ready to roll! 🎉


Usage 🚀

Create a Python script (e.g., run_agent.py) to define your project. Here’s an example for a LeetCode AI agent with a Streamlit app:

from codefabric.graph.developer_agent import DeveloperAgent
from codefabric.types.models import Requirements
from codefabric.types.enums import Technologies

process_id = "leetcode-agent"
project_description = """
Build a python ai agent that takes the leetcode DSA questions, it understands the problem and identify the common
patterns. The explain user how to approach and solve the problem in very pattern identification way.
It then proposes the python solution code for the problem.
I will give the key in the .env.
Make a user freindly streamlit app for the same with chat support. Save the Each Questions as a row in sqlite3 local database.
Use should be able to converse for each question. can change the leetcode question using + icon. can go back to question list and converse again.
"""

dev_agent = DeveloperAgent(
    process_id=process_id,
    requirements=Requirements(
        project_name="leetcode-agent",
        project_description=project_description,
        packages=[],
        technology=Technologies.PYTHON.value,
    ),
    # llm=CustomLLM(), # Pass Your Custom LLM Here if needed or add OPENAI_API_KEY in .env file
    # reasoning_llm=CustomReasoningLLM(), # Pass Your Custom Reasoning LLM Here if needed or add OPENAI_API_KEY in .env file
)

# Optional: Pass your own LLM (must support structured output)
# from your_llm_library import CustomLLM
# custom_llm = CustomLLM(model="your-model", api_key="your-key")
# dev_agent = DeveloperAgent(process_id=process_id, requirements=requirements, llm=custom_llm)

dev_agent.run()

Using OpenAI

Add OPENAI_API_KEY to a .env file in your project root:

OPENAI_API_KEY=your_openai_api_key_here

Using Custom LLM

If using a custom LLM with structured output support, initialize it in your script (see commented example above) and pass it to DeveloperAgent.

Run the script:

python run_agent.py

Your project files will appear in a new directory (e.g., leetcode-agent-any). Check logs for details. 🎉


Troubleshooting 🐞

  • Module not found? Ensure codefabric is installed (pip install codefabric) and your Python version is 3.8+.
  • LLM issues? Verify your API key in .env or ensure your custom LLM supports structured output.
  • Still stuck? Check logs or channel your inner detective 🕵️‍♂️.

Contributing 🤝

Want to enhance CodeFabric? Fork the repo, make tweaks, and submit a pull request. We love community vibes! 🌈


License 📜

MIT License. Use, share, remix—just don’t build a rogue AI without a nod to us 😉.


Happy coding, and may your commits be clean and your coffee strong! ☕

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codefabric-0.1.1.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codefabric-0.1.1-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file codefabric-0.1.1.tar.gz.

File metadata

  • Download URL: codefabric-0.1.1.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for codefabric-0.1.1.tar.gz
Algorithm Hash digest
SHA256 34b713daba938a1b10e3ca2255683cb14f746a2637e2ca57463725442a4f8885
MD5 d64ae2aed8c3b74415444d6bcd906a35
BLAKE2b-256 536565268bbd17e06f367c69ba52506fccf804fe11ea6b378eed3eed9f508dac

See more details on using hashes here.

File details

Details for the file codefabric-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: codefabric-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for codefabric-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb771341a9b846d1a92be6fd305b7220bd7eb4215d321e41a66c4e5cd9c044d5
MD5 e0e73469699a352cce752e3317cd4c7c
BLAKE2b-256 2f7aadcd957a20b6295fd4808f568a57c2d31f75a3174814bd07f9b6cfd28f7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page