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,152 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
3
|
+
|
4
|
+
from attrs import define as _attrs_define
|
5
|
+
from attrs import field as _attrs_field
|
6
|
+
|
7
|
+
from ..types import UNSET, Unset
|
8
|
+
|
9
|
+
if TYPE_CHECKING:
|
10
|
+
from ..models.get_api_trace_id_response_200_evaluations_item_error import (
|
11
|
+
GetApiTraceIdResponse200EvaluationsItemError,
|
12
|
+
)
|
13
|
+
from ..models.get_api_trace_id_response_200_evaluations_item_timestamps import (
|
14
|
+
GetApiTraceIdResponse200EvaluationsItemTimestamps,
|
15
|
+
)
|
16
|
+
|
17
|
+
|
18
|
+
T = TypeVar("T", bound="GetApiTraceIdResponse200EvaluationsItem")
|
19
|
+
|
20
|
+
|
21
|
+
@_attrs_define
|
22
|
+
class GetApiTraceIdResponse200EvaluationsItem:
|
23
|
+
"""
|
24
|
+
Attributes:
|
25
|
+
evaluation_id (Union[Unset, str]): Example: check_VCagriZHNWICSOM09dXjM.
|
26
|
+
name (Union[Unset, str]): Example: Ragas Answer Relevancy.
|
27
|
+
type_ (Union[Unset, str]): Example: ragas/answer_relevancy.
|
28
|
+
trace_id (Union[Unset, str]): Example: trace_BKZL_X0TKSD4oa1aBJTc_.
|
29
|
+
project_id (Union[Unset, str]): Example: KAXYxPR8MUgTcP8CF193y.
|
30
|
+
status (Union[Unset, str]): Example: error.
|
31
|
+
timestamps (Union[Unset, GetApiTraceIdResponse200EvaluationsItemTimestamps]):
|
32
|
+
error (Union[Unset, GetApiTraceIdResponse200EvaluationsItemError]):
|
33
|
+
"""
|
34
|
+
|
35
|
+
evaluation_id: Union[Unset, str] = UNSET
|
36
|
+
name: Union[Unset, str] = UNSET
|
37
|
+
type_: Union[Unset, str] = UNSET
|
38
|
+
trace_id: Union[Unset, str] = UNSET
|
39
|
+
project_id: Union[Unset, str] = UNSET
|
40
|
+
status: Union[Unset, str] = UNSET
|
41
|
+
timestamps: Union[Unset, "GetApiTraceIdResponse200EvaluationsItemTimestamps"] = UNSET
|
42
|
+
error: Union[Unset, "GetApiTraceIdResponse200EvaluationsItemError"] = UNSET
|
43
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
44
|
+
|
45
|
+
def to_dict(self) -> dict[str, Any]:
|
46
|
+
evaluation_id = self.evaluation_id
|
47
|
+
|
48
|
+
name = self.name
|
49
|
+
|
50
|
+
type_ = self.type_
|
51
|
+
|
52
|
+
trace_id = self.trace_id
|
53
|
+
|
54
|
+
project_id = self.project_id
|
55
|
+
|
56
|
+
status = self.status
|
57
|
+
|
58
|
+
timestamps: Union[Unset, dict[str, Any]] = UNSET
|
59
|
+
if not isinstance(self.timestamps, Unset):
|
60
|
+
timestamps = self.timestamps.to_dict()
|
61
|
+
|
62
|
+
error: Union[Unset, dict[str, Any]] = UNSET
|
63
|
+
if not isinstance(self.error, Unset):
|
64
|
+
error = self.error.to_dict()
|
65
|
+
|
66
|
+
field_dict: dict[str, Any] = {}
|
67
|
+
field_dict.update(self.additional_properties)
|
68
|
+
field_dict.update({})
|
69
|
+
if evaluation_id is not UNSET:
|
70
|
+
field_dict["evaluation_id"] = evaluation_id
|
71
|
+
if name is not UNSET:
|
72
|
+
field_dict["name"] = name
|
73
|
+
if type_ is not UNSET:
|
74
|
+
field_dict["type"] = type_
|
75
|
+
if trace_id is not UNSET:
|
76
|
+
field_dict["trace_id"] = trace_id
|
77
|
+
if project_id is not UNSET:
|
78
|
+
field_dict["project_id"] = project_id
|
79
|
+
if status is not UNSET:
|
80
|
+
field_dict["status"] = status
|
81
|
+
if timestamps is not UNSET:
|
82
|
+
field_dict["timestamps"] = timestamps
|
83
|
+
if error is not UNSET:
|
84
|
+
field_dict["error"] = error
|
85
|
+
|
86
|
+
return field_dict
|
87
|
+
|
88
|
+
@classmethod
|
89
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
90
|
+
from ..models.get_api_trace_id_response_200_evaluations_item_error import (
|
91
|
+
GetApiTraceIdResponse200EvaluationsItemError,
|
92
|
+
)
|
93
|
+
from ..models.get_api_trace_id_response_200_evaluations_item_timestamps import (
|
94
|
+
GetApiTraceIdResponse200EvaluationsItemTimestamps,
|
95
|
+
)
|
96
|
+
|
97
|
+
d = dict(src_dict)
|
98
|
+
evaluation_id = d.pop("evaluation_id", UNSET)
|
99
|
+
|
100
|
+
name = d.pop("name", UNSET)
|
101
|
+
|
102
|
+
type_ = d.pop("type", UNSET)
|
103
|
+
|
104
|
+
trace_id = d.pop("trace_id", UNSET)
|
105
|
+
|
106
|
+
project_id = d.pop("project_id", UNSET)
|
107
|
+
|
108
|
+
status = d.pop("status", UNSET)
|
109
|
+
|
110
|
+
_timestamps = d.pop("timestamps", UNSET)
|
111
|
+
timestamps: Union[Unset, GetApiTraceIdResponse200EvaluationsItemTimestamps]
|
112
|
+
if isinstance(_timestamps, Unset):
|
113
|
+
timestamps = UNSET
|
114
|
+
else:
|
115
|
+
timestamps = GetApiTraceIdResponse200EvaluationsItemTimestamps.from_dict(_timestamps)
|
116
|
+
|
117
|
+
_error = d.pop("error", UNSET)
|
118
|
+
error: Union[Unset, GetApiTraceIdResponse200EvaluationsItemError]
|
119
|
+
if isinstance(_error, Unset):
|
120
|
+
error = UNSET
|
121
|
+
else:
|
122
|
+
error = GetApiTraceIdResponse200EvaluationsItemError.from_dict(_error)
|
123
|
+
|
124
|
+
get_api_trace_id_response_200_evaluations_item = cls(
|
125
|
+
evaluation_id=evaluation_id,
|
126
|
+
name=name,
|
127
|
+
type_=type_,
|
128
|
+
trace_id=trace_id,
|
129
|
+
project_id=project_id,
|
130
|
+
status=status,
|
131
|
+
timestamps=timestamps,
|
132
|
+
error=error,
|
133
|
+
)
|
134
|
+
|
135
|
+
get_api_trace_id_response_200_evaluations_item.additional_properties = d
|
136
|
+
return get_api_trace_id_response_200_evaluations_item
|
137
|
+
|
138
|
+
@property
|
139
|
+
def additional_keys(self) -> list[str]:
|
140
|
+
return list(self.additional_properties.keys())
|
141
|
+
|
142
|
+
def __getitem__(self, key: str) -> Any:
|
143
|
+
return self.additional_properties[key]
|
144
|
+
|
145
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
146
|
+
self.additional_properties[key] = value
|
147
|
+
|
148
|
+
def __delitem__(self, key: str) -> None:
|
149
|
+
del self.additional_properties[key]
|
150
|
+
|
151
|
+
def __contains__(self, key: str) -> bool:
|
152
|
+
return key in self.additional_properties
|
@@ -0,0 +1,79 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import Any, TypeVar, Union, cast
|
3
|
+
|
4
|
+
from attrs import define as _attrs_define
|
5
|
+
from attrs import field as _attrs_field
|
6
|
+
|
7
|
+
from ..types import UNSET, Unset
|
8
|
+
|
9
|
+
T = TypeVar("T", bound="GetApiTraceIdResponse200EvaluationsItemError")
|
10
|
+
|
11
|
+
|
12
|
+
@_attrs_define
|
13
|
+
class GetApiTraceIdResponse200EvaluationsItemError:
|
14
|
+
"""
|
15
|
+
Attributes:
|
16
|
+
stacktrace (Union[Unset, list[str]]): Example: ['TypeError: fetch failed'].
|
17
|
+
message (Union[Unset, str]): Example: fetch failed.
|
18
|
+
has_error (Union[Unset, bool]): Example: True.
|
19
|
+
"""
|
20
|
+
|
21
|
+
stacktrace: Union[Unset, list[str]] = UNSET
|
22
|
+
message: Union[Unset, str] = UNSET
|
23
|
+
has_error: Union[Unset, bool] = UNSET
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
|
+
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
27
|
+
stacktrace: Union[Unset, list[str]] = UNSET
|
28
|
+
if not isinstance(self.stacktrace, Unset):
|
29
|
+
stacktrace = self.stacktrace
|
30
|
+
|
31
|
+
message = self.message
|
32
|
+
|
33
|
+
has_error = self.has_error
|
34
|
+
|
35
|
+
field_dict: dict[str, Any] = {}
|
36
|
+
field_dict.update(self.additional_properties)
|
37
|
+
field_dict.update({})
|
38
|
+
if stacktrace is not UNSET:
|
39
|
+
field_dict["stacktrace"] = stacktrace
|
40
|
+
if message is not UNSET:
|
41
|
+
field_dict["message"] = message
|
42
|
+
if has_error is not UNSET:
|
43
|
+
field_dict["has_error"] = has_error
|
44
|
+
|
45
|
+
return field_dict
|
46
|
+
|
47
|
+
@classmethod
|
48
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
49
|
+
d = dict(src_dict)
|
50
|
+
stacktrace = cast(list[str], d.pop("stacktrace", UNSET))
|
51
|
+
|
52
|
+
message = d.pop("message", UNSET)
|
53
|
+
|
54
|
+
has_error = d.pop("has_error", UNSET)
|
55
|
+
|
56
|
+
get_api_trace_id_response_200_evaluations_item_error = cls(
|
57
|
+
stacktrace=stacktrace,
|
58
|
+
message=message,
|
59
|
+
has_error=has_error,
|
60
|
+
)
|
61
|
+
|
62
|
+
get_api_trace_id_response_200_evaluations_item_error.additional_properties = d
|
63
|
+
return get_api_trace_id_response_200_evaluations_item_error
|
64
|
+
|
65
|
+
@property
|
66
|
+
def additional_keys(self) -> list[str]:
|
67
|
+
return list(self.additional_properties.keys())
|
68
|
+
|
69
|
+
def __getitem__(self, key: str) -> Any:
|
70
|
+
return self.additional_properties[key]
|
71
|
+
|
72
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
73
|
+
self.additional_properties[key] = value
|
74
|
+
|
75
|
+
def __delitem__(self, key: str) -> None:
|
76
|
+
del self.additional_properties[key]
|
77
|
+
|
78
|
+
def __contains__(self, key: str) -> bool:
|
79
|
+
return key in self.additional_properties
|
@@ -0,0 +1,68 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import Any, TypeVar, Union
|
3
|
+
|
4
|
+
from attrs import define as _attrs_define
|
5
|
+
from attrs import field as _attrs_field
|
6
|
+
|
7
|
+
from ..types import UNSET, Unset
|
8
|
+
|
9
|
+
T = TypeVar("T", bound="GetApiTraceIdResponse200EvaluationsItemTimestamps")
|
10
|
+
|
11
|
+
|
12
|
+
@_attrs_define
|
13
|
+
class GetApiTraceIdResponse200EvaluationsItemTimestamps:
|
14
|
+
"""
|
15
|
+
Attributes:
|
16
|
+
updated_at (Union[Unset, int]): Example: 1721383657788.
|
17
|
+
inserted_at (Union[Unset, int]): Example: 1721382493358.
|
18
|
+
"""
|
19
|
+
|
20
|
+
updated_at: Union[Unset, int] = UNSET
|
21
|
+
inserted_at: Union[Unset, int] = UNSET
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
+
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
25
|
+
updated_at = self.updated_at
|
26
|
+
|
27
|
+
inserted_at = self.inserted_at
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if updated_at is not UNSET:
|
33
|
+
field_dict["updated_at"] = updated_at
|
34
|
+
if inserted_at is not UNSET:
|
35
|
+
field_dict["inserted_at"] = inserted_at
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
41
|
+
d = dict(src_dict)
|
42
|
+
updated_at = d.pop("updated_at", UNSET)
|
43
|
+
|
44
|
+
inserted_at = d.pop("inserted_at", UNSET)
|
45
|
+
|
46
|
+
get_api_trace_id_response_200_evaluations_item_timestamps = cls(
|
47
|
+
updated_at=updated_at,
|
48
|
+
inserted_at=inserted_at,
|
49
|
+
)
|
50
|
+
|
51
|
+
get_api_trace_id_response_200_evaluations_item_timestamps.additional_properties = d
|
52
|
+
return get_api_trace_id_response_200_evaluations_item_timestamps
|
53
|
+
|
54
|
+
@property
|
55
|
+
def additional_keys(self) -> list[str]:
|
56
|
+
return list(self.additional_properties.keys())
|
57
|
+
|
58
|
+
def __getitem__(self, key: str) -> Any:
|
59
|
+
return self.additional_properties[key]
|
60
|
+
|
61
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
62
|
+
self.additional_properties[key] = value
|
63
|
+
|
64
|
+
def __delitem__(self, key: str) -> None:
|
65
|
+
del self.additional_properties[key]
|
66
|
+
|
67
|
+
def __contains__(self, key: str) -> bool:
|
68
|
+
return key in self.additional_properties
|
@@ -0,0 +1,59 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import Any, TypeVar, Union
|
3
|
+
|
4
|
+
from attrs import define as _attrs_define
|
5
|
+
from attrs import field as _attrs_field
|
6
|
+
|
7
|
+
from ..types import UNSET, Unset
|
8
|
+
|
9
|
+
T = TypeVar("T", bound="GetApiTraceIdResponse200Input")
|
10
|
+
|
11
|
+
|
12
|
+
@_attrs_define
|
13
|
+
class GetApiTraceIdResponse200Input:
|
14
|
+
"""
|
15
|
+
Attributes:
|
16
|
+
value (Union[Unset, str]): Example: hi.
|
17
|
+
"""
|
18
|
+
|
19
|
+
value: Union[Unset, str] = UNSET
|
20
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
21
|
+
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
23
|
+
value = self.value
|
24
|
+
|
25
|
+
field_dict: dict[str, Any] = {}
|
26
|
+
field_dict.update(self.additional_properties)
|
27
|
+
field_dict.update({})
|
28
|
+
if value is not UNSET:
|
29
|
+
field_dict["value"] = value
|
30
|
+
|
31
|
+
return field_dict
|
32
|
+
|
33
|
+
@classmethod
|
34
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
35
|
+
d = dict(src_dict)
|
36
|
+
value = d.pop("value", UNSET)
|
37
|
+
|
38
|
+
get_api_trace_id_response_200_input = cls(
|
39
|
+
value=value,
|
40
|
+
)
|
41
|
+
|
42
|
+
get_api_trace_id_response_200_input.additional_properties = d
|
43
|
+
return get_api_trace_id_response_200_input
|
44
|
+
|
45
|
+
@property
|
46
|
+
def additional_keys(self) -> list[str]:
|
47
|
+
return list(self.additional_properties.keys())
|
48
|
+
|
49
|
+
def __getitem__(self, key: str) -> Any:
|
50
|
+
return self.additional_properties[key]
|
51
|
+
|
52
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
53
|
+
self.additional_properties[key] = value
|
54
|
+
|
55
|
+
def __delitem__(self, key: str) -> None:
|
56
|
+
del self.additional_properties[key]
|
57
|
+
|
58
|
+
def __contains__(self, key: str) -> bool:
|
59
|
+
return key in self.additional_properties
|
@@ -0,0 +1,68 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import Any, TypeVar, Union
|
3
|
+
|
4
|
+
from attrs import define as _attrs_define
|
5
|
+
from attrs import field as _attrs_field
|
6
|
+
|
7
|
+
from ..types import UNSET, Unset
|
8
|
+
|
9
|
+
T = TypeVar("T", bound="GetApiTraceIdResponse200Metadata")
|
10
|
+
|
11
|
+
|
12
|
+
@_attrs_define
|
13
|
+
class GetApiTraceIdResponse200Metadata:
|
14
|
+
"""
|
15
|
+
Attributes:
|
16
|
+
sdk_version (Union[Unset, str]): Example: 0.1.11.
|
17
|
+
sdk_language (Union[Unset, str]): Example: python.
|
18
|
+
"""
|
19
|
+
|
20
|
+
sdk_version: Union[Unset, str] = UNSET
|
21
|
+
sdk_language: Union[Unset, str] = UNSET
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
+
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
25
|
+
sdk_version = self.sdk_version
|
26
|
+
|
27
|
+
sdk_language = self.sdk_language
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if sdk_version is not UNSET:
|
33
|
+
field_dict["sdk_version"] = sdk_version
|
34
|
+
if sdk_language is not UNSET:
|
35
|
+
field_dict["sdk_language"] = sdk_language
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
41
|
+
d = dict(src_dict)
|
42
|
+
sdk_version = d.pop("sdk_version", UNSET)
|
43
|
+
|
44
|
+
sdk_language = d.pop("sdk_language", UNSET)
|
45
|
+
|
46
|
+
get_api_trace_id_response_200_metadata = cls(
|
47
|
+
sdk_version=sdk_version,
|
48
|
+
sdk_language=sdk_language,
|
49
|
+
)
|
50
|
+
|
51
|
+
get_api_trace_id_response_200_metadata.additional_properties = d
|
52
|
+
return get_api_trace_id_response_200_metadata
|
53
|
+
|
54
|
+
@property
|
55
|
+
def additional_keys(self) -> list[str]:
|
56
|
+
return list(self.additional_properties.keys())
|
57
|
+
|
58
|
+
def __getitem__(self, key: str) -> Any:
|
59
|
+
return self.additional_properties[key]
|
60
|
+
|
61
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
62
|
+
self.additional_properties[key] = value
|
63
|
+
|
64
|
+
def __delitem__(self, key: str) -> None:
|
65
|
+
del self.additional_properties[key]
|
66
|
+
|
67
|
+
def __contains__(self, key: str) -> bool:
|
68
|
+
return key in self.additional_properties
|
@@ -0,0 +1,95 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import Any, TypeVar, Union
|
3
|
+
|
4
|
+
from attrs import define as _attrs_define
|
5
|
+
from attrs import field as _attrs_field
|
6
|
+
|
7
|
+
from ..types import UNSET, Unset
|
8
|
+
|
9
|
+
T = TypeVar("T", bound="GetApiTraceIdResponse200Metrics")
|
10
|
+
|
11
|
+
|
12
|
+
@_attrs_define
|
13
|
+
class GetApiTraceIdResponse200Metrics:
|
14
|
+
"""
|
15
|
+
Attributes:
|
16
|
+
first_token_ms (Union[Unset, int]): Example: 1449.
|
17
|
+
total_time_ms (Union[Unset, int]): Example: 1543.
|
18
|
+
prompt_tokens (Union[Unset, int]): Example: 20.
|
19
|
+
completion_tokens (Union[Unset, int]): Example: 7.
|
20
|
+
tokens_estimated (Union[Unset, bool]): Example: True.
|
21
|
+
"""
|
22
|
+
|
23
|
+
first_token_ms: Union[Unset, int] = UNSET
|
24
|
+
total_time_ms: Union[Unset, int] = UNSET
|
25
|
+
prompt_tokens: Union[Unset, int] = UNSET
|
26
|
+
completion_tokens: Union[Unset, int] = UNSET
|
27
|
+
tokens_estimated: Union[Unset, bool] = UNSET
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
29
|
+
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
31
|
+
first_token_ms = self.first_token_ms
|
32
|
+
|
33
|
+
total_time_ms = self.total_time_ms
|
34
|
+
|
35
|
+
prompt_tokens = self.prompt_tokens
|
36
|
+
|
37
|
+
completion_tokens = self.completion_tokens
|
38
|
+
|
39
|
+
tokens_estimated = self.tokens_estimated
|
40
|
+
|
41
|
+
field_dict: dict[str, Any] = {}
|
42
|
+
field_dict.update(self.additional_properties)
|
43
|
+
field_dict.update({})
|
44
|
+
if first_token_ms is not UNSET:
|
45
|
+
field_dict["first_token_ms"] = first_token_ms
|
46
|
+
if total_time_ms is not UNSET:
|
47
|
+
field_dict["total_time_ms"] = total_time_ms
|
48
|
+
if prompt_tokens is not UNSET:
|
49
|
+
field_dict["prompt_tokens"] = prompt_tokens
|
50
|
+
if completion_tokens is not UNSET:
|
51
|
+
field_dict["completion_tokens"] = completion_tokens
|
52
|
+
if tokens_estimated is not UNSET:
|
53
|
+
field_dict["tokens_estimated"] = tokens_estimated
|
54
|
+
|
55
|
+
return field_dict
|
56
|
+
|
57
|
+
@classmethod
|
58
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
59
|
+
d = dict(src_dict)
|
60
|
+
first_token_ms = d.pop("first_token_ms", UNSET)
|
61
|
+
|
62
|
+
total_time_ms = d.pop("total_time_ms", UNSET)
|
63
|
+
|
64
|
+
prompt_tokens = d.pop("prompt_tokens", UNSET)
|
65
|
+
|
66
|
+
completion_tokens = d.pop("completion_tokens", UNSET)
|
67
|
+
|
68
|
+
tokens_estimated = d.pop("tokens_estimated", UNSET)
|
69
|
+
|
70
|
+
get_api_trace_id_response_200_metrics = cls(
|
71
|
+
first_token_ms=first_token_ms,
|
72
|
+
total_time_ms=total_time_ms,
|
73
|
+
prompt_tokens=prompt_tokens,
|
74
|
+
completion_tokens=completion_tokens,
|
75
|
+
tokens_estimated=tokens_estimated,
|
76
|
+
)
|
77
|
+
|
78
|
+
get_api_trace_id_response_200_metrics.additional_properties = d
|
79
|
+
return get_api_trace_id_response_200_metrics
|
80
|
+
|
81
|
+
@property
|
82
|
+
def additional_keys(self) -> list[str]:
|
83
|
+
return list(self.additional_properties.keys())
|
84
|
+
|
85
|
+
def __getitem__(self, key: str) -> Any:
|
86
|
+
return self.additional_properties[key]
|
87
|
+
|
88
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
89
|
+
self.additional_properties[key] = value
|
90
|
+
|
91
|
+
def __delitem__(self, key: str) -> None:
|
92
|
+
del self.additional_properties[key]
|
93
|
+
|
94
|
+
def __contains__(self, key: str) -> bool:
|
95
|
+
return key in self.additional_properties
|
@@ -0,0 +1,59 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import Any, TypeVar, Union
|
3
|
+
|
4
|
+
from attrs import define as _attrs_define
|
5
|
+
from attrs import field as _attrs_field
|
6
|
+
|
7
|
+
from ..types import UNSET, Unset
|
8
|
+
|
9
|
+
T = TypeVar("T", bound="GetApiTraceIdResponse200Output")
|
10
|
+
|
11
|
+
|
12
|
+
@_attrs_define
|
13
|
+
class GetApiTraceIdResponse200Output:
|
14
|
+
"""
|
15
|
+
Attributes:
|
16
|
+
value (Union[Unset, str]): Example: Hey there! 👋😊.
|
17
|
+
"""
|
18
|
+
|
19
|
+
value: Union[Unset, str] = UNSET
|
20
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
21
|
+
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
23
|
+
value = self.value
|
24
|
+
|
25
|
+
field_dict: dict[str, Any] = {}
|
26
|
+
field_dict.update(self.additional_properties)
|
27
|
+
field_dict.update({})
|
28
|
+
if value is not UNSET:
|
29
|
+
field_dict["value"] = value
|
30
|
+
|
31
|
+
return field_dict
|
32
|
+
|
33
|
+
@classmethod
|
34
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
35
|
+
d = dict(src_dict)
|
36
|
+
value = d.pop("value", UNSET)
|
37
|
+
|
38
|
+
get_api_trace_id_response_200_output = cls(
|
39
|
+
value=value,
|
40
|
+
)
|
41
|
+
|
42
|
+
get_api_trace_id_response_200_output.additional_properties = d
|
43
|
+
return get_api_trace_id_response_200_output
|
44
|
+
|
45
|
+
@property
|
46
|
+
def additional_keys(self) -> list[str]:
|
47
|
+
return list(self.additional_properties.keys())
|
48
|
+
|
49
|
+
def __getitem__(self, key: str) -> Any:
|
50
|
+
return self.additional_properties[key]
|
51
|
+
|
52
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
53
|
+
self.additional_properties[key] = value
|
54
|
+
|
55
|
+
def __delitem__(self, key: str) -> None:
|
56
|
+
del self.additional_properties[key]
|
57
|
+
|
58
|
+
def __contains__(self, key: str) -> bool:
|
59
|
+
return key in self.additional_properties
|