import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
scenario_view = client.scenarios.create(
input_context={
"problem_statement": "problem_statement"
},
name="name",
scoring_contract={
"scoring_function_parameters": [{
"name": "my scorer",
"scorer": {
"type": "custom_scorer",
"custom_scorer_type": "my_custom_scorer_type",
"scorer_params": {
"expected_length": 10,
"file_path": "/home/user/file.txt"
}
},
"weight": 1.0,
}]
},
)
print(scenario_view.id)