> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wyvern.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Experimentation Support

> This tutorial explains how to do experiments in your Wyvern Pipelines.

Wyvern experimentation framework is designed to be agnostic to your preferred experimentation provider. It is designed
to be flexible and allow you to use any experimentation provider you want. In this tutorial, we will show you how to
use Wyvern with [Eppo](https://www.geteppo.com/) as your experimentation provider. Currently, Wyvern only supports Eppo
as an experimentation provider, but we are working on adding support for other providers.

## Prerequisites

* [Install `wyvern-ai`](https://docs.wyvern.ai/quickstart#install-wyvern)
* Create an account on [Eppo](https://www.geteppo.com/)
* Set the following environment variables:
  * `EXPERIMENTATION_ENABLED`: Whether experimentation is enabled, set it to `true`
  * `EXPERIMENTATION_PROVIDER`: The experimentation provider, set it to `eppo`
  * `EPPO_API_KEY`: The API key for Eppo, you can find it in your Eppo account

## Assign treatments to your users

```python theme={null}
from wyvern.experimentation.client import experimentation_client

treatment = experimentation_client.get_experiment_result(
    "wyvern-test-feature-flag",
    request.user.user_id,
    # Add additional targeting attributes as you defined
    # them in your experiment in Eppo.
    # You can add as many as you like but instead of
    # passing a dictionary, you need to pass them as separate
    # keyword arguments.
    userID=12345678,
)
```

## Use the treatment in your pipeline

```python theme={null}
if treatment == "on":
    # Do something
elif treatment == "off":
    # Do something else
else:
    # Do something else
```

This is how you can use Wyvern with Eppo. If you want to use Wyvern with another experimentation provider, please feel
free to get your hands dirty and contribute to [Wyvern Library](https://github.com/Wyvern-AI/wyvern). We are always looking for contributors.

[Here is the link to the source code for the experimentation module in Wyvern.](https://github.com/Wyvern-AI/wyvern/tree/main/wyvern/experimentation)
