plato-sdk-v2 2.0.23__tar.gz
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.
- plato_sdk_v2-2.0.23/.gitignore +23 -0
- plato_sdk_v2-2.0.23/BUILDING_SIMS.md +70 -0
- plato_sdk_v2-2.0.23/PKG-INFO +234 -0
- plato_sdk_v2-2.0.23/README.md +190 -0
- plato_sdk_v2-2.0.23/plato/__init__.py +44 -0
- plato_sdk_v2-2.0.23/plato/_generated/__init__.py +37 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/__init__.py +8 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/__init__.py +31 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/agent_artifacts/__init__.py +10 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/agent_artifacts/archive_agent_artifact.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/agent_artifacts/create_agent_artifact.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/agent_artifacts/get_agent_artifact_by_public_id.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/agent_artifacts/get_agent_artifacts.py +63 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/cluster/__init__.py +21 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/cluster/cleanup_stale_vms.py +87 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/cluster/get_dispatchers.py +50 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/cluster/get_nodes_status.py +62 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/cluster/get_snapshot_lineage.py +78 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/cluster/get_snapshots_status.py +62 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/cluster/pause_resume_dispatchers.py +93 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/cluster/prefetch_snapshot.py +104 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/__init__.py +67 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/backup.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/cleanup.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/close.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/close_async.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/create.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/create_batch.py +78 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/create_simulator.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/evaluate_session.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/generate_mutations.py +53 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/generate_mutations_single.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_active_session.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_app_sim_worker_info.py +52 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_cdp_url.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_flows.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_interface_worker_info.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_job_info.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_job_status.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_job_worker_info.py +52 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_proxy_url.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_public_url.py +99 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_simulator_by_name.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_simulators.py +64 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_state.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/get_worker_ready.py +87 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/log_state_mutation.py +64 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/rescore_simulator_sessions.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/reset.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/score.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/send_heartbeat.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/env/update_simulator.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/evals/__init__.py +21 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/evals/create_test_case_review.py +72 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/evals/evaluate_python.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/evals/get_scores_by_user.py +101 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/evals/get_scoring.py +51 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/evals/get_test_case_review.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/evals/human_in_the_loop_scoring.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/evals/start_eval_from_git.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/__init__.py +35 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/create_gitea_repository.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/create_simulator_repository.py +76 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/delete_gitea_repository.py +74 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/get_accessible_simulators.py +71 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/get_gitea_credentials.py +64 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/get_gitea_repository.py +74 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/get_my_gitea_info.py +64 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/get_my_repositories.py +64 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/get_repository_branches.py +73 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/get_repository_contents.py +90 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/get_simulator_file_content.py +93 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/get_simulator_repository.py +76 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/get_simulator_repository_branches.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/gitea/get_simulator_repository_contents.py +92 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/jobs/__init__.py +11 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/jobs/get_job_by_id.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/jobs/get_jobs_by_group_id.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/jobs/get_keepalive_jobs.py +63 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/jobs/list_jobs.py +109 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/jobs/update_job_status.py +77 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/__init__.py +33 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/create_annotator_assignment.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/create_org_api_key.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/create_org_policy.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/delete_org_api_key.py +73 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/delete_org_policy.py +73 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/get_annotator_assignments.py +74 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/get_org_api_key_policies.py +74 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/get_org_api_keys.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/get_org_policies.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/get_organization_concurrency_status.py +85 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/get_organization_members.py +63 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/update_annotator_assignment_stage.py +81 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/organization/update_organization_concurrency_limit.py +89 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/queue/__init__.py +10 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/queue/get_queue_status.py +56 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/queue/get_vm_detail.py +83 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/queue/get_vms.py +96 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/queue/get_workers.py +87 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/sandbox/__init__.py +29 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/sandbox/checkpoint_vm.py +90 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/sandbox/close_vm.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/sandbox/create_vm.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/sandbox/execute_ssh_command.py +81 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/sandbox/get_operation_events.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/sandbox/healthy_services.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/sandbox/healthy_worker.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/sandbox/save_vm_snapshot.py +88 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/sandbox/setup_root_access.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/sandbox/setup_sandbox.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/sandbox/start_worker.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/__init__.py +59 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/analyze_labels.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/archive_session.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/archive_session_logs_endpoint.py +73 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/create_from_labels.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/create_session_from_browser.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/create_session_from_env_recording.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/create_session_from_har.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_env_recording.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_grouped_replay_sessions.py +63 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_logs_status.py +73 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_network_requests.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_next_session_for_annotator.py +73 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_public_benchmark_sessions.py +72 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_replay_score_data.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_rrweb_actions.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_rrweb_events.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_screen_recording.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_session.py +78 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_session_replays.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_sessions.py +63 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/get_ui_events.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/restore_session_logs.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/score_session_with_config.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/search_sessions_by_ids.py +73 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/update_session_public.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/session/update_session_testcase.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/__init__.py +53 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/add_simulator_review.py +81 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/batch_create_test_cases.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/batch_get_artifact_metadata.py +53 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_all_simulators_info.py +74 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_db_config.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_env_flows.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_plato_config.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_sessions_batch_by_job_groups.py +81 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_sessions_by_job_group.py +86 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_simulator_by_name.py +82 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_simulator_id.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_simulator_info.py +67 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_simulator_version_details.py +62 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_simulator_versions.py +79 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_start_path.py +82 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/get_version_by_tag.py +55 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/list_simulators.py +64 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/list_simulators_by_org.py +64 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/list_simulators_status.py +64 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/register.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/update_simulator.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/update_simulator_status.py +85 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/simulator/update_tag.py +72 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/__init__.py +61 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/archive_organization_test_case_assignments.py +72 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/archive_organization_testcase.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/archive_testcase.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/assign_testcase_to_organizations.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/bulk_archive_testcases.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/convert_text_to_structured_data.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/create_testcase.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/create_testcase_set.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/delete_testcase_set.py +51 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/filter_human_recorder_testcases.py +101 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/generate_outcome_schema.py +53 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/generate_prediction.py +53 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/generate_prediction_from_steps.py +53 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/generate_scoring_config_from_sessions.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/generate_state_mutations_config_route.py +51 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/get_human_recorder_tab_counts.py +94 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/get_human_recorder_testcases.py +101 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/get_merged_mutations.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/get_next_output_testcase_for_scoring.py +79 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/get_organization_test_case_assignments.py +96 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/get_testcase.py +51 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/get_testcase_sets.py +63 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/get_testcases.py +171 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/get_testcases_in_set.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/mark_organization_test_case_completed.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/update_testcase.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v1/testcases/version_bump_testcase.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/__init__.py +11 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/chronos_packages/__init__.py +17 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/chronos_packages/get_package_versions.py +89 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/chronos_packages/list_chronos_packages.py +76 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/chronos_packages/lookup_package_version.py +96 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/chronos_packages/register_chronos_package.py +102 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/chronos_packages/upload_chronos_package.py +112 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/interfaces/__init__.py +27 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/interfaces/v2_interface_browser_create.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/interfaces/v2_interface_cdp_url.py +65 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/interfaces/v2_interface_click.py +64 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/interfaces/v2_interface_close.py +59 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/interfaces/v2_interface_computer_create.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/interfaces/v2_interface_cursor.py +64 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/interfaces/v2_interface_key.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/interfaces/v2_interface_screenshot.py +65 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/interfaces/v2_interface_scroll.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/interfaces/v2_interface_type.py +64 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/__init__.py +33 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/close.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/connect_routing_info.py +74 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/connect_url.py +105 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/execute.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/get_flows.py +95 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/get_plato_config.py +95 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/make.py +78 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/public_url.py +107 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/reset.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/set_date.py +89 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/snapshot.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/state.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/jobs/wait_for_ready.py +105 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/pypi/__init__.py +10 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/pypi/download_package.py +66 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/pypi/package_index.py +62 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/pypi/simple_index.py +55 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/pypi/upload_package.py +57 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/releases/__init__.py +12 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/releases/create.py +70 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/releases/deploy.py +82 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/releases/get.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/releases/handle_import.py +61 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/releases/list_releases.py +81 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/releases/update.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/__init__.py +55 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/checkpoint.py +87 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/close.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/evaluate.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/execute.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/get_connect_url.py +99 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/get_presigned_url.py +80 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/get_public_url.py +101 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/get_s3_content.py +80 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/get_session_details.py +68 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/get_session_documents.py +73 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/get_session_flows.py +93 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/get_session_logs.py +83 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/get_session_plato_config.py +93 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/heartbeat.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/list_jobs.py +69 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/list_sessions.py +80 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/log_job_mutation.py +108 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/make.py +78 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/reset.py +75 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/set_date.py +89 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/snapshot.py +78 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/state.py +87 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/upload_session_documents.py +115 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/v2/sessions/wait_for_ready.py +107 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/version/__init__.py +7 -0
- plato_sdk_v2-2.0.23/plato/_generated/api/version/check.py +43 -0
- plato_sdk_v2-2.0.23/plato/_generated/client.py +171 -0
- plato_sdk_v2-2.0.23/plato/_generated/errors.py +141 -0
- plato_sdk_v2-2.0.23/plato/_generated/models/__init__.py +4205 -0
- plato_sdk_v2-2.0.23/plato/_generated/py.typed +0 -0
- plato_sdk_v2-2.0.23/plato/_sims_generator/__init__.py +43 -0
- plato_sdk_v2-2.0.23/plato/_sims_generator/cli.py +83 -0
- plato_sdk_v2-2.0.23/plato/_sims_generator/parser.py +978 -0
- plato_sdk_v2-2.0.23/plato/_sims_generator/python.py +496 -0
- plato_sdk_v2-2.0.23/plato/_sims_generator/templates/python/api_init.py.jinja +11 -0
- plato_sdk_v2-2.0.23/plato/_sims_generator/templates/python/client.py.jinja +578 -0
- plato_sdk_v2-2.0.23/plato/_sims_generator/templates/python/endpoint.py.jinja +359 -0
- plato_sdk_v2-2.0.23/plato/_sims_generator/templates/python/errors.py.jinja +141 -0
- plato_sdk_v2-2.0.23/plato/_sims_generator/templates/python/package_init.py.jinja +37 -0
- plato_sdk_v2-2.0.23/plato/_sims_generator/templates/python/tag_init.py.jinja +11 -0
- plato_sdk_v2-2.0.23/plato/_sims_generator/templates/python/version_init.py.jinja +11 -0
- plato_sdk_v2-2.0.23/plato/py.typed +0 -0
- plato_sdk_v2-2.0.23/plato/sims/README.md +283 -0
- plato_sdk_v2-2.0.23/plato/sims/__init__.py +47 -0
- plato_sdk_v2-2.0.23/plato/sims/agent_helpers.py +291 -0
- plato_sdk_v2-2.0.23/plato/sims/cli.py +1496 -0
- plato_sdk_v2-2.0.23/plato/sims/generate_clients.py +200 -0
- plato_sdk_v2-2.0.23/plato/sims/registry.py +221 -0
- plato_sdk_v2-2.0.23/plato/v1/__init__.py +6 -0
- plato_sdk_v2-2.0.23/plato/v1/audit_ui.py +281 -0
- plato_sdk_v2-2.0.23/plato/v1/cli.py +1384 -0
- plato_sdk_v2-2.0.23/plato/v1/config.py +25 -0
- plato_sdk_v2-2.0.23/plato/v1/examples/doordash_tasks.py +540 -0
- plato_sdk_v2-2.0.23/plato/v1/examples/loadtest.py +160 -0
- plato_sdk_v2-2.0.23/plato/v1/examples/test_env.py +128 -0
- plato_sdk_v2-2.0.23/plato/v1/examples/test_env_custom_browser.py +103 -0
- plato_sdk_v2-2.0.23/plato/v1/examples/test_env_sync.py +80 -0
- plato_sdk_v2-2.0.23/plato/v1/examples/test_reuse_env.py +0 -0
- plato_sdk_v2-2.0.23/plato/v1/examples/test_run.py +0 -0
- plato_sdk_v2-2.0.23/plato/v1/exceptions.py +4 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/README.md +223 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/api-client.js +158 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/background.js +1044 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/build-sdk.js +17 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/content.js +446 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/manifest.json +51 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/offscreen.html +10 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/offscreen.js +205 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/options.html +204 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/options.js +101 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/package-lock.json +496 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/package.json +5 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/plato-sdk-bundle.js +7036 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/plato-sdk-bundle.js.map +7 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/popup.html +228 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/popup.js +324 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/review-panel.html +63 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/review-panel.js +216 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/review-success.html +49 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/review-success.js +58 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/session-active.html +63 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/session-active.js +487 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/session-ended.html +54 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/session-ended.js +61 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/session-setup.html +54 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/session-setup.js +101 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/sessions.html +270 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/sessions.js +444 -0
- plato_sdk_v2-2.0.23/plato/v1/extensions/envgen-recorder/styles.css +374 -0
- plato_sdk_v2-2.0.23/plato/v1/flow_executor.py +459 -0
- plato_sdk_v2-2.0.23/plato/v1/models/__init__.py +37 -0
- plato_sdk_v2-2.0.23/plato/v1/models/build_models.py +245 -0
- plato_sdk_v2-2.0.23/plato/v1/models/env.py +775 -0
- plato_sdk_v2-2.0.23/plato/v1/models/flow.py +195 -0
- plato_sdk_v2-2.0.23/plato/v1/models/sandbox.py +143 -0
- plato_sdk_v2-2.0.23/plato/v1/models/task.py +145 -0
- plato_sdk_v2-2.0.23/plato/v1/sandbox_sdk.py +1092 -0
- plato_sdk_v2-2.0.23/plato/v1/sdk.py +852 -0
- plato_sdk_v2-2.0.23/plato/v1/sync_env.py +604 -0
- plato_sdk_v2-2.0.23/plato/v1/sync_flow_executor.py +453 -0
- plato_sdk_v2-2.0.23/plato/v1/sync_sdk.py +689 -0
- plato_sdk_v2-2.0.23/plato/v1/utils/proxytunnel.py +152 -0
- plato_sdk_v2-2.0.23/plato/v2/__init__.py +59 -0
- plato_sdk_v2-2.0.23/plato/v2/async_/__init__.py +15 -0
- plato_sdk_v2-2.0.23/plato/v2/async_/client.py +130 -0
- plato_sdk_v2-2.0.23/plato/v2/async_/environment.py +146 -0
- plato_sdk_v2-2.0.23/plato/v2/async_/flow_executor.py +353 -0
- plato_sdk_v2-2.0.23/plato/v2/async_/session.py +942 -0
- plato_sdk_v2-2.0.23/plato/v2/models.py +65 -0
- plato_sdk_v2-2.0.23/plato/v2/sync/__init__.py +11 -0
- plato_sdk_v2-2.0.23/plato/v2/sync/client.py +127 -0
- plato_sdk_v2-2.0.23/plato/v2/sync/environment.py +146 -0
- plato_sdk_v2-2.0.23/plato/v2/sync/flow_executor.py +353 -0
- plato_sdk_v2-2.0.23/plato/v2/sync/session.py +709 -0
- plato_sdk_v2-2.0.23/plato/v2/types.py +127 -0
- plato_sdk_v2-2.0.23/plato/v2/utils/__init__.py +1 -0
- plato_sdk_v2-2.0.23/plato/v2/utils/db_cleanup.py +226 -0
- plato_sdk_v2-2.0.23/plato/v2/utils/models.py +54 -0
- plato_sdk_v2-2.0.23/plato/v2/utils/proxy_tunnel.py +301 -0
- plato_sdk_v2-2.0.23/pyproject.toml +91 -0
- plato_sdk_v2-2.0.23/tests/__init__.py +1 -0
- plato_sdk_v2-2.0.23/tests/integration/test_cleanup_snapshot.py +143 -0
- plato_sdk_v2-2.0.23/tests/sims/__init__.py +1 -0
- plato_sdk_v2-2.0.23/tests/sims/conftest.py +13 -0
- plato_sdk_v2-2.0.23/tests/sims/test_agent_helpers.py +116 -0
- plato_sdk_v2-2.0.23/tests/test_heartbeat_keepalive.py +205 -0
- plato_sdk_v2-2.0.23/tests/test_set_date.py +149 -0
- plato_sdk_v2-2.0.23/tests/test_v2_multisim_integration.py +229 -0
- plato_sdk_v2-2.0.23/tests/test_v2_session.py +50 -0
- plato_sdk_v2-2.0.23/uv.lock +2138 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
build/
|
|
3
|
+
dist/
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
|
|
7
|
+
# pyenv
|
|
8
|
+
.python-version
|
|
9
|
+
|
|
10
|
+
# Environments
|
|
11
|
+
.env
|
|
12
|
+
.venv
|
|
13
|
+
|
|
14
|
+
# mypy
|
|
15
|
+
.mypy_cache/
|
|
16
|
+
.dmypy.json
|
|
17
|
+
dmypy.json
|
|
18
|
+
|
|
19
|
+
# JetBrains
|
|
20
|
+
.idea/
|
|
21
|
+
|
|
22
|
+
/coverage.xml
|
|
23
|
+
/.coverage
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Building Simulators
|
|
2
|
+
|
|
3
|
+
Internal documentation for building and snapshotting simulators.
|
|
4
|
+
|
|
5
|
+
## Snapshot Environments
|
|
6
|
+
|
|
7
|
+
Create snapshots of environment state:
|
|
8
|
+
|
|
9
|
+
```python
|
|
10
|
+
from plato.v2 import AsyncPlato, Env
|
|
11
|
+
|
|
12
|
+
async def main():
|
|
13
|
+
plato = AsyncPlato()
|
|
14
|
+
|
|
15
|
+
session = await plato.sessions.create(
|
|
16
|
+
envs=[Env.simulator("gitea", alias="gitea")],
|
|
17
|
+
timeout=600,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
await session.start_heartbeat()
|
|
21
|
+
|
|
22
|
+
# ... make changes to the environment ...
|
|
23
|
+
|
|
24
|
+
# Snapshot all environments
|
|
25
|
+
snapshots = await session.snapshot()
|
|
26
|
+
print(snapshots)
|
|
27
|
+
|
|
28
|
+
# Or snapshot individual environment
|
|
29
|
+
gitea = session.get_env("gitea")
|
|
30
|
+
if gitea:
|
|
31
|
+
snapshot = await gitea.snapshot()
|
|
32
|
+
print(snapshot)
|
|
33
|
+
|
|
34
|
+
await session.close()
|
|
35
|
+
await plato.close()
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Database Cleanup
|
|
39
|
+
|
|
40
|
+
Clean up database audit logs before snapshotting (async only):
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from plato.v2 import AsyncPlato, Env
|
|
44
|
+
|
|
45
|
+
async def main():
|
|
46
|
+
plato = AsyncPlato()
|
|
47
|
+
|
|
48
|
+
session = await plato.sessions.create(
|
|
49
|
+
envs=[Env.simulator("gitea", alias="gitea")],
|
|
50
|
+
timeout=600,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
# ... make changes ...
|
|
54
|
+
|
|
55
|
+
# Clean up audit logs before snapshot
|
|
56
|
+
cleanup_result = await session.cleanup_databases()
|
|
57
|
+
print(cleanup_result)
|
|
58
|
+
|
|
59
|
+
# Then snapshot
|
|
60
|
+
snapshots = await session.snapshot()
|
|
61
|
+
|
|
62
|
+
await session.close()
|
|
63
|
+
await plato.close()
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Requires additional dependencies:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install plato-sdk-v2[db-cleanup]
|
|
70
|
+
```
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: plato-sdk-v2
|
|
3
|
+
Version: 2.0.23
|
|
4
|
+
Summary: Python SDK for the Plato API
|
|
5
|
+
Author-email: Plato <support@plato.so>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Typing :: Typed
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Requires-Dist: aiohttp>=3.13.2
|
|
17
|
+
Requires-Dist: datamodel-code-generator>=0.43.0
|
|
18
|
+
Requires-Dist: email-validator>=2.0.0
|
|
19
|
+
Requires-Dist: google-genai>=1.0.0
|
|
20
|
+
Requires-Dist: httpx>=0.25.0
|
|
21
|
+
Requires-Dist: jinja2>=3.1.0
|
|
22
|
+
Requires-Dist: openapi-pydantic>=0.5.1
|
|
23
|
+
Requires-Dist: playwright>=1.56.0
|
|
24
|
+
Requires-Dist: pydantic-settings>=2.12.0
|
|
25
|
+
Requires-Dist: pydantic>=2.0.0
|
|
26
|
+
Requires-Dist: python-dotenv>=1.2.1
|
|
27
|
+
Requires-Dist: pyyaml>=6.0
|
|
28
|
+
Requires-Dist: requests>=2.32.5
|
|
29
|
+
Requires-Dist: rich>=13.0.0
|
|
30
|
+
Requires-Dist: tenacity>=9.1.2
|
|
31
|
+
Requires-Dist: tomli>=2.0.0
|
|
32
|
+
Requires-Dist: typer>=0.9.0
|
|
33
|
+
Provides-Extra: db-cleanup
|
|
34
|
+
Requires-Dist: aiomysql>=0.2; extra == 'db-cleanup'
|
|
35
|
+
Requires-Dist: aiosqlite>=0.20; extra == 'db-cleanup'
|
|
36
|
+
Requires-Dist: asyncpg>=0.29; extra == 'db-cleanup'
|
|
37
|
+
Requires-Dist: sqlalchemy[asyncio]>=2.0; extra == 'db-cleanup'
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: basedpyright>=1.18; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
|
|
41
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
42
|
+
Requires-Dist: ruff>=0.1; extra == 'dev'
|
|
43
|
+
Description-Content-Type: text/markdown
|
|
44
|
+
|
|
45
|
+
# Plato Python SDK
|
|
46
|
+
|
|
47
|
+
Python SDK for the Plato API v2.
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install plato-sdk-v2
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Or with uv:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uv add plato-sdk-v2
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Configuration
|
|
62
|
+
|
|
63
|
+
Create a `.env` file in your project root:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
PLATO_API_KEY=your-api-key
|
|
67
|
+
PLATO_BASE_URL=https://plato.so # optional, defaults to https://plato.so
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Or set environment variables directly:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
export PLATO_API_KEY=your-api-key
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Usage
|
|
77
|
+
|
|
78
|
+
There are two main flows depending on your use case:
|
|
79
|
+
|
|
80
|
+
### Flow 1: Create Session from Environments
|
|
81
|
+
|
|
82
|
+
Use this when you want to spin up environments for development, testing, or custom automation.
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
import asyncio
|
|
86
|
+
from plato.v2 import AsyncPlato, Env
|
|
87
|
+
|
|
88
|
+
async def main():
|
|
89
|
+
plato = AsyncPlato()
|
|
90
|
+
|
|
91
|
+
# Create session with one or more environments
|
|
92
|
+
# (heartbeat starts automatically to keep session alive)
|
|
93
|
+
session = await plato.sessions.create(
|
|
94
|
+
envs=[
|
|
95
|
+
Env.simulator("gitea", dataset="blank", alias="gitea"),
|
|
96
|
+
Env.simulator("kanboard", alias="kanboard"),
|
|
97
|
+
],
|
|
98
|
+
timeout=600,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
# Reset environments to initial state
|
|
102
|
+
await session.reset()
|
|
103
|
+
|
|
104
|
+
# Get public URLs for browser access
|
|
105
|
+
public_urls = await session.get_public_url()
|
|
106
|
+
for alias, url in public_urls.items():
|
|
107
|
+
print(f"{alias}: {url}")
|
|
108
|
+
|
|
109
|
+
# ============================================
|
|
110
|
+
# Interact with environments via browser/API
|
|
111
|
+
# ============================================
|
|
112
|
+
|
|
113
|
+
# Get state mutations from all environments
|
|
114
|
+
state = await session.get_state()
|
|
115
|
+
print(state)
|
|
116
|
+
|
|
117
|
+
# Cleanup
|
|
118
|
+
await session.close()
|
|
119
|
+
await plato.close()
|
|
120
|
+
|
|
121
|
+
asyncio.run(main())
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Flow 2: Create Session from Task
|
|
125
|
+
|
|
126
|
+
Use this when running evaluations against predefined tasks. This flow includes task evaluation at the end.
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
import asyncio
|
|
130
|
+
from plato.v2 import AsyncPlato
|
|
131
|
+
|
|
132
|
+
async def main():
|
|
133
|
+
plato = AsyncPlato()
|
|
134
|
+
|
|
135
|
+
# Create session from task ID
|
|
136
|
+
# (heartbeat starts automatically to keep session alive)
|
|
137
|
+
session = await plato.sessions.create(task=123, timeout=600)
|
|
138
|
+
|
|
139
|
+
# Reset environments to initial state
|
|
140
|
+
await session.reset()
|
|
141
|
+
|
|
142
|
+
# Get public URLs for browser access
|
|
143
|
+
public_urls = await session.get_public_url()
|
|
144
|
+
for alias, url in public_urls.items():
|
|
145
|
+
print(f"{alias}: {url}")
|
|
146
|
+
|
|
147
|
+
# ============================================
|
|
148
|
+
# Interact with environments via browser/API
|
|
149
|
+
# ============================================
|
|
150
|
+
|
|
151
|
+
# Get state mutations from all environments
|
|
152
|
+
state = await session.get_state()
|
|
153
|
+
print(state)
|
|
154
|
+
|
|
155
|
+
# Evaluate task completion
|
|
156
|
+
evaluation = await session.evaluate()
|
|
157
|
+
print(f"Task completed: {evaluation}")
|
|
158
|
+
|
|
159
|
+
# Cleanup
|
|
160
|
+
await session.close()
|
|
161
|
+
await plato.close()
|
|
162
|
+
|
|
163
|
+
asyncio.run(main())
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Environment Configuration
|
|
167
|
+
|
|
168
|
+
Two ways to specify environments:
|
|
169
|
+
|
|
170
|
+
```python
|
|
171
|
+
from plato.v2 import Env
|
|
172
|
+
|
|
173
|
+
# 1. From simulator (most common)
|
|
174
|
+
Env.simulator("gitea") # default tag
|
|
175
|
+
Env.simulator("gitea", tag="staging") # specific tag
|
|
176
|
+
Env.simulator("gitea", dataset="blank") # specific dataset
|
|
177
|
+
Env.simulator("gitea", alias="my-git") # custom alias
|
|
178
|
+
|
|
179
|
+
# 2. From artifact ID
|
|
180
|
+
Env.artifact("artifact-abc123")
|
|
181
|
+
Env.artifact("artifact-abc123", alias="my-env")
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Per-Environment Operations
|
|
185
|
+
|
|
186
|
+
Access individual environments within a session:
|
|
187
|
+
|
|
188
|
+
```python
|
|
189
|
+
# Get all environments
|
|
190
|
+
for env in session.envs:
|
|
191
|
+
print(f"{env.alias}: {env.job_id}")
|
|
192
|
+
|
|
193
|
+
# Get specific environment by alias
|
|
194
|
+
gitea = session.get_env("gitea")
|
|
195
|
+
|
|
196
|
+
if gitea:
|
|
197
|
+
# Execute shell command
|
|
198
|
+
result = await gitea.execute("whoami", timeout=30)
|
|
199
|
+
print(result)
|
|
200
|
+
|
|
201
|
+
# Get state for this environment only
|
|
202
|
+
state = await gitea.get_state()
|
|
203
|
+
|
|
204
|
+
# Reset this environment only
|
|
205
|
+
await gitea.reset()
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Sync Client
|
|
209
|
+
|
|
210
|
+
A synchronous client is also available:
|
|
211
|
+
|
|
212
|
+
```python
|
|
213
|
+
from plato.v2 import Plato, Env
|
|
214
|
+
|
|
215
|
+
plato = Plato()
|
|
216
|
+
|
|
217
|
+
# Heartbeat starts automatically
|
|
218
|
+
session = plato.sessions.create(
|
|
219
|
+
envs=[Env.simulator("gitea", alias="gitea")],
|
|
220
|
+
timeout=600,
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
session.reset()
|
|
224
|
+
|
|
225
|
+
public_urls = session.get_public_url()
|
|
226
|
+
state = session.get_state()
|
|
227
|
+
|
|
228
|
+
session.close()
|
|
229
|
+
plato.close()
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## License
|
|
233
|
+
|
|
234
|
+
MIT
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Plato Python SDK
|
|
2
|
+
|
|
3
|
+
Python SDK for the Plato API v2.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install plato-sdk-v2
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or with uv:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
uv add plato-sdk-v2
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
Create a `.env` file in your project root:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
PLATO_API_KEY=your-api-key
|
|
23
|
+
PLATO_BASE_URL=https://plato.so # optional, defaults to https://plato.so
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or set environment variables directly:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
export PLATO_API_KEY=your-api-key
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
There are two main flows depending on your use case:
|
|
35
|
+
|
|
36
|
+
### Flow 1: Create Session from Environments
|
|
37
|
+
|
|
38
|
+
Use this when you want to spin up environments for development, testing, or custom automation.
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
import asyncio
|
|
42
|
+
from plato.v2 import AsyncPlato, Env
|
|
43
|
+
|
|
44
|
+
async def main():
|
|
45
|
+
plato = AsyncPlato()
|
|
46
|
+
|
|
47
|
+
# Create session with one or more environments
|
|
48
|
+
# (heartbeat starts automatically to keep session alive)
|
|
49
|
+
session = await plato.sessions.create(
|
|
50
|
+
envs=[
|
|
51
|
+
Env.simulator("gitea", dataset="blank", alias="gitea"),
|
|
52
|
+
Env.simulator("kanboard", alias="kanboard"),
|
|
53
|
+
],
|
|
54
|
+
timeout=600,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Reset environments to initial state
|
|
58
|
+
await session.reset()
|
|
59
|
+
|
|
60
|
+
# Get public URLs for browser access
|
|
61
|
+
public_urls = await session.get_public_url()
|
|
62
|
+
for alias, url in public_urls.items():
|
|
63
|
+
print(f"{alias}: {url}")
|
|
64
|
+
|
|
65
|
+
# ============================================
|
|
66
|
+
# Interact with environments via browser/API
|
|
67
|
+
# ============================================
|
|
68
|
+
|
|
69
|
+
# Get state mutations from all environments
|
|
70
|
+
state = await session.get_state()
|
|
71
|
+
print(state)
|
|
72
|
+
|
|
73
|
+
# Cleanup
|
|
74
|
+
await session.close()
|
|
75
|
+
await plato.close()
|
|
76
|
+
|
|
77
|
+
asyncio.run(main())
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Flow 2: Create Session from Task
|
|
81
|
+
|
|
82
|
+
Use this when running evaluations against predefined tasks. This flow includes task evaluation at the end.
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
import asyncio
|
|
86
|
+
from plato.v2 import AsyncPlato
|
|
87
|
+
|
|
88
|
+
async def main():
|
|
89
|
+
plato = AsyncPlato()
|
|
90
|
+
|
|
91
|
+
# Create session from task ID
|
|
92
|
+
# (heartbeat starts automatically to keep session alive)
|
|
93
|
+
session = await plato.sessions.create(task=123, timeout=600)
|
|
94
|
+
|
|
95
|
+
# Reset environments to initial state
|
|
96
|
+
await session.reset()
|
|
97
|
+
|
|
98
|
+
# Get public URLs for browser access
|
|
99
|
+
public_urls = await session.get_public_url()
|
|
100
|
+
for alias, url in public_urls.items():
|
|
101
|
+
print(f"{alias}: {url}")
|
|
102
|
+
|
|
103
|
+
# ============================================
|
|
104
|
+
# Interact with environments via browser/API
|
|
105
|
+
# ============================================
|
|
106
|
+
|
|
107
|
+
# Get state mutations from all environments
|
|
108
|
+
state = await session.get_state()
|
|
109
|
+
print(state)
|
|
110
|
+
|
|
111
|
+
# Evaluate task completion
|
|
112
|
+
evaluation = await session.evaluate()
|
|
113
|
+
print(f"Task completed: {evaluation}")
|
|
114
|
+
|
|
115
|
+
# Cleanup
|
|
116
|
+
await session.close()
|
|
117
|
+
await plato.close()
|
|
118
|
+
|
|
119
|
+
asyncio.run(main())
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Environment Configuration
|
|
123
|
+
|
|
124
|
+
Two ways to specify environments:
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
from plato.v2 import Env
|
|
128
|
+
|
|
129
|
+
# 1. From simulator (most common)
|
|
130
|
+
Env.simulator("gitea") # default tag
|
|
131
|
+
Env.simulator("gitea", tag="staging") # specific tag
|
|
132
|
+
Env.simulator("gitea", dataset="blank") # specific dataset
|
|
133
|
+
Env.simulator("gitea", alias="my-git") # custom alias
|
|
134
|
+
|
|
135
|
+
# 2. From artifact ID
|
|
136
|
+
Env.artifact("artifact-abc123")
|
|
137
|
+
Env.artifact("artifact-abc123", alias="my-env")
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Per-Environment Operations
|
|
141
|
+
|
|
142
|
+
Access individual environments within a session:
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
# Get all environments
|
|
146
|
+
for env in session.envs:
|
|
147
|
+
print(f"{env.alias}: {env.job_id}")
|
|
148
|
+
|
|
149
|
+
# Get specific environment by alias
|
|
150
|
+
gitea = session.get_env("gitea")
|
|
151
|
+
|
|
152
|
+
if gitea:
|
|
153
|
+
# Execute shell command
|
|
154
|
+
result = await gitea.execute("whoami", timeout=30)
|
|
155
|
+
print(result)
|
|
156
|
+
|
|
157
|
+
# Get state for this environment only
|
|
158
|
+
state = await gitea.get_state()
|
|
159
|
+
|
|
160
|
+
# Reset this environment only
|
|
161
|
+
await gitea.reset()
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Sync Client
|
|
165
|
+
|
|
166
|
+
A synchronous client is also available:
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
from plato.v2 import Plato, Env
|
|
170
|
+
|
|
171
|
+
plato = Plato()
|
|
172
|
+
|
|
173
|
+
# Heartbeat starts automatically
|
|
174
|
+
session = plato.sessions.create(
|
|
175
|
+
envs=[Env.simulator("gitea", alias="gitea")],
|
|
176
|
+
timeout=600,
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
session.reset()
|
|
180
|
+
|
|
181
|
+
public_urls = session.get_public_url()
|
|
182
|
+
state = session.get_state()
|
|
183
|
+
|
|
184
|
+
session.close()
|
|
185
|
+
plato.close()
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
MIT
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Plato SDK
|
|
2
|
+
#
|
|
3
|
+
# v1: Legacy SDK (deprecated)
|
|
4
|
+
# v2: New SDK with separate sync/async modules
|
|
5
|
+
# agents: Code execution agent framework
|
|
6
|
+
# sims: Simulation clients (Spree, Firefly, etc.)
|
|
7
|
+
#
|
|
8
|
+
# Usage (v2 - recommended):
|
|
9
|
+
# from plato.v2 import AsyncPlato, Plato, Env
|
|
10
|
+
#
|
|
11
|
+
# Usage (agents):
|
|
12
|
+
# from plato.agents import CodeAgent, CodeExecutor
|
|
13
|
+
#
|
|
14
|
+
# Usage (sims):
|
|
15
|
+
# from plato.sims import SpreeClient, FireflyClient
|
|
16
|
+
|
|
17
|
+
from plato import v2 as v2
|
|
18
|
+
|
|
19
|
+
__all__ = ["v2"]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def __getattr__(name: str):
|
|
23
|
+
"""Lazy import to avoid loading all modules at once."""
|
|
24
|
+
if name in ("Plato", "SyncPlato", "PlatoTask", "v1"):
|
|
25
|
+
try:
|
|
26
|
+
from plato import v1
|
|
27
|
+
|
|
28
|
+
if name == "v1":
|
|
29
|
+
return v1
|
|
30
|
+
return getattr(v1, name)
|
|
31
|
+
except ImportError:
|
|
32
|
+
raise AttributeError(f"module 'plato' has no attribute '{name}' (v1 unavailable)")
|
|
33
|
+
|
|
34
|
+
if name == "agents":
|
|
35
|
+
from plato import agents
|
|
36
|
+
|
|
37
|
+
return agents
|
|
38
|
+
|
|
39
|
+
if name == "sims":
|
|
40
|
+
from plato import sims
|
|
41
|
+
|
|
42
|
+
return sims
|
|
43
|
+
|
|
44
|
+
raise AttributeError(f"module 'plato' has no attribute '{name}'")
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Plato API SDK - v0.19.3"""
|
|
2
|
+
|
|
3
|
+
from . import api, errors, models
|
|
4
|
+
from .client import AsyncClient, Client
|
|
5
|
+
from .errors import (
|
|
6
|
+
APIError,
|
|
7
|
+
BadRequestError,
|
|
8
|
+
ConflictError,
|
|
9
|
+
ForbiddenError,
|
|
10
|
+
InternalServerError,
|
|
11
|
+
NotFoundError,
|
|
12
|
+
RateLimitError,
|
|
13
|
+
ServiceUnavailableError,
|
|
14
|
+
UnauthorizedError,
|
|
15
|
+
UnprocessableEntityError,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
# Clients
|
|
20
|
+
"Client",
|
|
21
|
+
"AsyncClient",
|
|
22
|
+
# Modules
|
|
23
|
+
"api",
|
|
24
|
+
"models",
|
|
25
|
+
"errors",
|
|
26
|
+
# Error types for convenience
|
|
27
|
+
"APIError",
|
|
28
|
+
"BadRequestError",
|
|
29
|
+
"UnauthorizedError",
|
|
30
|
+
"ForbiddenError",
|
|
31
|
+
"NotFoundError",
|
|
32
|
+
"ConflictError",
|
|
33
|
+
"UnprocessableEntityError",
|
|
34
|
+
"RateLimitError",
|
|
35
|
+
"InternalServerError",
|
|
36
|
+
"ServiceUnavailableError",
|
|
37
|
+
]
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""API version module."""
|
|
2
|
+
|
|
3
|
+
from . import (
|
|
4
|
+
agent_artifacts,
|
|
5
|
+
cluster,
|
|
6
|
+
env,
|
|
7
|
+
evals,
|
|
8
|
+
gitea,
|
|
9
|
+
jobs,
|
|
10
|
+
organization,
|
|
11
|
+
queue,
|
|
12
|
+
sandbox,
|
|
13
|
+
session,
|
|
14
|
+
simulator,
|
|
15
|
+
testcases,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"agent_artifacts",
|
|
20
|
+
"cluster",
|
|
21
|
+
"env",
|
|
22
|
+
"evals",
|
|
23
|
+
"gitea",
|
|
24
|
+
"jobs",
|
|
25
|
+
"organization",
|
|
26
|
+
"queue",
|
|
27
|
+
"sandbox",
|
|
28
|
+
"session",
|
|
29
|
+
"simulator",
|
|
30
|
+
"testcases",
|
|
31
|
+
]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""API endpoints."""
|
|
2
|
+
|
|
3
|
+
from . import archive_agent_artifact, create_agent_artifact, get_agent_artifact_by_public_id, get_agent_artifacts
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"get_agent_artifacts",
|
|
7
|
+
"create_agent_artifact",
|
|
8
|
+
"get_agent_artifact_by_public_id",
|
|
9
|
+
"archive_agent_artifact",
|
|
10
|
+
]
|