Skip to main content

kosoftiks — укороченный вызов к ИИ

Одна строка настройки — и вызывай ИИ коротко:

from kosoftiks import register, kosoftiks

register(provider="openrouter", model="gemini-3-pro", api_key="sk-or-...")

ответ = kosoftiks("Привет! Кто ты?")
print(ответ)

Установка

pip install kosoftiks

Настройка

from kosoftiks import register, kosoftiks

# Вариант 1: ключ прямо в коде (только для тестов!)
register(provider="openrouter", model="gemini-3-pro", api_key="sk-or-ТВОЙ_КЛЮЧ")

# Вариант 2 (правильно): ключ в переменной окружения
# export OPENROUTER_API_KEY="sk-or-..."
register(provider="openrouter", model="gemini-3-pro")

Короткие имена моделей (сами превращаются в полные ID OpenRouter):

Пишешь Превращается в
gemini-3-pro google/gemini-2.5-pro
gemini-flash google/gemini-2.0-flash-001
gpt-4o openai/gpt-4o
gpt-4o-mini openai/gpt-4o-mini

Можно писать и полный ID сразу: model="google/gemini-2.0-flash-001".

Способы вызова

# Способ 1: обычный
ответ = kosoftiks("Напиши хокку про код")

# Способ 2: фабрика функций
ai = kosoftiks(register(provider="openrouter", model="gemini-3-pro"))
ответ = ai("Напиши шутку")

# Способ 3: всё в одну строку
ответ = kosoftiks("Привет!", provider="openrouter", model="gpt-4o-mini", api_key="sk-or-...")

# С системным промптом
ответ = kosoftiks("Привет!", system="Ты пират. Отвечай как пират.")

Запуск файлов и установка программ

from kosoftiks import kosoftiks, run, install

# Запустить файл
kosoftiks(run("file", "C:/Games/game.exe"))

# Запустить с правами администратора (3-й параметр "adm", выскочит окно UAC)
kosoftiks(run("file", "C:/setup.exe", "adm"))

# Выполнить команду
kosoftiks(run("cmd", "notepad"))

# Скачать и запустить установщик по ссылке
kosoftiks(install("https://example.com/setup.exe"))

# Тихая установка + права админа
kosoftiks(install("https://example.com/setup.exe", silent=True, admin=True))

# Только скачать, не запускать
kosoftiks(install("https://example.com/app.msi", run_after=False))

run() и install() выполняются сразу — обёртка kosoftiks() необязательна, но с ней стиль единый. Результат — dict: {"ok": True, "message": ..., "pid": ...}.

Все параметры install(): filename= (имя файла), silent= (тихая установка), args= (свои ключи, например "/S"), admin= (права админа), run_after= (False — только скачать), folder= (куда скачать).

Провайдеры

License

MIT

Metadata

Release files for kosoftiks 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kosoftiks 0.2.0
File Size Uploaded
kosoftiks-0.2.0.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kosoftiks 0.2.0
File Interpreter ABI Platform
kosoftiks-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.0 kB

Release files / kosoftiks-0.2.0.tar.gz

Download URL kosoftiks-0.2.0.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7fdfce6b6be33fa2a3ba83c4b0fc585fe8f3ac280218ac929124e5ef9a9c33a2
BLAKE2b-256 checksum
How to use checksums
1085847f6aa7168cc76ccf52005027df357ab101a90d4176da6f05e621382cd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / kosoftiks-0.2.0-py3-none-any.whl

Download URL kosoftiks-0.2.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
091ec7b8b93b5ef4e294b6860ad53379797feef3623f8b0a1f1a0372453d198b
BLAKE2b-256 checksum
How to use checksums
a5d7075abaf1554e1fd90743f97195124576ead152c0aa4bf3681719cbc7d84b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page