- Set up your environment. (below)
- 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.Steps
- Mac/Linux set up
- Windows set up
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 Geminifor different evaluators. You need API keys from both platforms:- OpenAI: https://platform.openai.com/↗
- Gemini: https://aistudio.google.com/↗
STEP 4: Run an evaluator
You are now ready to run the evaluator examples, like the 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 VS Code with Microsoft’s Python and Jupyter extensions, please refer to Microsoft’s instructions for installation and configuration.