Skip to main content

Python-библиотека для удаления следов ИИ-генерации в текстах через OpenRouter и PydanticAI

Project description

deslopify

Python-библиотека для удаления следов ИИ-генерации в текстах. Трёхэтапный пайплайн: черновик → самокритика → финальная версия.

Установка

uv sync
cp .env.example .env   # и пропишите OPENROUTER_API_KEY

Ключ OpenRouter можно задать в .env — библиотека подхватит его при импорте. Для явной загрузки через uv: uv run --env-file .env python test_api.py.

Альтернатива через pip:

pip install -e ".[dev]"
export OPENROUTER_API_KEY="sk-or-..."

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

import asyncio
from deslopify import deslop, DeslopConfig

async def main():
    result = await deslop(
        "В современном мире искусственный интеллект играет ключевую роль...",
        config=DeslopConfig(model="google/gemini-2.5-flash"),
    )
    print(result.final_text)
    print(result.tokens_consumed)

asyncio.run(main())

Синхронно:

from deslopify import deslop_sync

print(deslop_sync("Ваш текст").final_text)

PydanticAI tool

Tool remove_ai_traces можно повесить на любого агента:

from pydantic_ai import Agent
from deslopify import DeslopConfig, DeslopToolDeps, create_deslop_tool

config = DeslopConfig()
agent = Agent(
    "openrouter:google/gemini-2.5-flash",
    deps_type=DeslopToolDeps,
    tools=[create_deslop_tool(config)],
)

result = await agent.run(
    "Убери ИИ-следы из текста: ...",
    deps=DeslopToolDeps(config=config),
)

Или использовать готового редактора:

from deslopify import DeslopToolDeps, create_deslop_agent, DeslopConfig

config = DeslopConfig()
agent = create_deslop_agent(config=config)
result = await agent.run(
    "Очеловечь этот абзац: ...",
    deps=DeslopToolDeps(config=config),
)

CLI

uv run deslopify "Текст для обработки"
uv run python test_api.py --text "Ваш текст"
echo "Текст" | uv run deslopify --json

Модель по умолчанию

google/gemini-2.5-flash через OpenRouter.

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

deslopify-0.3.0.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

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

deslopify-0.3.0-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file deslopify-0.3.0.tar.gz.

File metadata

  • Download URL: deslopify-0.3.0.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deslopify-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9329fddc4a28fe807b80272b6c1964e1b22cdc83cc3ecc24f696a81a369105cb
MD5 e528f4d969142a4163c095d88004178d
BLAKE2b-256 7df2e07d4eb17cdae9fee79e5c4ec4346151179eed977959801606edf9253f9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for deslopify-0.3.0.tar.gz:

Publisher: publish.yml on vpuhoff/deslopify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deslopify-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: deslopify-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deslopify-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17e467bcd4e9b2b25a1f89ebb344f8bfb69cef8ded68e6aa2e15c1c9d2986b5d
MD5 8c172fd56a1daabe2741afb034c5b69e
BLAKE2b-256 a711c60559d87598e16a42eaa85eb11a5de46cd818189e46e78272a70958f277

See more details on using hashes here.

Provenance

The following attestation bundles were made for deslopify-0.3.0-py3-none-any.whl:

Publisher: publish.yml on vpuhoff/deslopify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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