Metadata-Version: 2.4
Name: gentiq
Version: 0.7.6b1
Summary: A world-class, modular framework for building production-ready AI chatbots.
Project-URL: Homepage, https://github.com/arxyzan/gentiq
Project-URL: Repository, https://github.com/arxyzan/gentiq
Project-URL: Documentation, https://github.com/arxyzan/gentiq#readme
Project-URL: Issues, https://github.com/arxyzan/gentiq/issues
Author-email: Aryan Shekarlaban <arxyzan@gmail.com>
License: Apache-2.0
Keywords: ai,chatbot,fastapi,framework,pydantic-ai
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Requires-Dist: fastapi>=0.129.0
Requires-Dist: pydantic-ai-slim[a2a,anthropic,fastmcp,google,logfire,mcp,openai,vertexai]>=1.59.0
Requires-Dist: pyjwt>=2.11.0
Requires-Dist: python-dotenv>=1.2.1
Requires-Dist: python-multipart>=0.0.22
Requires-Dist: sse-starlette>=3.2.0
Requires-Dist: starlette>=0.52.1
Requires-Dist: uvicorn>=0.40.0
Provides-Extra: engines
Requires-Dist: minio>=7.2.20; extra == 'engines'
Requires-Dist: pymongo>=4.16.0; extra == 'engines'
Description-Content-Type: text/markdown

# Gentiq Backend Framework (Python)

**The core Python engine for building high-performance, agentic AI backends.**

`gentiq-python` is a modular, [FastAPI](https://fastapi.tiangolo.com/)-based framework built on top of [PydanticAI](https://ai.pydantic.dev/). It handles all the infrastructure—persistence, security, and streaming—allowing you to focus entirely on defining your agents and tools.

---

## 🚀 Key Features

- **`GentiqApp` Factory**: Rapidly initialize a production-ready FastAPI application with just an agent.
- **Deep PydanticAI Integration**: Fully supports PydanticAI's type-safe agent system.
- **Dependency Injection**: Automatic injection of `AgentDeps` containing `UserStore`, `ChatStore`, and the current `User`.
- **Atomic Balance Tracking**: Integrated per-user token and request balance management with automatic deduction.
- **Pluggable Persistence**: Switch between SQLite/MongoDB and FileSystem/MinIO with simple configuration.
- **Advanced Admin Management**: Secure API endpoints for user analytics, chat history auditing, and permission-based administration.

---

## 📦 Installation

Since Gentiq is typically used as a core framework, you can install it via pip:

```bash
pip install gentiq
```

*For monorepo development, it is recommended to install it in editable mode:*

```bash
# In your app's pyproject.toml
[tool.uv.sources]
gentiq = { path = "../../../packages/gentiq-python", editable = true }
```

---

## 💡 Quick Start

```python
from gentiq import GentiqApp, AgentDeps
from pydantic_ai import Agent

# Define your agent
agent = Agent[AgentDeps[dict]]('openai:gpt-4o')

# Initialize GentiqApp
app = GentiqApp(agent, app_name="MyAI")

# GentiqApp.api is a regular FastAPI instance
# Run with: uvicorn main:app.api --reload
```

---

## 📂 Core Modules

- **`gentiq.app`**: The main application orchestrator (`GentiqApp`).
- **`gentiq.stores`**: High-level stores for users, chat history, and administration.
- **`gentiq.engines`**: Pluggable persistence backends (SQLite, MongoDB, S3, FileSystem).
- **`gentiq.auth`**: Pluggable JWT-based authentication adapters.
- **`gentiq.api.dependencies`**: Reusable FastAPI dependencies like `get_user_store`, `get_chat_store`, and `get_current_user`.

---

## 🛠️ Local Development

To contribute or test the package locally:

1. **Install uv**: Ensure you have `uv` installed.
2. **Sync Dependencies**:
   ```bash
   uv sync
   ```
3. **Run Tests** (if applicable):
   ```bash
   uv run pytest
   ```
