Spaces:
Running
Running
File size: 1,918 Bytes
0646b18 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# Example: Using Environment Variables in Experiments
# This demonstrates how to set/unset environment variables per experiment run
profiling:
configs:
- "settings.openai.toml"
modes:
- "balanced"
tasks:
- "test_get_top_account_by_revenue_stream"
runs: 3
langfuse:
host: "https://cloud.langfuse.com"
retry:
max_attempts: 10
initial_delay: 2.0
experiment:
name: "env_variables_example"
description: "Example showing how to use environment variables"
runs:
# Run 1: Set MODEL_NAME to a specific value
- name: "with_model_name"
test_id: "settings.openai.toml:balanced:test_get_top_account_by_revenue_stream"
iterations: 3
output: "experiments/with_model_name_{{timestamp}}.json"
env:
MODEL_NAME: "Azure/gpt-4o"
DEBUG_MODE: "true"
MAX_RETRIES: "5"
# Run 2: Unset MODEL_NAME (use null to unset)
- name: "without_model_name"
test_id: "settings.openai.toml:balanced:test_get_top_account_by_revenue_stream"
iterations: 3
output: "experiments/without_model_name_{{timestamp}}.json"
env:
MODEL_NAME: null # This will unset the variable
DEBUG_MODE: null # This will also unset DEBUG_MODE
# Run 3: Different model configuration
- name: "alt_model"
test_id: "settings.openai.toml:balanced:test_get_top_account_by_revenue_stream"
iterations: 3
output: "experiments/alt_model_{{timestamp}}.json"
env:
MODEL_NAME: "OpenAI/gpt-4"
TEMPERATURE: "0.7"
comparison:
generate_html: true
html_output: "experiments/comparison.html"
# Notes:
# - Environment variables are set before each run
# - Use `null` to explicitly unset a variable
# - Variables are isolated per run (don't affect other runs)
# - Existing environment variables are preserved unless overridden
# - String values should be quoted
|