- Set up your environment.
- Download examples.
- Work through the tutorial.
- Build it into your app or process.
Requirements
We rely on the Python interpreter to power the evaluators. All examples and tutorials are provided as Python code snippets.Set up on Mac/Linux
Set up on Mac/Linux
You’ll need Python 3.10 or newer. To verify your version of Python, run the following code in the terminal:Remember to activate the virtual environment for each new shell session when working with Evaluators.
Step 1: Create a virtual environment
Creating an isolated environment is a best practice that prevents conflicts between Python packages used in this project and others on your system.Step 2: Install dependencies
The list of required packages is provided in the requirements.txt file.Step 3: Set your API keys
We are using both OpenAI and Google Gemini for different evaluators. You need API keys from both platforms:- OpenAI: https://platform.openai.com/
- Gemini: https://aistudio.google.com/
Set up on Windows
Set up on Windows
You’ll need Python 3.10 or newer. To verify your version of Python, run the following code in the terminal:Or in PowerShell:Remember to activate the virtual environment for each new shell session when working with Evaluators.In PowerShell:
Step 1: Create a virtual environment
Open a Command Prompt and run:Step 2: Install dependencies
Step 3: Set your API keys
Get your API keys from:- OpenAI: https://platform.openai.com/
- Gemini: https://aistudio.google.com/
Run an evaluator
You are now ready to run the evaluator examples, like this Sentence Structure Evaluator. We recommend using a Jupyter Notebook for interactive exploration.- Start Jupyter Notebook:
http://localhost:8888
).
- Create a new notebook by clicking the “Notebook: Python 3 (ipykernel)” tile in the Jupyter Lab launcher. Alternatively, navigate to the menu and select File > New > Notebook > Python 3 (ipykernel).
- You can now copy the code from our Python examples into the cells of your new notebook to run an evaluator. If you prefer using an IDE with Python and Jupyter notebook support, such as VSCode with Microsoft’s Python and Jupyter extensions, please refer to Microsoft’s instructions for their installation and configuration.