|
21 | 21 | * [File & Folder Structure](#file--folder-structure) |
22 | 22 | * [Contributing & Support](#contributing--support) |
23 | 23 | * [License](#license) |
| 24 | +* [OpenAI API Usage (Optional)](#openai-api-usage-optional) |
24 | 25 |
|
25 | 26 | ## Overview |
26 | 27 |
|
@@ -67,27 +68,45 @@ This project is for anyone who wants to build a deep, recallable understanding o |
67 | 68 | python main.py setup |
68 | 69 | ``` |
69 | 70 |
|
| 71 | +## Installation (Local CLI) |
| 72 | + |
| 73 | +You can install all dependencies with either: |
| 74 | + |
| 75 | +```sh |
| 76 | +pip install -r requirements.txt |
| 77 | +``` |
| 78 | + |
| 79 | +or, if you prefer PEP 621/modern Python packaging: |
| 80 | + |
| 81 | +```sh |
| 82 | +pip install . |
| 83 | +``` |
| 84 | + |
| 85 | +Both methods will install all required packages for Scarleet. |
| 86 | + |
| 87 | +See [INSTALL.md](INSTALL.md) for more details. |
| 88 | + |
70 | 89 | ## The Workflow: A Quick Start |
71 | 90 |
|
72 | 91 | The entire process is designed to be simple and flow naturally with your practice. |
73 | 92 |
|
74 | 93 | 1. **Create a New Problem:** |
75 | 94 | ```sh |
76 | | - python main.py new <problem-slug> |
77 | | - # Example: python main.py new two-sum |
| 95 | + scarleet new <problem-slug> |
| 96 | + # Example: scarleet new two-sum |
78 | 97 | ``` |
79 | 98 | 2. **Solve It:** Navigate to the new `problems/[id]-[slug]` directory and write your solution in `solution.py`. |
80 | 99 | 3. **Generate Docs:** After your solution is accepted on LeetCode, let Scarleet document it for you. |
81 | 100 | ```sh |
82 | | - python main.py docgen <problem-slug> |
| 101 | + scarleet docgen <problem-slug> |
83 | 102 | ``` |
84 | 103 | 4. **Create Flashcards:** Turn your documented solution into study material. |
85 | 104 | ```sh |
86 | | - python main.py flashcards <problem-slug> |
| 105 | + scarleet flashcards <problem-slug> |
87 | 106 | ``` |
88 | 107 | 5. **Track Your Progress:** View a summary of all your solved problems and update the master `README.md`. |
89 | 108 | ```sh |
90 | | - python main.py status --update-readme |
| 109 | + scarleet status --update-readme |
91 | 110 | ``` |
92 | 111 |
|
93 | 112 | ## Command Usage |
@@ -123,6 +142,39 @@ All configuration is managed in the `scarleet.toml` file, which is created by th |
123 | 142 | └── neetcode150.json # NeetCode 150 list |
124 | 143 | ``` |
125 | 144 |
|
| 145 | + |
| 146 | +## OpenAI or Azure OpenAI Usage (Optional) |
| 147 | + |
| 148 | +Scarleet can use either OpenAI or Azure OpenAI models (like GPT-4, GPT-3.5, etc.) for generating flashcards and documentation. To enable this, set the following environment variables in a `.env` file (which should NOT be committed to version control): |
| 149 | + |
| 150 | +### For OpenAI: |
| 151 | +``` |
| 152 | +OPENAI_API_KEY=sk-...your-key... |
| 153 | +OPENAI_API_URL=https://api.openai.com/v1 |
| 154 | +OPENAI_MODEL=gpt-4o |
| 155 | +OPENAI_API_VERSION=2024-06-01 |
| 156 | +``` |
| 157 | + |
| 158 | +### For Azure OpenAI: |
| 159 | +``` |
| 160 | +AZURE_API_KEY=your-azure-key |
| 161 | +AZURE_API_BASE=https://your-resource.openai.azure.com |
| 162 | +AZURE_DEPLOYMENT_NAME=your-deployment |
| 163 | +AZURE_API_VERSION=2024-06-01 |
| 164 | +``` |
| 165 | + |
| 166 | +- Scarleet will auto-detect which provider to use based on your `.env`. |
| 167 | +- If neither is set, Scarleet will use your local SLM endpoint as a fallback. |
| 168 | +- Install dependencies for .env support: |
| 169 | + ```sh |
| 170 | + pip install python-dotenv |
| 171 | + ``` |
| 172 | +- The `openai` Python package is required (see `requirements.txt`). |
| 173 | + |
| 174 | +**Never commit your `.env` file or API keys to version control.** |
| 175 | + |
| 176 | +--- |
| 177 | + |
126 | 178 | ## Contributing & Support |
127 | 179 |
|
128 | 180 | Contributions, suggestions, and improvements are welcome! Please open an issue or PR. By contributing, you agree that your contributions will be licensed under the GNU General Public License v3.0. |
|
0 commit comments