Multi-provider Uzbek-friendly AI chat CLI package
Project description
ai_salom_x391
ai_salom_x391 is a Python package for a beautiful Uzbek-friendly AI chat CLI with automatic provider and model selection.
ai_salom_x391 - API kalit formatiga qarab providerni avtomatik aniqlaydigan, chiroyli CLI interfeysli, o'zbek tiliga mos AI chat paketi.
Features
- Google Gemini, OpenAI, Anthropic Claude, DeepSeek, and local Ollama support
- Automatic provider detection from API key format
- Automatic best-model selection
- Default Uzbek ethical assistant system prompt
- Rich terminal UI, prompt-toolkit input, chat history, export, stats
- Retry logic, streaming support, token and approximate cost tracking
- Thread-safe JSON history helpers
Installation
pip install .
For development:
pip install -r requirements.txt
pip install -e .
Environment Variables
You can pass API keys directly or set:
GEMINI_API_KEY=...
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
DEEPSEEK_API_KEY=...
OLLAMA_BASE_URL=http://localhost:11434
Python Usage
Minimal usage:
import ai_salom_x391
ai_salom_x391.run(API_KEY="user_api_key")
Full usage:
ai_salom_x391.run(
API_KEY="user_api_key",
SYSTEM_PROMPT="Siz yordamchi AI...",
MODEL="auto",
PROVIDER="auto",
TEMPERATURE=0.7,
MAX_TOKENS=2048,
)
Gemini:
ai_salom_x391.run(API_KEY="AIza...")
OpenAI:
ai_salom_x391.run(API_KEY="sk-...", PROVIDER="openai", MODEL="gpt-4")
Local Ollama:
ai_salom_x391.run(PROVIDER="ollama", MODEL="llama3")
CLI Usage
ai-salom --api-key "AIza..."
ai-salom --provider openai --model gpt-4 --api-key "sk-..."
ai-salom --provider ollama --model llama3
python -m ai_salom_x391 --provider ollama --model llama3
CLI commands:
/help Help
/clear Clear terminal
/model Show current provider and model
/switch provider:X Switch provider
/switch model:Y Switch model
/history Show conversation history
/export [md|json|txt] Export conversation
/stats Show token and cost stats
/exit Exit
O'zbekcha qo'llanma
O'rnatish:
pip install .
Ishlatish:
import ai_salom_x391
ai_salom_x391.run(API_KEY="har_qanday_provider_api_kaliti")
Paket quyidagilarni avtomatik bajaradi:
- API key formatiga qarab providerni aniqlaydi
- Provider ichida eng yaxshi default modelni tanlaydi
- O'zbek tilidagi default system promptni yuboradi
- Chiroyli terminal chat interfeysini ochadi
- Suhbat tarixini saqlaydi va eksport qiladi
Ollama uchun API key kerak emas:
ai_salom_x391.run(PROVIDER="ollama", MODEL="llama3")
Tests
pytest
Integration tests are written with mocked provider calls, so they do not call paid APIs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_salom_x391-2.0.0.tar.gz.
File metadata
- Download URL: ai_salom_x391-2.0.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38a6173debcb528942b61fd24f4efe490829749e160b4fb390e57dfdea313aac
|
|
| MD5 |
1f5bb2685be7cb8962c669f7a47e34de
|
|
| BLAKE2b-256 |
d723b4be4ee90908a7a1467e9bd52ec4e75c8dcb4b5f32fc27e85578788bd2c9
|
File details
Details for the file ai_salom_x391-2.0.0-py3-none-any.whl.
File metadata
- Download URL: ai_salom_x391-2.0.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8146c8711da0cc66cd662732ded6547f76b321760b2fa08a0ab5474d80937a8
|
|
| MD5 |
29b4995702f1422e3e608fd0f5ca7be8
|
|
| BLAKE2b-256 |
5efe9d3015ac407d64256e85a8a6bfde183c6b2515b1a796680f2da2088b9c8f
|