import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const response = await client.scenarios.scorers.validate('id', { scoring_context: {} });
console.log(response.name);{
"name": "<string>",
"scoring_context": {},
"scoring_result": {
"score": 123,
"scoring_function_name": "<string>",
"output": "<string>",
"state": "unknown"
},
"environment_parameters": {
"blueprint_id": "<string>",
"snapshot_id": "<string>",
"launch_parameters": {
"launch_commands": [
"<string>"
],
"resource_size_request": "X_SMALL",
"keep_alive_time_seconds": 123,
"available_ports": [
123
],
"after_idle": {
"idle_time_seconds": 123,
"on_idle": "shutdown"
},
"custom_cpu_cores": 123,
"custom_gb_memory": 123,
"custom_disk_size": 123,
"architecture": "x86_64",
"user_parameters": {
"username": "<string>",
"uid": 123
},
"required_services": [
"<string>"
],
"network_policy_id": "<string>"
},
"working_directory": "<string>"
}
}Validate a scenario scorer.
import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const response = await client.scenarios.scorers.validate('id', { scoring_context: {} });
console.log(response.name);{
"name": "<string>",
"scoring_context": {},
"scoring_result": {
"score": 123,
"scoring_function_name": "<string>",
"output": "<string>",
"state": "unknown"
},
"environment_parameters": {
"blueprint_id": "<string>",
"snapshot_id": "<string>",
"launch_parameters": {
"launch_commands": [
"<string>"
],
"resource_size_request": "X_SMALL",
"keep_alive_time_seconds": 123,
"available_ports": [
123
],
"after_idle": {
"idle_time_seconds": 123,
"on_idle": "shutdown"
},
"custom_cpu_cores": 123,
"custom_gb_memory": 123,
"custom_disk_size": 123,
"architecture": "x86_64",
"user_parameters": {
"username": "<string>",
"uid": 123
},
"required_services": [
"<string>"
],
"network_policy_id": "<string>"
},
"working_directory": "<string>"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The Scorer ID.
OK
Name of the custom scorer.
Json context that gets passed to the custom scorer
Result of the scoring function.
Show child attributes
The Environment in which the Scenario will run.
Show child attributes
Was this page helpful?