langwatch-scenario 0.6.0__py3-none-any.whl → 0.7.2__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.2.dist-info}/METADATA +145 -41
- langwatch_scenario-0.7.2.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.2.dist-info}/WHEEL +0 -0
- {langwatch_scenario-0.6.0.dist-info → langwatch_scenario-0.7.2.dist-info}/entry_points.txt +0 -0
- {langwatch_scenario-0.6.0.dist-info → langwatch_scenario-0.7.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,245 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import TYPE_CHECKING, Any, Literal, 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.post_api_scenario_events_body_type_2_messages_item_type_0 import (
|
11
|
+
PostApiScenarioEventsBodyType2MessagesItemType0,
|
12
|
+
)
|
13
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_1 import (
|
14
|
+
PostApiScenarioEventsBodyType2MessagesItemType1,
|
15
|
+
)
|
16
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_2 import (
|
17
|
+
PostApiScenarioEventsBodyType2MessagesItemType2,
|
18
|
+
)
|
19
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_3 import (
|
20
|
+
PostApiScenarioEventsBodyType2MessagesItemType3,
|
21
|
+
)
|
22
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_4 import (
|
23
|
+
PostApiScenarioEventsBodyType2MessagesItemType4,
|
24
|
+
)
|
25
|
+
|
26
|
+
|
27
|
+
T = TypeVar("T", bound="PostApiScenarioEventsBodyType2")
|
28
|
+
|
29
|
+
|
30
|
+
@_attrs_define
|
31
|
+
class PostApiScenarioEventsBodyType2:
|
32
|
+
"""
|
33
|
+
Attributes:
|
34
|
+
type_ (Literal['SCENARIO_MESSAGE_SNAPSHOT']):
|
35
|
+
timestamp (float):
|
36
|
+
messages (list[Union['PostApiScenarioEventsBodyType2MessagesItemType0',
|
37
|
+
'PostApiScenarioEventsBodyType2MessagesItemType1', 'PostApiScenarioEventsBodyType2MessagesItemType2',
|
38
|
+
'PostApiScenarioEventsBodyType2MessagesItemType3', 'PostApiScenarioEventsBodyType2MessagesItemType4']]):
|
39
|
+
batch_run_id (str):
|
40
|
+
scenario_id (str):
|
41
|
+
scenario_run_id (str):
|
42
|
+
raw_event (Union[Unset, Any]):
|
43
|
+
scenario_set_id (Union[Unset, str]): Default: 'default'.
|
44
|
+
"""
|
45
|
+
|
46
|
+
type_: Literal["SCENARIO_MESSAGE_SNAPSHOT"]
|
47
|
+
timestamp: float
|
48
|
+
messages: list[
|
49
|
+
Union[
|
50
|
+
"PostApiScenarioEventsBodyType2MessagesItemType0",
|
51
|
+
"PostApiScenarioEventsBodyType2MessagesItemType1",
|
52
|
+
"PostApiScenarioEventsBodyType2MessagesItemType2",
|
53
|
+
"PostApiScenarioEventsBodyType2MessagesItemType3",
|
54
|
+
"PostApiScenarioEventsBodyType2MessagesItemType4",
|
55
|
+
]
|
56
|
+
]
|
57
|
+
batch_run_id: str
|
58
|
+
scenario_id: str
|
59
|
+
scenario_run_id: str
|
60
|
+
raw_event: Union[Unset, Any] = UNSET
|
61
|
+
scenario_set_id: Union[Unset, str] = "default"
|
62
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
63
|
+
|
64
|
+
def to_dict(self) -> dict[str, Any]:
|
65
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_0 import (
|
66
|
+
PostApiScenarioEventsBodyType2MessagesItemType0,
|
67
|
+
)
|
68
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_1 import (
|
69
|
+
PostApiScenarioEventsBodyType2MessagesItemType1,
|
70
|
+
)
|
71
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_2 import (
|
72
|
+
PostApiScenarioEventsBodyType2MessagesItemType2,
|
73
|
+
)
|
74
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_3 import (
|
75
|
+
PostApiScenarioEventsBodyType2MessagesItemType3,
|
76
|
+
)
|
77
|
+
|
78
|
+
type_ = self.type_
|
79
|
+
|
80
|
+
timestamp = self.timestamp
|
81
|
+
|
82
|
+
messages = []
|
83
|
+
for messages_item_data in self.messages:
|
84
|
+
messages_item: dict[str, Any]
|
85
|
+
if isinstance(messages_item_data, PostApiScenarioEventsBodyType2MessagesItemType0):
|
86
|
+
messages_item = messages_item_data.to_dict()
|
87
|
+
elif isinstance(messages_item_data, PostApiScenarioEventsBodyType2MessagesItemType1):
|
88
|
+
messages_item = messages_item_data.to_dict()
|
89
|
+
elif isinstance(messages_item_data, PostApiScenarioEventsBodyType2MessagesItemType2):
|
90
|
+
messages_item = messages_item_data.to_dict()
|
91
|
+
elif isinstance(messages_item_data, PostApiScenarioEventsBodyType2MessagesItemType3):
|
92
|
+
messages_item = messages_item_data.to_dict()
|
93
|
+
else:
|
94
|
+
messages_item = messages_item_data.to_dict()
|
95
|
+
|
96
|
+
messages.append(messages_item)
|
97
|
+
|
98
|
+
batch_run_id = self.batch_run_id
|
99
|
+
|
100
|
+
scenario_id = self.scenario_id
|
101
|
+
|
102
|
+
scenario_run_id = self.scenario_run_id
|
103
|
+
|
104
|
+
raw_event = self.raw_event
|
105
|
+
|
106
|
+
scenario_set_id = self.scenario_set_id
|
107
|
+
|
108
|
+
field_dict: dict[str, Any] = {}
|
109
|
+
field_dict.update(self.additional_properties)
|
110
|
+
field_dict.update(
|
111
|
+
{
|
112
|
+
"type": type_,
|
113
|
+
"timestamp": timestamp,
|
114
|
+
"messages": messages,
|
115
|
+
"batchRunId": batch_run_id,
|
116
|
+
"scenarioId": scenario_id,
|
117
|
+
"scenarioRunId": scenario_run_id,
|
118
|
+
}
|
119
|
+
)
|
120
|
+
if raw_event is not UNSET:
|
121
|
+
field_dict["rawEvent"] = raw_event
|
122
|
+
if scenario_set_id is not UNSET:
|
123
|
+
field_dict["scenarioSetId"] = scenario_set_id
|
124
|
+
|
125
|
+
return field_dict
|
126
|
+
|
127
|
+
@classmethod
|
128
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
129
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_0 import (
|
130
|
+
PostApiScenarioEventsBodyType2MessagesItemType0,
|
131
|
+
)
|
132
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_1 import (
|
133
|
+
PostApiScenarioEventsBodyType2MessagesItemType1,
|
134
|
+
)
|
135
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_2 import (
|
136
|
+
PostApiScenarioEventsBodyType2MessagesItemType2,
|
137
|
+
)
|
138
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_3 import (
|
139
|
+
PostApiScenarioEventsBodyType2MessagesItemType3,
|
140
|
+
)
|
141
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_4 import (
|
142
|
+
PostApiScenarioEventsBodyType2MessagesItemType4,
|
143
|
+
)
|
144
|
+
|
145
|
+
d = dict(src_dict)
|
146
|
+
type_ = cast(Literal["SCENARIO_MESSAGE_SNAPSHOT"], d.pop("type"))
|
147
|
+
if type_ != "SCENARIO_MESSAGE_SNAPSHOT":
|
148
|
+
raise ValueError(f"type must match const 'SCENARIO_MESSAGE_SNAPSHOT', got '{type_}'")
|
149
|
+
|
150
|
+
timestamp = d.pop("timestamp")
|
151
|
+
|
152
|
+
messages = []
|
153
|
+
_messages = d.pop("messages")
|
154
|
+
for messages_item_data in _messages:
|
155
|
+
|
156
|
+
def _parse_messages_item(
|
157
|
+
data: object,
|
158
|
+
) -> Union[
|
159
|
+
"PostApiScenarioEventsBodyType2MessagesItemType0",
|
160
|
+
"PostApiScenarioEventsBodyType2MessagesItemType1",
|
161
|
+
"PostApiScenarioEventsBodyType2MessagesItemType2",
|
162
|
+
"PostApiScenarioEventsBodyType2MessagesItemType3",
|
163
|
+
"PostApiScenarioEventsBodyType2MessagesItemType4",
|
164
|
+
]:
|
165
|
+
try:
|
166
|
+
if not isinstance(data, dict):
|
167
|
+
raise TypeError()
|
168
|
+
messages_item_type_0 = PostApiScenarioEventsBodyType2MessagesItemType0.from_dict(data)
|
169
|
+
|
170
|
+
return messages_item_type_0
|
171
|
+
except: # noqa: E722
|
172
|
+
pass
|
173
|
+
try:
|
174
|
+
if not isinstance(data, dict):
|
175
|
+
raise TypeError()
|
176
|
+
messages_item_type_1 = PostApiScenarioEventsBodyType2MessagesItemType1.from_dict(data)
|
177
|
+
|
178
|
+
return messages_item_type_1
|
179
|
+
except: # noqa: E722
|
180
|
+
pass
|
181
|
+
try:
|
182
|
+
if not isinstance(data, dict):
|
183
|
+
raise TypeError()
|
184
|
+
messages_item_type_2 = PostApiScenarioEventsBodyType2MessagesItemType2.from_dict(data)
|
185
|
+
|
186
|
+
return messages_item_type_2
|
187
|
+
except: # noqa: E722
|
188
|
+
pass
|
189
|
+
try:
|
190
|
+
if not isinstance(data, dict):
|
191
|
+
raise TypeError()
|
192
|
+
messages_item_type_3 = PostApiScenarioEventsBodyType2MessagesItemType3.from_dict(data)
|
193
|
+
|
194
|
+
return messages_item_type_3
|
195
|
+
except: # noqa: E722
|
196
|
+
pass
|
197
|
+
if not isinstance(data, dict):
|
198
|
+
raise TypeError()
|
199
|
+
messages_item_type_4 = PostApiScenarioEventsBodyType2MessagesItemType4.from_dict(data)
|
200
|
+
|
201
|
+
return messages_item_type_4
|
202
|
+
|
203
|
+
messages_item = _parse_messages_item(messages_item_data)
|
204
|
+
|
205
|
+
messages.append(messages_item)
|
206
|
+
|
207
|
+
batch_run_id = d.pop("batchRunId")
|
208
|
+
|
209
|
+
scenario_id = d.pop("scenarioId")
|
210
|
+
|
211
|
+
scenario_run_id = d.pop("scenarioRunId")
|
212
|
+
|
213
|
+
raw_event = d.pop("rawEvent", UNSET)
|
214
|
+
|
215
|
+
scenario_set_id = d.pop("scenarioSetId", UNSET)
|
216
|
+
|
217
|
+
post_api_scenario_events_body_type_2 = cls(
|
218
|
+
type_=type_,
|
219
|
+
timestamp=timestamp,
|
220
|
+
messages=messages,
|
221
|
+
batch_run_id=batch_run_id,
|
222
|
+
scenario_id=scenario_id,
|
223
|
+
scenario_run_id=scenario_run_id,
|
224
|
+
raw_event=raw_event,
|
225
|
+
scenario_set_id=scenario_set_id,
|
226
|
+
)
|
227
|
+
|
228
|
+
post_api_scenario_events_body_type_2.additional_properties = d
|
229
|
+
return post_api_scenario_events_body_type_2
|
230
|
+
|
231
|
+
@property
|
232
|
+
def additional_keys(self) -> list[str]:
|
233
|
+
return list(self.additional_properties.keys())
|
234
|
+
|
235
|
+
def __getitem__(self, key: str) -> Any:
|
236
|
+
return self.additional_properties[key]
|
237
|
+
|
238
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
239
|
+
self.additional_properties[key] = value
|
240
|
+
|
241
|
+
def __delitem__(self, key: str) -> None:
|
242
|
+
del self.additional_properties[key]
|
243
|
+
|
244
|
+
def __contains__(self, key: str) -> bool:
|
245
|
+
return key in self.additional_properties
|
@@ -0,0 +1,88 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import Any, Literal, 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="PostApiScenarioEventsBodyType2MessagesItemType0")
|
10
|
+
|
11
|
+
|
12
|
+
@_attrs_define
|
13
|
+
class PostApiScenarioEventsBodyType2MessagesItemType0:
|
14
|
+
"""
|
15
|
+
Attributes:
|
16
|
+
id (str):
|
17
|
+
role (Literal['developer']):
|
18
|
+
content (str):
|
19
|
+
name (Union[Unset, str]):
|
20
|
+
"""
|
21
|
+
|
22
|
+
id: str
|
23
|
+
role: Literal["developer"]
|
24
|
+
content: str
|
25
|
+
name: Union[Unset, str] = UNSET
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
27
|
+
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
29
|
+
id = self.id
|
30
|
+
|
31
|
+
role = self.role
|
32
|
+
|
33
|
+
content = self.content
|
34
|
+
|
35
|
+
name = self.name
|
36
|
+
|
37
|
+
field_dict: dict[str, Any] = {}
|
38
|
+
field_dict.update(self.additional_properties)
|
39
|
+
field_dict.update(
|
40
|
+
{
|
41
|
+
"id": id,
|
42
|
+
"role": role,
|
43
|
+
"content": content,
|
44
|
+
}
|
45
|
+
)
|
46
|
+
if name is not UNSET:
|
47
|
+
field_dict["name"] = name
|
48
|
+
|
49
|
+
return field_dict
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
53
|
+
d = dict(src_dict)
|
54
|
+
id = d.pop("id")
|
55
|
+
|
56
|
+
role = cast(Literal["developer"], d.pop("role"))
|
57
|
+
if role != "developer":
|
58
|
+
raise ValueError(f"role must match const 'developer', got '{role}'")
|
59
|
+
|
60
|
+
content = d.pop("content")
|
61
|
+
|
62
|
+
name = d.pop("name", UNSET)
|
63
|
+
|
64
|
+
post_api_scenario_events_body_type_2_messages_item_type_0 = cls(
|
65
|
+
id=id,
|
66
|
+
role=role,
|
67
|
+
content=content,
|
68
|
+
name=name,
|
69
|
+
)
|
70
|
+
|
71
|
+
post_api_scenario_events_body_type_2_messages_item_type_0.additional_properties = d
|
72
|
+
return post_api_scenario_events_body_type_2_messages_item_type_0
|
73
|
+
|
74
|
+
@property
|
75
|
+
def additional_keys(self) -> list[str]:
|
76
|
+
return list(self.additional_properties.keys())
|
77
|
+
|
78
|
+
def __getitem__(self, key: str) -> Any:
|
79
|
+
return self.additional_properties[key]
|
80
|
+
|
81
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
82
|
+
self.additional_properties[key] = value
|
83
|
+
|
84
|
+
def __delitem__(self, key: str) -> None:
|
85
|
+
del self.additional_properties[key]
|
86
|
+
|
87
|
+
def __contains__(self, key: str) -> bool:
|
88
|
+
return key in self.additional_properties
|
@@ -0,0 +1,88 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import Any, Literal, 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="PostApiScenarioEventsBodyType2MessagesItemType1")
|
10
|
+
|
11
|
+
|
12
|
+
@_attrs_define
|
13
|
+
class PostApiScenarioEventsBodyType2MessagesItemType1:
|
14
|
+
"""
|
15
|
+
Attributes:
|
16
|
+
id (str):
|
17
|
+
role (Literal['system']):
|
18
|
+
content (str):
|
19
|
+
name (Union[Unset, str]):
|
20
|
+
"""
|
21
|
+
|
22
|
+
id: str
|
23
|
+
role: Literal["system"]
|
24
|
+
content: str
|
25
|
+
name: Union[Unset, str] = UNSET
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
27
|
+
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
29
|
+
id = self.id
|
30
|
+
|
31
|
+
role = self.role
|
32
|
+
|
33
|
+
content = self.content
|
34
|
+
|
35
|
+
name = self.name
|
36
|
+
|
37
|
+
field_dict: dict[str, Any] = {}
|
38
|
+
field_dict.update(self.additional_properties)
|
39
|
+
field_dict.update(
|
40
|
+
{
|
41
|
+
"id": id,
|
42
|
+
"role": role,
|
43
|
+
"content": content,
|
44
|
+
}
|
45
|
+
)
|
46
|
+
if name is not UNSET:
|
47
|
+
field_dict["name"] = name
|
48
|
+
|
49
|
+
return field_dict
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
53
|
+
d = dict(src_dict)
|
54
|
+
id = d.pop("id")
|
55
|
+
|
56
|
+
role = cast(Literal["system"], d.pop("role"))
|
57
|
+
if role != "system":
|
58
|
+
raise ValueError(f"role must match const 'system', got '{role}'")
|
59
|
+
|
60
|
+
content = d.pop("content")
|
61
|
+
|
62
|
+
name = d.pop("name", UNSET)
|
63
|
+
|
64
|
+
post_api_scenario_events_body_type_2_messages_item_type_1 = cls(
|
65
|
+
id=id,
|
66
|
+
role=role,
|
67
|
+
content=content,
|
68
|
+
name=name,
|
69
|
+
)
|
70
|
+
|
71
|
+
post_api_scenario_events_body_type_2_messages_item_type_1.additional_properties = d
|
72
|
+
return post_api_scenario_events_body_type_2_messages_item_type_1
|
73
|
+
|
74
|
+
@property
|
75
|
+
def additional_keys(self) -> list[str]:
|
76
|
+
return list(self.additional_properties.keys())
|
77
|
+
|
78
|
+
def __getitem__(self, key: str) -> Any:
|
79
|
+
return self.additional_properties[key]
|
80
|
+
|
81
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
82
|
+
self.additional_properties[key] = value
|
83
|
+
|
84
|
+
def __delitem__(self, key: str) -> None:
|
85
|
+
del self.additional_properties[key]
|
86
|
+
|
87
|
+
def __contains__(self, key: str) -> bool:
|
88
|
+
return key in self.additional_properties
|
@@ -0,0 +1,120 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import TYPE_CHECKING, Any, Literal, 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.post_api_scenario_events_body_type_2_messages_item_type_2_tool_calls_item import (
|
11
|
+
PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItem,
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
T = TypeVar("T", bound="PostApiScenarioEventsBodyType2MessagesItemType2")
|
16
|
+
|
17
|
+
|
18
|
+
@_attrs_define
|
19
|
+
class PostApiScenarioEventsBodyType2MessagesItemType2:
|
20
|
+
"""
|
21
|
+
Attributes:
|
22
|
+
id (str):
|
23
|
+
role (Literal['assistant']):
|
24
|
+
content (Union[Unset, str]):
|
25
|
+
name (Union[Unset, str]):
|
26
|
+
tool_calls (Union[Unset, list['PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItem']]):
|
27
|
+
"""
|
28
|
+
|
29
|
+
id: str
|
30
|
+
role: Literal["assistant"]
|
31
|
+
content: Union[Unset, str] = UNSET
|
32
|
+
name: Union[Unset, str] = UNSET
|
33
|
+
tool_calls: Union[Unset, list["PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItem"]] = UNSET
|
34
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
35
|
+
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
37
|
+
id = self.id
|
38
|
+
|
39
|
+
role = self.role
|
40
|
+
|
41
|
+
content = self.content
|
42
|
+
|
43
|
+
name = self.name
|
44
|
+
|
45
|
+
tool_calls: Union[Unset, list[dict[str, Any]]] = UNSET
|
46
|
+
if not isinstance(self.tool_calls, Unset):
|
47
|
+
tool_calls = []
|
48
|
+
for tool_calls_item_data in self.tool_calls:
|
49
|
+
tool_calls_item = tool_calls_item_data.to_dict()
|
50
|
+
tool_calls.append(tool_calls_item)
|
51
|
+
|
52
|
+
field_dict: dict[str, Any] = {}
|
53
|
+
field_dict.update(self.additional_properties)
|
54
|
+
field_dict.update(
|
55
|
+
{
|
56
|
+
"id": id,
|
57
|
+
"role": role,
|
58
|
+
}
|
59
|
+
)
|
60
|
+
if content is not UNSET:
|
61
|
+
field_dict["content"] = content
|
62
|
+
if name is not UNSET:
|
63
|
+
field_dict["name"] = name
|
64
|
+
if tool_calls is not UNSET:
|
65
|
+
field_dict["toolCalls"] = tool_calls
|
66
|
+
|
67
|
+
return field_dict
|
68
|
+
|
69
|
+
@classmethod
|
70
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
71
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_2_tool_calls_item import (
|
72
|
+
PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItem,
|
73
|
+
)
|
74
|
+
|
75
|
+
d = dict(src_dict)
|
76
|
+
id = d.pop("id")
|
77
|
+
|
78
|
+
role = cast(Literal["assistant"], d.pop("role"))
|
79
|
+
if role != "assistant":
|
80
|
+
raise ValueError(f"role must match const 'assistant', got '{role}'")
|
81
|
+
|
82
|
+
content = d.pop("content", UNSET)
|
83
|
+
|
84
|
+
name = d.pop("name", UNSET)
|
85
|
+
|
86
|
+
tool_calls = []
|
87
|
+
_tool_calls = d.pop("toolCalls", UNSET)
|
88
|
+
for tool_calls_item_data in _tool_calls or []:
|
89
|
+
tool_calls_item = PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItem.from_dict(
|
90
|
+
tool_calls_item_data
|
91
|
+
)
|
92
|
+
|
93
|
+
tool_calls.append(tool_calls_item)
|
94
|
+
|
95
|
+
post_api_scenario_events_body_type_2_messages_item_type_2 = cls(
|
96
|
+
id=id,
|
97
|
+
role=role,
|
98
|
+
content=content,
|
99
|
+
name=name,
|
100
|
+
tool_calls=tool_calls,
|
101
|
+
)
|
102
|
+
|
103
|
+
post_api_scenario_events_body_type_2_messages_item_type_2.additional_properties = d
|
104
|
+
return post_api_scenario_events_body_type_2_messages_item_type_2
|
105
|
+
|
106
|
+
@property
|
107
|
+
def additional_keys(self) -> list[str]:
|
108
|
+
return list(self.additional_properties.keys())
|
109
|
+
|
110
|
+
def __getitem__(self, key: str) -> Any:
|
111
|
+
return self.additional_properties[key]
|
112
|
+
|
113
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
114
|
+
self.additional_properties[key] = value
|
115
|
+
|
116
|
+
def __delitem__(self, key: str) -> None:
|
117
|
+
del self.additional_properties[key]
|
118
|
+
|
119
|
+
def __contains__(self, key: str) -> bool:
|
120
|
+
return key in self.additional_properties
|
@@ -0,0 +1,87 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast
|
3
|
+
|
4
|
+
from attrs import define as _attrs_define
|
5
|
+
from attrs import field as _attrs_field
|
6
|
+
|
7
|
+
if TYPE_CHECKING:
|
8
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_2_tool_calls_item_function import (
|
9
|
+
PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItemFunction,
|
10
|
+
)
|
11
|
+
|
12
|
+
|
13
|
+
T = TypeVar("T", bound="PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItem")
|
14
|
+
|
15
|
+
|
16
|
+
@_attrs_define
|
17
|
+
class PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItem:
|
18
|
+
"""
|
19
|
+
Attributes:
|
20
|
+
id (str):
|
21
|
+
type_ (Literal['function']):
|
22
|
+
function (PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItemFunction):
|
23
|
+
"""
|
24
|
+
|
25
|
+
id: str
|
26
|
+
type_: Literal["function"]
|
27
|
+
function: "PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItemFunction"
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
29
|
+
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
31
|
+
id = self.id
|
32
|
+
|
33
|
+
type_ = self.type_
|
34
|
+
|
35
|
+
function = self.function.to_dict()
|
36
|
+
|
37
|
+
field_dict: dict[str, Any] = {}
|
38
|
+
field_dict.update(self.additional_properties)
|
39
|
+
field_dict.update(
|
40
|
+
{
|
41
|
+
"id": id,
|
42
|
+
"type": type_,
|
43
|
+
"function": function,
|
44
|
+
}
|
45
|
+
)
|
46
|
+
|
47
|
+
return field_dict
|
48
|
+
|
49
|
+
@classmethod
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
51
|
+
from ..models.post_api_scenario_events_body_type_2_messages_item_type_2_tool_calls_item_function import (
|
52
|
+
PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItemFunction,
|
53
|
+
)
|
54
|
+
|
55
|
+
d = dict(src_dict)
|
56
|
+
id = d.pop("id")
|
57
|
+
|
58
|
+
type_ = cast(Literal["function"], d.pop("type"))
|
59
|
+
if type_ != "function":
|
60
|
+
raise ValueError(f"type must match const 'function', got '{type_}'")
|
61
|
+
|
62
|
+
function = PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItemFunction.from_dict(d.pop("function"))
|
63
|
+
|
64
|
+
post_api_scenario_events_body_type_2_messages_item_type_2_tool_calls_item = cls(
|
65
|
+
id=id,
|
66
|
+
type_=type_,
|
67
|
+
function=function,
|
68
|
+
)
|
69
|
+
|
70
|
+
post_api_scenario_events_body_type_2_messages_item_type_2_tool_calls_item.additional_properties = d
|
71
|
+
return post_api_scenario_events_body_type_2_messages_item_type_2_tool_calls_item
|
72
|
+
|
73
|
+
@property
|
74
|
+
def additional_keys(self) -> list[str]:
|
75
|
+
return list(self.additional_properties.keys())
|
76
|
+
|
77
|
+
def __getitem__(self, key: str) -> Any:
|
78
|
+
return self.additional_properties[key]
|
79
|
+
|
80
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
81
|
+
self.additional_properties[key] = value
|
82
|
+
|
83
|
+
def __delitem__(self, key: str) -> None:
|
84
|
+
del self.additional_properties[key]
|
85
|
+
|
86
|
+
def __contains__(self, key: str) -> bool:
|
87
|
+
return key in self.additional_properties
|
@@ -0,0 +1,67 @@
|
|
1
|
+
from collections.abc import Mapping
|
2
|
+
from typing import Any, TypeVar
|
3
|
+
|
4
|
+
from attrs import define as _attrs_define
|
5
|
+
from attrs import field as _attrs_field
|
6
|
+
|
7
|
+
T = TypeVar("T", bound="PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItemFunction")
|
8
|
+
|
9
|
+
|
10
|
+
@_attrs_define
|
11
|
+
class PostApiScenarioEventsBodyType2MessagesItemType2ToolCallsItemFunction:
|
12
|
+
"""
|
13
|
+
Attributes:
|
14
|
+
name (str):
|
15
|
+
arguments (str):
|
16
|
+
"""
|
17
|
+
|
18
|
+
name: str
|
19
|
+
arguments: str
|
20
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
21
|
+
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
23
|
+
name = self.name
|
24
|
+
|
25
|
+
arguments = self.arguments
|
26
|
+
|
27
|
+
field_dict: dict[str, Any] = {}
|
28
|
+
field_dict.update(self.additional_properties)
|
29
|
+
field_dict.update(
|
30
|
+
{
|
31
|
+
"name": name,
|
32
|
+
"arguments": arguments,
|
33
|
+
}
|
34
|
+
)
|
35
|
+
|
36
|
+
return field_dict
|
37
|
+
|
38
|
+
@classmethod
|
39
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
40
|
+
d = dict(src_dict)
|
41
|
+
name = d.pop("name")
|
42
|
+
|
43
|
+
arguments = d.pop("arguments")
|
44
|
+
|
45
|
+
post_api_scenario_events_body_type_2_messages_item_type_2_tool_calls_item_function = cls(
|
46
|
+
name=name,
|
47
|
+
arguments=arguments,
|
48
|
+
)
|
49
|
+
|
50
|
+
post_api_scenario_events_body_type_2_messages_item_type_2_tool_calls_item_function.additional_properties = d
|
51
|
+
return post_api_scenario_events_body_type_2_messages_item_type_2_tool_calls_item_function
|
52
|
+
|
53
|
+
@property
|
54
|
+
def additional_keys(self) -> list[str]:
|
55
|
+
return list(self.additional_properties.keys())
|
56
|
+
|
57
|
+
def __getitem__(self, key: str) -> Any:
|
58
|
+
return self.additional_properties[key]
|
59
|
+
|
60
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
61
|
+
self.additional_properties[key] = value
|
62
|
+
|
63
|
+
def __delitem__(self, key: str) -> None:
|
64
|
+
del self.additional_properties[key]
|
65
|
+
|
66
|
+
def __contains__(self, key: str) -> bool:
|
67
|
+
return key in self.additional_properties
|