Added default model option++

This commit is contained in:
2025-12-08 13:09:52 +01:00
parent 254d92174c
commit 93cd60b271
2 changed files with 70 additions and 22 deletions

View File

@@ -43,10 +43,10 @@ A command-line interface (CLI) chat application for interacting with AI language
```bash
# Using pip
pip install typer rich openrouter pyperclip requests prompt_toolkit
# Using uv
uv add typer rich openrouter pyperclip requests prompt_toolkit
# Using pip and requirements.txt (recommended)
pip3 install -r requirements.txt
```
@@ -74,17 +74,18 @@ python oai_chat.py chat
### Available Commands
| Command | Description | Example |
|---------------------|-----------------------------------------------------------------------------|-------------------------------------------------------------------------|
|---------------------|-----------------------------------------------------------------------------|:------------------------------------------------------------------------|
| `/help` | Display a table with examples for all commands and features, including new ones like `/clear`. | `/help` |
| `/model [search]` | Select or switch models; optional search for substring matching. | `/model gpt` (Filters to GPT models)<br>`/model` (Shows all models) |
| `/config api` | Update OpenRouter API key and reinitialize the client. | `/config api`<br>Enter key: sk-...<br>[Output: API key updated!] |
| `/config url` | Change the base URL for custom OpenRouter endpoints. | `/config url`<br>Enter URL: https://custom.openrouter.ai/api/v1 |
| `/config stream on/off` | Toggle response streaming (default: on for real-time chat). | `/config stream off` (For full responses at once)<br>`/config stream on`|
| `/config` | View current configurations. | `/config` (Displays table: API Key, Base URL, Streaming, Database path)|
| `/clear` | Clear the terminal screen for a clean interface, preserving chat state. | `/clear`<br>[Output: Screen cleared. Ready for your next input!] |
| `exit`, `quit`, `bye` | Exit the app cleanly. | `exit` |
| Chatting with Files | Attach files using `@path` (e.g., images for vision models, text for context). | `Explain this @~/demo.png`<br>(Attaches image if model supports it) |
| Arrow Key Navigation | Use ↑/↓ arrow keys to scroll through and edit previous user inputs. | While at "You>" prompt, press ↑ for last message, ↓ for next. |
| /config model | "Set a default model that loads on startup; displays models for selection (persisted in DB, doesn't change current session model)." | `/config model gpt`<br />(Shows GPT models; user selects to set as default) |
| `/config stream on/off` | Toggle response streaming (default: on for real-time chat). | `/config stream off` (For full responses at once)<br>`/config stream on` |
| `/config` | View current configurations. | `/config` (Displays table: API Key, Base URL, Streaming, Database path) |
| `/clear` | Clear the terminal screen for a clean interface, preserving chat state. | `/clear`<br>[Output: Screen cleared. Ready for your next input!] |
| `exit`, `quit`, `bye` | Exit the app cleanly. | `exit` |
| Chatting with Files | Attach files using `@path` (e.g., images for vision models, text for context). | `Explain this @~/demo.png`<br>(Attaches image if model supports it) |
| Arrow Key Navigation | Use ↑/↓ arrow keys to scroll through and edit previous user inputs. | While at "You>" prompt, press ↑ for last message, ↓ for next. |
### Example Session