Metadata-Version: 2.5
Name: promptforge-llm
Version: 1.0.1
Summary: System prompt generator for LLM agents with JSON export for OpenAI and Anthropic APIs
Project-URL: Homepage, https://github.com/mandalay-rp/prompt-forge
Project-URL: Repository, https://github.com/mandalay-rp/prompt-forge
Project-URL: Documentation, https://github.com/mandalay-rp/prompt-forge#promptforge
Project-URL: Bug Tracker, https://github.com/mandalay-rp/prompt-forge/issues
Project-URL: Changelog, https://github.com/mandalay-rp/prompt-forge/blob/main/CHANGELOG.md
Author-email: Alex Jurow <teletoo51@yahoo.com>
Maintainer-email: Alex Jurow <teletoo51@yahoo.com>
License: MIT
License-File: LICENSE
Keywords: agent,anthropic,claude,django,function-calling,gpt,llm,openai,prompt,system-prompt
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Markup
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: all
Requires-Dist: pyyaml>=6.0; extra == 'all'
Requires-Dist: tiktoken>=0.5.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: pyyaml>=6.0; extra == 'dev'
Requires-Dist: ruff>=0.3.0; extra == 'dev'
Requires-Dist: tiktoken>=0.5.0; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
Provides-Extra: tokens
Requires-Dist: tiktoken>=0.5.0; extra == 'tokens'
Provides-Extra: yaml
Requires-Dist: pyyaml>=6.0; extra == 'yaml'
Description-Content-Type: text/markdown

<p align="center">
  <h1 align="center">PromptForge</h1>
  <p align="center">
    <em>Генератор system-промтов для LLM-агентов с экспортом в JSON для API</em>
  </p>
</p>

<p align="center">
  <a href="https://pypi.org/project/promptforge-llm/">
    <img src="https://img.shields.io/pypi/v/promptforge-llm?label=PyPI&color=blue" alt="PyPI version">
  </a>
  <a href="https://pypi.org/project/promptforge-llm/">
    <img src="https://img.shields.io/pypi/pyversions/promptforge-llm?label=Python&color=3776AB" alt="Python versions">
  </a>
  <a href="https://github.com/mandalay-rp/prompt-forge/actions/workflows/test.yml">
    <img src="https://img.shields.io/github/actions/workflow/status/mandalay-rp/prompt-forge/test.yml?label=Tests" alt="Tests">
  </a>
  <a href="https://github.com/mandalay-rp/prompt-forge/blob/main/LICENSE">
    <img src="https://img.shields.io/pypi/l/promptforge-llm?label=License&color=green" alt="License">
  </a>
  <a href="https://pypi.org/project/promptforge-llm/">
    <img src="https://img.shields.io/pypi/dm/promptforge-llm?label=Downloads" alt="Downloads">
  </a>
</p>

<p align="center">
  <a href="README.md">English</a> | <strong>Русский</strong>
</p>

---

**PromptForge** — инструмент для создания, валидации и экспорта system-промтов LLM-агентов в готовые JSON-payload для API (OpenAI, Anthropic, универсальный формат).

### Ключевые возможности

- 🎯 **Интерактивный мастер** — пошаговое создание конфигурации агента
- 🔒 **Детерминированный рендер** — одинаковый конфиг → одинаковый `sha256` и версия промта
- ✅ **Валидация** конфигурации до генерации
- 🔧 **Подстановка переменных** `{{key}}` в тексте промта
- 📦 **Три формата экспорта**: OpenAI, Anthropic, универсальный raw
- 💬 **Few-shot примеры** — inline в system-промт или отдельными сообщениями
- 🛡️ **Атомарная запись** файлов
- 🎓 **Интеграция с Django** через management command

## Установка

```bash
pip install promptforge-llm

# С дополнительными зависимостями
pip install promptforge-llm[yaml]       # поддержка YAML-конфигов
pip install promptforge-llm[tokens]     # точная оценка токенов через tiktoken
pip install promptforge-llm[all]        # все опциональные зависимости
```

## Быстрый старт

```bash
# Создать конфигурацию агента (интерактивный мастер)
promptforge init -o agent.config.json

# Проверить конфигурацию
promptforge validate -c agent.config.json

# Посмотреть сгенерированный system-промт
promptforge preview -c agent.config.json

# Собрать JSON-payload для OpenAI
promptforge build -c agent.config.json -f openai -o build/agent.json

# Собрать JSON-payload для Anthropic
promptforge build -c agent.config.json -f anthropic -o build/agent.claude.json
```

## Использование в коде

```python
from promptforge import AgentConfig, PromptBuilder, export
from openai import OpenAI

# Загрузить конфигурацию
config = AgentConfig.from_file("agent.config.json")

# Собрать промт с подстановкой переменных
built = PromptBuilder(config, variables={"django_version": "5.1"}).build()

# Экспортировать в формат OpenAI
payload = export(built, "openai")

# Использовать с API
response = OpenAI().chat.completions.create(**payload)
print(response.choices[0].message.content)
```

---

## Цитирование

Если вы используете PromptForge в научной работе или проекте, будем признательны за ссылку:

```bibtex
@software{promptforge2026,
  author = {Your Name},
  title = {PromptForge: System Prompt Generator for LLM Agents},
  year = {2026},
  publisher = {PyPI},
  url = {https://pypi.org/project/promptforge-llm/},
  version = {1.0.0}
}
```

## Лицензия

Проект распространяется под лицензией [MIT](LICENSE).

```
Copyright: Copyright (c) 2026 Alex Jurow (mandalay-rp)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
```
