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
@@ -0,0 +1,271 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import TYPE_CHECKING, 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
|
+
if TYPE_CHECKING:
|
10
|
+
from ..models.get_api_trace_id_response_200_spans_item_error_type_0 import (
|
11
|
+
GetApiTraceIdResponse200SpansItemErrorType0,
|
12
|
+
)
|
13
|
+
from ..models.get_api_trace_id_response_200_spans_item_input import GetApiTraceIdResponse200SpansItemInput
|
14
|
+
from ..models.get_api_trace_id_response_200_spans_item_metrics import GetApiTraceIdResponse200SpansItemMetrics
|
15
|
+
from ..models.get_api_trace_id_response_200_spans_item_output import GetApiTraceIdResponse200SpansItemOutput
|
16
|
+
from ..models.get_api_trace_id_response_200_spans_item_params import GetApiTraceIdResponse200SpansItemParams
|
17
|
+
from ..models.get_api_trace_id_response_200_spans_item_timestamps import GetApiTraceIdResponse200SpansItemTimestamps
|
18
|
+
|
19
|
+
|
20
|
+
T = TypeVar("T", bound="GetApiTraceIdResponse200SpansItem")
|
21
|
+
|
22
|
+
|
23
|
+
@_attrs_define
|
24
|
+
class GetApiTraceIdResponse200SpansItem:
|
25
|
+
"""
|
26
|
+
Attributes:
|
27
|
+
trace_id (Union[Unset, str]): Example: trace_BKZL_X0TKSD4oa1aBJTc_.
|
28
|
+
span_id (Union[Unset, str]): Example: span_h1xUkcUJilhudDrLeQbR_.
|
29
|
+
timestamps (Union[Unset, GetApiTraceIdResponse200SpansItemTimestamps]):
|
30
|
+
type_ (Union[Unset, str]): Example: llm.
|
31
|
+
error (Union['GetApiTraceIdResponse200SpansItemErrorType0', None, Unset]):
|
32
|
+
params (Union[Unset, GetApiTraceIdResponse200SpansItemParams]):
|
33
|
+
project_id (Union[Unset, str]): Example: KAXYxPR8MUgTcP8CF193y.
|
34
|
+
parent_id (Union[None, Unset, str]): Example: span_ijZNjUMTz3ys0Z0YKwF_T.
|
35
|
+
name (Union[None, Unset, str]):
|
36
|
+
model (Union[Unset, str]): Example: openai/gpt-4o.
|
37
|
+
metrics (Union[Unset, GetApiTraceIdResponse200SpansItemMetrics]):
|
38
|
+
input_ (Union[Unset, GetApiTraceIdResponse200SpansItemInput]):
|
39
|
+
output (Union[Unset, GetApiTraceIdResponse200SpansItemOutput]):
|
40
|
+
"""
|
41
|
+
|
42
|
+
trace_id: Union[Unset, str] = UNSET
|
43
|
+
span_id: Union[Unset, str] = UNSET
|
44
|
+
timestamps: Union[Unset, "GetApiTraceIdResponse200SpansItemTimestamps"] = UNSET
|
45
|
+
type_: Union[Unset, str] = UNSET
|
46
|
+
error: Union["GetApiTraceIdResponse200SpansItemErrorType0", None, Unset] = UNSET
|
47
|
+
params: Union[Unset, "GetApiTraceIdResponse200SpansItemParams"] = UNSET
|
48
|
+
project_id: Union[Unset, str] = UNSET
|
49
|
+
parent_id: Union[None, Unset, str] = UNSET
|
50
|
+
name: Union[None, Unset, str] = UNSET
|
51
|
+
model: Union[Unset, str] = UNSET
|
52
|
+
metrics: Union[Unset, "GetApiTraceIdResponse200SpansItemMetrics"] = UNSET
|
53
|
+
input_: Union[Unset, "GetApiTraceIdResponse200SpansItemInput"] = UNSET
|
54
|
+
output: Union[Unset, "GetApiTraceIdResponse200SpansItemOutput"] = UNSET
|
55
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
56
|
+
|
57
|
+
def to_dict(self) -> dict[str, Any]:
|
58
|
+
from ..models.get_api_trace_id_response_200_spans_item_error_type_0 import (
|
59
|
+
GetApiTraceIdResponse200SpansItemErrorType0,
|
60
|
+
)
|
61
|
+
|
62
|
+
trace_id = self.trace_id
|
63
|
+
|
64
|
+
span_id = self.span_id
|
65
|
+
|
66
|
+
timestamps: Union[Unset, dict[str, Any]] = UNSET
|
67
|
+
if not isinstance(self.timestamps, Unset):
|
68
|
+
timestamps = self.timestamps.to_dict()
|
69
|
+
|
70
|
+
type_ = self.type_
|
71
|
+
|
72
|
+
error: Union[None, Unset, dict[str, Any]]
|
73
|
+
if isinstance(self.error, Unset):
|
74
|
+
error = UNSET
|
75
|
+
elif isinstance(self.error, GetApiTraceIdResponse200SpansItemErrorType0):
|
76
|
+
error = self.error.to_dict()
|
77
|
+
else:
|
78
|
+
error = self.error
|
79
|
+
|
80
|
+
params: Union[Unset, dict[str, Any]] = UNSET
|
81
|
+
if not isinstance(self.params, Unset):
|
82
|
+
params = self.params.to_dict()
|
83
|
+
|
84
|
+
project_id = self.project_id
|
85
|
+
|
86
|
+
parent_id: Union[None, Unset, str]
|
87
|
+
if isinstance(self.parent_id, Unset):
|
88
|
+
parent_id = UNSET
|
89
|
+
else:
|
90
|
+
parent_id = self.parent_id
|
91
|
+
|
92
|
+
name: Union[None, Unset, str]
|
93
|
+
if isinstance(self.name, Unset):
|
94
|
+
name = UNSET
|
95
|
+
else:
|
96
|
+
name = self.name
|
97
|
+
|
98
|
+
model = self.model
|
99
|
+
|
100
|
+
metrics: Union[Unset, dict[str, Any]] = UNSET
|
101
|
+
if not isinstance(self.metrics, Unset):
|
102
|
+
metrics = self.metrics.to_dict()
|
103
|
+
|
104
|
+
input_: Union[Unset, dict[str, Any]] = UNSET
|
105
|
+
if not isinstance(self.input_, Unset):
|
106
|
+
input_ = self.input_.to_dict()
|
107
|
+
|
108
|
+
output: Union[Unset, dict[str, Any]] = UNSET
|
109
|
+
if not isinstance(self.output, Unset):
|
110
|
+
output = self.output.to_dict()
|
111
|
+
|
112
|
+
field_dict: dict[str, Any] = {}
|
113
|
+
field_dict.update(self.additional_properties)
|
114
|
+
field_dict.update({})
|
115
|
+
if trace_id is not UNSET:
|
116
|
+
field_dict["trace_id"] = trace_id
|
117
|
+
if span_id is not UNSET:
|
118
|
+
field_dict["span_id"] = span_id
|
119
|
+
if timestamps is not UNSET:
|
120
|
+
field_dict["timestamps"] = timestamps
|
121
|
+
if type_ is not UNSET:
|
122
|
+
field_dict["type"] = type_
|
123
|
+
if error is not UNSET:
|
124
|
+
field_dict["error"] = error
|
125
|
+
if params is not UNSET:
|
126
|
+
field_dict["params"] = params
|
127
|
+
if project_id is not UNSET:
|
128
|
+
field_dict["project_id"] = project_id
|
129
|
+
if parent_id is not UNSET:
|
130
|
+
field_dict["parent_id"] = parent_id
|
131
|
+
if name is not UNSET:
|
132
|
+
field_dict["name"] = name
|
133
|
+
if model is not UNSET:
|
134
|
+
field_dict["model"] = model
|
135
|
+
if metrics is not UNSET:
|
136
|
+
field_dict["metrics"] = metrics
|
137
|
+
if input_ is not UNSET:
|
138
|
+
field_dict["input"] = input_
|
139
|
+
if output is not UNSET:
|
140
|
+
field_dict["output"] = output
|
141
|
+
|
142
|
+
return field_dict
|
143
|
+
|
144
|
+
@classmethod
|
145
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
146
|
+
from ..models.get_api_trace_id_response_200_spans_item_error_type_0 import (
|
147
|
+
GetApiTraceIdResponse200SpansItemErrorType0,
|
148
|
+
)
|
149
|
+
from ..models.get_api_trace_id_response_200_spans_item_input import GetApiTraceIdResponse200SpansItemInput
|
150
|
+
from ..models.get_api_trace_id_response_200_spans_item_metrics import GetApiTraceIdResponse200SpansItemMetrics
|
151
|
+
from ..models.get_api_trace_id_response_200_spans_item_output import GetApiTraceIdResponse200SpansItemOutput
|
152
|
+
from ..models.get_api_trace_id_response_200_spans_item_params import GetApiTraceIdResponse200SpansItemParams
|
153
|
+
from ..models.get_api_trace_id_response_200_spans_item_timestamps import (
|
154
|
+
GetApiTraceIdResponse200SpansItemTimestamps,
|
155
|
+
)
|
156
|
+
|
157
|
+
d = dict(src_dict)
|
158
|
+
trace_id = d.pop("trace_id", UNSET)
|
159
|
+
|
160
|
+
span_id = d.pop("span_id", UNSET)
|
161
|
+
|
162
|
+
_timestamps = d.pop("timestamps", UNSET)
|
163
|
+
timestamps: Union[Unset, GetApiTraceIdResponse200SpansItemTimestamps]
|
164
|
+
if isinstance(_timestamps, Unset):
|
165
|
+
timestamps = UNSET
|
166
|
+
else:
|
167
|
+
timestamps = GetApiTraceIdResponse200SpansItemTimestamps.from_dict(_timestamps)
|
168
|
+
|
169
|
+
type_ = d.pop("type", UNSET)
|
170
|
+
|
171
|
+
def _parse_error(data: object) -> Union["GetApiTraceIdResponse200SpansItemErrorType0", None, Unset]:
|
172
|
+
if data is None:
|
173
|
+
return data
|
174
|
+
if isinstance(data, Unset):
|
175
|
+
return data
|
176
|
+
try:
|
177
|
+
if not isinstance(data, dict):
|
178
|
+
raise TypeError()
|
179
|
+
error_type_0 = GetApiTraceIdResponse200SpansItemErrorType0.from_dict(data)
|
180
|
+
|
181
|
+
return error_type_0
|
182
|
+
except: # noqa: E722
|
183
|
+
pass
|
184
|
+
return cast(Union["GetApiTraceIdResponse200SpansItemErrorType0", None, Unset], data)
|
185
|
+
|
186
|
+
error = _parse_error(d.pop("error", UNSET))
|
187
|
+
|
188
|
+
_params = d.pop("params", UNSET)
|
189
|
+
params: Union[Unset, GetApiTraceIdResponse200SpansItemParams]
|
190
|
+
if isinstance(_params, Unset):
|
191
|
+
params = UNSET
|
192
|
+
else:
|
193
|
+
params = GetApiTraceIdResponse200SpansItemParams.from_dict(_params)
|
194
|
+
|
195
|
+
project_id = d.pop("project_id", UNSET)
|
196
|
+
|
197
|
+
def _parse_parent_id(data: object) -> Union[None, Unset, str]:
|
198
|
+
if data is None:
|
199
|
+
return data
|
200
|
+
if isinstance(data, Unset):
|
201
|
+
return data
|
202
|
+
return cast(Union[None, Unset, str], data)
|
203
|
+
|
204
|
+
parent_id = _parse_parent_id(d.pop("parent_id", UNSET))
|
205
|
+
|
206
|
+
def _parse_name(data: object) -> Union[None, Unset, str]:
|
207
|
+
if data is None:
|
208
|
+
return data
|
209
|
+
if isinstance(data, Unset):
|
210
|
+
return data
|
211
|
+
return cast(Union[None, Unset, str], data)
|
212
|
+
|
213
|
+
name = _parse_name(d.pop("name", UNSET))
|
214
|
+
|
215
|
+
model = d.pop("model", UNSET)
|
216
|
+
|
217
|
+
_metrics = d.pop("metrics", UNSET)
|
218
|
+
metrics: Union[Unset, GetApiTraceIdResponse200SpansItemMetrics]
|
219
|
+
if isinstance(_metrics, Unset):
|
220
|
+
metrics = UNSET
|
221
|
+
else:
|
222
|
+
metrics = GetApiTraceIdResponse200SpansItemMetrics.from_dict(_metrics)
|
223
|
+
|
224
|
+
_input_ = d.pop("input", UNSET)
|
225
|
+
input_: Union[Unset, GetApiTraceIdResponse200SpansItemInput]
|
226
|
+
if isinstance(_input_, Unset):
|
227
|
+
input_ = UNSET
|
228
|
+
else:
|
229
|
+
input_ = GetApiTraceIdResponse200SpansItemInput.from_dict(_input_)
|
230
|
+
|
231
|
+
_output = d.pop("output", UNSET)
|
232
|
+
output: Union[Unset, GetApiTraceIdResponse200SpansItemOutput]
|
233
|
+
if isinstance(_output, Unset):
|
234
|
+
output = UNSET
|
235
|
+
else:
|
236
|
+
output = GetApiTraceIdResponse200SpansItemOutput.from_dict(_output)
|
237
|
+
|
238
|
+
get_api_trace_id_response_200_spans_item = cls(
|
239
|
+
trace_id=trace_id,
|
240
|
+
span_id=span_id,
|
241
|
+
timestamps=timestamps,
|
242
|
+
type_=type_,
|
243
|
+
error=error,
|
244
|
+
params=params,
|
245
|
+
project_id=project_id,
|
246
|
+
parent_id=parent_id,
|
247
|
+
name=name,
|
248
|
+
model=model,
|
249
|
+
metrics=metrics,
|
250
|
+
input_=input_,
|
251
|
+
output=output,
|
252
|
+
)
|
253
|
+
|
254
|
+
get_api_trace_id_response_200_spans_item.additional_properties = d
|
255
|
+
return get_api_trace_id_response_200_spans_item
|
256
|
+
|
257
|
+
@property
|
258
|
+
def additional_keys(self) -> list[str]:
|
259
|
+
return list(self.additional_properties.keys())
|
260
|
+
|
261
|
+
def __getitem__(self, key: str) -> Any:
|
262
|
+
return self.additional_properties[key]
|
263
|
+
|
264
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
265
|
+
self.additional_properties[key] = value
|
266
|
+
|
267
|
+
def __delitem__(self, key: str) -> None:
|
268
|
+
del self.additional_properties[key]
|
269
|
+
|
270
|
+
def __contains__(self, key: str) -> bool:
|
271
|
+
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="GetApiTraceIdResponse200SpansItemErrorType0")
|
10
|
+
|
11
|
+
|
12
|
+
@_attrs_define
|
13
|
+
class GetApiTraceIdResponse200SpansItemErrorType0:
|
14
|
+
"""
|
15
|
+
Attributes:
|
16
|
+
stacktrace (Union[Unset, list[str]]):
|
17
|
+
message (Union[Unset, str]):
|
18
|
+
has_error (Union[Unset, bool]):
|
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_spans_item_error_type_0 = cls(
|
57
|
+
stacktrace=stacktrace,
|
58
|
+
message=message,
|
59
|
+
has_error=has_error,
|
60
|
+
)
|
61
|
+
|
62
|
+
get_api_trace_id_response_200_spans_item_error_type_0.additional_properties = d
|
63
|
+
return get_api_trace_id_response_200_spans_item_error_type_0
|
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,90 @@
|
|
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_spans_item_input_value_item import (
|
11
|
+
GetApiTraceIdResponse200SpansItemInputValueItem,
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
T = TypeVar("T", bound="GetApiTraceIdResponse200SpansItemInput")
|
16
|
+
|
17
|
+
|
18
|
+
@_attrs_define
|
19
|
+
class GetApiTraceIdResponse200SpansItemInput:
|
20
|
+
"""
|
21
|
+
Attributes:
|
22
|
+
type_ (Union[Unset, str]): Example: chat_messages.
|
23
|
+
value (Union[Unset, list['GetApiTraceIdResponse200SpansItemInputValueItem']]): Example: [{'role': 'system',
|
24
|
+
'content': 'You are a helpful assistant that only reply in short tweet-like responses, using lots of emojis.'},
|
25
|
+
{'role': 'user', 'content': 'hi'}].
|
26
|
+
"""
|
27
|
+
|
28
|
+
type_: Union[Unset, str] = UNSET
|
29
|
+
value: Union[Unset, list["GetApiTraceIdResponse200SpansItemInputValueItem"]] = UNSET
|
30
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
31
|
+
|
32
|
+
def to_dict(self) -> dict[str, Any]:
|
33
|
+
type_ = self.type_
|
34
|
+
|
35
|
+
value: Union[Unset, list[dict[str, Any]]] = UNSET
|
36
|
+
if not isinstance(self.value, Unset):
|
37
|
+
value = []
|
38
|
+
for value_item_data in self.value:
|
39
|
+
value_item = value_item_data.to_dict()
|
40
|
+
value.append(value_item)
|
41
|
+
|
42
|
+
field_dict: dict[str, Any] = {}
|
43
|
+
field_dict.update(self.additional_properties)
|
44
|
+
field_dict.update({})
|
45
|
+
if type_ is not UNSET:
|
46
|
+
field_dict["type"] = type_
|
47
|
+
if value is not UNSET:
|
48
|
+
field_dict["value"] = value
|
49
|
+
|
50
|
+
return field_dict
|
51
|
+
|
52
|
+
@classmethod
|
53
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
54
|
+
from ..models.get_api_trace_id_response_200_spans_item_input_value_item import (
|
55
|
+
GetApiTraceIdResponse200SpansItemInputValueItem,
|
56
|
+
)
|
57
|
+
|
58
|
+
d = dict(src_dict)
|
59
|
+
type_ = d.pop("type", UNSET)
|
60
|
+
|
61
|
+
value = []
|
62
|
+
_value = d.pop("value", UNSET)
|
63
|
+
for value_item_data in _value or []:
|
64
|
+
value_item = GetApiTraceIdResponse200SpansItemInputValueItem.from_dict(value_item_data)
|
65
|
+
|
66
|
+
value.append(value_item)
|
67
|
+
|
68
|
+
get_api_trace_id_response_200_spans_item_input = cls(
|
69
|
+
type_=type_,
|
70
|
+
value=value,
|
71
|
+
)
|
72
|
+
|
73
|
+
get_api_trace_id_response_200_spans_item_input.additional_properties = d
|
74
|
+
return get_api_trace_id_response_200_spans_item_input
|
75
|
+
|
76
|
+
@property
|
77
|
+
def additional_keys(self) -> list[str]:
|
78
|
+
return list(self.additional_properties.keys())
|
79
|
+
|
80
|
+
def __getitem__(self, key: str) -> Any:
|
81
|
+
return self.additional_properties[key]
|
82
|
+
|
83
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
84
|
+
self.additional_properties[key] = value
|
85
|
+
|
86
|
+
def __delitem__(self, key: str) -> None:
|
87
|
+
del self.additional_properties[key]
|
88
|
+
|
89
|
+
def __contains__(self, key: str) -> bool:
|
90
|
+
return key in self.additional_properties
|
@@ -0,0 +1,69 @@
|
|
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="GetApiTraceIdResponse200SpansItemInputValueItem")
|
10
|
+
|
11
|
+
|
12
|
+
@_attrs_define
|
13
|
+
class GetApiTraceIdResponse200SpansItemInputValueItem:
|
14
|
+
"""
|
15
|
+
Attributes:
|
16
|
+
role (Union[Unset, str]): Example: system.
|
17
|
+
content (Union[Unset, str]): Example: You are a helpful assistant that only reply in short tweet-like
|
18
|
+
responses, using lots of emojis..
|
19
|
+
"""
|
20
|
+
|
21
|
+
role: Union[Unset, str] = UNSET
|
22
|
+
content: Union[Unset, str] = UNSET
|
23
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
24
|
+
|
25
|
+
def to_dict(self) -> dict[str, Any]:
|
26
|
+
role = self.role
|
27
|
+
|
28
|
+
content = self.content
|
29
|
+
|
30
|
+
field_dict: dict[str, Any] = {}
|
31
|
+
field_dict.update(self.additional_properties)
|
32
|
+
field_dict.update({})
|
33
|
+
if role is not UNSET:
|
34
|
+
field_dict["role"] = role
|
35
|
+
if content is not UNSET:
|
36
|
+
field_dict["content"] = content
|
37
|
+
|
38
|
+
return field_dict
|
39
|
+
|
40
|
+
@classmethod
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
42
|
+
d = dict(src_dict)
|
43
|
+
role = d.pop("role", UNSET)
|
44
|
+
|
45
|
+
content = d.pop("content", UNSET)
|
46
|
+
|
47
|
+
get_api_trace_id_response_200_spans_item_input_value_item = cls(
|
48
|
+
role=role,
|
49
|
+
content=content,
|
50
|
+
)
|
51
|
+
|
52
|
+
get_api_trace_id_response_200_spans_item_input_value_item.additional_properties = d
|
53
|
+
return get_api_trace_id_response_200_spans_item_input_value_item
|
54
|
+
|
55
|
+
@property
|
56
|
+
def additional_keys(self) -> list[str]:
|
57
|
+
return list(self.additional_properties.keys())
|
58
|
+
|
59
|
+
def __getitem__(self, key: str) -> Any:
|
60
|
+
return self.additional_properties[key]
|
61
|
+
|
62
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
63
|
+
self.additional_properties[key] = value
|
64
|
+
|
65
|
+
def __delitem__(self, key: str) -> None:
|
66
|
+
del self.additional_properties[key]
|
67
|
+
|
68
|
+
def __contains__(self, key: str) -> bool:
|
69
|
+
return key in self.additional_properties
|
@@ -0,0 +1,77 @@
|
|
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="GetApiTraceIdResponse200SpansItemMetrics")
|
10
|
+
|
11
|
+
|
12
|
+
@_attrs_define
|
13
|
+
class GetApiTraceIdResponse200SpansItemMetrics:
|
14
|
+
"""
|
15
|
+
Attributes:
|
16
|
+
tokens_estimated (Union[Unset, bool]): Example: True.
|
17
|
+
completion_tokens (Union[Unset, int]): Example: 7.
|
18
|
+
prompt_tokens (Union[Unset, int]): Example: 20.
|
19
|
+
"""
|
20
|
+
|
21
|
+
tokens_estimated: Union[Unset, bool] = UNSET
|
22
|
+
completion_tokens: Union[Unset, int] = UNSET
|
23
|
+
prompt_tokens: Union[Unset, int] = UNSET
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
|
+
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
27
|
+
tokens_estimated = self.tokens_estimated
|
28
|
+
|
29
|
+
completion_tokens = self.completion_tokens
|
30
|
+
|
31
|
+
prompt_tokens = self.prompt_tokens
|
32
|
+
|
33
|
+
field_dict: dict[str, Any] = {}
|
34
|
+
field_dict.update(self.additional_properties)
|
35
|
+
field_dict.update({})
|
36
|
+
if tokens_estimated is not UNSET:
|
37
|
+
field_dict["tokens_estimated"] = tokens_estimated
|
38
|
+
if completion_tokens is not UNSET:
|
39
|
+
field_dict["completion_tokens"] = completion_tokens
|
40
|
+
if prompt_tokens is not UNSET:
|
41
|
+
field_dict["prompt_tokens"] = prompt_tokens
|
42
|
+
|
43
|
+
return field_dict
|
44
|
+
|
45
|
+
@classmethod
|
46
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
47
|
+
d = dict(src_dict)
|
48
|
+
tokens_estimated = d.pop("tokens_estimated", UNSET)
|
49
|
+
|
50
|
+
completion_tokens = d.pop("completion_tokens", UNSET)
|
51
|
+
|
52
|
+
prompt_tokens = d.pop("prompt_tokens", UNSET)
|
53
|
+
|
54
|
+
get_api_trace_id_response_200_spans_item_metrics = cls(
|
55
|
+
tokens_estimated=tokens_estimated,
|
56
|
+
completion_tokens=completion_tokens,
|
57
|
+
prompt_tokens=prompt_tokens,
|
58
|
+
)
|
59
|
+
|
60
|
+
get_api_trace_id_response_200_spans_item_metrics.additional_properties = d
|
61
|
+
return get_api_trace_id_response_200_spans_item_metrics
|
62
|
+
|
63
|
+
@property
|
64
|
+
def additional_keys(self) -> list[str]:
|
65
|
+
return list(self.additional_properties.keys())
|
66
|
+
|
67
|
+
def __getitem__(self, key: str) -> Any:
|
68
|
+
return self.additional_properties[key]
|
69
|
+
|
70
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
71
|
+
self.additional_properties[key] = value
|
72
|
+
|
73
|
+
def __delitem__(self, key: str) -> None:
|
74
|
+
del self.additional_properties[key]
|
75
|
+
|
76
|
+
def __contains__(self, key: str) -> bool:
|
77
|
+
return key in self.additional_properties
|
@@ -0,0 +1,89 @@
|
|
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_spans_item_output_value_item import (
|
11
|
+
GetApiTraceIdResponse200SpansItemOutputValueItem,
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
T = TypeVar("T", bound="GetApiTraceIdResponse200SpansItemOutput")
|
16
|
+
|
17
|
+
|
18
|
+
@_attrs_define
|
19
|
+
class GetApiTraceIdResponse200SpansItemOutput:
|
20
|
+
"""
|
21
|
+
Attributes:
|
22
|
+
type_ (Union[Unset, str]): Example: chat_messages.
|
23
|
+
value (Union[Unset, list['GetApiTraceIdResponse200SpansItemOutputValueItem']]): Example: [{'role': 'assistant',
|
24
|
+
'content': 'Hey there! 👋😊'}].
|
25
|
+
"""
|
26
|
+
|
27
|
+
type_: Union[Unset, str] = UNSET
|
28
|
+
value: Union[Unset, list["GetApiTraceIdResponse200SpansItemOutputValueItem"]] = UNSET
|
29
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
30
|
+
|
31
|
+
def to_dict(self) -> dict[str, Any]:
|
32
|
+
type_ = self.type_
|
33
|
+
|
34
|
+
value: Union[Unset, list[dict[str, Any]]] = UNSET
|
35
|
+
if not isinstance(self.value, Unset):
|
36
|
+
value = []
|
37
|
+
for value_item_data in self.value:
|
38
|
+
value_item = value_item_data.to_dict()
|
39
|
+
value.append(value_item)
|
40
|
+
|
41
|
+
field_dict: dict[str, Any] = {}
|
42
|
+
field_dict.update(self.additional_properties)
|
43
|
+
field_dict.update({})
|
44
|
+
if type_ is not UNSET:
|
45
|
+
field_dict["type"] = type_
|
46
|
+
if value is not UNSET:
|
47
|
+
field_dict["value"] = value
|
48
|
+
|
49
|
+
return field_dict
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
53
|
+
from ..models.get_api_trace_id_response_200_spans_item_output_value_item import (
|
54
|
+
GetApiTraceIdResponse200SpansItemOutputValueItem,
|
55
|
+
)
|
56
|
+
|
57
|
+
d = dict(src_dict)
|
58
|
+
type_ = d.pop("type", UNSET)
|
59
|
+
|
60
|
+
value = []
|
61
|
+
_value = d.pop("value", UNSET)
|
62
|
+
for value_item_data in _value or []:
|
63
|
+
value_item = GetApiTraceIdResponse200SpansItemOutputValueItem.from_dict(value_item_data)
|
64
|
+
|
65
|
+
value.append(value_item)
|
66
|
+
|
67
|
+
get_api_trace_id_response_200_spans_item_output = cls(
|
68
|
+
type_=type_,
|
69
|
+
value=value,
|
70
|
+
)
|
71
|
+
|
72
|
+
get_api_trace_id_response_200_spans_item_output.additional_properties = d
|
73
|
+
return get_api_trace_id_response_200_spans_item_output
|
74
|
+
|
75
|
+
@property
|
76
|
+
def additional_keys(self) -> list[str]:
|
77
|
+
return list(self.additional_properties.keys())
|
78
|
+
|
79
|
+
def __getitem__(self, key: str) -> Any:
|
80
|
+
return self.additional_properties[key]
|
81
|
+
|
82
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
83
|
+
self.additional_properties[key] = value
|
84
|
+
|
85
|
+
def __delitem__(self, key: str) -> None:
|
86
|
+
del self.additional_properties[key]
|
87
|
+
|
88
|
+
def __contains__(self, key: str) -> bool:
|
89
|
+
return key in self.additional_properties
|