Basic REPL to chat with the GPT models and a specific implemention that uses these models to help you learn a new language.
- Install dependencies:
python -m pip install -r requirements.in
- Create an OpenAI acccount here
- Create OpenAI api keys here
- Create a .env file with the following content:
OPENAI_API_KEY=your-openai-api-key
OPENAI_ORGANIZATION=your-openai-organization-id
python tutor.py
Generates sentences in English and lets you translate them. The program then checks if your translation is correct and gives you feedback.
The current implementation is for Spanish but you can easily set a new language in settings.ini.
Just make sure you include a section with the same name as the language and translate the [Spanish] section into that language.
You can also use these special commands which each start with a colon:
Syntax | Description |
---|---|
:reset | resets the conversation |
:load name | loads the saved conversation with the specified name |
:save name | saves the conversation under the specified name |
:model gpt-4 | Sets the AI model |
:max_tokens 800 | The maximum number of tokens to generate in the completion |
:exit or :quit | quits the program |