langwatch-scenario 0.4.0__py3-none-any.whl → 0.7.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.
- {langwatch_scenario-0.4.0.dist-info → langwatch_scenario-0.7.1.dist-info}/METADATA +210 -86
- langwatch_scenario-0.7.1.dist-info/RECORD +237 -0
- scenario/__init__.py +12 -118
- scenario/_events/__init__.py +64 -0
- scenario/_events/event_bus.py +185 -0
- scenario/_events/event_reporter.py +83 -0
- scenario/_events/events.py +162 -0
- scenario/_events/messages.py +58 -0
- scenario/_events/utils.py +97 -0
- scenario/_generated/langwatch_api_client/README.md +139 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/__init__.py +13 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/__init__.py +1 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/__init__.py +1 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/delete_api_annotations_id.py +155 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/delete_api_prompts_by_id.py +218 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/delete_api_scenario_events.py +183 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/get_api_annotations.py +136 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/get_api_annotations_id.py +155 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/get_api_annotations_trace_id.py +160 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/get_api_dataset_by_slug_or_id.py +229 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/get_api_prompts.py +188 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/get_api_prompts_by_id.py +218 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/get_api_prompts_by_id_versions.py +218 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/get_api_trace_id.py +155 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/patch_api_annotations_id.py +178 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/post_api_annotations_trace_id.py +178 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/post_api_dataset_by_slug_entries.py +108 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/post_api_prompts.py +187 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/post_api_prompts_by_id_versions.py +241 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/post_api_scenario_events.py +229 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/post_api_trace_id_share.py +155 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/post_api_trace_id_unshare.py +155 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/put_api_prompts_by_id.py +241 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/traces/__init__.py +1 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/api/traces/post_api_trace_search.py +168 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/client.py +268 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/errors.py +16 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/__init__.py +455 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/annotation.py +131 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/dataset_post_entries.py +74 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/dataset_post_entries_entries_item.py +44 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/delete_api_annotations_id_response_200.py +68 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/delete_api_prompts_by_id_response_200.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/delete_api_prompts_by_id_response_400.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/delete_api_prompts_by_id_response_400_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/delete_api_prompts_by_id_response_401.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/delete_api_prompts_by_id_response_401_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/delete_api_prompts_by_id_response_404.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/delete_api_prompts_by_id_response_500.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/delete_api_scenario_events_response_200.py +81 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/delete_api_scenario_events_response_400.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/delete_api_scenario_events_response_401.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/delete_api_scenario_events_response_500.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/error.py +67 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/evaluation.py +164 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/evaluation_timestamps.py +68 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_dataset_by_slug_or_id_response_200.py +75 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_dataset_by_slug_or_id_response_200_data_item.py +109 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_dataset_by_slug_or_id_response_200_data_item_entry.py +44 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_dataset_by_slug_or_id_response_400.py +78 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_dataset_by_slug_or_id_response_401.py +78 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_dataset_by_slug_or_id_response_404.py +78 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_dataset_by_slug_or_id_response_422.py +67 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_dataset_by_slug_or_id_response_500.py +78 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_200.py +172 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_200_messages_item.py +69 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_200_messages_item_role.py +10 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_200_response_format_type_0.py +81 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_200_response_format_type_0_json_schema.py +77 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_200_response_format_type_0_json_schema_schema.py +44 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_200_response_format_type_0_type.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_400.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_400_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_401.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_401_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_404.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_response_500.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200.py +155 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data.py +204 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data_demonstrations.py +101 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data_demonstrations_columns_item.py +79 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data_demonstrations_columns_item_type.py +18 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data_demonstrations_rows_item.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data_inputs_item.py +71 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data_inputs_item_type.py +16 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data_messages_item.py +71 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data_messages_item_role.py +10 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data_outputs_item.py +98 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data_outputs_item_json_schema.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data_outputs_item_type.py +11 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_200_config_data_prompting_technique.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_400.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_400_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_401.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_401_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_404.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_by_id_versions_response_500.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_response_200_item.py +172 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_response_200_item_messages_item.py +69 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_response_200_item_messages_item_role.py +10 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_response_200_item_response_format_type_0.py +81 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_response_200_item_response_format_type_0_json_schema.py +77 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_response_200_item_response_format_type_0_json_schema_schema.py +44 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_response_200_item_response_format_type_0_type.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_response_400.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_response_400_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_response_401.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_response_401_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_prompts_response_500.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200.py +249 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_error_type_0.py +79 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_evaluations_item.py +152 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_evaluations_item_error.py +79 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_evaluations_item_timestamps.py +68 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_input.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_metadata.py +68 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_metrics.py +95 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_output.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_spans_item.py +271 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_spans_item_error_type_0.py +79 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_spans_item_input.py +90 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_spans_item_input_value_item.py +69 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_spans_item_metrics.py +77 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_spans_item_output.py +89 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_spans_item_output_value_item.py +68 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_spans_item_params.py +68 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_spans_item_timestamps.py +95 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/get_api_trace_id_response_200_timestamps.py +77 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/input_.py +68 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/metadata.py +68 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/metrics.py +115 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/output.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/pagination.py +68 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/patch_api_annotations_id_body.py +77 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/patch_api_annotations_id_response_200.py +68 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_annotations_trace_id_body.py +77 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_body.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body.py +147 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data.py +207 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data_demonstrations.py +106 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data_demonstrations_columns_item.py +79 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data_demonstrations_columns_item_type.py +18 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data_demonstrations_rows_item.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data_inputs_item.py +71 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data_inputs_item_type.py +16 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data_messages_item.py +71 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data_messages_item_role.py +10 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data_outputs_item.py +98 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data_outputs_item_json_schema.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data_outputs_item_type.py +11 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_body_config_data_prompting_technique.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200.py +155 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data.py +206 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data_demonstrations.py +101 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data_demonstrations_columns_item.py +79 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data_demonstrations_columns_item_type.py +18 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data_demonstrations_rows_item.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data_inputs_item.py +71 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data_inputs_item_type.py +16 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data_messages_item.py +71 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data_messages_item_role.py +10 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data_outputs_item.py +98 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data_outputs_item_json_schema.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data_outputs_item_type.py +11 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_200_config_data_prompting_technique.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_400.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_400_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_401.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_401_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_404.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_by_id_versions_response_500.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_response_200.py +172 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_response_200_messages_item.py +69 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_response_200_messages_item_role.py +10 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_response_200_response_format_type_0.py +81 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_response_200_response_format_type_0_json_schema.py +77 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_response_200_response_format_type_0_json_schema_schema.py +44 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_response_200_response_format_type_0_type.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_response_400.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_response_400_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_response_401.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_response_401_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_prompts_response_500.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_0.py +127 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_0_metadata.py +68 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_1.py +164 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_1_results_type_0.py +98 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_1_results_type_0_verdict.py +10 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_1_status.py +13 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_2.py +245 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_2_messages_item_type_0.py +88 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_2_messages_item_type_1.py +88 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_2_messages_item_type_2.py +120 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_2_messages_item_type_2_tool_calls_item.py +87 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_2_messages_item_type_2_tool_calls_item_function.py +67 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_2_messages_item_type_3.py +88 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_body_type_2_messages_item_type_4.py +85 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_response_201.py +81 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_response_400.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_response_401.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_scenario_events_response_500.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_trace_id_share_response_200.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/post_api_trace_id_unshare_response_200.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/put_api_prompts_by_id_body.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/put_api_prompts_by_id_response_200.py +75 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/put_api_prompts_by_id_response_400.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/put_api_prompts_by_id_response_400_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/put_api_prompts_by_id_response_401.py +61 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/put_api_prompts_by_id_response_401_error.py +8 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/put_api_prompts_by_id_response_404.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/put_api_prompts_by_id_response_500.py +59 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/search_request.py +133 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/search_request_filters.py +51 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/search_response.py +93 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/timestamps.py +77 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/models/trace.py +225 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/py.typed +1 -0
- scenario/_generated/langwatch_api_client/lang_watch_api_client/types.py +46 -0
- scenario/_generated/langwatch_api_client/pyproject.toml +27 -0
- scenario/_utils/__init__.py +32 -0
- scenario/_utils/ids.py +58 -0
- scenario/_utils/message_conversion.py +103 -0
- scenario/{utils.py → _utils/utils.py} +21 -110
- scenario/agent_adapter.py +8 -4
- scenario/cache.py +4 -3
- scenario/config.py +7 -5
- scenario/judge_agent.py +13 -29
- scenario/pytest_plugin.py +6 -51
- scenario/scenario_executor.py +372 -215
- scenario/scenario_state.py +6 -6
- scenario/script.py +9 -9
- scenario/types.py +15 -8
- scenario/user_simulator_agent.py +4 -11
- langwatch_scenario-0.4.0.dist-info/RECORD +0 -18
- {langwatch_scenario-0.4.0.dist-info → langwatch_scenario-0.7.1.dist-info}/WHEEL +0 -0
- {langwatch_scenario-0.4.0.dist-info → langwatch_scenario-0.7.1.dist-info}/entry_points.txt +0 -0
- {langwatch_scenario-0.4.0.dist-info → langwatch_scenario-0.7.1.dist-info}/top_level.txt +0 -0
- /scenario/{error_messages.py → _error_messages.py} +0 -0
@@ -0,0 +1,218 @@
|
|
1
|
+
from http import HTTPStatus
|
2
|
+
from typing import Any, Optional, Union
|
3
|
+
|
4
|
+
import httpx
|
5
|
+
|
6
|
+
from ... import errors
|
7
|
+
from ...client import AuthenticatedClient, Client
|
8
|
+
from ...models.get_api_prompts_by_id_versions_response_200 import GetApiPromptsByIdVersionsResponse200
|
9
|
+
from ...models.get_api_prompts_by_id_versions_response_400 import GetApiPromptsByIdVersionsResponse400
|
10
|
+
from ...models.get_api_prompts_by_id_versions_response_401 import GetApiPromptsByIdVersionsResponse401
|
11
|
+
from ...models.get_api_prompts_by_id_versions_response_404 import GetApiPromptsByIdVersionsResponse404
|
12
|
+
from ...models.get_api_prompts_by_id_versions_response_500 import GetApiPromptsByIdVersionsResponse500
|
13
|
+
from ...types import Response
|
14
|
+
|
15
|
+
|
16
|
+
def _get_kwargs(
|
17
|
+
id: str,
|
18
|
+
) -> dict[str, Any]:
|
19
|
+
_kwargs: dict[str, Any] = {
|
20
|
+
"method": "get",
|
21
|
+
"url": f"/api/prompts/{id}/versions",
|
22
|
+
}
|
23
|
+
|
24
|
+
return _kwargs
|
25
|
+
|
26
|
+
|
27
|
+
def _parse_response(
|
28
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
29
|
+
) -> Optional[
|
30
|
+
Union[
|
31
|
+
GetApiPromptsByIdVersionsResponse200,
|
32
|
+
GetApiPromptsByIdVersionsResponse400,
|
33
|
+
GetApiPromptsByIdVersionsResponse401,
|
34
|
+
GetApiPromptsByIdVersionsResponse404,
|
35
|
+
GetApiPromptsByIdVersionsResponse500,
|
36
|
+
]
|
37
|
+
]:
|
38
|
+
if response.status_code == 200:
|
39
|
+
response_200 = GetApiPromptsByIdVersionsResponse200.from_dict(response.json())
|
40
|
+
|
41
|
+
return response_200
|
42
|
+
if response.status_code == 400:
|
43
|
+
response_400 = GetApiPromptsByIdVersionsResponse400.from_dict(response.json())
|
44
|
+
|
45
|
+
return response_400
|
46
|
+
if response.status_code == 401:
|
47
|
+
response_401 = GetApiPromptsByIdVersionsResponse401.from_dict(response.json())
|
48
|
+
|
49
|
+
return response_401
|
50
|
+
if response.status_code == 404:
|
51
|
+
response_404 = GetApiPromptsByIdVersionsResponse404.from_dict(response.json())
|
52
|
+
|
53
|
+
return response_404
|
54
|
+
if response.status_code == 500:
|
55
|
+
response_500 = GetApiPromptsByIdVersionsResponse500.from_dict(response.json())
|
56
|
+
|
57
|
+
return response_500
|
58
|
+
if client.raise_on_unexpected_status:
|
59
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
60
|
+
else:
|
61
|
+
return None
|
62
|
+
|
63
|
+
|
64
|
+
def _build_response(
|
65
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
66
|
+
) -> Response[
|
67
|
+
Union[
|
68
|
+
GetApiPromptsByIdVersionsResponse200,
|
69
|
+
GetApiPromptsByIdVersionsResponse400,
|
70
|
+
GetApiPromptsByIdVersionsResponse401,
|
71
|
+
GetApiPromptsByIdVersionsResponse404,
|
72
|
+
GetApiPromptsByIdVersionsResponse500,
|
73
|
+
]
|
74
|
+
]:
|
75
|
+
return Response(
|
76
|
+
status_code=HTTPStatus(response.status_code),
|
77
|
+
content=response.content,
|
78
|
+
headers=response.headers,
|
79
|
+
parsed=_parse_response(client=client, response=response),
|
80
|
+
)
|
81
|
+
|
82
|
+
|
83
|
+
def sync_detailed(
|
84
|
+
id: str,
|
85
|
+
*,
|
86
|
+
client: Union[AuthenticatedClient, Client],
|
87
|
+
) -> Response[
|
88
|
+
Union[
|
89
|
+
GetApiPromptsByIdVersionsResponse200,
|
90
|
+
GetApiPromptsByIdVersionsResponse400,
|
91
|
+
GetApiPromptsByIdVersionsResponse401,
|
92
|
+
GetApiPromptsByIdVersionsResponse404,
|
93
|
+
GetApiPromptsByIdVersionsResponse500,
|
94
|
+
]
|
95
|
+
]:
|
96
|
+
"""Get all versions for a prompt
|
97
|
+
|
98
|
+
Args:
|
99
|
+
id (str):
|
100
|
+
|
101
|
+
Raises:
|
102
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
103
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
104
|
+
|
105
|
+
Returns:
|
106
|
+
Response[Union[GetApiPromptsByIdVersionsResponse200, GetApiPromptsByIdVersionsResponse400, GetApiPromptsByIdVersionsResponse401, GetApiPromptsByIdVersionsResponse404, GetApiPromptsByIdVersionsResponse500]]
|
107
|
+
"""
|
108
|
+
|
109
|
+
kwargs = _get_kwargs(
|
110
|
+
id=id,
|
111
|
+
)
|
112
|
+
|
113
|
+
response = client.get_httpx_client().request(
|
114
|
+
**kwargs,
|
115
|
+
)
|
116
|
+
|
117
|
+
return _build_response(client=client, response=response)
|
118
|
+
|
119
|
+
|
120
|
+
def sync(
|
121
|
+
id: str,
|
122
|
+
*,
|
123
|
+
client: Union[AuthenticatedClient, Client],
|
124
|
+
) -> Optional[
|
125
|
+
Union[
|
126
|
+
GetApiPromptsByIdVersionsResponse200,
|
127
|
+
GetApiPromptsByIdVersionsResponse400,
|
128
|
+
GetApiPromptsByIdVersionsResponse401,
|
129
|
+
GetApiPromptsByIdVersionsResponse404,
|
130
|
+
GetApiPromptsByIdVersionsResponse500,
|
131
|
+
]
|
132
|
+
]:
|
133
|
+
"""Get all versions for a prompt
|
134
|
+
|
135
|
+
Args:
|
136
|
+
id (str):
|
137
|
+
|
138
|
+
Raises:
|
139
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
140
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
141
|
+
|
142
|
+
Returns:
|
143
|
+
Union[GetApiPromptsByIdVersionsResponse200, GetApiPromptsByIdVersionsResponse400, GetApiPromptsByIdVersionsResponse401, GetApiPromptsByIdVersionsResponse404, GetApiPromptsByIdVersionsResponse500]
|
144
|
+
"""
|
145
|
+
|
146
|
+
return sync_detailed(
|
147
|
+
id=id,
|
148
|
+
client=client,
|
149
|
+
).parsed
|
150
|
+
|
151
|
+
|
152
|
+
async def asyncio_detailed(
|
153
|
+
id: str,
|
154
|
+
*,
|
155
|
+
client: Union[AuthenticatedClient, Client],
|
156
|
+
) -> Response[
|
157
|
+
Union[
|
158
|
+
GetApiPromptsByIdVersionsResponse200,
|
159
|
+
GetApiPromptsByIdVersionsResponse400,
|
160
|
+
GetApiPromptsByIdVersionsResponse401,
|
161
|
+
GetApiPromptsByIdVersionsResponse404,
|
162
|
+
GetApiPromptsByIdVersionsResponse500,
|
163
|
+
]
|
164
|
+
]:
|
165
|
+
"""Get all versions for a prompt
|
166
|
+
|
167
|
+
Args:
|
168
|
+
id (str):
|
169
|
+
|
170
|
+
Raises:
|
171
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
172
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
173
|
+
|
174
|
+
Returns:
|
175
|
+
Response[Union[GetApiPromptsByIdVersionsResponse200, GetApiPromptsByIdVersionsResponse400, GetApiPromptsByIdVersionsResponse401, GetApiPromptsByIdVersionsResponse404, GetApiPromptsByIdVersionsResponse500]]
|
176
|
+
"""
|
177
|
+
|
178
|
+
kwargs = _get_kwargs(
|
179
|
+
id=id,
|
180
|
+
)
|
181
|
+
|
182
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
183
|
+
|
184
|
+
return _build_response(client=client, response=response)
|
185
|
+
|
186
|
+
|
187
|
+
async def asyncio(
|
188
|
+
id: str,
|
189
|
+
*,
|
190
|
+
client: Union[AuthenticatedClient, Client],
|
191
|
+
) -> Optional[
|
192
|
+
Union[
|
193
|
+
GetApiPromptsByIdVersionsResponse200,
|
194
|
+
GetApiPromptsByIdVersionsResponse400,
|
195
|
+
GetApiPromptsByIdVersionsResponse401,
|
196
|
+
GetApiPromptsByIdVersionsResponse404,
|
197
|
+
GetApiPromptsByIdVersionsResponse500,
|
198
|
+
]
|
199
|
+
]:
|
200
|
+
"""Get all versions for a prompt
|
201
|
+
|
202
|
+
Args:
|
203
|
+
id (str):
|
204
|
+
|
205
|
+
Raises:
|
206
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
207
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
208
|
+
|
209
|
+
Returns:
|
210
|
+
Union[GetApiPromptsByIdVersionsResponse200, GetApiPromptsByIdVersionsResponse400, GetApiPromptsByIdVersionsResponse401, GetApiPromptsByIdVersionsResponse404, GetApiPromptsByIdVersionsResponse500]
|
211
|
+
"""
|
212
|
+
|
213
|
+
return (
|
214
|
+
await asyncio_detailed(
|
215
|
+
id=id,
|
216
|
+
client=client,
|
217
|
+
)
|
218
|
+
).parsed
|
scenario/_generated/langwatch_api_client/lang_watch_api_client/api/default/get_api_trace_id.py
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
from http import HTTPStatus
|
2
|
+
from typing import Any, Optional, Union
|
3
|
+
|
4
|
+
import httpx
|
5
|
+
|
6
|
+
from ... import errors
|
7
|
+
from ...client import AuthenticatedClient, Client
|
8
|
+
from ...models.error import Error
|
9
|
+
from ...models.get_api_trace_id_response_200 import GetApiTraceIdResponse200
|
10
|
+
from ...types import Response
|
11
|
+
|
12
|
+
|
13
|
+
def _get_kwargs(
|
14
|
+
id: str,
|
15
|
+
) -> dict[str, Any]:
|
16
|
+
_kwargs: dict[str, Any] = {
|
17
|
+
"method": "get",
|
18
|
+
"url": f"/api/trace/{id}",
|
19
|
+
}
|
20
|
+
|
21
|
+
return _kwargs
|
22
|
+
|
23
|
+
|
24
|
+
def _parse_response(
|
25
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
26
|
+
) -> Optional[Union[Error, GetApiTraceIdResponse200]]:
|
27
|
+
if response.status_code == 200:
|
28
|
+
response_200 = GetApiTraceIdResponse200.from_dict(response.json())
|
29
|
+
|
30
|
+
return response_200
|
31
|
+
if response.status_code == 400:
|
32
|
+
response_400 = Error.from_dict(response.json())
|
33
|
+
|
34
|
+
return response_400
|
35
|
+
if client.raise_on_unexpected_status:
|
36
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
37
|
+
else:
|
38
|
+
return None
|
39
|
+
|
40
|
+
|
41
|
+
def _build_response(
|
42
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
43
|
+
) -> Response[Union[Error, GetApiTraceIdResponse200]]:
|
44
|
+
return Response(
|
45
|
+
status_code=HTTPStatus(response.status_code),
|
46
|
+
content=response.content,
|
47
|
+
headers=response.headers,
|
48
|
+
parsed=_parse_response(client=client, response=response),
|
49
|
+
)
|
50
|
+
|
51
|
+
|
52
|
+
def sync_detailed(
|
53
|
+
id: str,
|
54
|
+
*,
|
55
|
+
client: Union[AuthenticatedClient, Client],
|
56
|
+
) -> Response[Union[Error, GetApiTraceIdResponse200]]:
|
57
|
+
"""Returns single trace details based on the ID supplied
|
58
|
+
|
59
|
+
Args:
|
60
|
+
id (str):
|
61
|
+
|
62
|
+
Raises:
|
63
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
64
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
65
|
+
|
66
|
+
Returns:
|
67
|
+
Response[Union[Error, GetApiTraceIdResponse200]]
|
68
|
+
"""
|
69
|
+
|
70
|
+
kwargs = _get_kwargs(
|
71
|
+
id=id,
|
72
|
+
)
|
73
|
+
|
74
|
+
response = client.get_httpx_client().request(
|
75
|
+
**kwargs,
|
76
|
+
)
|
77
|
+
|
78
|
+
return _build_response(client=client, response=response)
|
79
|
+
|
80
|
+
|
81
|
+
def sync(
|
82
|
+
id: str,
|
83
|
+
*,
|
84
|
+
client: Union[AuthenticatedClient, Client],
|
85
|
+
) -> Optional[Union[Error, GetApiTraceIdResponse200]]:
|
86
|
+
"""Returns single trace details based on the ID supplied
|
87
|
+
|
88
|
+
Args:
|
89
|
+
id (str):
|
90
|
+
|
91
|
+
Raises:
|
92
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
93
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
94
|
+
|
95
|
+
Returns:
|
96
|
+
Union[Error, GetApiTraceIdResponse200]
|
97
|
+
"""
|
98
|
+
|
99
|
+
return sync_detailed(
|
100
|
+
id=id,
|
101
|
+
client=client,
|
102
|
+
).parsed
|
103
|
+
|
104
|
+
|
105
|
+
async def asyncio_detailed(
|
106
|
+
id: str,
|
107
|
+
*,
|
108
|
+
client: Union[AuthenticatedClient, Client],
|
109
|
+
) -> Response[Union[Error, GetApiTraceIdResponse200]]:
|
110
|
+
"""Returns single trace details based on the ID supplied
|
111
|
+
|
112
|
+
Args:
|
113
|
+
id (str):
|
114
|
+
|
115
|
+
Raises:
|
116
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
117
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
118
|
+
|
119
|
+
Returns:
|
120
|
+
Response[Union[Error, GetApiTraceIdResponse200]]
|
121
|
+
"""
|
122
|
+
|
123
|
+
kwargs = _get_kwargs(
|
124
|
+
id=id,
|
125
|
+
)
|
126
|
+
|
127
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
128
|
+
|
129
|
+
return _build_response(client=client, response=response)
|
130
|
+
|
131
|
+
|
132
|
+
async def asyncio(
|
133
|
+
id: str,
|
134
|
+
*,
|
135
|
+
client: Union[AuthenticatedClient, Client],
|
136
|
+
) -> Optional[Union[Error, GetApiTraceIdResponse200]]:
|
137
|
+
"""Returns single trace details based on the ID supplied
|
138
|
+
|
139
|
+
Args:
|
140
|
+
id (str):
|
141
|
+
|
142
|
+
Raises:
|
143
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
144
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
145
|
+
|
146
|
+
Returns:
|
147
|
+
Union[Error, GetApiTraceIdResponse200]
|
148
|
+
"""
|
149
|
+
|
150
|
+
return (
|
151
|
+
await asyncio_detailed(
|
152
|
+
id=id,
|
153
|
+
client=client,
|
154
|
+
)
|
155
|
+
).parsed
|
@@ -0,0 +1,178 @@
|
|
1
|
+
from http import HTTPStatus
|
2
|
+
from typing import Any, Optional, Union
|
3
|
+
|
4
|
+
import httpx
|
5
|
+
|
6
|
+
from ... import errors
|
7
|
+
from ...client import AuthenticatedClient, Client
|
8
|
+
from ...models.error import Error
|
9
|
+
from ...models.patch_api_annotations_id_body import PatchApiAnnotationsIdBody
|
10
|
+
from ...models.patch_api_annotations_id_response_200 import PatchApiAnnotationsIdResponse200
|
11
|
+
from ...types import Response
|
12
|
+
|
13
|
+
|
14
|
+
def _get_kwargs(
|
15
|
+
id: str,
|
16
|
+
*,
|
17
|
+
body: PatchApiAnnotationsIdBody,
|
18
|
+
) -> dict[str, Any]:
|
19
|
+
headers: dict[str, Any] = {}
|
20
|
+
|
21
|
+
_kwargs: dict[str, Any] = {
|
22
|
+
"method": "patch",
|
23
|
+
"url": f"/api/annotations/{id}",
|
24
|
+
}
|
25
|
+
|
26
|
+
_body = body.to_dict()
|
27
|
+
|
28
|
+
_kwargs["json"] = _body
|
29
|
+
headers["Content-Type"] = "application/json"
|
30
|
+
|
31
|
+
_kwargs["headers"] = headers
|
32
|
+
return _kwargs
|
33
|
+
|
34
|
+
|
35
|
+
def _parse_response(
|
36
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
37
|
+
) -> Optional[Union[Error, PatchApiAnnotationsIdResponse200]]:
|
38
|
+
if response.status_code == 200:
|
39
|
+
response_200 = PatchApiAnnotationsIdResponse200.from_dict(response.json())
|
40
|
+
|
41
|
+
return response_200
|
42
|
+
if response.status_code == 400:
|
43
|
+
response_400 = Error.from_dict(response.json())
|
44
|
+
|
45
|
+
return response_400
|
46
|
+
if client.raise_on_unexpected_status:
|
47
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
48
|
+
else:
|
49
|
+
return None
|
50
|
+
|
51
|
+
|
52
|
+
def _build_response(
|
53
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
54
|
+
) -> Response[Union[Error, PatchApiAnnotationsIdResponse200]]:
|
55
|
+
return Response(
|
56
|
+
status_code=HTTPStatus(response.status_code),
|
57
|
+
content=response.content,
|
58
|
+
headers=response.headers,
|
59
|
+
parsed=_parse_response(client=client, response=response),
|
60
|
+
)
|
61
|
+
|
62
|
+
|
63
|
+
def sync_detailed(
|
64
|
+
id: str,
|
65
|
+
*,
|
66
|
+
client: Union[AuthenticatedClient, Client],
|
67
|
+
body: PatchApiAnnotationsIdBody,
|
68
|
+
) -> Response[Union[Error, PatchApiAnnotationsIdResponse200]]:
|
69
|
+
"""Updates a single annotation based on the ID supplied
|
70
|
+
|
71
|
+
Args:
|
72
|
+
id (str):
|
73
|
+
body (PatchApiAnnotationsIdBody):
|
74
|
+
|
75
|
+
Raises:
|
76
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
77
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
78
|
+
|
79
|
+
Returns:
|
80
|
+
Response[Union[Error, PatchApiAnnotationsIdResponse200]]
|
81
|
+
"""
|
82
|
+
|
83
|
+
kwargs = _get_kwargs(
|
84
|
+
id=id,
|
85
|
+
body=body,
|
86
|
+
)
|
87
|
+
|
88
|
+
response = client.get_httpx_client().request(
|
89
|
+
**kwargs,
|
90
|
+
)
|
91
|
+
|
92
|
+
return _build_response(client=client, response=response)
|
93
|
+
|
94
|
+
|
95
|
+
def sync(
|
96
|
+
id: str,
|
97
|
+
*,
|
98
|
+
client: Union[AuthenticatedClient, Client],
|
99
|
+
body: PatchApiAnnotationsIdBody,
|
100
|
+
) -> Optional[Union[Error, PatchApiAnnotationsIdResponse200]]:
|
101
|
+
"""Updates a single annotation based on the ID supplied
|
102
|
+
|
103
|
+
Args:
|
104
|
+
id (str):
|
105
|
+
body (PatchApiAnnotationsIdBody):
|
106
|
+
|
107
|
+
Raises:
|
108
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
109
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
110
|
+
|
111
|
+
Returns:
|
112
|
+
Union[Error, PatchApiAnnotationsIdResponse200]
|
113
|
+
"""
|
114
|
+
|
115
|
+
return sync_detailed(
|
116
|
+
id=id,
|
117
|
+
client=client,
|
118
|
+
body=body,
|
119
|
+
).parsed
|
120
|
+
|
121
|
+
|
122
|
+
async def asyncio_detailed(
|
123
|
+
id: str,
|
124
|
+
*,
|
125
|
+
client: Union[AuthenticatedClient, Client],
|
126
|
+
body: PatchApiAnnotationsIdBody,
|
127
|
+
) -> Response[Union[Error, PatchApiAnnotationsIdResponse200]]:
|
128
|
+
"""Updates a single annotation based on the ID supplied
|
129
|
+
|
130
|
+
Args:
|
131
|
+
id (str):
|
132
|
+
body (PatchApiAnnotationsIdBody):
|
133
|
+
|
134
|
+
Raises:
|
135
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
136
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
137
|
+
|
138
|
+
Returns:
|
139
|
+
Response[Union[Error, PatchApiAnnotationsIdResponse200]]
|
140
|
+
"""
|
141
|
+
|
142
|
+
kwargs = _get_kwargs(
|
143
|
+
id=id,
|
144
|
+
body=body,
|
145
|
+
)
|
146
|
+
|
147
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
148
|
+
|
149
|
+
return _build_response(client=client, response=response)
|
150
|
+
|
151
|
+
|
152
|
+
async def asyncio(
|
153
|
+
id: str,
|
154
|
+
*,
|
155
|
+
client: Union[AuthenticatedClient, Client],
|
156
|
+
body: PatchApiAnnotationsIdBody,
|
157
|
+
) -> Optional[Union[Error, PatchApiAnnotationsIdResponse200]]:
|
158
|
+
"""Updates a single annotation based on the ID supplied
|
159
|
+
|
160
|
+
Args:
|
161
|
+
id (str):
|
162
|
+
body (PatchApiAnnotationsIdBody):
|
163
|
+
|
164
|
+
Raises:
|
165
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
166
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
167
|
+
|
168
|
+
Returns:
|
169
|
+
Union[Error, PatchApiAnnotationsIdResponse200]
|
170
|
+
"""
|
171
|
+
|
172
|
+
return (
|
173
|
+
await asyncio_detailed(
|
174
|
+
id=id,
|
175
|
+
client=client,
|
176
|
+
body=body,
|
177
|
+
)
|
178
|
+
).parsed
|