File size: 2,395 Bytes
a7d7463 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | """Documentation: Usage Guide"""
# Usage Guide - Burme-Coder-Max
## Quick Start
### Ask a Question
```bash
burme-coder ask "Python decorator hta ya py"
```
### Interactive Mode
```bash
burme-coder interactive
```
### Train Agent
```bash
burme-coder train --data ./data/trajectories
```
## CLI Commands
### `ask` - Ask a single question
```bash
burme-coder ask [INSTRUCTION] [OPTIONS]
Options:
--model TEXT AI model to use (default: gpt-4)
--verbose Show detailed output
--output, -o Save response to file
```
### `interactive` - Start chat mode
```bash
burme-coder interactive
```
Interactive commands:
- `exit` - Quit
- `clear` - Clear history
- `help` - Show help
- `history` - Show conversation history
### `train` - Train on trajectories
```bash
burme-coder train [OPTIONS]
Options:
--data TEXT Training data directory (default: ./data/trajectories)
--epochs INT Number of epochs (default: 10)
--batch-size INT Batch size (default: 4)
```
### `eval` - Evaluate performance
```bash
burme-coder eval --data ./data/trajectories
```
## Python API
### Import and Use Agent
```python
from burme_coder.core import CoderAgent
agent = CoderAgent(model="gpt-4")
response = agent.generate_response("Python list sorting hta ya")
print(response["response"])
```
### Use Animations
```python
from burme_coder.animations import Spinner, ProgressBar
with Spinner("Loading"):
do_something()
for i in ProgressBar(range(100)):
process(i)
```
### Use Thanking System
```python
from burme_coder.ui.thanking import ThankYou
ThankYou.show()
```
## Configuration
Edit `.env` file:
```bash
# API Keys
OPENAI_API_KEY=sk-your-key-here
# Animation Settings
ANIMATION_SPEED=0.05
ANIMATION_COLOR=true
# Cache Settings
CACHE_DIR=./data/cache
CACHE_TTL=3600
```
## Knowledge Base
Search local knowledge:
```python
from burme_coder.knowledge import LocalKB
kb = LocalKB()
results = kb.search("python decorators")
for result in results:
print(result["snippet"])
```
Update from web:
```python
from burme_coder.knowledge import WebUpdater
updater = WebUpdater()
updater.update_markdown_files("./data/knowledge/skills")
```
## Examples
See `examples/` directory for more examples:
- `demo_animation.py` - Animation demonstrations
- `demo_thanking.py` - Thanking system examples
- `demo_skill_query.py` - Knowledge base queries
|