πŸš€Getting Started

Introduction

This tutorial will guide you step-by-step on how to install the GenAI Evaluator SDK and run your first evaluation.

chevron-rightPrerequisiteshashtag

Before installing, make sure you have:

  1. gcloud CLIarrow-up-right - required because gllm-evals is a private library hosted in a private Google Cloud repository

After installing, please run

gcloud auth login

to authorize gcloud to access the Cloud Platform with Google user credentials.

circle-info

Our internal gllm-evals package is hosted in a secure Google Cloud Artifact Registry. You need to authenticate via gcloud CLI to access and download the package during installation.

Installation

Run the following command to install

pip install --extra-index-url "https://oauth2accesstoken:$(gcloud auth print-access-token)@glsdk.gdplabs.id/gen-ai-internal/simple/" "gllm-evals[deepeval,langchain,ragas]"

Environment Setup

Set a valid language model credential as an environment variable.

  • In this example, let's use an OpenAI API key.

circle-info

Get an OpenAI API key from OpenAI Consolearrow-up-right.

Running Your First Evaluation

In this tutorial, we will evaluate RAG pipeline output.

1

Create a script called eval.py

2

Run the script

3

The evaluator will generate a response for the given input, e.g.:

circle-check

Recommendation

If you want to run an end-to-end evaluation, use the evaluate() convenience function instead of the step-by-step commands above.

It will automatically handle experiment tracking (via the Experiment Tracker) and integrates results into your existing Dataset, so you don’t have to wire these pieces together manually.

Next Steps

You're now ready to start using our evaluators. We offer several prebuilt evaluators to get you started:

Looking for something else? Build your own custom evaluator here.

*All fields are optional and can be adjusted depending on the chosen metric.

Last updated