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. 🎉


Flow Chart 🗺️

CodeFabric Screenshot

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.2.tar.gz (19.9 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.2-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codefabric-0.1.2.tar.gz
  • Upload date:
  • Size: 19.9 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.2.tar.gz
Algorithm Hash digest
SHA256 6d8e8a159ee417811171d0db78049de2e3a33c2fdb899b481013f9e437ffc0fe
MD5 499835c5a5db4472dfd2fb6d3fcb8960
BLAKE2b-256 b7bc2a48fe7c08bf6fe65518ef779a3c68bd3a602e987526e6e9a4d2afd09538

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codefabric-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 abe3495564829b6e8a32a3d57a400ee1a584aee488ec7ae86c038cf5350e89c1
MD5 997c3542753248241515f6a1d3e1d008
BLAKE2b-256 8e682b65774cb16e0ccfcd53018c41736827df767400483cb2ac6dc86d43143e

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