langwatch-scenario 0.6.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.6.0.dist-info → langwatch_scenario-0.7.1.dist-info}/METADATA +143 -41
- langwatch_scenario-0.7.1.dist-info/RECORD +237 -0
- scenario/__init__.py +1 -4
- scenario/{events → _events}/__init__.py +9 -11
- scenario/_events/event_bus.py +185 -0
- scenario/{events → _events}/event_reporter.py +1 -1
- scenario/{events → _events}/events.py +20 -27
- scenario/_events/messages.py +58 -0
- scenario/{events → _events}/utils.py +43 -32
- 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 +1 -1
- scenario/_utils/message_conversion.py +2 -2
- scenario/judge_agent.py +6 -1
- scenario/pytest_plugin.py +4 -4
- scenario/scenario_executor.py +196 -223
- scenario/types.py +5 -2
- langwatch_scenario-0.6.0.dist-info/RECORD +0 -27
- scenario/events/event_bus.py +0 -175
- scenario/events/messages.py +0 -84
- {langwatch_scenario-0.6.0.dist-info → langwatch_scenario-0.7.1.dist-info}/WHEEL +0 -0
- {langwatch_scenario-0.6.0.dist-info → langwatch_scenario-0.7.1.dist-info}/entry_points.txt +0 -0
- {langwatch_scenario-0.6.0.dist-info → langwatch_scenario-0.7.1.dist-info}/top_level.txt +0 -0
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
|
@@ -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.annotation import Annotation
|
9
|
+
from ...models.error import Error
|
10
|
+
from ...models.post_api_annotations_trace_id_body import PostApiAnnotationsTraceIdBody
|
11
|
+
from ...types import Response
|
12
|
+
|
13
|
+
|
14
|
+
def _get_kwargs(
|
15
|
+
id: str,
|
16
|
+
*,
|
17
|
+
body: PostApiAnnotationsTraceIdBody,
|
18
|
+
) -> dict[str, Any]:
|
19
|
+
headers: dict[str, Any] = {}
|
20
|
+
|
21
|
+
_kwargs: dict[str, Any] = {
|
22
|
+
"method": "post",
|
23
|
+
"url": f"/api/annotations/trace/{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[Annotation, Error]]:
|
38
|
+
if response.status_code == 200:
|
39
|
+
response_200 = Annotation.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[Annotation, Error]]:
|
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: PostApiAnnotationsTraceIdBody,
|
68
|
+
) -> Response[Union[Annotation, Error]]:
|
69
|
+
"""Create an annotation for a single trace
|
70
|
+
|
71
|
+
Args:
|
72
|
+
id (str):
|
73
|
+
body (PostApiAnnotationsTraceIdBody):
|
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[Annotation, Error]]
|
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: PostApiAnnotationsTraceIdBody,
|
100
|
+
) -> Optional[Union[Annotation, Error]]:
|
101
|
+
"""Create an annotation for a single trace
|
102
|
+
|
103
|
+
Args:
|
104
|
+
id (str):
|
105
|
+
body (PostApiAnnotationsTraceIdBody):
|
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[Annotation, Error]
|
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: PostApiAnnotationsTraceIdBody,
|
127
|
+
) -> Response[Union[Annotation, Error]]:
|
128
|
+
"""Create an annotation for a single trace
|
129
|
+
|
130
|
+
Args:
|
131
|
+
id (str):
|
132
|
+
body (PostApiAnnotationsTraceIdBody):
|
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[Annotation, Error]]
|
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: PostApiAnnotationsTraceIdBody,
|
157
|
+
) -> Optional[Union[Annotation, Error]]:
|
158
|
+
"""Create an annotation for a single trace
|
159
|
+
|
160
|
+
Args:
|
161
|
+
id (str):
|
162
|
+
body (PostApiAnnotationsTraceIdBody):
|
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[Annotation, Error]
|
170
|
+
"""
|
171
|
+
|
172
|
+
return (
|
173
|
+
await asyncio_detailed(
|
174
|
+
id=id,
|
175
|
+
client=client,
|
176
|
+
body=body,
|
177
|
+
)
|
178
|
+
).parsed
|
@@ -0,0 +1,108 @@
|
|
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.dataset_post_entries import DatasetPostEntries
|
9
|
+
from ...types import Response
|
10
|
+
|
11
|
+
|
12
|
+
def _get_kwargs(
|
13
|
+
slug: str,
|
14
|
+
*,
|
15
|
+
body: DatasetPostEntries,
|
16
|
+
) -> dict[str, Any]:
|
17
|
+
headers: dict[str, Any] = {}
|
18
|
+
|
19
|
+
_kwargs: dict[str, Any] = {
|
20
|
+
"method": "post",
|
21
|
+
"url": f"/api/dataset/{slug}/entries",
|
22
|
+
}
|
23
|
+
|
24
|
+
_body = body.to_dict()
|
25
|
+
|
26
|
+
_kwargs["json"] = _body
|
27
|
+
headers["Content-Type"] = "application/json"
|
28
|
+
|
29
|
+
_kwargs["headers"] = headers
|
30
|
+
return _kwargs
|
31
|
+
|
32
|
+
|
33
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
34
|
+
if client.raise_on_unexpected_status:
|
35
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
36
|
+
else:
|
37
|
+
return None
|
38
|
+
|
39
|
+
|
40
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
41
|
+
return Response(
|
42
|
+
status_code=HTTPStatus(response.status_code),
|
43
|
+
content=response.content,
|
44
|
+
headers=response.headers,
|
45
|
+
parsed=_parse_response(client=client, response=response),
|
46
|
+
)
|
47
|
+
|
48
|
+
|
49
|
+
def sync_detailed(
|
50
|
+
slug: str,
|
51
|
+
*,
|
52
|
+
client: Union[AuthenticatedClient, Client],
|
53
|
+
body: DatasetPostEntries,
|
54
|
+
) -> Response[Any]:
|
55
|
+
"""Add entries to a dataset
|
56
|
+
|
57
|
+
Args:
|
58
|
+
slug (str):
|
59
|
+
body (DatasetPostEntries):
|
60
|
+
|
61
|
+
Raises:
|
62
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
63
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
64
|
+
|
65
|
+
Returns:
|
66
|
+
Response[Any]
|
67
|
+
"""
|
68
|
+
|
69
|
+
kwargs = _get_kwargs(
|
70
|
+
slug=slug,
|
71
|
+
body=body,
|
72
|
+
)
|
73
|
+
|
74
|
+
response = client.get_httpx_client().request(
|
75
|
+
**kwargs,
|
76
|
+
)
|
77
|
+
|
78
|
+
return _build_response(client=client, response=response)
|
79
|
+
|
80
|
+
|
81
|
+
async def asyncio_detailed(
|
82
|
+
slug: str,
|
83
|
+
*,
|
84
|
+
client: Union[AuthenticatedClient, Client],
|
85
|
+
body: DatasetPostEntries,
|
86
|
+
) -> Response[Any]:
|
87
|
+
"""Add entries to a dataset
|
88
|
+
|
89
|
+
Args:
|
90
|
+
slug (str):
|
91
|
+
body (DatasetPostEntries):
|
92
|
+
|
93
|
+
Raises:
|
94
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
95
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
96
|
+
|
97
|
+
Returns:
|
98
|
+
Response[Any]
|
99
|
+
"""
|
100
|
+
|
101
|
+
kwargs = _get_kwargs(
|
102
|
+
slug=slug,
|
103
|
+
body=body,
|
104
|
+
)
|
105
|
+
|
106
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
107
|
+
|
108
|
+
return _build_response(client=client, response=response)
|