runloop_api_client 1.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- runloop_api_client/__init__.py +95 -0
- runloop_api_client/_base_client.py +2127 -0
- runloop_api_client/_client.py +866 -0
- runloop_api_client/_compat.py +219 -0
- runloop_api_client/_constants.py +23 -0
- runloop_api_client/_exceptions.py +108 -0
- runloop_api_client/_files.py +123 -0
- runloop_api_client/_models.py +872 -0
- runloop_api_client/_qs.py +150 -0
- runloop_api_client/_resource.py +43 -0
- runloop_api_client/_response.py +832 -0
- runloop_api_client/_streaming.py +518 -0
- runloop_api_client/_types.py +270 -0
- runloop_api_client/_utils/__init__.py +65 -0
- runloop_api_client/_utils/_compat.py +45 -0
- runloop_api_client/_utils/_datetime_parse.py +136 -0
- runloop_api_client/_utils/_json.py +35 -0
- runloop_api_client/_utils/_logs.py +25 -0
- runloop_api_client/_utils/_proxy.py +65 -0
- runloop_api_client/_utils/_reflection.py +42 -0
- runloop_api_client/_utils/_resources_proxy.py +24 -0
- runloop_api_client/_utils/_streams.py +12 -0
- runloop_api_client/_utils/_sync.py +58 -0
- runloop_api_client/_utils/_transform.py +457 -0
- runloop_api_client/_utils/_typing.py +156 -0
- runloop_api_client/_utils/_utils.py +421 -0
- runloop_api_client/_utils/_validation.py +31 -0
- runloop_api_client/_version.py +4 -0
- runloop_api_client/lib/.keep +4 -0
- runloop_api_client/lib/__init__.py +3 -0
- runloop_api_client/lib/_ignore.py +496 -0
- runloop_api_client/lib/context_loader.py +78 -0
- runloop_api_client/lib/polling.py +75 -0
- runloop_api_client/lib/polling_async.py +60 -0
- runloop_api_client/pagination.py +986 -0
- runloop_api_client/py.typed +0 -0
- runloop_api_client/resources/__init__.py +173 -0
- runloop_api_client/resources/agents.py +431 -0
- runloop_api_client/resources/benchmark_jobs.py +394 -0
- runloop_api_client/resources/benchmark_runs.py +595 -0
- runloop_api_client/resources/benchmarks.py +1085 -0
- runloop_api_client/resources/blueprints.py +1563 -0
- runloop_api_client/resources/devboxes/__init__.py +89 -0
- runloop_api_client/resources/devboxes/browsers.py +267 -0
- runloop_api_client/resources/devboxes/computers.py +648 -0
- runloop_api_client/resources/devboxes/devboxes.py +3784 -0
- runloop_api_client/resources/devboxes/disk_snapshots.py +602 -0
- runloop_api_client/resources/devboxes/executions.py +1212 -0
- runloop_api_client/resources/devboxes/logs.py +197 -0
- runloop_api_client/resources/gateway_configs.py +658 -0
- runloop_api_client/resources/network_policies.py +680 -0
- runloop_api_client/resources/objects.py +870 -0
- runloop_api_client/resources/repositories.py +918 -0
- runloop_api_client/resources/scenarios/__init__.py +47 -0
- runloop_api_client/resources/scenarios/runs.py +973 -0
- runloop_api_client/resources/scenarios/scenarios.py +1101 -0
- runloop_api_client/resources/scenarios/scorers.py +629 -0
- runloop_api_client/resources/secrets.py +500 -0
- runloop_api_client/sdk/__init__.py +117 -0
- runloop_api_client/sdk/_helpers.py +49 -0
- runloop_api_client/sdk/_types.py +264 -0
- runloop_api_client/sdk/agent.py +70 -0
- runloop_api_client/sdk/async_.py +1036 -0
- runloop_api_client/sdk/async_agent.py +70 -0
- runloop_api_client/sdk/async_benchmark.py +169 -0
- runloop_api_client/sdk/async_benchmark_run.py +127 -0
- runloop_api_client/sdk/async_blueprint.py +104 -0
- runloop_api_client/sdk/async_devbox.py +797 -0
- runloop_api_client/sdk/async_execution.py +144 -0
- runloop_api_client/sdk/async_execution_result.py +175 -0
- runloop_api_client/sdk/async_network_policy.py +80 -0
- runloop_api_client/sdk/async_scenario.py +118 -0
- runloop_api_client/sdk/async_scenario_builder.py +480 -0
- runloop_api_client/sdk/async_scenario_run.py +242 -0
- runloop_api_client/sdk/async_scorer.py +77 -0
- runloop_api_client/sdk/async_snapshot.py +125 -0
- runloop_api_client/sdk/async_storage_object.py +188 -0
- runloop_api_client/sdk/benchmark.py +167 -0
- runloop_api_client/sdk/benchmark_run.py +127 -0
- runloop_api_client/sdk/blueprint.py +104 -0
- runloop_api_client/sdk/devbox.py +800 -0
- runloop_api_client/sdk/execution.py +132 -0
- runloop_api_client/sdk/execution_result.py +173 -0
- runloop_api_client/sdk/network_policy.py +80 -0
- runloop_api_client/sdk/scenario.py +118 -0
- runloop_api_client/sdk/scenario_builder.py +480 -0
- runloop_api_client/sdk/scenario_run.py +242 -0
- runloop_api_client/sdk/scorer.py +77 -0
- runloop_api_client/sdk/snapshot.py +125 -0
- runloop_api_client/sdk/storage_object.py +188 -0
- runloop_api_client/sdk/sync.py +1061 -0
- runloop_api_client/types/__init__.py +130 -0
- runloop_api_client/types/agent_create_params.py +21 -0
- runloop_api_client/types/agent_list_params.py +27 -0
- runloop_api_client/types/agent_list_view.py +24 -0
- runloop_api_client/types/agent_view.py +30 -0
- runloop_api_client/types/benchmark_create_params.py +40 -0
- runloop_api_client/types/benchmark_definitions_params.py +15 -0
- runloop_api_client/types/benchmark_job_create_params.py +220 -0
- runloop_api_client/types/benchmark_job_list_params.py +18 -0
- runloop_api_client/types/benchmark_job_list_view.py +19 -0
- runloop_api_client/types/benchmark_job_view.py +344 -0
- runloop_api_client/types/benchmark_list_params.py +18 -0
- runloop_api_client/types/benchmark_list_public_params.py +15 -0
- runloop_api_client/types/benchmark_run_list_params.py +21 -0
- runloop_api_client/types/benchmark_run_list_scenario_runs_params.py +18 -0
- runloop_api_client/types/benchmark_run_list_view.py +19 -0
- runloop_api_client/types/benchmark_run_view.py +58 -0
- runloop_api_client/types/benchmark_start_run_params.py +29 -0
- runloop_api_client/types/benchmark_update_params.py +42 -0
- runloop_api_client/types/benchmark_update_scenarios_params.py +18 -0
- runloop_api_client/types/benchmark_view.py +49 -0
- runloop_api_client/types/blueprint_build_log.py +16 -0
- runloop_api_client/types/blueprint_build_logs_list_view.py +16 -0
- runloop_api_client/types/blueprint_build_parameters.py +119 -0
- runloop_api_client/types/blueprint_create_from_inspection_params.py +49 -0
- runloop_api_client/types/blueprint_create_params.py +121 -0
- runloop_api_client/types/blueprint_list_params.py +21 -0
- runloop_api_client/types/blueprint_list_public_params.py +21 -0
- runloop_api_client/types/blueprint_list_view.py +19 -0
- runloop_api_client/types/blueprint_preview_params.py +121 -0
- runloop_api_client/types/blueprint_preview_view.py +10 -0
- runloop_api_client/types/blueprint_view.py +93 -0
- runloop_api_client/types/devbox_async_execution_detail_view.py +46 -0
- runloop_api_client/types/devbox_create_params.py +124 -0
- runloop_api_client/types/devbox_create_ssh_key_response.py +19 -0
- runloop_api_client/types/devbox_create_tunnel_params.py +12 -0
- runloop_api_client/types/devbox_download_file_params.py +15 -0
- runloop_api_client/types/devbox_enable_tunnel_params.py +13 -0
- runloop_api_client/types/devbox_execute_async_params.py +33 -0
- runloop_api_client/types/devbox_execute_params.py +37 -0
- runloop_api_client/types/devbox_execute_sync_params.py +31 -0
- runloop_api_client/types/devbox_execution_detail_view.py +24 -0
- runloop_api_client/types/devbox_list_disk_snapshots_params.py +32 -0
- runloop_api_client/types/devbox_list_params.py +20 -0
- runloop_api_client/types/devbox_list_view.py +19 -0
- runloop_api_client/types/devbox_read_file_contents_params.py +15 -0
- runloop_api_client/types/devbox_read_file_contents_response.py +7 -0
- runloop_api_client/types/devbox_remove_tunnel_params.py +12 -0
- runloop_api_client/types/devbox_send_std_in_result.py +16 -0
- runloop_api_client/types/devbox_snapshot_disk_async_params.py +19 -0
- runloop_api_client/types/devbox_snapshot_disk_params.py +19 -0
- runloop_api_client/types/devbox_snapshot_list_view.py +19 -0
- runloop_api_client/types/devbox_snapshot_view.py +30 -0
- runloop_api_client/types/devbox_tunnel_view.py +16 -0
- runloop_api_client/types/devbox_update_params.py +16 -0
- runloop_api_client/types/devbox_upload_file_params.py +19 -0
- runloop_api_client/types/devbox_view.py +121 -0
- runloop_api_client/types/devbox_wait_for_command_params.py +28 -0
- runloop_api_client/types/devbox_write_file_contents_params.py +18 -0
- runloop_api_client/types/devboxes/__init__.py +33 -0
- runloop_api_client/types/devboxes/browser_create_params.py +13 -0
- runloop_api_client/types/devboxes/browser_view.py +29 -0
- runloop_api_client/types/devboxes/computer_create_params.py +26 -0
- runloop_api_client/types/devboxes/computer_keyboard_interaction_params.py +16 -0
- runloop_api_client/types/devboxes/computer_keyboard_interaction_response.py +15 -0
- runloop_api_client/types/devboxes/computer_mouse_interaction_params.py +35 -0
- runloop_api_client/types/devboxes/computer_mouse_interaction_response.py +15 -0
- runloop_api_client/types/devboxes/computer_screen_interaction_params.py +12 -0
- runloop_api_client/types/devboxes/computer_screen_interaction_response.py +15 -0
- runloop_api_client/types/devboxes/computer_view.py +23 -0
- runloop_api_client/types/devboxes/devbox_logs_list_view.py +39 -0
- runloop_api_client/types/devboxes/devbox_snapshot_async_status_view.py +20 -0
- runloop_api_client/types/devboxes/disk_snapshot_list_params.py +32 -0
- runloop_api_client/types/devboxes/disk_snapshot_update_params.py +19 -0
- runloop_api_client/types/devboxes/execution_execute_async_params.py +31 -0
- runloop_api_client/types/devboxes/execution_execute_sync_params.py +31 -0
- runloop_api_client/types/devboxes/execution_kill_params.py +18 -0
- runloop_api_client/types/devboxes/execution_retrieve_params.py +14 -0
- runloop_api_client/types/devboxes/execution_send_std_in_params.py +18 -0
- runloop_api_client/types/devboxes/execution_stream_stderr_updates_params.py +17 -0
- runloop_api_client/types/devboxes/execution_stream_stdout_updates_params.py +17 -0
- runloop_api_client/types/devboxes/execution_update_chunk.py +15 -0
- runloop_api_client/types/devboxes/log_list_params.py +15 -0
- runloop_api_client/types/gateway_config_create_params.py +41 -0
- runloop_api_client/types/gateway_config_list_params.py +21 -0
- runloop_api_client/types/gateway_config_list_view.py +21 -0
- runloop_api_client/types/gateway_config_update_params.py +32 -0
- runloop_api_client/types/gateway_config_view.py +47 -0
- runloop_api_client/types/input_context.py +19 -0
- runloop_api_client/types/input_context_param.py +20 -0
- runloop_api_client/types/input_context_update_param.py +16 -0
- runloop_api_client/types/inspection_source_param.py +18 -0
- runloop_api_client/types/network_policy_create_params.py +40 -0
- runloop_api_client/types/network_policy_list_params.py +21 -0
- runloop_api_client/types/network_policy_list_view.py +21 -0
- runloop_api_client/types/network_policy_update_params.py +30 -0
- runloop_api_client/types/network_policy_view.py +52 -0
- runloop_api_client/types/object_create_params.py +30 -0
- runloop_api_client/types/object_download_params.py +12 -0
- runloop_api_client/types/object_download_url_view.py +12 -0
- runloop_api_client/types/object_list_params.py +27 -0
- runloop_api_client/types/object_list_public_params.py +27 -0
- runloop_api_client/types/object_list_view.py +24 -0
- runloop_api_client/types/object_view.py +36 -0
- runloop_api_client/types/repository_connection_list_view.py +19 -0
- runloop_api_client/types/repository_connection_view.py +18 -0
- runloop_api_client/types/repository_create_params.py +22 -0
- runloop_api_client/types/repository_inspect_params.py +13 -0
- runloop_api_client/types/repository_inspection_details.py +83 -0
- runloop_api_client/types/repository_inspection_list_view.py +13 -0
- runloop_api_client/types/repository_list_params.py +21 -0
- runloop_api_client/types/repository_manifest_view.py +174 -0
- runloop_api_client/types/repository_refresh_params.py +16 -0
- runloop_api_client/types/scenario_create_params.py +53 -0
- runloop_api_client/types/scenario_definition_list_view.py +19 -0
- runloop_api_client/types/scenario_environment.py +29 -0
- runloop_api_client/types/scenario_environment_param.py +31 -0
- runloop_api_client/types/scenario_list_params.py +24 -0
- runloop_api_client/types/scenario_list_public_params.py +18 -0
- runloop_api_client/types/scenario_run_list_view.py +19 -0
- runloop_api_client/types/scenario_run_view.py +55 -0
- runloop_api_client/types/scenario_start_run_params.py +30 -0
- runloop_api_client/types/scenario_update_params.py +49 -0
- runloop_api_client/types/scenario_view.py +61 -0
- runloop_api_client/types/scenarios/__init__.py +14 -0
- runloop_api_client/types/scenarios/run_list_params.py +27 -0
- runloop_api_client/types/scenarios/scorer_create_params.py +18 -0
- runloop_api_client/types/scenarios/scorer_create_response.py +18 -0
- runloop_api_client/types/scenarios/scorer_list_params.py +15 -0
- runloop_api_client/types/scenarios/scorer_list_response.py +18 -0
- runloop_api_client/types/scenarios/scorer_retrieve_response.py +18 -0
- runloop_api_client/types/scenarios/scorer_update_params.py +18 -0
- runloop_api_client/types/scenarios/scorer_update_response.py +18 -0
- runloop_api_client/types/scenarios/scorer_validate_params.py +17 -0
- runloop_api_client/types/scenarios/scorer_validate_response.py +23 -0
- runloop_api_client/types/scoring_contract.py +17 -0
- runloop_api_client/types/scoring_contract_param.py +19 -0
- runloop_api_client/types/scoring_contract_result_view.py +20 -0
- runloop_api_client/types/scoring_contract_update_param.py +15 -0
- runloop_api_client/types/scoring_function.py +157 -0
- runloop_api_client/types/scoring_function_param.py +153 -0
- runloop_api_client/types/scoring_function_result_view.py +25 -0
- runloop_api_client/types/secret_create_params.py +23 -0
- runloop_api_client/types/secret_list_params.py +12 -0
- runloop_api_client/types/secret_list_view.py +24 -0
- runloop_api_client/types/secret_update_params.py +16 -0
- runloop_api_client/types/secret_view.py +26 -0
- runloop_api_client/types/shared/__init__.py +10 -0
- runloop_api_client/types/shared/after_idle.py +15 -0
- runloop_api_client/types/shared/agent_mount.py +31 -0
- runloop_api_client/types/shared/agent_source.py +75 -0
- runloop_api_client/types/shared/code_mount_parameters.py +24 -0
- runloop_api_client/types/shared/launch_parameters.py +86 -0
- runloop_api_client/types/shared/mount.py +43 -0
- runloop_api_client/types/shared/object_mount.py +21 -0
- runloop_api_client/types/shared/run_profile.py +37 -0
- runloop_api_client/types/shared_params/__init__.py +10 -0
- runloop_api_client/types/shared_params/after_idle.py +15 -0
- runloop_api_client/types/shared_params/agent_mount.py +31 -0
- runloop_api_client/types/shared_params/agent_source.py +78 -0
- runloop_api_client/types/shared_params/code_mount_parameters.py +25 -0
- runloop_api_client/types/shared_params/launch_parameters.py +88 -0
- runloop_api_client/types/shared_params/mount.py +43 -0
- runloop_api_client/types/shared_params/object_mount.py +21 -0
- runloop_api_client/types/shared_params/run_profile.py +38 -0
- runloop_api_client/types/tunnel_view.py +34 -0
- runloop_api_client-1.5.1.dist-info/METADATA +522 -0
- runloop_api_client-1.5.1.dist-info/RECORD +261 -0
- runloop_api_client-1.5.1.dist-info/WHEEL +4 -0
- runloop_api_client-1.5.1.dist-info/licenses/LICENSE +7 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Optional
|
|
6
|
+
from typing_extensions import Literal, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
from .input_context_update_param import InputContextUpdateParam
|
|
10
|
+
from .scenario_environment_param import ScenarioEnvironmentParam
|
|
11
|
+
from .scoring_contract_update_param import ScoringContractUpdateParam
|
|
12
|
+
|
|
13
|
+
__all__ = ["ScenarioUpdateParams"]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ScenarioUpdateParams(TypedDict, total=False):
|
|
17
|
+
environment_parameters: Optional[ScenarioEnvironmentParam]
|
|
18
|
+
"""The Environment in which the Scenario will run."""
|
|
19
|
+
|
|
20
|
+
input_context: Optional[InputContextUpdateParam]
|
|
21
|
+
"""The input context for the Scenario."""
|
|
22
|
+
|
|
23
|
+
metadata: Optional[Dict[str, str]]
|
|
24
|
+
"""User defined metadata to attach to the scenario. Pass in empty map to clear."""
|
|
25
|
+
|
|
26
|
+
name: Optional[str]
|
|
27
|
+
"""Name of the scenario. Cannot be blank."""
|
|
28
|
+
|
|
29
|
+
reference_output: Optional[str]
|
|
30
|
+
"""A string representation of the reference output to solve the scenario.
|
|
31
|
+
|
|
32
|
+
Commonly can be the result of a git diff or a sequence of command actions to
|
|
33
|
+
apply to the environment. Pass in empty string to clear.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
required_environment_variables: Optional[SequenceNotStr[str]]
|
|
37
|
+
"""Environment variables required to run the scenario.
|
|
38
|
+
|
|
39
|
+
Pass in empty list to clear.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
required_secret_names: Optional[SequenceNotStr[str]]
|
|
43
|
+
"""Secrets required to run the scenario. Pass in empty list to clear."""
|
|
44
|
+
|
|
45
|
+
scoring_contract: Optional[ScoringContractUpdateParam]
|
|
46
|
+
"""The scoring contract for the Scenario."""
|
|
47
|
+
|
|
48
|
+
validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]]
|
|
49
|
+
"""Validation strategy. Pass in empty string to clear."""
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
from .input_context import InputContext
|
|
8
|
+
from .scoring_contract import ScoringContract
|
|
9
|
+
from .scenario_environment import ScenarioEnvironment
|
|
10
|
+
|
|
11
|
+
__all__ = ["ScenarioView"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ScenarioView(BaseModel):
|
|
15
|
+
"""
|
|
16
|
+
A ScenarioDefinitionView represents a repeatable AI coding evaluation test, complete with initial environment and scoring contract.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
id: str
|
|
20
|
+
"""The ID of the Scenario."""
|
|
21
|
+
|
|
22
|
+
input_context: InputContext
|
|
23
|
+
"""The input context for the Scenario."""
|
|
24
|
+
|
|
25
|
+
metadata: Dict[str, str]
|
|
26
|
+
"""User defined metadata to attach to the scenario for organization."""
|
|
27
|
+
|
|
28
|
+
name: str
|
|
29
|
+
"""The name of the Scenario."""
|
|
30
|
+
|
|
31
|
+
scoring_contract: ScoringContract
|
|
32
|
+
"""The scoring contract for the Scenario."""
|
|
33
|
+
|
|
34
|
+
environment: Optional[ScenarioEnvironment] = None
|
|
35
|
+
"""The Environment in which the Scenario is run."""
|
|
36
|
+
|
|
37
|
+
is_public: Optional[bool] = None
|
|
38
|
+
"""Whether this scenario is public."""
|
|
39
|
+
|
|
40
|
+
reference_output: Optional[str] = None
|
|
41
|
+
"""A string representation of the reference output to solve the scenario.
|
|
42
|
+
|
|
43
|
+
Commonly can be the result of a git diff or a sequence of command actions to
|
|
44
|
+
apply to the environment.
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
required_environment_variables: Optional[List[str]] = None
|
|
48
|
+
"""Environment variables required to run the scenario.
|
|
49
|
+
|
|
50
|
+
If any required environment variables are missing, the scenario will fail to
|
|
51
|
+
start.
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
required_secret_names: Optional[List[str]] = None
|
|
55
|
+
"""Environment variables required to run the scenario.
|
|
56
|
+
|
|
57
|
+
If any required secrets are missing, the scenario will fail to start.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] = None
|
|
61
|
+
"""Validation strategy."""
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .run_list_params import RunListParams as RunListParams
|
|
6
|
+
from .scorer_list_params import ScorerListParams as ScorerListParams
|
|
7
|
+
from .scorer_create_params import ScorerCreateParams as ScorerCreateParams
|
|
8
|
+
from .scorer_list_response import ScorerListResponse as ScorerListResponse
|
|
9
|
+
from .scorer_update_params import ScorerUpdateParams as ScorerUpdateParams
|
|
10
|
+
from .scorer_create_response import ScorerCreateResponse as ScorerCreateResponse
|
|
11
|
+
from .scorer_update_response import ScorerUpdateResponse as ScorerUpdateResponse
|
|
12
|
+
from .scorer_validate_params import ScorerValidateParams as ScorerValidateParams
|
|
13
|
+
from .scorer_retrieve_response import ScorerRetrieveResponse as ScorerRetrieveResponse
|
|
14
|
+
from .scorer_validate_response import ScorerValidateResponse as ScorerValidateResponse
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import TypedDict
|
|
6
|
+
|
|
7
|
+
__all__ = ["RunListParams"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class RunListParams(TypedDict, total=False):
|
|
11
|
+
benchmark_run_id: str
|
|
12
|
+
"""Filter by benchmark run ID"""
|
|
13
|
+
|
|
14
|
+
limit: int
|
|
15
|
+
"""The limit of items to return. Default is 20. Max is 5000."""
|
|
16
|
+
|
|
17
|
+
name: str
|
|
18
|
+
"""Filter by name"""
|
|
19
|
+
|
|
20
|
+
scenario_id: str
|
|
21
|
+
"""Filter runs associated to Scenario given ID"""
|
|
22
|
+
|
|
23
|
+
starting_after: str
|
|
24
|
+
"""Load the next page of data starting after the item with the given ID."""
|
|
25
|
+
|
|
26
|
+
state: str
|
|
27
|
+
"""Filter by state"""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Required, TypedDict
|
|
6
|
+
|
|
7
|
+
__all__ = ["ScorerCreateParams"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ScorerCreateParams(TypedDict, total=False):
|
|
11
|
+
bash_script: Required[str]
|
|
12
|
+
"""
|
|
13
|
+
Bash script for the custom scorer taking context as a json object
|
|
14
|
+
$RL_SCORER_CONTEXT.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
type: Required[str]
|
|
18
|
+
"""Name of the type of custom scorer."""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from ..._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["ScorerCreateResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ScorerCreateResponse(BaseModel):
|
|
9
|
+
"""A ScenarioScorerView represents a custom scoring function for a Scenario."""
|
|
10
|
+
|
|
11
|
+
id: str
|
|
12
|
+
"""ID for the scenario scorer."""
|
|
13
|
+
|
|
14
|
+
bash_script: str
|
|
15
|
+
"""Bash script that takes in $RL_SCORER_CONTEXT as env variable and runs scoring."""
|
|
16
|
+
|
|
17
|
+
type: str
|
|
18
|
+
"""Name of the type of scenario scorer."""
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import TypedDict
|
|
6
|
+
|
|
7
|
+
__all__ = ["ScorerListParams"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ScorerListParams(TypedDict, total=False):
|
|
11
|
+
limit: int
|
|
12
|
+
"""The limit of items to return. Default is 20. Max is 5000."""
|
|
13
|
+
|
|
14
|
+
starting_after: str
|
|
15
|
+
"""Load the next page of data starting after the item with the given ID."""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from ..._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["ScorerListResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ScorerListResponse(BaseModel):
|
|
9
|
+
"""A ScenarioScorerView represents a custom scoring function for a Scenario."""
|
|
10
|
+
|
|
11
|
+
id: str
|
|
12
|
+
"""ID for the scenario scorer."""
|
|
13
|
+
|
|
14
|
+
bash_script: str
|
|
15
|
+
"""Bash script that takes in $RL_SCORER_CONTEXT as env variable and runs scoring."""
|
|
16
|
+
|
|
17
|
+
type: str
|
|
18
|
+
"""Name of the type of scenario scorer."""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from ..._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["ScorerRetrieveResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ScorerRetrieveResponse(BaseModel):
|
|
9
|
+
"""A ScenarioScorerView represents a custom scoring function for a Scenario."""
|
|
10
|
+
|
|
11
|
+
id: str
|
|
12
|
+
"""ID for the scenario scorer."""
|
|
13
|
+
|
|
14
|
+
bash_script: str
|
|
15
|
+
"""Bash script that takes in $RL_SCORER_CONTEXT as env variable and runs scoring."""
|
|
16
|
+
|
|
17
|
+
type: str
|
|
18
|
+
"""Name of the type of scenario scorer."""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Required, TypedDict
|
|
6
|
+
|
|
7
|
+
__all__ = ["ScorerUpdateParams"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ScorerUpdateParams(TypedDict, total=False):
|
|
11
|
+
bash_script: Required[str]
|
|
12
|
+
"""
|
|
13
|
+
Bash script for the custom scorer taking context as a json object
|
|
14
|
+
$RL_SCORER_CONTEXT.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
type: Required[str]
|
|
18
|
+
"""Name of the type of custom scorer."""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from ..._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["ScorerUpdateResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ScorerUpdateResponse(BaseModel):
|
|
9
|
+
"""A ScenarioScorerView represents a custom scoring function for a Scenario."""
|
|
10
|
+
|
|
11
|
+
id: str
|
|
12
|
+
"""ID for the scenario scorer."""
|
|
13
|
+
|
|
14
|
+
bash_script: str
|
|
15
|
+
"""Bash script that takes in $RL_SCORER_CONTEXT as env variable and runs scoring."""
|
|
16
|
+
|
|
17
|
+
type: str
|
|
18
|
+
"""Name of the type of scenario scorer."""
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Required, TypedDict
|
|
6
|
+
|
|
7
|
+
from ..scenario_environment_param import ScenarioEnvironmentParam
|
|
8
|
+
|
|
9
|
+
__all__ = ["ScorerValidateParams"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ScorerValidateParams(TypedDict, total=False):
|
|
13
|
+
scoring_context: Required[object]
|
|
14
|
+
"""Json context that gets passed to the custom scorer"""
|
|
15
|
+
|
|
16
|
+
environment_parameters: ScenarioEnvironmentParam
|
|
17
|
+
"""The Environment in which the Scenario will run."""
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from ..._models import BaseModel
|
|
6
|
+
from ..scenario_environment import ScenarioEnvironment
|
|
7
|
+
from ..scoring_function_result_view import ScoringFunctionResultView
|
|
8
|
+
|
|
9
|
+
__all__ = ["ScorerValidateResponse"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ScorerValidateResponse(BaseModel):
|
|
13
|
+
name: str
|
|
14
|
+
"""Name of the custom scorer."""
|
|
15
|
+
|
|
16
|
+
scoring_context: object
|
|
17
|
+
"""Json context that gets passed to the custom scorer"""
|
|
18
|
+
|
|
19
|
+
scoring_result: ScoringFunctionResultView
|
|
20
|
+
"""Result of the scoring function."""
|
|
21
|
+
|
|
22
|
+
environment_parameters: Optional[ScenarioEnvironment] = None
|
|
23
|
+
"""The Environment in which the Scenario will run."""
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
from .scoring_function import ScoringFunction
|
|
7
|
+
|
|
8
|
+
__all__ = ["ScoringContract"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ScoringContract(BaseModel):
|
|
12
|
+
"""
|
|
13
|
+
InputContextView specifies the problem statement along with all additional context for a Scenario.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
scoring_function_parameters: List[ScoringFunction]
|
|
17
|
+
"""A list of scoring functions used to evaluate the Scenario."""
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Iterable
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
from .scoring_function_param import ScoringFunctionParam
|
|
9
|
+
|
|
10
|
+
__all__ = ["ScoringContractParam"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ScoringContractParam(TypedDict, total=False):
|
|
14
|
+
"""
|
|
15
|
+
InputContextView specifies the problem statement along with all additional context for a Scenario.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
scoring_function_parameters: Required[Iterable[ScoringFunctionParam]]
|
|
19
|
+
"""A list of scoring functions used to evaluate the Scenario."""
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
from .scoring_function_result_view import ScoringFunctionResultView
|
|
7
|
+
|
|
8
|
+
__all__ = ["ScoringContractResultView"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ScoringContractResultView(BaseModel):
|
|
12
|
+
"""
|
|
13
|
+
A ScoringContractResultView represents the result of running all scoring functions on a given input context.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
score: float
|
|
17
|
+
"""Total score for all scoring contracts. This will be a value between 0 and 1."""
|
|
18
|
+
|
|
19
|
+
scoring_function_results: List[ScoringFunctionResultView]
|
|
20
|
+
"""List of all individual scoring function results."""
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Iterable, Optional
|
|
6
|
+
from typing_extensions import TypedDict
|
|
7
|
+
|
|
8
|
+
from .scoring_function_param import ScoringFunctionParam
|
|
9
|
+
|
|
10
|
+
__all__ = ["ScoringContractUpdateParam"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ScoringContractUpdateParam(TypedDict, total=False):
|
|
14
|
+
scoring_function_parameters: Optional[Iterable[ScoringFunctionParam]]
|
|
15
|
+
"""A list of scoring functions used to evaluate the Scenario."""
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Union, Optional
|
|
4
|
+
from typing_extensions import Literal, Annotated, TypeAlias
|
|
5
|
+
|
|
6
|
+
from .._utils import PropertyInfo
|
|
7
|
+
from .._models import BaseModel
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"ScoringFunction",
|
|
11
|
+
"Scorer",
|
|
12
|
+
"ScorerAstGrepScoringFunction",
|
|
13
|
+
"ScorerBashScriptScoringFunction",
|
|
14
|
+
"ScorerCommandScoringFunction",
|
|
15
|
+
"ScorerCustomScoringFunction",
|
|
16
|
+
"ScorerPythonScriptScoringFunction",
|
|
17
|
+
"ScorerTestBasedScoringFunction",
|
|
18
|
+
"ScorerTestBasedScoringFunctionTestFile",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ScorerAstGrepScoringFunction(BaseModel):
|
|
23
|
+
"""AstGrepScoringFunction utilizes structured coach search for scoring."""
|
|
24
|
+
|
|
25
|
+
pattern: str
|
|
26
|
+
"""AST pattern to match.
|
|
27
|
+
|
|
28
|
+
Pattern will be passed to ast-grep using the commandline surround by double
|
|
29
|
+
quotes ("), so make sure to use proper escaping (for example, \\$$\\$$\\$$).
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
search_directory: str
|
|
33
|
+
"""The path to search."""
|
|
34
|
+
|
|
35
|
+
type: Literal["ast_grep_scorer"]
|
|
36
|
+
|
|
37
|
+
lang: Optional[str] = None
|
|
38
|
+
"""The language of the pattern."""
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class ScorerBashScriptScoringFunction(BaseModel):
|
|
42
|
+
"""
|
|
43
|
+
BashScriptScoringFunction is a scoring function specified by a bash script that will be run in the context of your environment.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
type: Literal["bash_script_scorer"]
|
|
47
|
+
|
|
48
|
+
bash_script: Optional[str] = None
|
|
49
|
+
"""
|
|
50
|
+
A single bash script that sets up the environment, scores, and prints the final
|
|
51
|
+
score to standard out. Score should be a float between 0.0 and 1.0, and look
|
|
52
|
+
like "score=[0.0..1.0].
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class ScorerCommandScoringFunction(BaseModel):
|
|
57
|
+
"""
|
|
58
|
+
CommandScoringFunction executes a single command and checks the result.The output of the command will be printed. Scoring will passed if the command returns status code 0, otherwise it will be failed.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
type: Literal["command_scorer"]
|
|
62
|
+
|
|
63
|
+
command: Optional[str] = None
|
|
64
|
+
"""The command to execute."""
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class ScorerCustomScoringFunction(BaseModel):
|
|
68
|
+
"""CustomScoringFunction is a custom, user defined scoring function."""
|
|
69
|
+
|
|
70
|
+
custom_scorer_type: str
|
|
71
|
+
"""Type of the scoring function, previously registered with Runloop."""
|
|
72
|
+
|
|
73
|
+
type: Literal["custom_scorer"]
|
|
74
|
+
|
|
75
|
+
scorer_params: Optional[object] = None
|
|
76
|
+
"""Additional JSON structured context to pass to the scoring function."""
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class ScorerPythonScriptScoringFunction(BaseModel):
|
|
80
|
+
"""
|
|
81
|
+
PythonScriptScoringFunction will run a python script in the context of your environment as a ScoringFunction.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
python_script: str
|
|
85
|
+
"""Python script to be run.
|
|
86
|
+
|
|
87
|
+
The script should output the score to standard out as a float between 0.0 and
|
|
88
|
+
1.0.
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
type: Literal["python_script_scorer"]
|
|
92
|
+
|
|
93
|
+
python_version_constraint: Optional[str] = None
|
|
94
|
+
"""Python version to run scoring. Default is "==3.12.10" """
|
|
95
|
+
|
|
96
|
+
requirements_contents: Optional[str] = None
|
|
97
|
+
"""Package dependencies to be installed.
|
|
98
|
+
|
|
99
|
+
The requirements should be a valid requirements.txt file.
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class ScorerTestBasedScoringFunctionTestFile(BaseModel):
|
|
104
|
+
file_contents: Optional[str] = None
|
|
105
|
+
"""Content of the test file"""
|
|
106
|
+
|
|
107
|
+
file_path: Optional[str] = None
|
|
108
|
+
"""
|
|
109
|
+
Path to write content of the test file, relative to your environment's working
|
|
110
|
+
directory
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class ScorerTestBasedScoringFunction(BaseModel):
|
|
115
|
+
"""
|
|
116
|
+
TestBasedScoringFunction writes test files to disk and executes a test command to verify the solution.
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
type: Literal["test_based_scorer"]
|
|
120
|
+
|
|
121
|
+
test_command: Optional[str] = None
|
|
122
|
+
"""The command to execute for running the tests"""
|
|
123
|
+
|
|
124
|
+
test_files: Optional[List[ScorerTestBasedScoringFunctionTestFile]] = None
|
|
125
|
+
"""List of test files to create"""
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
Scorer: TypeAlias = Annotated[
|
|
129
|
+
Union[
|
|
130
|
+
ScorerAstGrepScoringFunction,
|
|
131
|
+
ScorerBashScriptScoringFunction,
|
|
132
|
+
ScorerCommandScoringFunction,
|
|
133
|
+
ScorerCustomScoringFunction,
|
|
134
|
+
ScorerPythonScriptScoringFunction,
|
|
135
|
+
ScorerTestBasedScoringFunction,
|
|
136
|
+
],
|
|
137
|
+
PropertyInfo(discriminator="type"),
|
|
138
|
+
]
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class ScoringFunction(BaseModel):
|
|
142
|
+
"""ScoringFunction specifies a method of scoring a Scenario."""
|
|
143
|
+
|
|
144
|
+
name: str
|
|
145
|
+
"""Name of scoring function. Names must only contain ``[a-zA-Z0-9_-]``."""
|
|
146
|
+
|
|
147
|
+
scorer: Scorer
|
|
148
|
+
"""The scoring function to use for evaluating this scenario.
|
|
149
|
+
|
|
150
|
+
The type field determines which built-in function to use.
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
weight: float
|
|
154
|
+
"""Weight to apply to scoring function score.
|
|
155
|
+
|
|
156
|
+
Weights of all scoring functions should sum to 1.0.
|
|
157
|
+
"""
|