From ba81b8c02ba6014be87b86ca0cbf2a8bdfe34d1f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 4 Dec 2026 13:08:20 +0000 Subject: [PATCH] Update API Client --- openapi.yaml | 23400 +++++++++++----- ...annotation_queues_queue_id_settings_get.py | 181 + ...es_queue_id_templates_template_id_patch.py | 4 + ...annotation_queues_queue_id_settings_put.py | 194 + ...s_queue_id_records_record_id_rating_put.py | 219 - ...n_queues_queue_id_records_record_id_get.py | 258 +- ...ion_queues_queue_id_partial_search_post.py | 30 +- ...ices_scorers_package_policy_notices_get.py | 142 + ...atus_scorers_package_policy_status_post.py | 181 + ...ns_scorer_version_id_prompt_preview_get.py | 222 + ..._scorers_with_filters_scorers_list_post.py | 49 +- ...orers_decision_validate_log_record_post.py | 24 +- .../datasets/create_dataset_datasets_post.py | 8 +- ..._billing_usage_billing_usage_metric_get.py | 43 +- ...ams_log_stream_id_metric_settings_patch.py | 28 +- ...e_global_prompt_template_templates_post.py | 8 +- ...scorer_settings_evaluators_enable_post.py} | 82 +- ...scorer_settings_evaluators_inspect_post.py | 184 + ...ct_id_runs_run_id_scorer_settings_patch.py | 28 +- ...ect_id_runs_run_id_scorer_settings_post.py | 28 +- ...ects_project_id_sessions_session_id_get.py | 30 +- ...n_projects_project_id_spans_span_id_get.py | 218 +- ...projects_project_id_traces_trace_id_get.py | 20 + ...project_id_sessions_partial_search_post.py | 32 +- ...ts_project_id_spans_partial_search_post.py | 32 +- ...s_project_id_traces_partial_search_post.py | 32 +- ...rojects_project_id_sessions_search_post.py | 34 +- ...s_projects_project_id_spans_search_post.py | 34 +- ..._projects_project_id_traces_search_post.py | 34 +- src/splunk_ao/resources/models/__init__.py | 536 +- src/splunk_ao/resources/models/agent_span.py | 877 - .../models/agent_span_dataset_metadata.py | 47 - .../models/agent_span_user_metadata.py | 47 - .../annotation_queue_name_filter_operator.py | 1 + .../models/annotation_queue_settings.py | 129 + .../annotation_queue_settings_response.py | 68 + .../models/annotation_rating_create.py | 174 - .../resources/models/annotation_rating_db.py | 193 - .../models/annotation_template_create.py | 14 +- .../models/annotation_template_db.py | 8 + .../models/annotation_template_update.py | 23 +- .../models/annotator_view_span_type.py | 14 + src/splunk_ao/resources/models/base_scorer.py | 85 + .../resources/models/billing_usage_metric.py | 1 + .../resources/models/choice_rating.py | 18 +- .../code_metric_policy_notices_response.py | 75 + .../models/code_metric_policy_state.py | 10 + .../models/code_metric_policy_status.py | 124 + .../code_metric_policy_status_request.py | 36 + .../code_metric_policy_status_response.py | 69 + .../resources/models/control_span.py | 715 - .../models/control_span_dataset_metadata.py | 47 - .../models/control_span_user_metadata.py | 47 - .../resources/models/create_scorer_request.py | 18 +- .../resources/models/credit_balance.py | 124 + .../models/custom_dashboard_action.py | 11 + .../models/dataset_name_filter_operator.py | 1 + .../models/decision_boolean_criteria.py | 3 +- .../resources/models/decision_choice.py | 10 +- .../models/decision_model_properties.py | 37 + .../decision_scorer_test_configuration.py | 40 +- src/splunk_ao/resources/models/document.py | 12 +- .../experiment_group_name_filter_operator.py | 1 + .../models/extended_agent_span_record.py | 1262 - ...agent_span_record_annotation_aggregates.py | 60 - ..._agent_span_record_annotation_agreement.py | 47 - .../extended_agent_span_record_annotations.py | 66 - ..._record_annotations_additional_property.py | 60 - ...nded_agent_span_record_dataset_metadata.py | 47 - ..._agent_span_record_feedback_rating_info.py | 60 - ...extended_agent_span_record_files_type_0.py | 60 - ...ed_agent_span_record_metric_info_type_0.py | 203 - ...xtended_agent_span_record_user_metadata.py | 47 - ...xtended_agent_span_record_with_children.py | 1510 - ...ord_with_children_annotation_aggregates.py | 60 - ...cord_with_children_annotation_agreement.py | 47 - ...t_span_record_with_children_annotations.py | 66 - ...hildren_annotations_additional_property.py | 62 - ...n_record_with_children_dataset_metadata.py | 47 - ...cord_with_children_feedback_rating_info.py | 60 - ..._span_record_with_children_files_type_0.py | 60 - ...record_with_children_metric_info_type_0.py | 203 - ...span_record_with_children_user_metadata.py | 47 - .../models/extended_control_span_record.py | 1108 - ...ntrol_span_record_annotation_aggregates.py | 60 - ...ontrol_span_record_annotation_agreement.py | 47 - ...xtended_control_span_record_annotations.py | 66 - ..._record_annotations_additional_property.py | 60 - ...ed_control_span_record_dataset_metadata.py | 47 - ...ontrol_span_record_feedback_rating_info.py | 60 - ...tended_control_span_record_files_type_0.py | 60 - ..._control_span_record_metric_info_type_0.py | 203 - ...ended_control_span_record_user_metadata.py | 47 - .../models/extended_http_span_record.py | 1111 - ..._http_span_record_annotation_aggregates.py | 60 - ...d_http_span_record_annotation_agreement.py | 47 - .../extended_http_span_record_annotations.py | 66 - ..._record_annotations_additional_property.py | 60 - ...ended_http_span_record_dataset_metadata.py | 47 - ...d_http_span_record_feedback_rating_info.py | 60 - .../extended_http_span_record_files_type_0.py | 60 - ...ded_http_span_record_metric_info_type_0.py | 203 - ...extended_http_span_record_user_metadata.py | 47 - ...extended_http_span_record_with_children.py | 1360 - ...ord_with_children_annotation_aggregates.py | 60 - ...cord_with_children_annotation_agreement.py | 47 - ...p_span_record_with_children_annotations.py | 66 - ...hildren_annotations_additional_property.py | 62 - ...n_record_with_children_dataset_metadata.py | 47 - ...cord_with_children_feedback_rating_info.py | 60 - ..._span_record_with_children_files_type_0.py | 60 - ...record_with_children_metric_info_type_0.py | 203 - ...span_record_with_children_user_metadata.py | 47 - .../models/extended_llm_span_record.py | 1153 - ...d_llm_span_record_annotation_aggregates.py | 60 - ...ed_llm_span_record_annotation_agreement.py | 47 - .../extended_llm_span_record_annotations.py | 66 - ..._record_annotations_additional_property.py | 60 - ...tended_llm_span_record_dataset_metadata.py | 47 - ...ed_llm_span_record_feedback_rating_info.py | 60 - .../extended_llm_span_record_files_type_0.py | 60 - ...nded_llm_span_record_metric_info_type_0.py | 203 - .../extended_llm_span_record_user_metadata.py | 47 - ...ended_read_session_record_with_children.py | 1289 - ...ord_with_children_annotation_aggregates.py | 60 - ...cord_with_children_annotation_agreement.py | 47 - ...ession_record_with_children_annotations.py | 68 - ...hildren_annotations_additional_property.py | 62 - ...n_record_with_children_dataset_metadata.py | 47 - ...cord_with_children_feedback_rating_info.py | 60 - ...ssion_record_with_children_files_type_0.py | 60 - ...record_with_children_metric_info_type_0.py | 203 - ...sion_record_with_children_user_metadata.py | 47 - .../models/extended_retriever_span_record.py | 44 + ...ded_retriever_span_record_with_children.py | 44 + .../models/extended_session_record.py | 1125 - ...ed_session_record_annotation_aggregates.py | 60 - ...ded_session_record_annotation_agreement.py | 47 - .../extended_session_record_annotations.py | 66 - ..._record_annotations_additional_property.py | 60 - ...xtended_session_record_dataset_metadata.py | 47 - ...ded_session_record_feedback_rating_info.py | 60 - .../extended_session_record_files_type_0.py | 60 - ...ended_session_record_metric_info_type_0.py | 203 - .../extended_session_record_user_metadata.py | 47 - .../models/extended_tool_span_record.py | 44 + ...extended_tool_span_record_with_children.py | 44 + .../resources/models/extended_trace_record.py | 10 + .../extended_trace_record_with_children.py | 10 + .../models/extended_workflow_span_record.py | 1121 - ...kflow_span_record_annotation_aggregates.py | 60 - ...rkflow_span_record_annotation_agreement.py | 47 - ...tended_workflow_span_record_annotations.py | 66 - ..._record_annotations_additional_property.py | 60 - ...d_workflow_span_record_dataset_metadata.py | 47 - ...rkflow_span_record_feedback_rating_info.py | 60 - ...ended_workflow_span_record_files_type_0.py | 60 - ...workflow_span_record_metric_info_type_0.py | 203 - ...nded_workflow_span_record_with_children.py | 1361 - ...ord_with_children_annotation_aggregates.py | 60 - ...cord_with_children_annotation_agreement.py | 47 - ...w_span_record_with_children_annotations.py | 68 - ...hildren_annotations_additional_property.py | 62 - ...n_record_with_children_dataset_metadata.py | 47 - ...cord_with_children_feedback_rating_info.py | 60 - ..._span_record_with_children_files_type_0.py | 60 - ...record_with_children_metric_info_type_0.py | 203 - ...span_record_with_children_user_metadata.py | 47 - .../models/generated_scorer_response.py | 12 +- src/splunk_ao/resources/models/http_span.py | 841 - .../models/http_span_dataset_metadata.py | 47 - .../models/http_span_user_metadata.py | 47 - .../resources/models/integration_provider.py | 1 + .../resources/models/invalid_result.py | 27 +- .../resources/models/left_out_reason.py | 10 + .../resources/models/like_dislike_rating.py | 18 +- .../llm_scorer_log_record_configuration.py | 226 + src/splunk_ao/resources/models/llm_span.py | 767 - .../models/llm_span_dataset_metadata.py | 47 - .../models/llm_span_user_metadata.py | 47 - .../log_records_partial_query_response.py | 367 - .../models/log_records_query_response.py | 359 - .../log_records_text_filter_operator.py | 1 + .../models/log_span_update_request.py | 448 - .../models/luna_billing_usage_response.py | 176 + .../resources/models/metadata_filter.py | 10 +- .../models/metadata_filter_operator.py | 1 + ...y => metric_settings_conflict_response.py} | 27 +- .../models/metric_settings_request.py | 24 +- .../models/metric_settings_response.py | 46 +- .../models/node_name_filter_operator.py | 1 + ....py => non_luna_billing_usage_response.py} | 36 +- .../non_luna_billing_usage_response_metric.py | 13 + .../resources/models/organization_action.py | 1 + .../partial_extended_agent_span_record.py | 1399 - ...agent_span_record_annotation_aggregates.py | 60 - ..._agent_span_record_annotation_agreement.py | 47 - ..._extended_agent_span_record_annotations.py | 66 - ..._record_annotations_additional_property.py | 60 - ...nded_agent_span_record_dataset_metadata.py | 47 - ..._agent_span_record_feedback_rating_info.py | 60 - ...extended_agent_span_record_files_type_0.py | 60 - ...ed_agent_span_record_metric_info_type_0.py | 203 - ...xtended_agent_span_record_user_metadata.py | 47 - .../partial_extended_control_span_record.py | 1250 - ...ntrol_span_record_annotation_aggregates.py | 60 - ...ontrol_span_record_annotation_agreement.py | 47 - ...xtended_control_span_record_annotations.py | 66 - ..._record_annotations_additional_property.py | 62 - ...ed_control_span_record_dataset_metadata.py | 47 - ...ontrol_span_record_feedback_rating_info.py | 60 - ...tended_control_span_record_files_type_0.py | 60 - ..._control_span_record_metric_info_type_0.py | 203 - ...ended_control_span_record_user_metadata.py | 47 - .../partial_extended_http_span_record.py | 1248 - ..._http_span_record_annotation_aggregates.py | 60 - ...d_http_span_record_annotation_agreement.py | 47 - ...l_extended_http_span_record_annotations.py | 66 - ..._record_annotations_additional_property.py | 60 - ...ended_http_span_record_dataset_metadata.py | 47 - ...d_http_span_record_feedback_rating_info.py | 60 - ..._extended_http_span_record_files_type_0.py | 60 - ...ded_http_span_record_metric_info_type_0.py | 203 - ...extended_http_span_record_user_metadata.py | 47 - .../partial_extended_llm_span_record.py | 1289 - ...d_llm_span_record_annotation_aggregates.py | 60 - ...ed_llm_span_record_annotation_agreement.py | 47 - ...al_extended_llm_span_record_annotations.py | 66 - ..._record_annotations_additional_property.py | 60 - ...tended_llm_span_record_dataset_metadata.py | 47 - ...ed_llm_span_record_feedback_rating_info.py | 60 - ...l_extended_llm_span_record_files_type_0.py | 60 - ...nded_llm_span_record_metric_info_type_0.py | 203 - ..._extended_llm_span_record_user_metadata.py | 47 - .../models/partial_extended_session_record.py | 1214 - ...ed_session_record_annotation_aggregates.py | 60 - ...ded_session_record_annotation_agreement.py | 47 - ...ial_extended_session_record_annotations.py | 66 - ..._record_annotations_additional_property.py | 60 - ...xtended_session_record_dataset_metadata.py | 47 - ...ded_session_record_feedback_rating_info.py | 60 - ...al_extended_session_record_files_type_0.py | 60 - ...ended_session_record_metric_info_type_0.py | 203 - ...l_extended_session_record_user_metadata.py | 47 - .../models/partial_extended_trace_record.py | 10 + .../partial_extended_workflow_span_record.py | 1263 - ...kflow_span_record_annotation_aggregates.py | 60 - ...rkflow_span_record_annotation_agreement.py | 47 - ...tended_workflow_span_record_annotations.py | 66 - ..._record_annotations_additional_property.py | 62 - ...d_workflow_span_record_dataset_metadata.py | 47 - ...rkflow_span_record_feedback_rating_info.py | 60 - ...ended_workflow_span_record_files_type_0.py | 60 - ...workflow_span_record_metric_info_type_0.py | 203 - ...nded_workflow_span_record_user_metadata.py | 47 - src/splunk_ao/resources/models/permission.py | 37 +- .../resources/models/policy_package_notice.py | 115 + .../resources/models/project_action.py | 3 + .../models/project_name_filter_operator.py | 1 + .../prompt_template_name_filter_operator.py | 1 + .../models/recommended_model_purpose.py | 2 + .../registered_scorer_task_result_response.py | 67 +- .../registered_scorer_validation_stage.py | 11 + .../resources/models/run_enabled_evaluator.py | 65 + .../resources/models/run_evaluator_binding.py | 158 + .../models/run_evaluators_enabled.py | 62 + .../models/run_evaluators_inspection.py | 77 + .../models/run_evaluators_request.py | 50 + .../models/run_name_filter_operator.py | 1 + .../run_scorer_settings_patch_request.py | 36 +- .../models/run_scorer_settings_response.py | 56 +- .../resources/models/runtime_scorer_config.py | 161 + .../models/saved_evaluator_reference.py | 58 + .../resources/models/score_rating.py | 18 +- .../models/scorer_catalog_version_response.py | 389 + ...sponse_luna_validation_contract_type_0.py} | 10 +- .../resources/models/scorer_defaults.py | 163 + .../models/scorer_defaults_request.py | 492 + .../models/scorer_label_filter_operator.py | 1 + .../models/scorer_metadata_selection.py | 112 + .../models/scorer_name_filter_operator.py | 1 + .../resources/models/scorer_prompt_message.py | 91 + ...rer_prompt_message_content_type_1_item.py} | 10 +- .../models/scorer_prompt_preview_response.py | 159 + ...preview_response_normalized_input_item.py} | 10 +- ...corer_prompt_preview_unavailable_reason.py | 10 + ...rer_prompt_preview_unavailable_response.py | 90 + .../resources/models/scorer_response.py | 58 +- .../resources/models/span_input_selection.py | 79 + .../span_input_selection_fields_item.py | 10 + .../models/span_input_selection_request.py | 79 + ...pan_input_selection_request_fields_item.py | 10 + src/splunk_ao/resources/models/star_rating.py | 18 +- .../resources/models/stub_trace_record.py | 6 +- src/splunk_ao/resources/models/tags_rating.py | 18 +- src/splunk_ao/resources/models/text_rating.py | 18 +- .../models/tokenomics_delegation_action.py | 20 + .../resources/models/tree_choice_rating.py | 18 +- ...pdate_annotation_queue_settings_request.py | 110 + .../resources/models/update_scorer_request.py | 18 +- src/splunk_ao/resources/models/user_db.py | 21 + src/splunk_ao/resources/models/user_info.py | 22 +- .../resources/models/user_lifecycle_state.py | 10 + .../validate_llm_scorer_log_record_request.py | 10 +- .../resources/models/violation_reason.py | 12 + .../resources/models/workflow_span.py | 840 - .../models/workflow_span_dataset_metadata.py | 47 - .../models/workflow_span_user_metadata.py | 47 - 308 files changed, 22180 insertions(+), 45440 deletions(-) create mode 100644 src/splunk_ao/resources/api/annotation_queue/get_settings_annotation_queues_queue_id_settings_get.py create mode 100644 src/splunk_ao/resources/api/annotation_queue/update_settings_annotation_queues_queue_id_settings_put.py delete mode 100644 src/splunk_ao/resources/api/annotation_queue_records/create_annotation_queue_record_rating_annotation_queues_queue_id_records_record_id_rating_put.py create mode 100644 src/splunk_ao/resources/api/data/get_package_policy_notices_scorers_package_policy_notices_get.py create mode 100644 src/splunk_ao/resources/api/data/get_package_policy_status_scorers_package_policy_status_post.py create mode 100644 src/splunk_ao/resources/api/data/get_scorer_prompt_preview_scorers_versions_scorer_version_id_prompt_preview_get.py rename src/splunk_ao/resources/api/{trace/update_span_projects_project_id_spans_span_id_patch.py => run_scorer_settings/enable_evaluators_projects_project_id_runs_run_id_scorer_settings_evaluators_enable_post.py} (60%) create mode 100644 src/splunk_ao/resources/api/run_scorer_settings/inspect_evaluators_projects_project_id_runs_run_id_scorer_settings_evaluators_inspect_post.py delete mode 100644 src/splunk_ao/resources/models/agent_span.py delete mode 100644 src/splunk_ao/resources/models/agent_span_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/agent_span_user_metadata.py create mode 100644 src/splunk_ao/resources/models/annotation_queue_settings.py create mode 100644 src/splunk_ao/resources/models/annotation_queue_settings_response.py delete mode 100644 src/splunk_ao/resources/models/annotation_rating_create.py delete mode 100644 src/splunk_ao/resources/models/annotation_rating_db.py create mode 100644 src/splunk_ao/resources/models/annotator_view_span_type.py create mode 100644 src/splunk_ao/resources/models/code_metric_policy_notices_response.py create mode 100644 src/splunk_ao/resources/models/code_metric_policy_state.py create mode 100644 src/splunk_ao/resources/models/code_metric_policy_status.py create mode 100644 src/splunk_ao/resources/models/code_metric_policy_status_request.py create mode 100644 src/splunk_ao/resources/models/code_metric_policy_status_response.py delete mode 100644 src/splunk_ao/resources/models/control_span.py delete mode 100644 src/splunk_ao/resources/models/control_span_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/control_span_user_metadata.py create mode 100644 src/splunk_ao/resources/models/credit_balance.py create mode 100644 src/splunk_ao/resources/models/custom_dashboard_action.py create mode 100644 src/splunk_ao/resources/models/decision_model_properties.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_annotations.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_with_children.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotations.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_with_children_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_with_children_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_with_children_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_with_children_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_agent_span_record_with_children_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_control_span_record.py delete mode 100644 src/splunk_ao/resources/models/extended_control_span_record_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/extended_control_span_record_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/extended_control_span_record_annotations.py delete mode 100644 src/splunk_ao/resources/models/extended_control_span_record_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/extended_control_span_record_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_control_span_record_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/extended_control_span_record_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_control_span_record_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_control_span_record_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_annotations.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_with_children.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_with_children_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_with_children_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_with_children_annotations.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_with_children_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_with_children_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_with_children_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_with_children_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_with_children_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_http_span_record_with_children_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_llm_span_record.py delete mode 100644 src/splunk_ao/resources/models/extended_llm_span_record_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/extended_llm_span_record_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/extended_llm_span_record_annotations.py delete mode 100644 src/splunk_ao/resources/models/extended_llm_span_record_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/extended_llm_span_record_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_llm_span_record_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/extended_llm_span_record_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_llm_span_record_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_llm_span_record_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_read_session_record_with_children.py delete mode 100644 src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations.py delete mode 100644 src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/extended_read_session_record_with_children_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_read_session_record_with_children_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/extended_read_session_record_with_children_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_read_session_record_with_children_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_read_session_record_with_children_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_session_record.py delete mode 100644 src/splunk_ao/resources/models/extended_session_record_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/extended_session_record_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/extended_session_record_annotations.py delete mode 100644 src/splunk_ao/resources/models/extended_session_record_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/extended_session_record_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_session_record_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/extended_session_record_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_session_record_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_session_record_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_annotations.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_with_children.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotations.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_with_children_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_with_children_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_with_children_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_with_children_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/extended_workflow_span_record_with_children_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/http_span.py delete mode 100644 src/splunk_ao/resources/models/http_span_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/http_span_user_metadata.py create mode 100644 src/splunk_ao/resources/models/left_out_reason.py create mode 100644 src/splunk_ao/resources/models/llm_scorer_log_record_configuration.py delete mode 100644 src/splunk_ao/resources/models/llm_span.py delete mode 100644 src/splunk_ao/resources/models/llm_span_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/llm_span_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/log_records_partial_query_response.py delete mode 100644 src/splunk_ao/resources/models/log_records_query_response.py delete mode 100644 src/splunk_ao/resources/models/log_span_update_request.py create mode 100644 src/splunk_ao/resources/models/luna_billing_usage_response.py rename src/splunk_ao/resources/models/{extended_workflow_span_record_user_metadata.py => metric_settings_conflict_response.py} (56%) rename src/splunk_ao/resources/models/{billing_usage_response.py => non_luna_billing_usage_response.py} (84%) create mode 100644 src/splunk_ao/resources/models/non_luna_billing_usage_response_metric.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_agent_span_record.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_agent_span_record_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_agent_span_record_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_agent_span_record_annotations.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_agent_span_record_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_agent_span_record_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_agent_span_record_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_agent_span_record_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_agent_span_record_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_agent_span_record_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_control_span_record.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_control_span_record_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_control_span_record_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_control_span_record_annotations.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_control_span_record_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_control_span_record_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_control_span_record_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_control_span_record_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_control_span_record_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_control_span_record_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_http_span_record.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_http_span_record_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_http_span_record_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_http_span_record_annotations.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_http_span_record_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_http_span_record_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_http_span_record_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_http_span_record_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_http_span_record_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_http_span_record_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_llm_span_record.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_llm_span_record_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_llm_span_record_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_llm_span_record_annotations.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_llm_span_record_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_llm_span_record_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_llm_span_record_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_llm_span_record_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_llm_span_record_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_llm_span_record_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_session_record.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_session_record_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_session_record_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_session_record_annotations.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_session_record_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_session_record_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_session_record_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_session_record_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_session_record_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_session_record_user_metadata.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_workflow_span_record.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotation_aggregates.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotation_agreement.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotations.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotations_additional_property.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_workflow_span_record_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_workflow_span_record_feedback_rating_info.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_workflow_span_record_files_type_0.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_workflow_span_record_metric_info_type_0.py delete mode 100644 src/splunk_ao/resources/models/partial_extended_workflow_span_record_user_metadata.py create mode 100644 src/splunk_ao/resources/models/policy_package_notice.py create mode 100644 src/splunk_ao/resources/models/registered_scorer_validation_stage.py create mode 100644 src/splunk_ao/resources/models/run_enabled_evaluator.py create mode 100644 src/splunk_ao/resources/models/run_evaluator_binding.py create mode 100644 src/splunk_ao/resources/models/run_evaluators_enabled.py create mode 100644 src/splunk_ao/resources/models/run_evaluators_inspection.py create mode 100644 src/splunk_ao/resources/models/run_evaluators_request.py create mode 100644 src/splunk_ao/resources/models/saved_evaluator_reference.py create mode 100644 src/splunk_ao/resources/models/scorer_catalog_version_response.py rename src/splunk_ao/resources/models/{partial_extended_llm_span_record_tools_type_0_item.py => scorer_catalog_version_response_luna_validation_contract_type_0.py} (72%) create mode 100644 src/splunk_ao/resources/models/scorer_defaults_request.py create mode 100644 src/splunk_ao/resources/models/scorer_metadata_selection.py create mode 100644 src/splunk_ao/resources/models/scorer_prompt_message.py rename src/splunk_ao/resources/models/{llm_span_tools_type_0_item.py => scorer_prompt_message_content_type_1_item.py} (78%) create mode 100644 src/splunk_ao/resources/models/scorer_prompt_preview_response.py rename src/splunk_ao/resources/models/{extended_llm_span_record_tools_type_0_item.py => scorer_prompt_preview_response_normalized_input_item.py} (75%) create mode 100644 src/splunk_ao/resources/models/scorer_prompt_preview_unavailable_reason.py create mode 100644 src/splunk_ao/resources/models/scorer_prompt_preview_unavailable_response.py create mode 100644 src/splunk_ao/resources/models/span_input_selection.py create mode 100644 src/splunk_ao/resources/models/span_input_selection_fields_item.py create mode 100644 src/splunk_ao/resources/models/span_input_selection_request.py create mode 100644 src/splunk_ao/resources/models/span_input_selection_request_fields_item.py create mode 100644 src/splunk_ao/resources/models/tokenomics_delegation_action.py create mode 100644 src/splunk_ao/resources/models/update_annotation_queue_settings_request.py create mode 100644 src/splunk_ao/resources/models/user_lifecycle_state.py create mode 100644 src/splunk_ao/resources/models/violation_reason.py delete mode 100644 src/splunk_ao/resources/models/workflow_span.py delete mode 100644 src/splunk_ao/resources/models/workflow_span_dataset_metadata.py delete mode 100644 src/splunk_ao/resources/models/workflow_span_user_metadata.py diff --git a/openapi.yaml b/openapi.yaml index 4053d733..4bab21c3 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -665,11 +665,11 @@ paths: tags: - prompts summary: Create Global Prompt Template - description: "Create a global prompt template.\n\nParameters\n----------\ncreate_request\ - \ : CreatePromptTemplateWithVersionRequestBody\n Request body containing\ - \ template name and content.\nprincipal : Principal\n Principal object.\n\ - \nReturns\n-------\nBasePromptTemplateResponse\n Details about the created\ - \ prompt template." + description: "Create a prompt template, optionally linked to a project.\n\n\ + Parameters\n----------\ncreate_request : CreatePromptTemplateWithVersionRequestBody\n\ + \ Request body containing template name and content.\nprincipal : Principal\n\ + \ Principal object.\n\nReturns\n-------\nBasePromptTemplateResponse\n \ + \ Details about the created prompt template." operationId: create_global_prompt_template_templates_post security: - APIKeyHeader: [] @@ -1377,7 +1377,7 @@ paths: tags: - datasets summary: Create Dataset - description: Creates a standalone dataset. + description: Create a dataset with an optional project link. operationId: create_dataset_datasets_post security: - APIKeyHeader: [] @@ -4871,6 +4871,17 @@ paths: description: Actions to include in the 'permissions' field of the scorers. title: Actions description: Actions to include in the 'permissions' field of the scorers. + - name: include_luna_validation_contract + in: query + required: false + schema: + type: boolean + description: Include exact training contracts on default and latest versions + for Luna eligibility. + default: false + title: Include Luna Validation Contract + description: Include exact training contracts on default and latest versions + for Luna eligibility. - name: starting_token in: query required: false @@ -4927,6 +4938,62 @@ paths: - ClassicAPIKeyHeader: [] - OAuth2PasswordBearer: [] - HTTPBasic: [] + /scorers/package-policy-status: + post: + tags: + - data + - prompts + - rows + summary: Get Package Policy Status + description: The code-metric package-policy state of each listed code metric + that has one and that the caller can read. + operationId: get_package_policy_status_scorers_package_policy_status_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CodeMetricPolicyStatusRequest' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CodeMetricPolicyStatusResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + security: + - APIKeyHeader: [] + - ClassicAPIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + /scorers/package-policy-notices: + get: + tags: + - data + - prompts + - rows + summary: Get Package Policy Notices + description: The package-policy notices of the caller's code metrics, or of + the organization's for an org admin. + operationId: get_package_policy_notices_scorers_package_policy_notices_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CodeMetricPolicyNoticesResponse' + security: + - APIKeyHeader: [] + - ClassicAPIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] /scorers/{scorer_id}/version: get: tags: @@ -5396,13 +5463,12 @@ paths: are at the top level, in place of the prompt fields. output_type, scoreable_node_types, - input_type and + input_type, - ground_truth are in scorer_configuration. scoreable_node_types holds exactly - one node type. The + ground_truth and metadata_selection are in scorer_configuration. scoreable_node_types + holds - fields that select the records (log_stream_id or experiment_id, and filters) - are at the top level.' + exactly one node type. The record source and filters are at the top level.' operationId: validate_decision_scorer_log_record_scorers_decision_validate_log_record_post requestBody: content: @@ -5583,6 +5649,66 @@ paths: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' + /scorers/versions/{scorer_version_id}/prompt-preview: + get: + tags: + - data + - prompts + - rows + summary: Get Scorer Prompt Preview + description: Return this version's prompt using the run's effective scorer settings. + operationId: get_scorer_prompt_preview_scorers_versions__scorer_version_id__prompt_preview_get + security: + - APIKeyHeader: [] + - ClassicAPIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: scorer_version_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Scorer Version Id + - name: project_id + in: query + required: true + schema: + type: string + format: uuid4 + title: Project Id + - name: run_id + in: query + required: true + schema: + type: string + format: uuid4 + title: Run Id + - name: record_id + in: query + required: true + schema: + type: string + format: uuid4 + title: Record Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/ScorerPromptPreviewResponse' + - $ref: '#/components/schemas/ScorerPromptPreviewUnavailableResponse' + title: Response Get Scorer Prompt Preview Scorers Versions Scorer + Version Id Prompt Preview Get + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' /scorers/{scorer_id}/health-scores: get: tags: @@ -5805,6 +5931,15 @@ paths: format: uuid4 - type: 'null' title: Access View Id + - name: run_id + in: query + required: false + schema: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Run Id responses: '200': description: Successful Response @@ -5922,20 +6057,20 @@ paths: oneOf: - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedLlmSpanRecord' + - $ref: '#/components/schemas/ExtendedLlmSpanRecord-Input' - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedControlSpanRecord' + - $ref: '#/components/schemas/ExtendedControlSpanRecord-Input' - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' discriminator: propertyName: type mapping: agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - llm: '#/components/schemas/ExtendedLlmSpanRecord' + llm: '#/components/schemas/ExtendedLlmSpanRecord-Input' tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - control: '#/components/schemas/ExtendedControlSpanRecord' + control: '#/components/schemas/ExtendedControlSpanRecord-Input' http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' title: Response Get Span Projects Project Id Spans Span Id Get '422': @@ -7196,7 +7331,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BillingUsageResponse' + oneOf: + - $ref: '#/components/schemas/NonLunaBillingUsageResponse' + - $ref: '#/components/schemas/LunaBillingUsageResponse' + discriminator: + propertyName: metric + mapping: + traces: '#/components/schemas/NonLunaBillingUsageResponse' + spans: '#/components/schemas/NonLunaBillingUsageResponse' + luna_tokens: '#/components/schemas/NonLunaBillingUsageResponse' + luna_fine_tuning_runs: '#/components/schemas/NonLunaBillingUsageResponse' + total_users: '#/components/schemas/NonLunaBillingUsageResponse' + monthly_active_users: '#/components/schemas/NonLunaBillingUsageResponse' + luna_decision_input_tokens: '#/components/schemas/LunaBillingUsageResponse' + title: Response Get Billing Usage Billing Usage Metric Get '422': description: Validation Error content: @@ -9414,6 +9562,8 @@ paths: - Template criteria + - Whether the template is required + Note: Constraints and other fields cannot be updated.' operationId: update_queue_template_annotation_queues__queue_id__templates__template_id__patch @@ -9507,6 +9657,86 @@ paths: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' + /annotation_queues/{queue_id}/settings: + get: + tags: + - annotation_queue + summary: Get Settings + description: 'Get the settings for an annotation queue. + + + Returns the default settings if none have been saved yet. Any user who can + read the queue can fetch them.' + operationId: get_settings_annotation_queues__queue_id__settings_get + security: + - APIKeyHeader: [] + - ClassicAPIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: queue_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Queue Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AnnotationQueueSettingsResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - annotation_queue + summary: Update Settings + description: 'Save the settings for an annotation queue. + + + Merges the fields in the body into the saved settings. Returns 403 unless + the user is an org admin or a queue + + owner. Fetch the settings with the GET endpoint.' + operationId: update_settings_annotation_queues__queue_id__settings_put + security: + - APIKeyHeader: [] + - ClassicAPIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: queue_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Queue Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAnnotationQueueSettingsRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' /annotation_queues/{queue_id}/users: post: tags: @@ -10034,27 +10264,27 @@ paths: application/json: schema: oneOf: - - $ref: '#/components/schemas/PartialExtendedTraceRecord' - - $ref: '#/components/schemas/PartialExtendedAgentSpanRecord' - - $ref: '#/components/schemas/PartialExtendedWorkflowSpanRecord' - - $ref: '#/components/schemas/PartialExtendedLlmSpanRecord' - - $ref: '#/components/schemas/PartialExtendedToolSpanRecord' - - $ref: '#/components/schemas/PartialExtendedRetrieverSpanRecord' - - $ref: '#/components/schemas/PartialExtendedControlSpanRecord' - - $ref: '#/components/schemas/PartialExtendedHttpSpanRecord' - - $ref: '#/components/schemas/PartialExtendedSessionRecord' + - $ref: '#/components/schemas/PartialExtendedTraceRecord-Input' + - $ref: '#/components/schemas/PartialExtendedAgentSpanRecord-Input' + - $ref: '#/components/schemas/PartialExtendedWorkflowSpanRecord-Input' + - $ref: '#/components/schemas/PartialExtendedLlmSpanRecord-Input' + - $ref: '#/components/schemas/PartialExtendedToolSpanRecord-Input' + - $ref: '#/components/schemas/PartialExtendedRetrieverSpanRecord-Input' + - $ref: '#/components/schemas/PartialExtendedControlSpanRecord-Input' + - $ref: '#/components/schemas/PartialExtendedHttpSpanRecord-Input' + - $ref: '#/components/schemas/PartialExtendedSessionRecord-Input' discriminator: propertyName: type mapping: - trace: '#/components/schemas/PartialExtendedTraceRecord' - agent: '#/components/schemas/PartialExtendedAgentSpanRecord' - workflow: '#/components/schemas/PartialExtendedWorkflowSpanRecord' - llm: '#/components/schemas/PartialExtendedLlmSpanRecord' - tool: '#/components/schemas/PartialExtendedToolSpanRecord' - retriever: '#/components/schemas/PartialExtendedRetrieverSpanRecord' - control: '#/components/schemas/PartialExtendedControlSpanRecord' - http: '#/components/schemas/PartialExtendedHttpSpanRecord' - session: '#/components/schemas/PartialExtendedSessionRecord' + trace: '#/components/schemas/PartialExtendedTraceRecord-Input' + agent: '#/components/schemas/PartialExtendedAgentSpanRecord-Input' + workflow: '#/components/schemas/PartialExtendedWorkflowSpanRecord-Input' + llm: '#/components/schemas/PartialExtendedLlmSpanRecord-Input' + tool: '#/components/schemas/PartialExtendedToolSpanRecord-Input' + retriever: '#/components/schemas/PartialExtendedRetrieverSpanRecord-Input' + control: '#/components/schemas/PartialExtendedControlSpanRecord-Input' + http: '#/components/schemas/PartialExtendedHttpSpanRecord-Input' + session: '#/components/schemas/PartialExtendedSessionRecord-Input' title: Response Get Annotation Queue Record Annotation Queues Queue Id Records Record Id Get '422': @@ -10831,6 +11061,12 @@ paths: application/json: schema: $ref: '#/components/schemas/MetricSettingsResponse' + '409': + description: The evaluator settings revision is stale. + content: + application/json: + schema: + $ref: '#/components/schemas/MetricSettingsConflictResponse' '422': description: Validation Error content: @@ -10875,6 +11111,99 @@ paths: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' + /projects/{project_id}/runs/{run_id}/scorer-settings/evaluators/inspect: + post: + tags: + - run_scorer_settings + summary: Inspect Evaluators + description: Resolve exact visible Evaluators on the primary before approval. + operationId: inspect_evaluators_projects__project_id__runs__run_id__scorer_settings_evaluators_inspect_post + security: + - APIKeyHeader: [] + - ClassicAPIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: project_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Project Id + - name: run_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Run Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RunEvaluatorsRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/RunEvaluatorsInspection' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /projects/{project_id}/runs/{run_id}/scorer-settings/evaluators/enable: + post: + tags: + - run_scorer_settings + summary: Enable Evaluators + description: Add exact saved Evaluators while preserving settings and historical + scores. + operationId: enable_evaluators_projects__project_id__runs__run_id__scorer_settings_evaluators_enable_post + security: + - APIKeyHeader: [] + - ClassicAPIKeyHeader: [] + - OAuth2PasswordBearer: [] + - HTTPBasic: [] + parameters: + - name: project_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Project Id + - name: run_id + in: path + required: true + schema: + type: string + format: uuid4 + title: Run Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RunEvaluatorsRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/RunEvaluatorsEnabled' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' /projects/{project_id}/runs/{run_id}/scorer-settings: patch: tags: @@ -10921,6 +11250,12 @@ paths: application/json: schema: $ref: '#/components/schemas/RunScorerSettingsResponse' + '409': + description: The evaluator settings revision is stale. + content: + application/json: + schema: + $ref: '#/components/schemas/MetricSettingsConflictResponse' '422': description: Validation Error content: @@ -10972,6 +11307,12 @@ paths: application/json: schema: $ref: '#/components/schemas/RunScorerSettingsResponse' + '409': + description: The evaluator settings revision is stale. + content: + application/json: + schema: + $ref: '#/components/schemas/MetricSettingsConflictResponse' '422': description: Validation Error content: @@ -11138,7 +11479,7 @@ components: - type: string - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Input' type: array - items: oneOf: @@ -11159,7 +11500,7 @@ components: - type: string - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Input' type: array - items: oneOf: @@ -11949,6 +12290,7 @@ components: - eq - ne - contains + - regex - one_of - not_in title: Operator @@ -12435,6 +12777,55 @@ components: - updated_at - created_by_user title: AnnotationQueueResponse + AnnotationQueueSettings: + properties: + show_full_session: + type: boolean + title: Show Full Session + default: true + show_conversation_history: + type: boolean + title: Show Conversation History + default: true + show_span_types: + type: boolean + title: Show Span Types + default: true + span_types: + items: + $ref: '#/components/schemas/AnnotatorViewSpanType' + type: array + maxItems: 7 + title: Span Types + show_parameters: + type: boolean + title: Show Parameters + default: true + show_span_metadata: + type: boolean + title: Show Span Metadata + default: true + show_evaluators: + type: boolean + title: Show Evaluators + default: true + type: object + title: AnnotationQueueSettings + description: What annotators see in the annotator view. Stored as JSON; defaults + apply to missing keys. + AnnotationQueueSettingsResponse: + properties: + annotation_queue_id: + type: string + format: uuid4 + title: Annotation Queue Id + settings: + $ref: '#/components/schemas/AnnotationQueueSettings' + type: object + required: + - annotation_queue_id + - settings + title: AnnotationQueueSettingsResponse AnnotationQueueUpdatedAtFilter: properties: name: @@ -12703,6 +13094,10 @@ components: type: boolean title: Include Explanation default: false + required: + type: boolean + title: Required + default: true criteria: anyOf: - type: string @@ -12744,6 +13139,9 @@ components: include_explanation: type: boolean title: Include Explanation + required: + type: boolean + title: Required criteria: anyOf: - type: string @@ -12795,6 +13193,7 @@ components: required: - name - include_explanation + - required - constraints - id - created_at @@ -12836,6 +13235,11 @@ components: minLength: 1 - type: 'null' title: Criteria + required: + anyOf: + - type: boolean + - type: 'null' + title: Required type: object required: - name @@ -12890,6 +13294,17 @@ components: - choice - tree_choice title: AnnotationType + AnnotatorViewSpanType: + type: string + enum: + - http + - llm + - retriever + - tool + - workflow + - agent + - control + title: AnnotatorViewSpanType AnthropicAuthenticationType: type: string enum: @@ -13812,6 +14227,21 @@ components: - type: boolean - type: 'null' title: Ground Truth + metadata_selection: + anyOf: + - $ref: '#/components/schemas/ScorerMetadataSelection' + - type: 'null' + span_input_selections: + anyOf: + - items: + $ref: '#/components/schemas/SpanInputSelection' + type: array + - type: 'null' + title: Span Input Selections + require_matching_span: + type: boolean + title: Require Matching Span + default: false regex_field: type: string title: Regex Field @@ -14161,36 +14591,11 @@ components: - traces - spans - luna_tokens + - luna_decision_input_tokens - luna_fine_tuning_runs - total_users - monthly_active_users title: BillingUsageMetric - BillingUsageResponse: - properties: - metric: - $ref: '#/components/schemas/BillingUsageMetric' - total: - type: integer - title: Total - default: 0 - projects: - items: - $ref: '#/components/schemas/ProjectBillingUsage' - type: array - title: Projects - available: - type: boolean - title: Available - default: true - unavailable_reason: - anyOf: - - type: string - - type: 'null' - title: Unavailable Reason - type: object - required: - - metric - title: BillingUsageResponse Body_create_code_scorer_version_scorers__scorer_id__version_code_post: properties: validation_result: @@ -14773,6 +15178,22 @@ components: - annotation_type - choices title: ChoiceConstraints + ChoiceRating-Output: + properties: + feedback_type: + type: string + const: choice + title: Feedback Type + default: choice + value: + type: string + maxLength: 255 + minLength: 1 + title: Value + type: object + required: + - value + title: ChoiceRating CodeMetricGenerationStatus: type: string enum: @@ -14804,6 +15225,89 @@ components: - status title: CodeMetricGenerationStatusResponse description: Lightweight polling response. + CodeMetricPolicyNoticesResponse: + properties: + notices: + items: + $ref: '#/components/schemas/CodeMetricPolicyStatus' + type: array + title: Notices + total: + type: integer + title: Total + type: object + required: + - notices + - total + title: CodeMetricPolicyNoticesResponse + CodeMetricPolicyState: + type: string + enum: + - blocked + - save_again + - end_of_life_soon + title: CodeMetricPolicyState + CodeMetricPolicyStatus: + properties: + scorer_id: + type: string + format: uuid4 + title: Scorer Id + scorer_name: + type: string + title: Scorer Name + scorer_version_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Scorer Version Id + state: + $ref: '#/components/schemas/CodeMetricPolicyState' + message: + type: string + title: Message + packages: + items: + $ref: '#/components/schemas/PolicyPackageNotice' + type: array + title: Packages + type: object + required: + - scorer_id + - scorer_name + - scorer_version_id + - state + - message + - packages + title: CodeMetricPolicyStatus + description: The package-policy state of one code metric's default version. + CodeMetricPolicyStatusRequest: + properties: + scorer_ids: + items: + type: string + format: uuid4 + type: array + maxItems: 500 + minItems: 1 + title: Scorer Ids + additionalProperties: false + type: object + required: + - scorer_ids + title: CodeMetricPolicyStatusRequest + CodeMetricPolicyStatusResponse: + properties: + scorers: + items: + $ref: '#/components/schemas/CodeMetricPolicyStatus' + type: array + title: Scorers + type: object + required: + - scorers + title: CodeMetricPolicyStatusResponse CollaboratorRole: type: string enum: @@ -15648,7 +16152,7 @@ components: - type: 'null' question: type: string - maxLength: 2000 + maxLength: 10000 minLength: 1 title: Question answer_options: @@ -16372,7 +16876,7 @@ components: title: Tags defaults: anyOf: - - $ref: '#/components/schemas/ScorerDefaults' + - $ref: '#/components/schemas/ScorerDefaultsRequest' - type: 'null' invocation: anyOf: @@ -16560,6 +17064,53 @@ components: - data_type - scoreable_node_types title: CreateUpdateRegisteredScorerResponse + CreditBalance: + properties: + organization_id: + type: string + format: uuid + title: Organization Id + unit: + type: string + const: input_tokens + title: Unit + default: input_tokens + granted_tokens: + type: integer + maximum: 9.223372036854776e+18 + minimum: 0.0 + title: Granted Tokens + consumed_tokens: + type: integer + maximum: 9.223372036854776e+18 + minimum: 0.0 + title: Consumed Tokens + reserved_tokens: + type: integer + maximum: 9.223372036854776e+18 + minimum: 0.0 + title: Reserved Tokens + available_tokens: + type: integer + maximum: 9.223372036854776e+18 + minimum: 0.0 + title: Available Tokens + eligible: + type: boolean + title: Eligible + default: true + exhausted: + type: boolean + title: Exhausted + type: object + required: + - organization_id + - granted_tokens + - consumed_tokens + - reserved_tokens + - available_tokens + - exhausted + title: CreditBalance CustomAuthenticationType: type: string enum: @@ -16577,6 +17128,15 @@ components: - oauth2: OAuth2 token-based authentication - api_key: API key header-based authentication' + CustomDashboardAction: + type: string + enum: + - update + - delete + - transfer + - share + title: CustomDashboardAction + description: Per-dashboard actions reported on custom dashboard responses. CustomIntegration: properties: multi_modal_config: @@ -16618,6 +17178,16 @@ components: title: Default Model description: Default model to use. If not provided, defaults to the first model. + decision_model_properties: + anyOf: + - items: + $ref: '#/components/schemas/DecisionModelProperties' + type: array + maxItems: 20 + - type: 'null' + title: Decision Model Properties + description: The decision models this integration serves. An integration + that lists decision models may have no chat models. endpoint: type: string title: Endpoint @@ -16745,6 +17315,16 @@ components: title: Default Model description: Default model to use. If not provided, defaults to the first model. + decision_model_properties: + anyOf: + - items: + $ref: '#/components/schemas/DecisionModelProperties' + type: array + maxItems: 20 + - type: 'null' + title: Decision Model Properties + description: The decision models this integration serves. An integration + that lists decision models may have no chat models. endpoint: type: string title: Endpoint @@ -16842,6 +17422,13 @@ components: type: array - type: 'null' title: Model Properties + decision_model_properties: + anyOf: + - items: + $ref: '#/components/schemas/DecisionModelProperties' + type: array + - type: 'null' + title: Decision Model Properties token: anyOf: - type: string @@ -17462,6 +18049,7 @@ components: - eq - ne - contains + - regex - one_of - not_in title: Operator @@ -17915,8 +18503,6 @@ components: - 'true' - 'false' title: DecisionBooleanCriteria - description: What a true answer and a false answer mean, for a yes/no question. - The two are set together. DecisionChoice: properties: label: @@ -17932,12 +18518,8 @@ components: required: - label title: DecisionChoice - description: 'One option of a choice question, with an optional description - of when it applies. - - - Extra fields are forbidden, so a level, which has a ``level`` field, never - validates as a choice.' + description: Extra fields are forbidden so a score level never validates as + a choice. DecisionLevel: properties: level: @@ -17960,6 +18542,20 @@ components: title: DecisionLevel description: One level of a score question. A question's levels run 0, 1, 2 and so on, with no gaps. + DecisionModelProperties: + properties: + name: + type: string + title: Name + description: Name of a decision model that a custom integration can serve, + such as 'kairos-jev'. + additionalProperties: false + type: object + required: + - name + title: DecisionModelProperties + description: One decision model that a custom integration serves. The registry + entry of the same name supplies the rest. DecisionScorerDB: properties: id: @@ -18036,6 +18632,10 @@ components: type: boolean title: Ground Truth default: false + metadata_selection: + anyOf: + - $ref: '#/components/schemas/ScorerMetadataSelection' + - type: 'null' type: object required: - output_type @@ -18077,8 +18677,12 @@ components: required: - message title: DeleteScorerResponse - Document: + Document-Input: properties: + page_content: + type: string + title: Page Content + description: Content of the document. metadata: additionalProperties: anyOf: @@ -18088,10 +18692,26 @@ components: - type: number type: object title: Metadata + additionalProperties: false + type: object + required: + - page_content + title: Document + Document-Output: + properties: content: type: string title: Content description: Content of the document. + metadata: + additionalProperties: + anyOf: + - type: boolean + - type: string + - type: integer + - type: number + type: object + title: Metadata additionalProperties: false type: object required: @@ -18365,6 +18985,7 @@ components: - eq - ne - contains + - regex - one_of - not_in title: Operator @@ -18474,6 +19095,7 @@ components: - eq - ne - contains + - regex - one_of - not_in title: Operator @@ -19033,7 +19655,7 @@ components: - content_type title: ExportPresignedUrlResponse description: Response for an export written to object storage. - ExtendedAgentSpanRecord: + ExtendedAgentSpanRecord-Input: properties: type: type: string @@ -19084,7 +19706,7 @@ components: - type: string - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Input' type: array - items: oneOf: @@ -19105,7 +19727,7 @@ components: - type: string - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Input' type: array - items: oneOf: @@ -19334,10 +19956,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -19347,8 +19969,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -19365,6 +19987,21 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' parent_id: type: string format: uuid4 @@ -19399,30 +20036,8 @@ components: - run_id - parent_id title: ExtendedAgentSpanRecord - ExtendedAgentSpanRecordWithChildren: + ExtendedAgentSpanRecord-Output: properties: - spans: - items: - oneOf: - - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedLlmSpanRecord' - - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedControlSpanRecord' - - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' - discriminator: - propertyName: type - mapping: - agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - control: '#/components/schemas/ExtendedControlSpanRecord' - http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' - llm: '#/components/schemas/ExtendedLlmSpanRecord' - retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - type: array - title: Spans type: type: string const: agent @@ -19433,7 +20048,7 @@ components: anyOf: - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + $ref: '#/components/schemas/Message-Output' type: array - items: oneOf: @@ -19452,7 +20067,7 @@ components: anyOf: - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + $ref: '#/components/schemas/Message-Output' type: array - items: oneOf: @@ -19470,9 +20085,9 @@ components: output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - $ref: '#/components/schemas/Message-Output' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Output' type: array - items: oneOf: @@ -19491,9 +20106,9 @@ components: redacted_output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - $ref: '#/components/schemas/Message-Output' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Output' type: array - items: oneOf: @@ -19722,10 +20337,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Output' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Output' discriminator: propertyName: status_type mapping: @@ -19735,8 +20350,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' type: object - type: 'null' title: Metric Info @@ -19753,6 +20368,21 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' parent_id: type: string format: uuid4 @@ -19786,15 +20416,37 @@ components: - project_id - run_id - parent_id - title: ExtendedAgentSpanRecordWithChildren - ExtendedControlSpanRecord: + title: ExtendedAgentSpanRecord + ExtendedAgentSpanRecordWithChildren: properties: + spans: + items: + oneOf: + - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedLlmSpanRecord-Input' + - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedControlSpanRecord-Input' + - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' + control: '#/components/schemas/ExtendedControlSpanRecord-Input' + http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' + llm: '#/components/schemas/ExtendedLlmSpanRecord-Input' + retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' + tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' + workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + type: array + title: Spans type: type: string - const: control + const: agent title: Type description: Type of the trace, span or session. - default: control + default: agent input: anyOf: - type: string @@ -19835,13 +20487,45 @@ components: description: Redacted input of the trace or span. output: anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - $ref: '#/components/schemas/ControlResult' - type: 'null' + title: Output description: Output of the trace or span. redacted_output: anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - $ref: '#/components/schemas/ControlResult' - type: 'null' + title: Redacted Output description: Redacted output of the trace or span. name: type: string @@ -20056,10 +20740,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -20069,8 +20753,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -20087,6 +20771,21 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' parent_id: type: string format: uuid4 @@ -20103,43 +20802,16 @@ components: - type: 'null' title: Step Number description: Topological step number of the span. - control_id: - anyOf: - - type: integer - - type: 'null' - title: Control Id - description: Identifier of the control definition that produced this span. + agent_type: + $ref: '#/components/schemas/AgentType' + description: Agent type. + default: default agent_name: anyOf: - type: string - type: 'null' title: Agent Name - description: Normalized agent name associated with this control execution. - check_stage: - anyOf: - - $ref: '#/components/schemas/ControlCheckStage' - - type: 'null' - description: Execution stage where the control ran, typically 'pre' or 'post'. - applies_to: - anyOf: - - $ref: '#/components/schemas/ControlAppliesTo' - - type: 'null' - description: Parent execution type the control applied to, for example 'llm_call' - or 'tool_call'. - evaluator_name: - anyOf: - - type: string - - type: 'null' - title: Evaluator Name - description: Representative evaluator name for this control span. For composite - controls, this is the primary evaluator chosen for observability identity. - selector_path: - anyOf: - - type: string - - type: 'null' - title: Selector Path - description: Representative selector path for this control span. For composite - controls, this is the primary selector path chosen for observability identity. + description: Name of the agent. type: object required: - id @@ -20147,15 +20819,15 @@ components: - project_id - run_id - parent_id - title: ExtendedControlSpanRecord - ExtendedHttpSpanRecord: + title: ExtendedAgentSpanRecordWithChildren + ExtendedControlSpanRecord-Input: properties: type: type: string - const: http + const: control title: Type description: Type of the trace, span or session. - default: http + default: control input: anyOf: - type: string @@ -20196,45 +20868,13 @@ components: description: Redacted input of the trace or span. output: anyOf: - - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - $ref: '#/components/schemas/ControlResult' - type: 'null' - title: Output description: Output of the trace or span. redacted_output: anyOf: - - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - $ref: '#/components/schemas/ControlResult' - type: 'null' - title: Redacted Output description: Redacted output of the trace or span. name: type: string @@ -20449,10 +21089,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -20462,8 +21102,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -20480,6 +21120,21 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' parent_id: type: string format: uuid4 @@ -20496,6 +21151,43 @@ components: - type: 'null' title: Step Number description: Topological step number of the span. + control_id: + anyOf: + - type: integer + - type: 'null' + title: Control Id + description: Identifier of the control definition that produced this span. + agent_name: + anyOf: + - type: string + - type: 'null' + title: Agent Name + description: Normalized agent name associated with this control execution. + check_stage: + anyOf: + - $ref: '#/components/schemas/ControlCheckStage' + - type: 'null' + description: Execution stage where the control ran, typically 'pre' or 'post'. + applies_to: + anyOf: + - $ref: '#/components/schemas/ControlAppliesTo' + - type: 'null' + description: Parent execution type the control applied to, for example 'llm_call' + or 'tool_call'. + evaluator_name: + anyOf: + - type: string + - type: 'null' + title: Evaluator Name + description: Representative evaluator name for this control span. For composite + controls, this is the primary evaluator chosen for observability identity. + selector_path: + anyOf: + - type: string + - type: 'null' + title: Selector Path + description: Representative selector path for this control span. For composite + controls, this is the primary selector path chosen for observability identity. type: object required: - id @@ -20503,42 +21195,20 @@ components: - project_id - run_id - parent_id - title: ExtendedHttpSpanRecord - ExtendedHttpSpanRecordWithChildren: + title: ExtendedControlSpanRecord + ExtendedControlSpanRecord-Output: properties: - spans: - items: - oneOf: - - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedLlmSpanRecord' - - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedControlSpanRecord' - - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' - discriminator: - propertyName: type - mapping: - agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - control: '#/components/schemas/ExtendedControlSpanRecord' - http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' - llm: '#/components/schemas/ExtendedLlmSpanRecord' - retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - type: array - title: Spans type: type: string - const: http + const: control title: Type description: Type of the trace, span or session. - default: http + default: control input: anyOf: - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + $ref: '#/components/schemas/Message-Output' type: array - items: oneOf: @@ -20557,7 +21227,7 @@ components: anyOf: - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + $ref: '#/components/schemas/Message-Output' type: array - items: oneOf: @@ -20574,45 +21244,13 @@ components: description: Redacted input of the trace or span. output: anyOf: - - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - $ref: '#/components/schemas/ControlResult' - type: 'null' - title: Output description: Output of the trace or span. redacted_output: anyOf: - - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - $ref: '#/components/schemas/ControlResult' - type: 'null' - title: Redacted Output description: Redacted output of the trace or span. name: type: string @@ -20827,10 +21465,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Output' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Output' discriminator: propertyName: status_type mapping: @@ -20840,8 +21478,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' type: object - type: 'null' title: Metric Info @@ -20858,6 +21496,21 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' parent_id: type: string format: uuid4 @@ -20874,6 +21527,43 @@ components: - type: 'null' title: Step Number description: Topological step number of the span. + control_id: + anyOf: + - type: integer + - type: 'null' + title: Control Id + description: Identifier of the control definition that produced this span. + agent_name: + anyOf: + - type: string + - type: 'null' + title: Agent Name + description: Normalized agent name associated with this control execution. + check_stage: + anyOf: + - $ref: '#/components/schemas/ControlCheckStage' + - type: 'null' + description: Execution stage where the control ran, typically 'pre' or 'post'. + applies_to: + anyOf: + - $ref: '#/components/schemas/ControlAppliesTo' + - type: 'null' + description: Parent execution type the control applied to, for example 'llm_call' + or 'tool_call'. + evaluator_name: + anyOf: + - type: string + - type: 'null' + title: Evaluator Name + description: Representative evaluator name for this control span. For composite + controls, this is the primary evaluator chosen for observability identity. + selector_path: + anyOf: + - type: string + - type: 'null' + title: Selector Path + description: Representative selector path for this control span. For composite + controls, this is the primary selector path chosen for observability identity. type: object required: - id @@ -20881,36 +21571,94 @@ components: - project_id - run_id - parent_id - title: ExtendedHttpSpanRecordWithChildren - ExtendedLlmSpanRecord: + title: ExtendedControlSpanRecord + ExtendedHttpSpanRecord-Input: properties: type: type: string - const: llm + const: http title: Type description: Type of the trace, span or session. - default: llm + default: http input: - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array title: Input description: Input to the trace or span. + default: '' redacted_input: anyOf: + - type: string - items: $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Output description: Output of the trace or span. redacted_output: anyOf: + - type: string - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' - type: 'null' + title: Redacted Output description: Redacted output of the trace or span. name: type: string @@ -20942,7 +21690,7 @@ components: description: Status code of the trace or span. Used for logging failure or error states. metrics: - $ref: '#/components/schemas/LlmMetrics' + $ref: '#/components/schemas/Metrics' description: Metrics associated with this trace or span. external_id: anyOf: @@ -21125,10 +21873,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -21138,8 +21886,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -21156,6 +21904,21 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' parent_id: type: string format: uuid4 @@ -21172,67 +21935,6 @@ components: - type: 'null' title: Step Number description: Topological step number of the span. - tools: - anyOf: - - items: - additionalProperties: true - type: object - type: array - - type: 'null' - title: Tools - description: List of available tools passed to the LLM on invocation. - events: - anyOf: - - items: - oneOf: - - $ref: '#/components/schemas/MessageEvent' - - $ref: '#/components/schemas/ReasoningEvent' - - $ref: '#/components/schemas/InternalToolCall' - - $ref: '#/components/schemas/WebSearchCallEvent' - - $ref: '#/components/schemas/ImageGenerationEvent' - - $ref: '#/components/schemas/MCPCallEvent' - - $ref: '#/components/schemas/MCPListToolsEvent' - - $ref: '#/components/schemas/MCPApprovalRequestEvent' - discriminator: - propertyName: type - mapping: - image_generation: '#/components/schemas/ImageGenerationEvent' - internal_tool_call: '#/components/schemas/InternalToolCall' - mcp_approval_request: '#/components/schemas/MCPApprovalRequestEvent' - mcp_call: '#/components/schemas/MCPCallEvent' - mcp_list_tools: '#/components/schemas/MCPListToolsEvent' - message: '#/components/schemas/MessageEvent' - reasoning: '#/components/schemas/ReasoningEvent' - web_search_call: '#/components/schemas/WebSearchCallEvent' - type: array - - type: 'null' - title: Events - description: List of reasoning, internal tool call, or MCP events that occurred - during the LLM span. - model: - anyOf: - - type: string - - type: 'null' - title: Model - description: Model used for this span. - provider: - anyOf: - - type: string - - type: 'null' - title: Provider - description: Provider used for this span. - temperature: - anyOf: - - type: number - - type: 'null' - title: Temperature - description: Temperature used for generation. - finish_reason: - anyOf: - - type: string - - type: 'null' - title: Finish Reason - description: Reason for finishing. type: object required: - id @@ -21240,20 +21942,20 @@ components: - project_id - run_id - parent_id - title: ExtendedLlmSpanRecord - ExtendedReadSessionRecordWithChildren: + title: ExtendedHttpSpanRecord + ExtendedHttpSpanRecord-Output: properties: type: type: string - const: session + const: http title: Type description: Type of the trace, span or session. - default: session + default: http input: anyOf: - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + $ref: '#/components/schemas/Message-Output' type: array - items: oneOf: @@ -21266,12 +21968,13 @@ components: text: '#/components/schemas/TextContentPart' type: array title: Input + description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + $ref: '#/components/schemas/Message-Output' type: array - items: oneOf: @@ -21289,9 +21992,9 @@ components: output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - $ref: '#/components/schemas/Message-Output' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Output' type: array - items: oneOf: @@ -21310,9 +22013,9 @@ components: redacted_output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - $ref: '#/components/schemas/Message-Output' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Output' type: array - items: oneOf: @@ -21388,14 +22091,13 @@ components: type: string format: uuid4 title: ID - description: Galileo ID of the session + description: Galileo ID of the session, trace or span session_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' + type: string + format: uuid4 title: Session ID - description: Galileo ID of the session containing the trace or span or session + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) trace_id: anyOf: - type: string @@ -21542,10 +22244,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Output' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Output' discriminator: propertyName: status_type mapping: @@ -21555,8 +22257,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' type: object - type: 'null' title: Metric Info @@ -21573,82 +22275,152 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - previous_session_id: + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: anyOf: - - type: string - format: uuid4 + - $ref: '#/components/schemas/LeftOutReason' - type: 'null' - title: Previous Session Id - num_traces: + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' + parent_id: + type: string + format: uuid4 + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: anyOf: - type: integer - type: 'null' - title: Num Traces - traces: - items: - oneOf: - - $ref: '#/components/schemas/ExtendedTraceRecordWithChildren' - - $ref: '#/components/schemas/StubTraceRecord' - discriminator: - propertyName: type - mapping: - stub_trace: '#/components/schemas/StubTraceRecord' - trace: '#/components/schemas/ExtendedTraceRecordWithChildren' - type: array - title: Traces + title: Step Number + description: Topological step number of the span. type: object required: - id + - session_id - project_id - run_id - title: ExtendedReadSessionRecordWithChildren - description: 'Read-side session response that also accepts synthesized stub_trace - roots. - - - Same shape as ExtendedSessionRecordWithChildren, except `traces` allows the - - StubTraceRecord placeholder produced by create_tree_for_extended_read_session - - for spans whose TraceRecord hasn''t arrived yet. Defined independently of - - ExtendedSessionRecordWithChildren/RecordWithChildTraces rather than - - subclassing them, since widening their Sequence[ExtendedTraceRecordWithChildren] - - field to also allow StubTraceRecord in a subclass is an LSP violation mypy - - correctly rejects.' - ExtendedRetrieverSpanRecord: + - parent_id + title: ExtendedHttpSpanRecord + ExtendedHttpSpanRecordWithChildren: properties: + spans: + items: + oneOf: + - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedLlmSpanRecord-Input' + - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedControlSpanRecord-Input' + - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' + control: '#/components/schemas/ExtendedControlSpanRecord-Input' + http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' + llm: '#/components/schemas/ExtendedLlmSpanRecord-Input' + retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' + tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' + workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + type: array + title: Spans type: type: string - const: retriever + const: http title: Type description: Type of the trace, span or session. - default: retriever + default: http input: - type: string + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array title: Input description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: - items: - $ref: '#/components/schemas/Document' - type: array + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' title: Output description: Output of the trace or span. redacted_output: anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array - items: - $ref: '#/components/schemas/Document' + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' type: array + - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Redacted Output description: Redacted output of the trace or span. @@ -21865,10 +22637,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -21878,8 +22650,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -21896,6 +22668,21 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' parent_id: type: string format: uuid4 @@ -21919,61 +22706,36 @@ components: - project_id - run_id - parent_id - title: ExtendedRetrieverSpanRecord - ExtendedRetrieverSpanRecordWithChildren: + title: ExtendedHttpSpanRecordWithChildren + ExtendedLlmSpanRecord-Input: properties: - spans: - items: - oneOf: - - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedLlmSpanRecord' - - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedControlSpanRecord' - - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' - discriminator: - propertyName: type - mapping: - agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - control: '#/components/schemas/ExtendedControlSpanRecord' - http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' - llm: '#/components/schemas/ExtendedLlmSpanRecord' - retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - type: array - title: Spans type: type: string - const: retriever + const: llm title: Type description: Type of the trace, span or session. - default: retriever + default: llm input: - type: string + items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array title: Input description: Input to the trace or span. - default: '' redacted_input: anyOf: - - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: - items: - $ref: '#/components/schemas/Document' - type: array - title: Output + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' description: Output of the trace or span. redacted_output: anyOf: - - items: - $ref: '#/components/schemas/Document' - type: array + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: 'null' - title: Redacted Output description: Redacted output of the trace or span. name: type: string @@ -22005,7 +22767,7 @@ components: description: Status code of the trace or span. Used for logging failure or error states. metrics: - $ref: '#/components/schemas/Metrics' + $ref: '#/components/schemas/LlmMetrics' description: Metrics associated with this trace or span. external_id: anyOf: @@ -22188,10 +22950,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -22201,8 +22963,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -22219,6 +22981,21 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' parent_id: type: string format: uuid4 @@ -22235,6 +23012,67 @@ components: - type: 'null' title: Step Number description: Topological step number of the span. + tools: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Tools + description: List of available tools passed to the LLM on invocation. + events: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/MessageEvent' + - $ref: '#/components/schemas/ReasoningEvent' + - $ref: '#/components/schemas/InternalToolCall' + - $ref: '#/components/schemas/WebSearchCallEvent' + - $ref: '#/components/schemas/ImageGenerationEvent' + - $ref: '#/components/schemas/MCPCallEvent' + - $ref: '#/components/schemas/MCPListToolsEvent' + - $ref: '#/components/schemas/MCPApprovalRequestEvent' + discriminator: + propertyName: type + mapping: + image_generation: '#/components/schemas/ImageGenerationEvent' + internal_tool_call: '#/components/schemas/InternalToolCall' + mcp_approval_request: '#/components/schemas/MCPApprovalRequestEvent' + mcp_call: '#/components/schemas/MCPCallEvent' + mcp_list_tools: '#/components/schemas/MCPListToolsEvent' + message: '#/components/schemas/MessageEvent' + reasoning: '#/components/schemas/ReasoningEvent' + web_search_call: '#/components/schemas/WebSearchCallEvent' + type: array + - type: 'null' + title: Events + description: List of reasoning, internal tool call, or MCP events that occurred + during the LLM span. + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: Model used for this span. + provider: + anyOf: + - type: string + - type: 'null' + title: Provider + description: Provider used for this span. + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Temperature used for generation. + finish_reason: + anyOf: + - type: string + - type: 'null' + title: Finish Reason + description: Reason for finishing. type: object required: - id @@ -22242,93 +23080,36 @@ components: - project_id - run_id - parent_id - title: ExtendedRetrieverSpanRecordWithChildren - ExtendedSessionRecord: + title: ExtendedLlmSpanRecord + ExtendedLlmSpanRecord-Output: properties: type: type: string - const: session + const: llm title: Type description: Type of the trace, span or session. - default: session + default: llm input: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array + items: + $ref: '#/components/schemas/Message-Output' + type: array title: Input - default: '' + description: Input to the trace or span. redacted_input: anyOf: - - type: string - - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' + $ref: '#/components/schemas/Message-Output' type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: - anyOf: - - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - - $ref: '#/components/schemas/ControlResult' - - type: 'null' - title: Output + $ref: '#/components/schemas/Message-Output' description: Output of the trace or span. redacted_output: anyOf: - - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - - $ref: '#/components/schemas/ControlResult' + - $ref: '#/components/schemas/Message-Output' - type: 'null' - title: Redacted Output description: Redacted output of the trace or span. name: type: string @@ -22360,7 +23141,7 @@ components: description: Status code of the trace or span. Used for logging failure or error states. metrics: - $ref: '#/components/schemas/Metrics' + $ref: '#/components/schemas/LlmMetrics' description: Metrics associated with this trace or span. external_id: anyOf: @@ -22390,14 +23171,13 @@ components: type: string format: uuid4 title: ID - description: Galileo ID of the session + description: Galileo ID of the session, trace or span session_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' + type: string + format: uuid4 title: Session ID - description: Galileo ID of the session containing the trace or span or session + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) trace_id: anyOf: - type: string @@ -22544,10 +23324,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Output' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Output' discriminator: propertyName: status_type mapping: @@ -22557,8 +23337,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' type: object - type: 'null' title: Metric Info @@ -22575,51 +23355,190 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - previous_session_id: + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: anyOf: - - type: string - format: uuid4 + - $ref: '#/components/schemas/LeftOutReason' - type: 'null' - title: Previous Session Id - num_traces: + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' + parent_id: + type: string + format: uuid4 + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: anyOf: - type: integer - type: 'null' - title: Num Traces + title: Step Number + description: Topological step number of the span. + tools: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Tools + description: List of available tools passed to the LLM on invocation. + events: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/MessageEvent' + - $ref: '#/components/schemas/ReasoningEvent' + - $ref: '#/components/schemas/InternalToolCall' + - $ref: '#/components/schemas/WebSearchCallEvent' + - $ref: '#/components/schemas/ImageGenerationEvent' + - $ref: '#/components/schemas/MCPCallEvent' + - $ref: '#/components/schemas/MCPListToolsEvent' + - $ref: '#/components/schemas/MCPApprovalRequestEvent' + discriminator: + propertyName: type + mapping: + image_generation: '#/components/schemas/ImageGenerationEvent' + internal_tool_call: '#/components/schemas/InternalToolCall' + mcp_approval_request: '#/components/schemas/MCPApprovalRequestEvent' + mcp_call: '#/components/schemas/MCPCallEvent' + mcp_list_tools: '#/components/schemas/MCPListToolsEvent' + message: '#/components/schemas/MessageEvent' + reasoning: '#/components/schemas/ReasoningEvent' + web_search_call: '#/components/schemas/WebSearchCallEvent' + type: array + - type: 'null' + title: Events + description: List of reasoning, internal tool call, or MCP events that occurred + during the LLM span. + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: Model used for this span. + provider: + anyOf: + - type: string + - type: 'null' + title: Provider + description: Provider used for this span. + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Temperature used for generation. + finish_reason: + anyOf: + - type: string + - type: 'null' + title: Finish Reason + description: Reason for finishing. type: object required: - id + - session_id - project_id - run_id - title: ExtendedSessionRecord - ExtendedToolSpanRecord: + - parent_id + title: ExtendedLlmSpanRecord + ExtendedReadSessionRecordWithChildren: properties: type: type: string - const: tool + const: session title: Type description: Type of the trace, span or session. - default: tool + default: session input: - type: string + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array title: Input - description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: anyOf: - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Output description: Output of the trace or span. redacted_output: anyOf: - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Redacted Output description: Redacted output of the trace or span. @@ -22683,13 +23602,14 @@ components: type: string format: uuid4 title: ID - description: Galileo ID of the session, trace or span + description: Galileo ID of the session session_id: - type: string - format: uuid4 + anyOf: + - type: string + format: uuid4 + - type: 'null' title: Session ID - description: Galileo ID of the session containing the trace (or the same - value as id for a trace) + description: Galileo ID of the session containing the trace or span or session trace_id: anyOf: - type: string @@ -22836,10 +23756,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -22849,8 +23769,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -22867,66 +23787,60 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - parent_id: - type: string - format: uuid4 - title: Parent ID - description: Galileo ID of the parent of this span - is_complete: - type: boolean - title: Is Complete - description: Whether the parent trace is complete or not - default: true - step_number: + previous_session_id: anyOf: - - type: integer + - type: string + format: uuid4 - type: 'null' - title: Step Number - description: Topological step number of the span. - tool_call_id: + title: Previous Session Id + num_traces: anyOf: - - type: string + - type: integer - type: 'null' - title: Tool Call Id - description: ID of the tool call. - type: object - required: - - id - - session_id - - project_id - - run_id - - parent_id - title: ExtendedToolSpanRecord - ExtendedToolSpanRecordWithChildren: - properties: - spans: + title: Num Traces + traces: items: oneOf: - - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedLlmSpanRecord' - - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedControlSpanRecord' - - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedTraceRecordWithChildren' + - $ref: '#/components/schemas/StubTraceRecord' discriminator: propertyName: type mapping: - agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - control: '#/components/schemas/ExtendedControlSpanRecord' - http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' - llm: '#/components/schemas/ExtendedLlmSpanRecord' - retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + stub_trace: '#/components/schemas/StubTraceRecord' + trace: '#/components/schemas/ExtendedTraceRecordWithChildren' type: array - title: Spans + title: Traces + type: object + required: + - id + - project_id + - run_id + title: ExtendedReadSessionRecordWithChildren + description: 'Read-side session response that also accepts synthesized stub_trace + roots. + + + Same shape as ExtendedSessionRecordWithChildren, except `traces` allows the + + StubTraceRecord placeholder produced by create_tree_for_extended_read_session + + for spans whose TraceRecord hasn''t arrived yet. Defined independently of + + ExtendedSessionRecordWithChildren/RecordWithChildTraces rather than + + subclassing them, since widening their Sequence[ExtendedTraceRecordWithChildren] + + field to also allow StubTraceRecord in a subclass is an LSP violation mypy + + correctly rejects.' + ExtendedRetrieverSpanRecord-Input: + properties: type: type: string - const: tool + const: retriever title: Type description: Type of the trace, span or session. - default: tool + default: retriever input: type: string title: Input @@ -22939,14 +23853,16 @@ components: title: Redacted Input description: Redacted input of the trace or span. output: - anyOf: - - type: string - - type: 'null' + items: + $ref: '#/components/schemas/Document-Input' + type: array title: Output description: Output of the trace or span. redacted_output: anyOf: - - type: string + - items: + $ref: '#/components/schemas/Document-Input' + type: array - type: 'null' title: Redacted Output description: Redacted output of the trace or span. @@ -23163,10 +24079,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -23176,8 +24092,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -23194,6 +24110,21 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' parent_id: type: string format: uuid4 @@ -23210,12 +24141,6 @@ components: - type: 'null' title: Step Number description: Topological step number of the span. - tool_call_id: - anyOf: - - type: string - - type: 'null' - title: Tool Call Id - description: ID of the tool call. type: object required: - id @@ -23223,75 +24148,36 @@ components: - project_id - run_id - parent_id - title: ExtendedToolSpanRecordWithChildren - ExtendedTraceRecord: + title: ExtendedRetrieverSpanRecord + ExtendedRetrieverSpanRecord-Output: properties: type: type: string - const: trace + const: retriever title: Type description: Type of the trace, span or session. - default: trace + default: retriever input: - anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array + type: string title: Input description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: - anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - - type: 'null' + items: + $ref: '#/components/schemas/Document-Output' + type: array title: Output description: Output of the trace or span. redacted_output: anyOf: - - type: string - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' + $ref: '#/components/schemas/Document-Output' type: array - type: 'null' title: Redacted Output @@ -23356,7 +24242,7 @@ components: type: string format: uuid4 title: ID - description: Galileo ID of the trace + description: Galileo ID of the session, trace or span session_id: type: string format: uuid4 @@ -23364,8 +24250,10 @@ components: description: Galileo ID of the session containing the trace (or the same value as id for a trace) trace_id: - type: string - format: uuid4 + anyOf: + - type: string + format: uuid4 + - type: 'null' title: Trace ID description: Galileo ID of the trace containing the span (or the same value as id for a trace) @@ -23507,10 +24395,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Output' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Output' discriminator: propertyName: status_type mapping: @@ -23520,8 +24408,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' type: object - type: 'null' title: Metric Info @@ -23538,49 +24426,64 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - dataset_generated_output: + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: anyOf: - - type: string + - $ref: '#/components/schemas/LeftOutReason' - type: 'null' - title: Dataset Generated Output - description: Generated output from the dataset associated with this trace + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' + parent_id: + type: string + format: uuid4 + title: Parent ID + description: Galileo ID of the parent of this span is_complete: type: boolean title: Is Complete - description: Whether the trace is complete or not + description: Whether the parent trace is complete or not default: true - num_spans: + step_number: anyOf: - type: integer - type: 'null' - title: Num Spans + title: Step Number + description: Topological step number of the span. type: object required: - id - session_id - - trace_id - project_id - run_id - title: ExtendedTraceRecord - ExtendedTraceRecordWithChildren: + - parent_id + title: ExtendedRetrieverSpanRecord + ExtendedRetrieverSpanRecordWithChildren: properties: spans: items: oneOf: - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedLlmSpanRecord' + - $ref: '#/components/schemas/ExtendedLlmSpanRecord-Input' - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedControlSpanRecord' + - $ref: '#/components/schemas/ExtendedControlSpanRecord-Input' - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' discriminator: propertyName: type mapping: agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - control: '#/components/schemas/ExtendedControlSpanRecord' + control: '#/components/schemas/ExtendedControlSpanRecord-Input' http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' - llm: '#/components/schemas/ExtendedLlmSpanRecord' + llm: '#/components/schemas/ExtendedLlmSpanRecord-Input' retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' @@ -23588,70 +24491,31 @@ components: title: Spans type: type: string - const: trace + const: retriever title: Type description: Type of the trace, span or session. - default: trace + default: retriever input: - anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array + type: string title: Input description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: - anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - - type: 'null' + items: + $ref: '#/components/schemas/Document-Input' + type: array title: Output description: Output of the trace or span. redacted_output: anyOf: - - type: string - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' + $ref: '#/components/schemas/Document-Input' type: array - type: 'null' title: Redacted Output @@ -23716,7 +24580,7 @@ components: type: string format: uuid4 title: ID - description: Galileo ID of the trace + description: Galileo ID of the session, trace or span session_id: type: string format: uuid4 @@ -23724,8 +24588,10 @@ components: description: Galileo ID of the session containing the trace (or the same value as id for a trace) trace_id: - type: string - format: uuid4 + anyOf: + - type: string + format: uuid4 + - type: 'null' title: Trace ID description: Galileo ID of the trace containing the span (or the same value as id for a trace) @@ -23867,10 +24733,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -23880,8 +24746,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -23898,38 +24764,53 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - dataset_generated_output: + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: anyOf: - - type: string + - $ref: '#/components/schemas/LeftOutReason' - type: 'null' - title: Dataset Generated Output - description: Generated output from the dataset associated with this trace + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' + parent_id: + type: string + format: uuid4 + title: Parent ID + description: Galileo ID of the parent of this span is_complete: type: boolean title: Is Complete - description: Whether the trace is complete or not + description: Whether the parent trace is complete or not default: true - num_spans: + step_number: anyOf: - type: integer - type: 'null' - title: Num Spans + title: Step Number + description: Topological step number of the span. type: object required: - id - session_id - - trace_id - project_id - run_id - title: ExtendedTraceRecordWithChildren - ExtendedWorkflowSpanRecord: + - parent_id + title: ExtendedRetrieverSpanRecordWithChildren + ExtendedSessionRecord-Input: properties: type: type: string - const: workflow + const: session title: Type description: Type of the trace, span or session. - default: workflow + default: session input: anyOf: - type: string @@ -23947,7 +24828,6 @@ components: text: '#/components/schemas/TextContentPart' type: array title: Input - description: Input to the trace or span. default: '' redacted_input: anyOf: @@ -23973,7 +24853,7 @@ components: - type: string - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Input' type: array - items: oneOf: @@ -23994,7 +24874,7 @@ components: - type: string - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Input' type: array - items: oneOf: @@ -24070,13 +24950,14 @@ components: type: string format: uuid4 title: ID - description: Galileo ID of the session, trace or span + description: Galileo ID of the session session_id: - type: string - format: uuid4 + anyOf: + - type: string + format: uuid4 + - type: 'null' title: Session ID - description: Galileo ID of the session containing the trace (or the same - value as id for a trace) + description: Galileo ID of the session containing the trace or span or session trace_id: anyOf: - type: string @@ -24223,10 +25104,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -24236,8 +25117,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -24254,65 +25135,36 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - parent_id: - type: string - format: uuid4 - title: Parent ID - description: Galileo ID of the parent of this span - is_complete: - type: boolean - title: Is Complete - description: Whether the parent trace is complete or not - default: true - step_number: + previous_session_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Previous Session Id + num_traces: anyOf: - type: integer - type: 'null' - title: Step Number - description: Topological step number of the span. + title: Num Traces type: object required: - id - - session_id - project_id - run_id - - parent_id - title: ExtendedWorkflowSpanRecord - ExtendedWorkflowSpanRecordWithChildren: + title: ExtendedSessionRecord + ExtendedSessionRecord-Output: properties: - spans: - items: - oneOf: - - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedLlmSpanRecord' - - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedControlSpanRecord' - - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' - discriminator: - propertyName: type - mapping: - agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - control: '#/components/schemas/ExtendedControlSpanRecord' - http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' - llm: '#/components/schemas/ExtendedLlmSpanRecord' - retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - type: array - title: Spans type: type: string - const: workflow + const: session title: Type description: Type of the trace, span or session. - default: workflow + default: session input: anyOf: - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + $ref: '#/components/schemas/Message-Output' type: array - items: oneOf: @@ -24325,13 +25177,12 @@ components: text: '#/components/schemas/TextContentPart' type: array title: Input - description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + $ref: '#/components/schemas/Message-Output' type: array - items: oneOf: @@ -24349,9 +25200,9 @@ components: output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - $ref: '#/components/schemas/Message-Output' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Output' type: array - items: oneOf: @@ -24370,9 +25221,9 @@ components: redacted_output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - $ref: '#/components/schemas/Message-Output' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Output' type: array - items: oneOf: @@ -24448,13 +25299,14 @@ components: type: string format: uuid4 title: ID - description: Galileo ID of the session, trace or span + description: Galileo ID of the session session_id: - type: string - format: uuid4 + anyOf: + - type: string + format: uuid4 + - type: 'null' title: Session ID - description: Galileo ID of the session containing the trace (or the same - value as id for a trace) + description: Galileo ID of the session containing the trace or span or session trace_id: anyOf: - type: string @@ -24601,10 +25453,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Output' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Output' discriminator: propertyName: status_type mapping: @@ -24614,8 +25466,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' type: object - type: 'null' title: Metric Info @@ -24632,842 +25484,371 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - parent_id: - type: string - format: uuid4 - title: Parent ID - description: Galileo ID of the parent of this span - is_complete: - type: boolean - title: Is Complete - description: Whether the parent trace is complete or not - default: true - step_number: + previous_session_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Previous Session Id + num_traces: anyOf: - type: integer - type: 'null' - title: Step Number - description: Topological step number of the span. + title: Num Traces type: object required: - id - - session_id - project_id - run_id - - parent_id - title: ExtendedWorkflowSpanRecordWithChildren - FeatureIntegrationCosts: + title: ExtendedSessionRecord + ExtendedToolSpanRecord-Input: properties: - feature_name: + type: type: string - title: Feature Name - total_cost: - type: number - title: Total Cost - default: 0.0 - projects: - items: - $ref: '#/components/schemas/ProjectIntegrationCosts' - type: array - title: Projects - type: object - required: - - feature_name - title: FeatureIntegrationCosts - FeedbackAggregate: - properties: - aggregate: - oneOf: - - $ref: '#/components/schemas/LikeDislikeAggregate' - - $ref: '#/components/schemas/StarAggregate' - - $ref: '#/components/schemas/ScoreAggregate' - - $ref: '#/components/schemas/TagsAggregate' - - $ref: '#/components/schemas/TextAggregate' - - $ref: '#/components/schemas/ChoiceAggregate' - - $ref: '#/components/schemas/TreeChoiceAggregate' - title: Aggregate - discriminator: - propertyName: feedback_type - mapping: - choice: '#/components/schemas/ChoiceAggregate' - like_dislike: '#/components/schemas/LikeDislikeAggregate' - score: '#/components/schemas/ScoreAggregate' - star: '#/components/schemas/StarAggregate' - tags: '#/components/schemas/TagsAggregate' - text: '#/components/schemas/TextAggregate' - tree_choice: '#/components/schemas/TreeChoiceAggregate' - type: object - required: - - aggregate - title: FeedbackAggregate - FeedbackRatingDB: - properties: - explanation: - anyOf: - - type: string - minLength: 1 - - type: 'null' - title: Explanation - rating: - oneOf: - - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__LikeDislikeRating' - - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__StarRating' - - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__ScoreRating' - - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__TagsRating' - - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__TextRating' - - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__ChoiceRating' - - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__TreeChoiceRating' - title: Rating - discriminator: - propertyName: feedback_type - mapping: - choice: '#/components/schemas/libs__python__schemas__log_records__feedback__ChoiceRating' - like_dislike: '#/components/schemas/libs__python__schemas__log_records__feedback__LikeDislikeRating' - score: '#/components/schemas/libs__python__schemas__log_records__feedback__ScoreRating' - star: '#/components/schemas/libs__python__schemas__log_records__feedback__StarRating' - tags: '#/components/schemas/libs__python__schemas__log_records__feedback__TagsRating' - text: '#/components/schemas/libs__python__schemas__log_records__feedback__TextRating' - tree_choice: '#/components/schemas/libs__python__schemas__log_records__feedback__TreeChoiceRating' - created_at: + const: tool + title: Type + description: Type of the trace, span or session. + default: tool + input: type: string - format: date-time - title: Created At - created_by: + title: Input + description: Input to the trace or span. + default: '' + redacted_input: anyOf: - type: string - format: uuid4 - type: 'null' - title: Created By - type: object - required: - - rating - - created_at - - created_by - title: FeedbackRatingDB - FeedbackRatingInfo: - properties: - feedback_type: - $ref: '#/components/schemas/FeedbackType' - value: + title: Redacted Input + description: Redacted input of the trace or span. + output: anyOf: - - type: boolean - - type: integer - type: string - - items: - type: string - maxLength: 255 - minLength: 1 - type: array - title: Value - explanation: + - type: 'null' + title: Output + description: Output of the trace or span. + redacted_output: anyOf: - type: string - type: 'null' - title: Explanation - type: object - required: - - feedback_type - - value - - explanation - title: FeedbackRatingInfo - FeedbackType: - type: string - enum: - - like_dislike - - star - - score - - tags - - text - - choice - - tree_choice - title: FeedbackType - FewShotExample: - properties: - generation_prompt_and_response: - type: string - title: Generation Prompt And Response - evaluating_response: - type: string - title: Evaluating Response - type: object - required: - - generation_prompt_and_response - - evaluating_response - title: FewShotExample - description: Few-shot example for a chainpoll metric prompt. - FileContentPart: - properties: - type: - type: string - const: file - title: Type - default: file - file_id: + title: Redacted Output + description: Redacted output of the trace or span. + name: type: string - format: uuid4 - title: File Id - type: object - required: - - file_id - title: FileContentPart - description: 'Reference to a file associated with this message. - - - The file_id can be resolved via the ``files`` dict returned on - - trace/span detail responses, which contains metadata such as - - modality, MIME type, and a presigned download URL.' - FileMetadata: - properties: - file_id: + title: Name + description: Name of the trace, span or session. + default: '' + created_at: type: string - format: uuid4 - title: File Id - modality: - $ref: '#/components/schemas/ContentModality' - content_type: + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: anyOf: - - type: string + - type: integer - type: 'null' - title: Content Type - url: + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: anyOf: - type: string - type: 'null' - title: Url - description: Presigned S3 URL or external URL - url_expires_at: + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: anyOf: - type: string - format: date-time - - type: 'null' - title: Url Expires At - description: Expiration time - size_bytes: - anyOf: - - type: integer - type: 'null' - title: Size Bytes - filename: + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: anyOf: - type: string - type: 'null' - title: Filename - source: - $ref: '#/components/schemas/FileSource' - status: - $ref: '#/components/schemas/FileStatus' - type: object - required: - - file_id - - modality - - source - - status - title: FileMetadata - description: 'Enriched file metadata returned to UI/SDK. - - - Contains presigned URLs and properties for displaying multimodal - - content in the Galileo console and SDKs.' - FileSource: - type: string - enum: - - direct_upload - - external_files_api - - external_url - - assembled_stream - title: FileSource - description: Source of the file data. - FileStatus: - type: string - enum: - - complete - - failed - - pending - - not_uploaded - title: FileStatus - description: Processing status of the file. - ? FilterExpression_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____ - : anyOf: - - $ref: '#/components/schemas/FilterLeaf_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' - - $ref: '#/components/schemas/AndNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' - - $ref: '#/components/schemas/OrNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' - - $ref: '#/components/schemas/NotNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' - title: FilterExpressionLogRecordsFilter - ? FilterLeaf_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____ - : properties: - filter: - oneOf: - - $ref: '#/components/schemas/LogRecordsIDFilter' - - $ref: '#/components/schemas/LogRecordsDateFilter' - - $ref: '#/components/schemas/LogRecordsNumberFilter' - - $ref: '#/components/schemas/LogRecordsBooleanFilter' - - $ref: '#/components/schemas/LogRecordsCollectionFilter' - - $ref: '#/components/schemas/LogRecordsTextFilter' - - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - title: Filter - discriminator: - propertyName: type - mapping: - boolean: '#/components/schemas/LogRecordsBooleanFilter' - collection: '#/components/schemas/LogRecordsCollectionFilter' - date: '#/components/schemas/LogRecordsDateFilter' - fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - id: '#/components/schemas/LogRecordsIDFilter' - number: '#/components/schemas/LogRecordsNumberFilter' - text: '#/components/schemas/LogRecordsTextFilter' - type: object - required: - - filter - title: FilterLeafLogRecordsFilter - FineTunedScorerAction: - type: string - enum: - - update - - delete - title: FineTunedScorerAction - FineTunedScorerResponse: - properties: + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace id: type: string format: uuid4 - title: Id - name: + title: ID + description: Galileo ID of the session, trace or span + session_id: type: string - title: Name - lora_task_id: - type: integer - title: Lora Task Id - lora_weights_path: + format: uuid4 + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Lora Weights Path - prompt: + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: type: string - title: Prompt - luna_input_type: + format: uuid4 + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: + type: string + format: uuid4 + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: anyOf: - - $ref: '#/components/schemas/LunaInputTypeEnum' + - type: string + format: date-time - type: 'null' - luna_output_type: + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: anyOf: - - $ref: '#/components/schemas/LunaOutputTypeEnum' + - type: boolean - type: 'null' - class_name_to_vocab_ix: + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: anyOf: - - additionalProperties: - items: - type: integer - type: array - uniqueItems: true - type: object - - additionalProperties: - type: integer - type: object + - type: string + format: uuid4 - type: 'null' - title: Class Name To Vocab Ix - executor: + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: anyOf: - - $ref: '#/components/schemas/ScorerName' + - type: string + format: uuid4 - type: 'null' - description: Executor pipeline. Defaults to finetuned scorer pipeline but - can run custom galileo score pipelines. - created_at: - type: string - format: date-time - title: Created At - updated_at: - type: string - format: date-time - title: Updated At - created_by: - type: string - format: uuid4 - title: Created By - type: object - required: - - id - - name - - lora_task_id - - prompt - - created_at - - updated_at - - created_by - title: FineTunedScorerResponse - GeneratedScorerAction: - type: string - enum: - - update - - delete - title: GeneratedScorerAction - GeneratedScorerConfiguration: - properties: - model_alias: - type: string - title: Model Alias - default: gpt-4.1-mini - num_judges: - type: integer - maximum: 10.0 - minimum: 1.0 - title: Num Judges - default: 3 - output_type: - $ref: '#/components/schemas/OutputTypeEnum' - description: Output type of the generated scorer. - default: boolean - scoreable_node_types: + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: items: type: string + format: uuid4 type: array - title: Scoreable Node Types - description: Types of nodes that can be scored by this scorer. - cot_enabled: - type: boolean - title: Cot Enabled - description: Whether chain of thought is enabled for this scorer. - default: false - ground_truth: - type: boolean - title: Ground Truth - description: Whether ground truth is enabled for this scorer. - default: false - multimodal_capabilities: + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: anyOf: - - items: - $ref: '#/components/schemas/MultimodalCapability' - type: array + - type: number - type: 'null' - title: Multimodal Capabilities - description: Multimodal capabilities required by this scorer. - type: object - title: GeneratedScorerConfiguration - GeneratedScorerResponse: - properties: - id: - type: string - format: uuid4 - title: Id - name: - type: string - title: Name - instructions: + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: anyOf: - - type: string + - type: boolean - type: 'null' - title: Instructions - chain_poll_template: - $ref: '#/components/schemas/ChainPollTemplate' - user_prompt: + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: anyOf: - - type: string + - $ref: '#/components/schemas/AnnotationStatus' - type: 'null' - title: User Prompt - created_by: - type: string - format: uuid4 - title: Created By - created_at: - type: string - format: date-time - title: Created At - updated_at: - type: string - format: date-time - title: Updated At - scoreable_node_types: + description: Annotation review status of the record + annotated_members: anyOf: - items: - $ref: '#/components/schemas/NodeType' + type: string type: array - type: 'null' - title: Scoreable Node Types - scorer_configuration: - $ref: '#/components/schemas/GeneratedScorerConfiguration' - type: object - required: - - id - - name - - chain_poll_template - - created_by - - created_at - - updated_at - - scoreable_node_types - - scorer_configuration - title: GeneratedScorerResponse - GeneratedScorerValidationResponse: - properties: - task_result_id: - type: string - format: uuid4 - title: Task Result Id - type: object - required: - - task_result_id - title: GeneratedScorerValidationResponse - GenerationResponse: - properties: - task_result_id: + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: type: string - format: uuid4 - title: Task Result Id - type: object - required: - - task_result_id - title: GenerationResponse - GroundTruthAdherenceScorer: - properties: - name: + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: type: string - const: ground_truth_adherence - title: Name - default: ground_truth_adherence - filters: + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: anyOf: - - items: + - additionalProperties: oneOf: - - $ref: '#/components/schemas/NodeNameFilter' - - $ref: '#/components/schemas/MetadataFilter' - - $ref: '#/components/schemas/ModalityFilter' + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Input' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: - propertyName: name + propertyName: status_type mapping: - metadata: '#/components/schemas/MetadataFilter' - modality: '#/components/schemas/ModalityFilter' - node_name: '#/components/schemas/NodeNameFilter' - type: array + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' + type: object - type: 'null' - title: Filters - description: List of filters to apply to the scorer. - type: - type: string - const: plus - title: Type - default: plus - model_name: + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: anyOf: - - type: string + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object - type: 'null' - title: Model Name - description: Alias of the model to use for the scorer. - num_judges: + title: Files + description: File metadata keyed by file ID for files associated with this + record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: anyOf: - - type: integer - maximum: 10.0 - minimum: 1.0 + - $ref: '#/components/schemas/LeftOutReason' - type: 'null' - title: Num Judges - description: Number of judges for the scorer. - type: object - title: GroundTruthAdherenceScorer - GroupAction: - type: string - enum: - - update - - list_members - - join - - request_to_join - title: GroupAction - GroupCollaborator: - properties: - id: - type: string - format: uuid4 - title: Id - permissions: - items: - $ref: '#/components/schemas/Permission' - type: array - title: Permissions - default: [] - role: - $ref: '#/components/schemas/CollaboratorRole' - created_at: - type: string - format: date-time - title: Created At - group_id: - type: string - format: uuid4 - title: Group Id - group_name: - type: string - title: Group Name - type: object - required: - - id - - role - - created_at - - group_id - - group_name - title: GroupCollaborator - GroupCollaboratorCreate: - properties: - role: - $ref: '#/components/schemas/CollaboratorRole' - default: viewer - group_id: + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' + parent_id: type: string format: uuid4 - title: Group Id - type: object - required: - - group_id - title: GroupCollaboratorCreate - GroupMemberAction: - type: string - enum: - - update_role - - delete - title: GroupMemberAction - HTTPValidationError: - properties: - detail: - items: - $ref: '#/components/schemas/ValidationError' - type: array - title: Detail - type: object - title: HTTPValidationError - HallucinationSegment: - properties: - hallucination_severity: - type: integer - maximum: 2.0 - minimum: 0.0 - title: Hallucination Severity - default: 0 - start: - type: integer - title: Start - end: - type: integer - title: End - hallucination: - type: number - title: Hallucination - type: object - required: - - start - - end - - hallucination - title: HallucinationSegment - HealthScoreResult: - properties: - health_score_type: + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: anyOf: - - $ref: '#/components/schemas/HealthScoreType' + - type: integer - type: 'null' - value: + title: Step Number + description: Topological step number of the span. + tool_call_id: anyOf: - - type: number + - type: string - type: 'null' - title: Value - description: Primary health score metric value, or None if no valid rows. - skipped_rows: - type: integer - title: Skipped Rows - description: Rows excluded because MGT or score could not be parsed. - secondary: - additionalProperties: - anyOf: - - type: number - - type: 'null' - type: object - title: Secondary - description: "Secondary metrics (MAE, RMSE, R², per-class F1, etc.)." - total_scored_rows: - type: integer - title: Total Scored Rows - description: Rows with a successful scorer result. - total_mgt_rows: - type: integer - title: Total Mgt Rows - description: Rows with a non-null MGT value after overlay. - joined_rows: - type: integer - title: Joined Rows - description: Rows with both a score and a MGT value (used for computation). - type: object - required: - - health_score_type - - value - - skipped_rows - - secondary - - total_scored_rows - - total_mgt_rows - - joined_rows - title: HealthScoreResult - HealthScoreType: - type: string - enum: - - macro_f1 - - micro_f1 - - mse - - mae - title: HealthScoreType - HealthcheckResponse: - properties: - api_version: - type: string - title: Api Version - message: - type: string - title: Message - version: - type: string - title: Version - type: object - required: - - api_version - - message - - version - title: HealthcheckResponse - Histogram: - properties: - strategy: - $ref: '#/components/schemas/HistogramStrategy' - description: The binning strategy used to create this histogram - edges: - items: - type: number - type: array - title: Edges - description: List of bin edges (monotonically increasing, length = number - of buckets + 1) - buckets: - items: - $ref: '#/components/schemas/HistogramBucket' - type: array - title: Buckets - description: List of histogram buckets containing the binned data - total: - type: integer - title: Total - description: Total number of data points in the histogram - type: object - required: - - strategy - - edges - - buckets - - total - title: Histogram - HistogramBucket: - properties: - lower: - type: number - title: Lower - description: Lower bound of the histogram bucket (inclusive) - upper: - type: number - title: Upper - description: Upper bound of the histogram bucket (exclusive, but inclusive - for the last bucket) - count: - type: integer - title: Count - description: Number of data points that fall within this bucket + title: Tool Call Id + description: ID of the tool call. type: object required: - - lower - - upper - - count - title: HistogramBucket - HistogramStrategy: - type: string - enum: - - fixed - - trimmed - - quantile - title: HistogramStrategy - HttpSpan: + - id + - session_id + - project_id + - run_id + - parent_id + title: ExtendedToolSpanRecord + ExtendedToolSpanRecord-Output: properties: type: type: string - const: http + const: tool title: Type description: Type of the trace, span or session. - default: http + default: tool input: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array + type: string title: Input description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string - - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Output description: Output of the trace or span. redacted_output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Redacted Output description: Redacted output of the trace or span. @@ -25528,19 +25909,16 @@ components: title: Dataset Metadata description: Metadata from the dataset associated with this trace id: - anyOf: - - type: string - format: uuid4 - - type: 'null' + type: string + format: uuid4 title: ID description: Galileo ID of the session, trace or span session_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' + type: string + format: uuid4 title: Session ID - description: Galileo ID of the session containing the trace or span or session + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) trace_id: anyOf: - type: string @@ -25549,1519 +25927,1343 @@ components: title: Trace ID description: Galileo ID of the trace containing the span (or the same value as id for a trace) - step_number: + project_id: + type: string + format: uuid4 + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: + type: string + format: uuid4 + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: anyOf: - - type: integer + - type: string + format: date-time - type: 'null' - title: Step Number - description: Topological step number of the span. - parent_id: + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: anyOf: - - type: string - format: uuid4 + - type: boolean - type: 'null' - title: Parent ID - description: Galileo ID of the parent of this span - spans: - items: - oneOf: - - $ref: '#/components/schemas/AgentSpan' - - $ref: '#/components/schemas/WorkflowSpan' - - $ref: '#/components/schemas/LlmSpan' - - $ref: '#/components/schemas/RetrieverSpan' - - $ref: '#/components/schemas/ToolSpan' - - $ref: '#/components/schemas/ControlSpan' - - $ref: '#/components/schemas/HttpSpan' - discriminator: - propertyName: type - mapping: - agent: '#/components/schemas/AgentSpan' - control: '#/components/schemas/ControlSpan' - http: '#/components/schemas/HttpSpan' - llm: '#/components/schemas/LlmSpan' - retriever: '#/components/schemas/RetrieverSpan' - tool: '#/components/schemas/ToolSpan' - workflow: '#/components/schemas/WorkflowSpan' - type: array - title: Spans - description: Child spans. - type: object - title: HttpSpan - ImageGenerationEvent: - properties: - type: - type: string - const: image_generation - title: Type - default: image_generation - id: + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Id - description: Unique identifier for the event - status: + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: anyOf: - - $ref: '#/components/schemas/EventStatus' + - type: string + format: uuid4 - type: 'null' - description: Status of the event - metadata: + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: + items: + type: string + format: uuid4 + type: array + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: anyOf: - - additionalProperties: true - type: object + - type: number - type: 'null' - title: Metadata - description: Provider-specific metadata and additional fields - error_message: + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: anyOf: - - type: string + - type: boolean - type: 'null' - title: Error Message - description: Error message if the event failed - prompt: + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: anyOf: - - type: string + - $ref: '#/components/schemas/AnnotationStatus' - type: 'null' - title: Prompt - description: The prompt used for image generation - images: + description: Annotation review status of the record + annotated_members: anyOf: - items: - additionalProperties: true - type: object + type: string type: array - type: 'null' - title: Images - description: Generated images with URLs or base64 data - model: - anyOf: - - type: string - - type: 'null' - title: Model - description: Image generation model used - type: object - title: ImageGenerationEvent - description: An image generation event from the model. - InputMap: - properties: - prompt: - type: string - title: Prompt - prefix: + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: type: string - title: Prefix + title: Progress Message + description: Runner progress text written directly to CH span default: '' - suffix: + error_message: type: string - title: Suffix + title: Error Message + description: Runner error text written directly to CH span default: '' - type: object - required: - - prompt - title: InputMap - InputPIIScorer: - properties: - name: - type: string - const: input_pii - title: Name - default: input_pii - filters: + metric_info: anyOf: - - items: + - additionalProperties: oneOf: - - $ref: '#/components/schemas/NodeNameFilter' - - $ref: '#/components/schemas/MetadataFilter' - - $ref: '#/components/schemas/ModalityFilter' + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Output' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Output' discriminator: - propertyName: name + propertyName: status_type mapping: - metadata: '#/components/schemas/MetadataFilter' - modality: '#/components/schemas/ModalityFilter' - node_name: '#/components/schemas/NodeNameFilter' - type: array + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' + type: object - type: 'null' - title: Filters - description: List of filters to apply to the scorer. - type: object - title: InputPIIScorer - InputSexistScorer: - properties: - name: - type: string - const: input_sexist - title: Name - default: input_sexist - filters: + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: anyOf: - - items: - oneOf: - - $ref: '#/components/schemas/NodeNameFilter' - - $ref: '#/components/schemas/MetadataFilter' - - $ref: '#/components/schemas/ModalityFilter' - discriminator: - propertyName: name - mapping: - metadata: '#/components/schemas/MetadataFilter' - modality: '#/components/schemas/ModalityFilter' - node_name: '#/components/schemas/NodeNameFilter' - type: array + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object - type: 'null' - title: Filters - description: List of filters to apply to the scorer. - type: - type: string - enum: - - luna - - plus - title: Type - default: luna - model_name: + title: Files + description: File metadata keyed by file ID for files associated with this + record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: anyOf: - - type: string + - $ref: '#/components/schemas/LeftOutReason' - type: 'null' - title: Model Name - description: Alias of the model to use for the scorer. - num_judges: + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' + parent_id: + type: string + format: uuid4 + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: anyOf: - type: integer - maximum: 10.0 - minimum: 1.0 - type: 'null' - title: Num Judges - description: Number of judges for the scorer. - type: object - title: InputSexistScorer - InputToneScorer: - properties: - name: - type: string - const: input_tone - title: Name - default: input_tone - filters: + title: Step Number + description: Topological step number of the span. + tool_call_id: anyOf: - - items: - oneOf: - - $ref: '#/components/schemas/NodeNameFilter' - - $ref: '#/components/schemas/MetadataFilter' - - $ref: '#/components/schemas/ModalityFilter' - discriminator: - propertyName: name - mapping: - metadata: '#/components/schemas/MetadataFilter' - modality: '#/components/schemas/ModalityFilter' - node_name: '#/components/schemas/NodeNameFilter' - type: array + - type: string - type: 'null' - title: Filters - description: List of filters to apply to the scorer. + title: Tool Call Id + description: ID of the tool call. type: object - title: InputToneScorer - InputToxicityScorer: + required: + - id + - session_id + - project_id + - run_id + - parent_id + title: ExtendedToolSpanRecord + ExtendedToolSpanRecordWithChildren: properties: - name: - type: string - const: input_toxicity - title: Name - default: input_toxicity - filters: - anyOf: - - items: - oneOf: - - $ref: '#/components/schemas/NodeNameFilter' - - $ref: '#/components/schemas/MetadataFilter' - - $ref: '#/components/schemas/ModalityFilter' - discriminator: - propertyName: name - mapping: - metadata: '#/components/schemas/MetadataFilter' - modality: '#/components/schemas/ModalityFilter' - node_name: '#/components/schemas/NodeNameFilter' - type: array - - type: 'null' - title: Filters - description: List of filters to apply to the scorer. + spans: + items: + oneOf: + - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedLlmSpanRecord-Input' + - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedControlSpanRecord-Input' + - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' + control: '#/components/schemas/ExtendedControlSpanRecord-Input' + http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' + llm: '#/components/schemas/ExtendedLlmSpanRecord-Input' + retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' + tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' + workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + type: array + title: Spans type: type: string - enum: - - luna - - plus + const: tool title: Type - default: luna - model_name: + description: Type of the trace, span or session. + default: tool + input: + type: string + title: Input + description: Input to the trace or span. + default: '' + redacted_input: anyOf: - type: string - type: 'null' - title: Model Name - description: Alias of the model to use for the scorer. - num_judges: - anyOf: - - type: integer - maximum: 10.0 - minimum: 1.0 - - type: 'null' - title: Num Judges - description: Number of judges for the scorer. - type: object - title: InputToxicityScorer - InputTypeEnum: - type: string - enum: - - basic - - llm_spans - - retriever_spans - - sessions_normalized - - sessions_trace_io_only - - tool_spans - - trace_input_only - - trace_io_only - - trace_normalized - - trace_output_only - - agent_spans - - workflow_spans - - trace_selected_spans - title: InputTypeEnum - description: Enumeration of input types. - InsightSummary: - properties: - id: - type: string - format: uuid4 - title: Id - description: Signal ID. - title: - type: string - title: Title - observation: - type: string - title: Observation - details: - type: string - title: Details - suggested_action: - type: string - title: Suggested Action - priority: - type: integer - title: Priority - priority_category: + title: Redacted Input + description: Redacted input of the trace or span. + output: anyOf: - type: string - enum: - - error - - warning - - info - type: 'null' - title: Priority Category - label: + title: Output + description: Output of the trace or span. + redacted_output: anyOf: - type: string - enum: - - Instruction - - Retrieval - - Decision - - Output - - Tool - - Reliability - - Security - - Efficiency - type: 'null' - title: Label - type: object - required: - - id - - title - - observation - - details - - suggested_action - - priority - title: InsightSummary - InsightType: - type: string - enum: - - vertical_bar - - horizontal_bar - title: InsightType - InstructionAdherenceScorer: - properties: + title: Redacted Output + description: Redacted output of the trace or span. name: type: string - const: instruction_adherence title: Name - default: instruction_adherence - filters: + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: anyOf: - - items: - oneOf: - - $ref: '#/components/schemas/NodeNameFilter' - - $ref: '#/components/schemas/MetadataFilter' - - $ref: '#/components/schemas/ModalityFilter' - discriminator: - propertyName: name - mapping: - metadata: '#/components/schemas/MetadataFilter' - modality: '#/components/schemas/ModalityFilter' - node_name: '#/components/schemas/NodeNameFilter' - type: array + - type: integer - type: 'null' - title: Filters - description: List of filters to apply to the scorer. - type: - type: string - const: plus - title: Type - default: plus - model_name: + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: anyOf: - type: string - type: 'null' - title: Model Name - description: Alias of the model to use for the scorer. - num_judges: + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: anyOf: - - type: integer - maximum: 10.0 - minimum: 1.0 + - type: string - type: 'null' - title: Num Judges - description: Number of judges for the scorer. - type: object - title: InstructionAdherenceScorer - IntegrationAction: - type: string - enum: - - update - - delete - - share - - read_secrets - title: IntegrationAction - IntegrationCostsDataPoint: - properties: - timestamp: - type: string - format: date-time - title: Timestamp - cost: - type: number - title: Cost - type: object - required: - - timestamp - - cost - title: IntegrationCostsDataPoint - IntegrationCostsResponse: - properties: - features: - items: - $ref: '#/components/schemas/FeatureIntegrationCosts' - type: array - title: Features - type: object - title: IntegrationCostsResponse - IntegrationDB: - properties: + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: + anyOf: + - type: string + - type: 'null' + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace id: type: string format: uuid4 - title: Id - permissions: - items: - $ref: '#/components/schemas/Permission' - type: array - title: Permissions - default: [] - name: - type: string - title: Name - provider: - $ref: '#/components/schemas/IntegrationProvider' - created_at: - type: string - format: date-time - title: Created At - updated_at: - type: string - format: date-time - title: Updated At - created_by: + title: ID + description: Galileo ID of the session, trace or span + session_id: type: string format: uuid4 - title: Created By - is_selected: - type: boolean - title: Is Selected - default: false - is_disabled: - type: boolean - title: Is Disabled - default: false - type: object - required: - - id - - name - - provider - - created_at - - updated_at - - created_by - title: IntegrationDB - IntegrationDisableRequest: - properties: - integration_name: - type: string - title: Integration Name - type: object - required: - - integration_name - title: IntegrationDisableRequest - IntegrationModelsResponse: - properties: - integration_name: + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: type: string - title: Integration Name - integration_id: + format: uuid4 + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: type: string format: uuid4 - title: Integration Id - provider: - $ref: '#/components/schemas/IntegrationProvider' - models: + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: + anyOf: + - type: boolean + - type: 'null' + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: items: type: string + format: uuid4 type: array - title: Models - scorer_models: + title: File Ids + description: IDs of files associated with this record + file_modalities: items: - type: string + $ref: '#/components/schemas/ContentModality' type: array - title: Scorer Models - recommended_models: + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: additionalProperties: - items: - type: string - type: array + $ref: '#/components/schemas/AnnotationAggregate' propertyNames: - $ref: '#/components/schemas/RecommendedModelPurpose' + format: uuid4 type: object - title: Recommended Models - supports_num_judges: - type: boolean - title: Supports Num Judges - default: true - supports_file_uploads: - type: boolean - title: Supports File Uploads - default: false - model_properties: + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: + anyOf: + - type: number + - type: 'null' + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: items: - $ref: '#/components/schemas/api__schemas__integration__llm_integration__ModelProperties' + type: string + format: uuid4 type: array - title: Model Properties - type: object - required: - - integration_name - - integration_id - - provider - - models - - scorer_models - title: IntegrationModelsResponse - IntegrationProvider: - type: string - enum: - - anthropic - - aws_bedrock - - aws_sagemaker - - azure - - custom - - databricks - - mistral - - nvidia - - openai - - typesafe - - vegas_gateway - - vertex_ai - - writer - title: IntegrationProvider - IntegrationSelectRequest: - properties: - integration_name: + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: + anyOf: + - type: boolean + - type: 'null' + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: + anyOf: + - $ref: '#/components/schemas/AnnotationStatus' + - type: 'null' + description: Annotation review status of the record + annotated_members: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: type: string - title: Integration Name - integration_id: + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: + type: string + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Input' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Input' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' + type: object + - type: 'null' + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object + - type: 'null' + title: Files + description: File metadata keyed by file ID for files associated with this + record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' + parent_id: type: string format: uuid4 - title: Integration Id + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: + anyOf: + - type: integer + - type: 'null' + title: Step Number + description: Topological step number of the span. + tool_call_id: + anyOf: + - type: string + - type: 'null' + title: Tool Call Id + description: ID of the tool call. type: object required: - - integration_name - - integration_id - title: IntegrationSelectRequest - InternalToolCall: + - id + - session_id + - project_id + - run_id + - parent_id + title: ExtendedToolSpanRecordWithChildren + ExtendedTraceRecord-Input: properties: type: type: string - const: internal_tool_call + const: trace title: Type - default: internal_tool_call - id: + description: Type of the trace, span or session. + default: trace + input: anyOf: - type: string - - type: 'null' - title: Id - description: Unique identifier for the event - status: + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + title: Input + description: Input to the trace or span. + default: '' + redacted_input: anyOf: - - $ref: '#/components/schemas/EventStatus' + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' - description: Status of the event - metadata: + title: Redacted Input + description: Redacted input of the trace or span. + output: anyOf: - - additionalProperties: true - type: object + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' - title: Metadata - description: Provider-specific metadata and additional fields - error_message: + title: Output + description: Output of the trace or span. + redacted_output: anyOf: - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' - title: Error Message - description: Error message if the event failed + title: Redacted Output + description: Redacted output of the trace or span. name: type: string title: Name - description: Name of the internal tool (e.g., 'web_search', 'code_interpreter', - 'file_search') - input: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Input - description: Input/arguments to the tool call - output: + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: anyOf: - - additionalProperties: true - type: object + - type: integer - type: 'null' - title: Output - description: Output/results from the tool call - type: object - required: - - name - title: InternalToolCall - description: 'A tool call executed internally by the model during reasoning. - - - This represents internal tools like web search, code execution, file search, - etc. - - that the model invokes (not user-defined functions or MCP tools).' - InvalidResult: - properties: - result_type: + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: + anyOf: + - type: string + - type: 'null' + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: + anyOf: + - type: string + - type: 'null' + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: + anyOf: + - type: string + - type: 'null' + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: type: string - const: invalid - title: Result Type - default: invalid - error_message: + format: uuid4 + title: ID + description: Galileo ID of the trace + session_id: type: string - title: Error Message - type: object - required: - - error_message - title: InvalidResult - InvokeResponse: - properties: - status: - $ref: '#/components/schemas/ExecutionStatus' - default: skipped - api_version: + format: uuid4 + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: type: string - title: Api Version - default: 1.0.0 - text: + format: uuid4 + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: type: string - title: Text - description: Text from the request after processing the rules. - trace_metadata: - $ref: '#/components/schemas/TraceMetadata' - stage_metadata: - $ref: '#/components/schemas/StageMetadata' - ruleset_results: + format: uuid4 + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: + type: string + format: uuid4 + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: + anyOf: + - type: boolean + - type: 'null' + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: items: - $ref: '#/components/schemas/RulesetResult' + type: string + format: uuid4 type: array - title: Ruleset Results - description: Results of the rule execution. - metric_results: + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: additionalProperties: - $ref: '#/components/schemas/MetricComputation' + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 type: object - title: Metric Results - description: Results of the metric computation. - action_result: - $ref: '#/components/schemas/ActionResult' - metadata: + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: anyOf: - - additionalProperties: + - type: number + - type: 'null' + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: + anyOf: + - type: boolean + - type: 'null' + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: + anyOf: + - $ref: '#/components/schemas/AnnotationStatus' + - type: 'null' + description: Annotation review status of the record + annotated_members: + anyOf: + - items: type: string + type: array + - type: 'null' + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: + type: string + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: + type: string + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Input' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Input' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' - title: Metadata - description: Optional additional metadata. This being echoed back from the - request. - headers: + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: anyOf: - additionalProperties: - type: string + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 type: object - type: 'null' - title: Headers - description: Optional additional HTTP headers that should be included in - the response. + title: Files + description: File metadata keyed by file ID for files associated with this + record + dataset_generated_output: + anyOf: + - type: string + - type: 'null' + title: Dataset Generated Output + description: Generated output from the dataset associated with this trace + is_complete: + type: boolean + title: Is Complete + description: Whether the trace is complete or not + default: true + num_spans: + anyOf: + - type: integer + - type: 'null' + title: Num Spans + is_synthetic: + type: boolean + title: Is Synthetic + description: Whether ingest created this trace row because the trace's root + span was missing + default: false type: object required: - - text - - trace_metadata - - stage_metadata - - action_result - title: InvokeResponse - JobProgress: + - id + - session_id + - trace_id + - project_id + - run_id + title: ExtendedTraceRecord + ExtendedTraceRecord-Output: properties: - progress_message: + type: + type: string + const: trace + title: Type + description: Type of the trace, span or session. + default: trace + input: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + title: Input + description: Input to the trace or span. + default: '' + redacted_input: anyOf: - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' - title: Progress Message - steps_completed: + title: Redacted Input + description: Redacted input of the trace or span. + output: anyOf: - - type: integer + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' - title: Steps Completed - steps_total: + title: Output + description: Output of the trace or span. + redacted_output: anyOf: - - type: integer + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' - title: Steps Total - type: object - title: JobProgress - JsonPrimitive: - anyOf: - - type: string - - type: integer - - type: number - - type: boolean - - type: 'null' - LLMExportFormat: - type: string - enum: - - csv - - jsonl - - jsonl_flat - title: LLMExportFormat - LLMIntegration: - type: string - enum: - - anthropic - - aws_bedrock - - aws_sagemaker - - azure - - custom - - databricks - - mistral - - nvidia - - openai - - vegas_gateway - - vertex_ai - - writer - title: LLMIntegration - LikeDislikeAggregate: - properties: - feedback_type: + title: Redacted Output + description: Redacted output of the trace or span. + name: type: string - const: like_dislike - title: Feedback Type - default: like_dislike - like_count: - type: integer - title: Like Count - dislike_count: - type: integer - title: Dislike Count - unrated_count: - type: integer - title: Unrated Count - type: object - required: - - like_count - - dislike_count - - unrated_count - title: LikeDislikeAggregate - LikeDislikeConstraints: - properties: - annotation_type: + title: Name + description: Name of the trace, span or session. + default: '' + created_at: type: string - const: like_dislike - title: Annotation Type - type: object - required: - - annotation_type - title: LikeDislikeConstraints - ListAnnotationQueueCollaboratorsResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: anyOf: - type: integer - type: 'null' - title: Next Starting Token - collaborators: - items: - $ref: '#/components/schemas/UserAnnotationQueueCollaborator' - type: array - title: Collaborators - type: object - required: - - collaborators - title: ListAnnotationQueueCollaboratorsResponse - ListAnnotationQueueParams: - properties: - filters: - items: - oneOf: - - $ref: '#/components/schemas/AnnotationQueueIDFilter' - - $ref: '#/components/schemas/AnnotationQueueNameFilter' - - $ref: '#/components/schemas/AnnotationQueueProjectFilter' - - $ref: '#/components/schemas/AnnotationQueueCreatedAtFilter' - - $ref: '#/components/schemas/AnnotationQueueUpdatedAtFilter' - - $ref: '#/components/schemas/AnnotationQueueNumLogRecordsFilter' - - $ref: '#/components/schemas/AnnotationQueueNumAnnotatorsFilter' - - $ref: '#/components/schemas/AnnotationQueueNumUsersFilter' - - $ref: '#/components/schemas/AnnotationQueueOverallProgressFilter' - - $ref: '#/components/schemas/AnnotationQueueNumTemplatesFilter' - discriminator: - propertyName: name - mapping: - created_at: '#/components/schemas/AnnotationQueueCreatedAtFilter' - id: '#/components/schemas/AnnotationQueueIDFilter' - name: '#/components/schemas/AnnotationQueueNameFilter' - num_annotators: '#/components/schemas/AnnotationQueueNumAnnotatorsFilter' - num_log_records: '#/components/schemas/AnnotationQueueNumLogRecordsFilter' - num_templates: '#/components/schemas/AnnotationQueueNumTemplatesFilter' - num_users: '#/components/schemas/AnnotationQueueNumUsersFilter' - overall_progress: '#/components/schemas/AnnotationQueueOverallProgressFilter' - project_id: '#/components/schemas/AnnotationQueueProjectFilter' - updated_at: '#/components/schemas/AnnotationQueueUpdatedAtFilter' - type: array - title: Filters - sort: + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: anyOf: - - oneOf: - - $ref: '#/components/schemas/AnnotationQueueNameSort' - - $ref: '#/components/schemas/AnnotationQueueCreatedAtSort' - - $ref: '#/components/schemas/AnnotationQueueUpdatedAtSort' - - $ref: '#/components/schemas/AnnotationQueueCreatedBySort' - - $ref: '#/components/schemas/AnnotationQueueNumUsersSort' - - $ref: '#/components/schemas/AnnotationQueueNumLogRecordsSort' - - $ref: '#/components/schemas/AnnotationQueueNumTemplatesSort' - - $ref: '#/components/schemas/AnnotationQueueNumAnnotatorsSort' - - $ref: '#/components/schemas/AnnotationQueueOverallProgressSort' - discriminator: - propertyName: name - mapping: - created_at: '#/components/schemas/AnnotationQueueCreatedAtSort' - created_by: '#/components/schemas/AnnotationQueueCreatedBySort' - name: '#/components/schemas/AnnotationQueueNameSort' - num_annotators: '#/components/schemas/AnnotationQueueNumAnnotatorsSort' - num_log_records: '#/components/schemas/AnnotationQueueNumLogRecordsSort' - num_templates: '#/components/schemas/AnnotationQueueNumTemplatesSort' - num_users: '#/components/schemas/AnnotationQueueNumUsersSort' - overall_progress: '#/components/schemas/AnnotationQueueOverallProgressSort' - updated_at: '#/components/schemas/AnnotationQueueUpdatedAtSort' + - type: string - type: 'null' - title: Sort - default: None - type: object - title: ListAnnotationQueueParams - ListAnnotationQueueResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: anyOf: - - type: integer + - type: string - type: 'null' - title: Next Starting Token - annotation_queues: - items: - $ref: '#/components/schemas/AnnotationQueueResponse' - type: array - title: Annotation Queues - type: object - required: - - annotation_queues - title: ListAnnotationQueueResponse - ListDatasetParams: - properties: - filters: - items: - oneOf: - - $ref: '#/components/schemas/DatasetNameFilter' - - $ref: '#/components/schemas/DatasetDraftFilter' - - $ref: '#/components/schemas/DatasetUsedInProjectFilter' - - $ref: '#/components/schemas/DatasetIDFilter' - - $ref: '#/components/schemas/DatasetNotInProjectFilter' - discriminator: - propertyName: name - mapping: - draft: '#/components/schemas/DatasetDraftFilter' - id: '#/components/schemas/DatasetIDFilter' - name: '#/components/schemas/DatasetNameFilter' - not_in_project: '#/components/schemas/DatasetNotInProjectFilter' - used_in_project: '#/components/schemas/DatasetUsedInProjectFilter' - type: array - title: Filters - sort: + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: anyOf: - - oneOf: - - $ref: '#/components/schemas/DatasetNameSort' - - $ref: '#/components/schemas/DatasetCreatedAtSort' - - $ref: '#/components/schemas/DatasetUpdatedAtSort' - - $ref: '#/components/schemas/DatasetProjectLastUsedAtSort' - - $ref: '#/components/schemas/DatasetProjectsSort' - - $ref: '#/components/schemas/DatasetRowsSort' - - $ref: '#/components/schemas/DatasetLastEditedByUserAtSort' - discriminator: - propertyName: name - mapping: - created_at: '#/components/schemas/DatasetCreatedAtSort' - last_edited_by_user_at: '#/components/schemas/DatasetLastEditedByUserAtSort' - name: '#/components/schemas/DatasetNameSort' - num_rows: '#/components/schemas/DatasetRowsSort' - project_count: '#/components/schemas/DatasetProjectsSort' - project_last_used_at: '#/components/schemas/DatasetProjectLastUsedAtSort' - updated_at: '#/components/schemas/DatasetUpdatedAtSort' + - type: string - type: 'null' - title: Sort - default: None - type: object - title: ListDatasetParams - ListDatasetProjectsResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: + type: string + format: uuid4 + title: ID + description: Galileo ID of the trace + session_id: + type: string + format: uuid4 + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: + type: string + format: uuid4 + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: + type: string + format: uuid4 + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: + type: string + format: uuid4 + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: anyOf: - - type: integer + - type: string + format: date-time - type: 'null' - title: Next Starting Token - projects: - items: - $ref: '#/components/schemas/DatasetProject' - type: array - title: Projects - type: object - title: ListDatasetProjectsResponse - ListDatasetResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: anyOf: - - type: integer + - type: boolean - type: 'null' - title: Next Starting Token - datasets: - items: - $ref: '#/components/schemas/DatasetDB' - type: array - title: Datasets - type: object - title: ListDatasetResponse - ListDatasetVersionParams: - properties: - sort: + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: anyOf: - - oneOf: - - $ref: '#/components/schemas/DatasetVersionIndexSort' - discriminator: - propertyName: name - mapping: - version_index: '#/components/schemas/DatasetVersionIndexSort' + - type: string + format: uuid4 - type: 'null' - title: Sort - type: object - title: ListDatasetVersionParams - ListDatasetVersionResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: anyOf: - - type: integer + - type: string + format: uuid4 - type: 'null' - title: Next Starting Token - versions: + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: items: - $ref: '#/components/schemas/DatasetVersionDB' + type: string + format: uuid4 type: array - title: Versions - type: object - required: - - versions - title: ListDatasetVersionResponse - ListExperimentResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: - anyOf: - - type: integer - - type: 'null' - title: Next Starting Token - experiments: + title: File Ids + description: IDs of files associated with this record + file_modalities: items: - $ref: '#/components/schemas/ExperimentResponse' + $ref: '#/components/schemas/ContentModality' type: array - title: Experiments - type: object - title: ListExperimentResponse - ListGroupCollaboratorsResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: anyOf: - - type: integer + - type: number - type: 'null' - title: Next Starting Token - collaborators: + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: items: - $ref: '#/components/schemas/GroupCollaborator' + type: string + format: uuid4 type: array - title: Collaborators - type: object - required: - - collaborators - title: ListGroupCollaboratorsResponse - ListLogStreamResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: anyOf: - - type: integer + - type: boolean - type: 'null' - title: Next Starting Token - log_streams: - items: - $ref: '#/components/schemas/LogStreamResponse' - type: array - title: Log Streams - type: object - required: - - log_streams - title: ListLogStreamResponse - ListProjectGroupCollaboratorsResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: anyOf: - - type: integer + - $ref: '#/components/schemas/AnnotationStatus' - type: 'null' - title: Next Starting Token - collaborators: - items: - $ref: '#/components/schemas/ProjectGroupCollaborator' - type: array - title: Collaborators - type: object - required: - - collaborators - title: ListProjectGroupCollaboratorsResponse - ListProjectUserCollaboratorsResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: + description: Annotation review status of the record + annotated_members: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: + type: string + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: + type: string + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Output' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Output' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' + type: object + - type: 'null' + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object + - type: 'null' + title: Files + description: File metadata keyed by file ID for files associated with this + record + dataset_generated_output: + anyOf: + - type: string + - type: 'null' + title: Dataset Generated Output + description: Generated output from the dataset associated with this trace + is_complete: type: boolean - title: Paginated - default: false - next_starting_token: + title: Is Complete + description: Whether the trace is complete or not + default: true + num_spans: anyOf: - type: integer - type: 'null' - title: Next Starting Token - collaborators: - items: - $ref: '#/components/schemas/ProjectUserCollaborator' - type: array - title: Collaborators + title: Num Spans + is_synthetic: + type: boolean + title: Is Synthetic + description: Whether ingest created this trace row because the trace's root + span was missing + default: false type: object required: - - collaborators - title: ListProjectUserCollaboratorsResponse - ListPromptTemplateParams: - properties: - filters: - items: - oneOf: - - $ref: '#/components/schemas/PromptTemplateNameFilter' - - $ref: '#/components/schemas/PromptTemplateCreatedByFilter' - - $ref: '#/components/schemas/PromptTemplateUsedInProjectFilter' - - $ref: '#/components/schemas/PromptTemplateNotInProjectFilter' - discriminator: - propertyName: name - mapping: - creator: '#/components/schemas/PromptTemplateCreatedByFilter' - name: '#/components/schemas/PromptTemplateNameFilter' - not_in_project: '#/components/schemas/PromptTemplateNotInProjectFilter' - used_in_project: '#/components/schemas/PromptTemplateUsedInProjectFilter' - type: array - title: Filters - sort: - anyOf: - - oneOf: - - $ref: '#/components/schemas/PromptTemplateNameSort' - - $ref: '#/components/schemas/PromptTemplateCreatedAtSort' - - $ref: '#/components/schemas/PromptTemplateUpdatedAtSort' - discriminator: - propertyName: name - mapping: - created_at: '#/components/schemas/PromptTemplateCreatedAtSort' - name: '#/components/schemas/PromptTemplateNameSort' - updated_at: '#/components/schemas/PromptTemplateUpdatedAtSort' - - type: 'null' - title: Sort - default: None - type: object - title: ListPromptTemplateParams - ListPromptTemplateResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: - anyOf: - - type: integer - - type: 'null' - title: Next Starting Token - templates: - items: - $ref: '#/components/schemas/BasePromptTemplateResponse' - type: array - title: Templates - type: object - title: ListPromptTemplateResponse - ListPromptTemplateVersionParams: - properties: - sort: - anyOf: - - oneOf: - - $ref: '#/components/schemas/PromptTemplateVersionNumberSort' - - $ref: '#/components/schemas/PromptTemplateVersionCreatedAtSort' - - $ref: '#/components/schemas/PromptTemplateVersionUpdatedAtSort' - discriminator: - propertyName: name - mapping: - created_at: '#/components/schemas/PromptTemplateVersionCreatedAtSort' - updated_at: '#/components/schemas/PromptTemplateVersionUpdatedAtSort' - version: '#/components/schemas/PromptTemplateVersionNumberSort' - - type: 'null' - title: Sort - type: object - title: ListPromptTemplateVersionParams - ListPromptTemplateVersionResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: - anyOf: - - type: integer - - type: 'null' - title: Next Starting Token - versions: - items: - $ref: '#/components/schemas/BasePromptTemplateVersionResponse' - type: array - title: Versions - type: object - title: ListPromptTemplateVersionResponse - ListScorerVersionsResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: - anyOf: - - type: integer - - type: 'null' - title: Next Starting Token - versions: - items: - $ref: '#/components/schemas/ScorerVersionListItem' - type: array - title: Versions - type: object - title: ListScorerVersionsResponse - ListScorersRequest: + - id + - session_id + - trace_id + - project_id + - run_id + title: ExtendedTraceRecord + ExtendedTraceRecordWithChildren: properties: - filters: + spans: items: oneOf: - - $ref: '#/components/schemas/ScorerNameFilter' - - $ref: '#/components/schemas/ScorerTypeFilter' - - $ref: '#/components/schemas/ScorerModelTypeFilter' - - $ref: '#/components/schemas/ScorerExcludeSlmScorersFilter' - - $ref: '#/components/schemas/ScorerExcludeNonO11ySlmScorersFilter' - - $ref: '#/components/schemas/ScorerExcludeMultimodalScorersFilter' - - $ref: '#/components/schemas/ScorerTagsFilter' - - $ref: '#/components/schemas/ScorerCreatorFilter' - - $ref: '#/components/schemas/ScorerCreatedAtFilter' - - $ref: '#/components/schemas/ScorerUpdatedAtFilter' - - $ref: '#/components/schemas/ScorerLabelFilter' - - $ref: '#/components/schemas/ScorerScoreableNodeTypesFilter' - - $ref: '#/components/schemas/ScorerMultimodalCapabilitiesFilter' - - $ref: '#/components/schemas/ScorerIDFilter' - - $ref: '#/components/schemas/ScorerIsGlobalFilter' - - $ref: '#/components/schemas/ScorerScopeProjectsFilter' + - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedLlmSpanRecord-Input' + - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedControlSpanRecord-Input' + - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' discriminator: - propertyName: name + propertyName: type mapping: - created_at: '#/components/schemas/ScorerCreatedAtFilter' - creator: '#/components/schemas/ScorerCreatorFilter' - exclude_multimodal_scorers: '#/components/schemas/ScorerExcludeMultimodalScorersFilter' - exclude_non_o11y_slm_scorers: '#/components/schemas/ScorerExcludeNonO11ySlmScorersFilter' - exclude_slm_scorers: '#/components/schemas/ScorerExcludeSlmScorersFilter' - id: '#/components/schemas/ScorerIDFilter' - is_global: '#/components/schemas/ScorerIsGlobalFilter' - label: '#/components/schemas/ScorerLabelFilter' - model_type: '#/components/schemas/ScorerModelTypeFilter' - multimodal_capabilities: '#/components/schemas/ScorerMultimodalCapabilitiesFilter' - name: '#/components/schemas/ScorerNameFilter' - scope_projects: '#/components/schemas/ScorerScopeProjectsFilter' - scoreable_node_types: '#/components/schemas/ScorerScoreableNodeTypesFilter' - scorer_type: '#/components/schemas/ScorerTypeFilter' - tags: '#/components/schemas/ScorerTagsFilter' - updated_at: '#/components/schemas/ScorerUpdatedAtFilter' - type: array - title: Filters - sort: - anyOf: - - oneOf: - - $ref: '#/components/schemas/ScorerNameSort' - - $ref: '#/components/schemas/ScorerUpdatedAtSort' - - $ref: '#/components/schemas/ScorerEnabledInRunSort' - - $ref: '#/components/schemas/ScorerEnabledInPlaygroundSort' - discriminator: - propertyName: name - mapping: - enabled_in_playground: '#/components/schemas/ScorerEnabledInPlaygroundSort' - enabled_in_run: '#/components/schemas/ScorerEnabledInRunSort' - name: '#/components/schemas/ScorerNameSort' - updated_at: '#/components/schemas/ScorerUpdatedAtSort' - - type: 'null' - title: Sort - type: object - title: ListScorersRequest - ListScorersResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: - anyOf: - - type: integer - - type: 'null' - title: Next Starting Token - scorers: - items: - $ref: '#/components/schemas/ScorerResponse' - type: array - title: Scorers - type: object - title: ListScorersResponse - ListStageResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: - anyOf: - - type: integer - - type: 'null' - title: Next Starting Token - stages: - items: - $ref: '#/components/schemas/StageDB' - type: array - title: Stages - type: object - required: - - stages - title: ListStageResponse - ListUserCollaboratorsResponse: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: - anyOf: - - type: integer - - type: 'null' - title: Next Starting Token - collaborators: - items: - $ref: '#/components/schemas/UserCollaborator' + agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' + control: '#/components/schemas/ExtendedControlSpanRecord-Input' + http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' + llm: '#/components/schemas/ExtendedLlmSpanRecord-Input' + retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' + tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' + workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' type: array - title: Collaborators - type: object - required: - - collaborators - title: ListUserCollaboratorsResponse - LlmMetrics: - properties: - duration_ns: - anyOf: - - type: integer - - type: 'null' - title: Duration Ns - description: Duration of the trace or span in nanoseconds. Displayed as - 'Latency' in Galileo. - num_input_tokens: - anyOf: - - type: integer - - type: 'null' - title: Num Input Tokens - description: Number of input tokens. - num_output_tokens: - anyOf: - - type: integer - - type: 'null' - title: Num Output Tokens - description: Number of output tokens. - num_total_tokens: - anyOf: - - type: integer - - type: 'null' - title: Num Total Tokens - description: Total number of tokens. - time_to_first_token_ns: - anyOf: - - type: integer - - type: 'null' - title: Time To First Token Ns - description: Time until the first token was generated in nanoseconds. - num_image_input_tokens: - anyOf: - - type: integer - - type: 'null' - title: Num Image Input Tokens - description: Number of image input tokens. - num_audio_input_tokens: - anyOf: - - type: integer - - type: 'null' - title: Num Audio Input Tokens - description: Number of audio input tokens. - num_audio_output_tokens: - anyOf: - - type: integer - - type: 'null' - title: Num Audio Output Tokens - description: Number of audio output tokens. - num_image_output_tokens: - anyOf: - - type: integer - - type: 'null' - title: Num Image Output Tokens - description: Number of image output tokens. - additionalProperties: true - type: object - title: LlmMetrics - LlmSpan: - properties: + title: Spans type: type: string - const: llm + const: trace title: Type description: Type of the trace, span or session. - default: llm + default: trace input: - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array title: Input description: Input to the trace or span. + default: '' redacted_input: anyOf: + - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - type: 'null' + title: Output description: Output of the trace or span. redacted_output: anyOf: - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' + title: Redacted Output description: Redacted output of the trace or span. name: type: string @@ -27093,7 +27295,7 @@ components: description: Status code of the trace or span. Used for logging failure or error states. metrics: - $ref: '#/components/schemas/LlmMetrics' + $ref: '#/components/schemas/Metrics' description: Metrics associated with this trace or span. external_id: anyOf: @@ -27120,163 +27322,4102 @@ components: title: Dataset Metadata description: Metadata from the dataset associated with this trace id: - anyOf: - - type: string - format: uuid4 - - type: 'null' + type: string + format: uuid4 title: ID - description: Galileo ID of the session, trace or span + description: Galileo ID of the trace session_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' + type: string + format: uuid4 title: Session ID - description: Galileo ID of the session containing the trace or span or session + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) trace_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' + type: string + format: uuid4 title: Trace ID description: Galileo ID of the trace containing the span (or the same value as id for a trace) - step_number: - anyOf: - - type: integer - - type: 'null' - title: Step Number - description: Topological step number of the span. - parent_id: + project_id: + type: string + format: uuid4 + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: + type: string + format: uuid4 + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: anyOf: - type: string - format: uuid4 - - type: 'null' - title: Parent ID - description: Galileo ID of the parent of this span - tools: - anyOf: - - items: - additionalProperties: true - type: object - type: array + format: date-time - type: 'null' - title: Tools - description: List of available tools passed to the LLM on invocation. - events: + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: anyOf: - - items: - oneOf: - - $ref: '#/components/schemas/MessageEvent' - - $ref: '#/components/schemas/ReasoningEvent' - - $ref: '#/components/schemas/InternalToolCall' - - $ref: '#/components/schemas/WebSearchCallEvent' - - $ref: '#/components/schemas/ImageGenerationEvent' - - $ref: '#/components/schemas/MCPCallEvent' - - $ref: '#/components/schemas/MCPListToolsEvent' - - $ref: '#/components/schemas/MCPApprovalRequestEvent' - discriminator: - propertyName: type - mapping: - image_generation: '#/components/schemas/ImageGenerationEvent' - internal_tool_call: '#/components/schemas/InternalToolCall' - mcp_approval_request: '#/components/schemas/MCPApprovalRequestEvent' - mcp_call: '#/components/schemas/MCPCallEvent' - mcp_list_tools: '#/components/schemas/MCPListToolsEvent' - message: '#/components/schemas/MessageEvent' - reasoning: '#/components/schemas/ReasoningEvent' - web_search_call: '#/components/schemas/WebSearchCallEvent' - type: array + - type: boolean - type: 'null' - title: Events - description: List of reasoning, internal tool call, or MCP events that occurred - during the LLM span. - model: + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Model - description: Model used for this span. - provider: + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Provider - description: Provider used for this span. - temperature: - anyOf: - - type: number - - type: 'null' - title: Temperature - description: Temperature used for generation. - finish_reason: + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: + items: + type: string + format: uuid4 + type: array + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: + anyOf: + - type: number + - type: 'null' + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: + anyOf: + - type: boolean + - type: 'null' + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: + anyOf: + - $ref: '#/components/schemas/AnnotationStatus' + - type: 'null' + description: Annotation review status of the record + annotated_members: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: + type: string + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: + type: string + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Input' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Input' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' + type: object + - type: 'null' + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object + - type: 'null' + title: Files + description: File metadata keyed by file ID for files associated with this + record + dataset_generated_output: anyOf: - type: string - type: 'null' - title: Finish Reason - description: Reason for finishing. + title: Dataset Generated Output + description: Generated output from the dataset associated with this trace + is_complete: + type: boolean + title: Is Complete + description: Whether the trace is complete or not + default: true + num_spans: + anyOf: + - type: integer + - type: 'null' + title: Num Spans + is_synthetic: + type: boolean + title: Is Synthetic + description: Whether ingest created this trace row because the trace's root + span was missing + default: false type: object - title: LlmSpan - LogRecordsAvailableColumnsRequest: + required: + - id + - session_id + - trace_id + - project_id + - run_id + title: ExtendedTraceRecordWithChildren + ExtendedWorkflowSpanRecord-Input: properties: - log_stream_id: + type: + type: string + const: workflow + title: Type + description: Type of the trace, span or session. + default: workflow + input: anyOf: - type: string - format: uuid4 + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + title: Input + description: Input to the trace or span. + default: '' + redacted_input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: + title: Redacted Input + description: Redacted input of the trace or span. + output: anyOf: - type: string - format: uuid4 + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: + title: Output + description: Output of the trace or span. + redacted_output: + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Redacted Output + description: Redacted output of the trace or span. + name: + type: string + title: Name + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: + anyOf: + - type: integer + - type: 'null' + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: + anyOf: + - type: string + - type: 'null' + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: + anyOf: + - type: string + - type: 'null' + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: + anyOf: + - type: string + - type: 'null' + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: + type: string + format: uuid4 + title: ID + description: Galileo ID of the session, trace or span + session_id: + type: string + format: uuid4 + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: anyOf: - type: string format: uuid4 - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - start_time: + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: + type: string + format: uuid4 + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: + type: string + format: uuid4 + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: anyOf: - type: string format: date-time - type: 'null' - title: Start Time - end_time: + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: + anyOf: + - type: boolean + - type: 'null' + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: anyOf: - type: string - format: date-time + format: uuid4 - type: 'null' - title: End Time - type: object - title: LogRecordsAvailableColumnsRequest - examples: - - log_stream_id: 00000000-0000-0000-0000-000000000000 - LogRecordsAvailableColumnsResponse: - properties: - columns: + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: items: - $ref: '#/components/schemas/LogRecordsColumnInfo' + type: string + format: uuid4 type: array - title: Columns + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: + anyOf: + - type: number + - type: 'null' + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: + anyOf: + - type: boolean + - type: 'null' + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: + anyOf: + - $ref: '#/components/schemas/AnnotationStatus' + - type: 'null' + description: Annotation review status of the record + annotated_members: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: + type: string + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: + type: string + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Input' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Input' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' + type: object + - type: 'null' + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object + - type: 'null' + title: Files + description: File metadata keyed by file ID for files associated with this + record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' + parent_id: + type: string + format: uuid4 + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: + anyOf: + - type: integer + - type: 'null' + title: Step Number + description: Topological step number of the span. type: object - title: LogRecordsAvailableColumnsResponse - examples: - - columns: - - applicable_types: - - workflow - - retriever - - llm - - control - - trace + required: + - id + - session_id + - project_id + - run_id + - parent_id + title: ExtendedWorkflowSpanRecord + ExtendedWorkflowSpanRecord-Output: + properties: + type: + type: string + const: workflow + title: Type + description: Type of the trace, span or session. + default: workflow + input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/Message-Output' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + title: Input + description: Input to the trace or span. + default: '' + redacted_input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/Message-Output' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - type: 'null' + title: Redacted Input + description: Redacted input of the trace or span. + output: + anyOf: + - type: string + - $ref: '#/components/schemas/Message-Output' + - items: + $ref: '#/components/schemas/Document-Output' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Output + description: Output of the trace or span. + redacted_output: + anyOf: + - type: string + - $ref: '#/components/schemas/Message-Output' + - items: + $ref: '#/components/schemas/Document-Output' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Redacted Output + description: Redacted output of the trace or span. + name: + type: string + title: Name + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: + anyOf: + - type: integer + - type: 'null' + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: + anyOf: + - type: string + - type: 'null' + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: + anyOf: + - type: string + - type: 'null' + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: + anyOf: + - type: string + - type: 'null' + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: + type: string + format: uuid4 + title: ID + description: Galileo ID of the session, trace or span + session_id: + type: string + format: uuid4 + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: + type: string + format: uuid4 + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: + type: string + format: uuid4 + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: + anyOf: + - type: boolean + - type: 'null' + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: + items: + type: string + format: uuid4 + type: array + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: + anyOf: + - type: number + - type: 'null' + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: + anyOf: + - type: boolean + - type: 'null' + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: + anyOf: + - $ref: '#/components/schemas/AnnotationStatus' + - type: 'null' + description: Annotation review status of the record + annotated_members: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: + type: string + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: + type: string + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Output' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Output' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' + type: object + - type: 'null' + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object + - type: 'null' + title: Files + description: File metadata keyed by file ID for files associated with this + record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' + parent_id: + type: string + format: uuid4 + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: + anyOf: + - type: integer + - type: 'null' + title: Step Number + description: Topological step number of the span. + type: object + required: + - id + - session_id + - project_id + - run_id + - parent_id + title: ExtendedWorkflowSpanRecord + ExtendedWorkflowSpanRecordWithChildren: + properties: + spans: + items: + oneOf: + - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedLlmSpanRecord-Input' + - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' + - $ref: '#/components/schemas/ExtendedControlSpanRecord-Input' + - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' + control: '#/components/schemas/ExtendedControlSpanRecord-Input' + http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' + llm: '#/components/schemas/ExtendedLlmSpanRecord-Input' + retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' + tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' + workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' + type: array + title: Spans + type: + type: string + const: workflow + title: Type + description: Type of the trace, span or session. + default: workflow + input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + title: Input + description: Input to the trace or span. + default: '' + redacted_input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - type: 'null' + title: Redacted Input + description: Redacted input of the trace or span. + output: + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Output + description: Output of the trace or span. + redacted_output: + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Redacted Output + description: Redacted output of the trace or span. + name: + type: string + title: Name + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: + anyOf: + - type: integer + - type: 'null' + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: + anyOf: + - type: string + - type: 'null' + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: + anyOf: + - type: string + - type: 'null' + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: + anyOf: + - type: string + - type: 'null' + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: + type: string + format: uuid4 + title: ID + description: Galileo ID of the session, trace or span + session_id: + type: string + format: uuid4 + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: + type: string + format: uuid4 + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: + type: string + format: uuid4 + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: + anyOf: + - type: boolean + - type: 'null' + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: + items: + type: string + format: uuid4 + type: array + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: + anyOf: + - type: number + - type: 'null' + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: + anyOf: + - type: boolean + - type: 'null' + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: + anyOf: + - $ref: '#/components/schemas/AnnotationStatus' + - type: 'null' + description: Annotation review status of the record + annotated_members: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: + type: string + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: + type: string + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Input' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Input' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' + type: object + - type: 'null' + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object + - type: 'null' + title: Files + description: File metadata keyed by file ID for files associated with this + record + is_placeholder: + type: boolean + title: Is Placeholder + description: Whether this span is not stored but stands in for a parent + span missing from its trace + default: false + left_out_reason: + anyOf: + - $ref: '#/components/schemas/LeftOutReason' + - type: 'null' + description: 'Set when the tree cannot place this span under its parent, + so it sits at the trace root instead. child_of_leaf_span: an ancestor + is an llm or control span. unreachable: its chain of parents never reaches + the trace. Detail trees never set no_trace_row: a stub_trace root shows + that case.' + parent_id: + type: string + format: uuid4 + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: + anyOf: + - type: integer + - type: 'null' + title: Step Number + description: Topological step number of the span. + type: object + required: + - id + - session_id + - project_id + - run_id + - parent_id + title: ExtendedWorkflowSpanRecordWithChildren + FeatureIntegrationCosts: + properties: + feature_name: + type: string + title: Feature Name + total_cost: + type: number + title: Total Cost + default: 0.0 + projects: + items: + $ref: '#/components/schemas/ProjectIntegrationCosts' + type: array + title: Projects + type: object + required: + - feature_name + title: FeatureIntegrationCosts + FeedbackAggregate: + properties: + aggregate: + oneOf: + - $ref: '#/components/schemas/LikeDislikeAggregate' + - $ref: '#/components/schemas/StarAggregate' + - $ref: '#/components/schemas/ScoreAggregate' + - $ref: '#/components/schemas/TagsAggregate' + - $ref: '#/components/schemas/TextAggregate' + - $ref: '#/components/schemas/ChoiceAggregate' + - $ref: '#/components/schemas/TreeChoiceAggregate' + title: Aggregate + discriminator: + propertyName: feedback_type + mapping: + choice: '#/components/schemas/ChoiceAggregate' + like_dislike: '#/components/schemas/LikeDislikeAggregate' + score: '#/components/schemas/ScoreAggregate' + star: '#/components/schemas/StarAggregate' + tags: '#/components/schemas/TagsAggregate' + text: '#/components/schemas/TextAggregate' + tree_choice: '#/components/schemas/TreeChoiceAggregate' + type: object + required: + - aggregate + title: FeedbackAggregate + FeedbackRatingDB-Input: + properties: + explanation: + anyOf: + - type: string + minLength: 1 + - type: 'null' + title: Explanation + rating: + oneOf: + - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__LikeDislikeRating' + - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__StarRating' + - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__ScoreRating' + - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__TagsRating' + - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__TextRating' + - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__ChoiceRating' + - $ref: '#/components/schemas/libs__python__schemas__log_records__feedback__TreeChoiceRating' + title: Rating + discriminator: + propertyName: feedback_type + mapping: + choice: '#/components/schemas/libs__python__schemas__log_records__feedback__ChoiceRating' + like_dislike: '#/components/schemas/libs__python__schemas__log_records__feedback__LikeDislikeRating' + score: '#/components/schemas/libs__python__schemas__log_records__feedback__ScoreRating' + star: '#/components/schemas/libs__python__schemas__log_records__feedback__StarRating' + tags: '#/components/schemas/libs__python__schemas__log_records__feedback__TagsRating' + text: '#/components/schemas/libs__python__schemas__log_records__feedback__TextRating' + tree_choice: '#/components/schemas/libs__python__schemas__log_records__feedback__TreeChoiceRating' + created_at: + type: string + format: date-time + title: Created At + created_by: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Created By + type: object + required: + - rating + - created_at + - created_by + title: FeedbackRatingDB + FeedbackRatingDB-Output: + properties: + explanation: + anyOf: + - type: string + minLength: 1 + - type: 'null' + title: Explanation + rating: + oneOf: + - $ref: '#/components/schemas/LikeDislikeRating-Output' + - $ref: '#/components/schemas/StarRating-Output' + - $ref: '#/components/schemas/ScoreRating-Output' + - $ref: '#/components/schemas/TagsRating-Output' + - $ref: '#/components/schemas/TextRating-Output' + - $ref: '#/components/schemas/ChoiceRating-Output' + - $ref: '#/components/schemas/TreeChoiceRating-Output' + title: Rating + discriminator: + propertyName: feedback_type + mapping: + choice: '#/components/schemas/ChoiceRating-Output' + like_dislike: '#/components/schemas/LikeDislikeRating-Output' + score: '#/components/schemas/ScoreRating-Output' + star: '#/components/schemas/StarRating-Output' + tags: '#/components/schemas/TagsRating-Output' + text: '#/components/schemas/TextRating-Output' + tree_choice: '#/components/schemas/TreeChoiceRating-Output' + created_at: + type: string + format: date-time + title: Created At + created_by: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Created By + type: object + required: + - rating + - created_at + - created_by + title: FeedbackRatingDB + FeedbackRatingInfo: + properties: + feedback_type: + $ref: '#/components/schemas/FeedbackType' + value: + anyOf: + - type: boolean + - type: integer + - type: string + - items: + type: string + maxLength: 255 + minLength: 1 + type: array + title: Value + explanation: + anyOf: + - type: string + - type: 'null' + title: Explanation + type: object + required: + - feedback_type + - value + - explanation + title: FeedbackRatingInfo + FeedbackType: + type: string + enum: + - like_dislike + - star + - score + - tags + - text + - choice + - tree_choice + title: FeedbackType + FewShotExample: + properties: + generation_prompt_and_response: + type: string + title: Generation Prompt And Response + evaluating_response: + type: string + title: Evaluating Response + type: object + required: + - generation_prompt_and_response + - evaluating_response + title: FewShotExample + description: Few-shot example for a chainpoll metric prompt. + FileContentPart: + properties: + type: + type: string + const: file + title: Type + default: file + file_id: + type: string + format: uuid4 + title: File Id + type: object + required: + - file_id + title: FileContentPart + description: 'Reference to a file associated with this message. + + + The file_id can be resolved via the ``files`` dict returned on + + trace/span detail responses, which contains metadata such as + + modality, MIME type, and a presigned download URL.' + FileMetadata: + properties: + file_id: + type: string + format: uuid4 + title: File Id + modality: + $ref: '#/components/schemas/ContentModality' + content_type: + anyOf: + - type: string + - type: 'null' + title: Content Type + url: + anyOf: + - type: string + - type: 'null' + title: Url + description: Presigned S3 URL or external URL + url_expires_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Url Expires At + description: Expiration time + size_bytes: + anyOf: + - type: integer + - type: 'null' + title: Size Bytes + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + source: + $ref: '#/components/schemas/FileSource' + status: + $ref: '#/components/schemas/FileStatus' + type: object + required: + - file_id + - modality + - source + - status + title: FileMetadata + description: 'Enriched file metadata returned to UI/SDK. + + + Contains presigned URLs and properties for displaying multimodal + + content in the Galileo console and SDKs.' + FileSource: + type: string + enum: + - direct_upload + - external_files_api + - external_url + - assembled_stream + title: FileSource + description: Source of the file data. + FileStatus: + type: string + enum: + - complete + - failed + - pending + - not_uploaded + title: FileStatus + description: Processing status of the file. + ? FilterExpression_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____ + : anyOf: + - $ref: '#/components/schemas/FilterLeaf_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - $ref: '#/components/schemas/AndNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - $ref: '#/components/schemas/OrNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - $ref: '#/components/schemas/NotNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + title: FilterExpressionLogRecordsFilter + ? FilterLeaf_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____ + : properties: + filter: + oneOf: + - $ref: '#/components/schemas/LogRecordsIDFilter' + - $ref: '#/components/schemas/LogRecordsDateFilter' + - $ref: '#/components/schemas/LogRecordsNumberFilter' + - $ref: '#/components/schemas/LogRecordsBooleanFilter' + - $ref: '#/components/schemas/LogRecordsCollectionFilter' + - $ref: '#/components/schemas/LogRecordsTextFilter' + - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + title: Filter + discriminator: + propertyName: type + mapping: + boolean: '#/components/schemas/LogRecordsBooleanFilter' + collection: '#/components/schemas/LogRecordsCollectionFilter' + date: '#/components/schemas/LogRecordsDateFilter' + fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + id: '#/components/schemas/LogRecordsIDFilter' + number: '#/components/schemas/LogRecordsNumberFilter' + text: '#/components/schemas/LogRecordsTextFilter' + type: object + required: + - filter + title: FilterLeafLogRecordsFilter + FineTunedScorerAction: + type: string + enum: + - update + - delete + title: FineTunedScorerAction + FineTunedScorerResponse: + properties: + id: + type: string + format: uuid4 + title: Id + name: + type: string + title: Name + lora_task_id: + type: integer + title: Lora Task Id + lora_weights_path: + anyOf: + - type: string + - type: 'null' + title: Lora Weights Path + prompt: + type: string + title: Prompt + luna_input_type: + anyOf: + - $ref: '#/components/schemas/LunaInputTypeEnum' + - type: 'null' + luna_output_type: + anyOf: + - $ref: '#/components/schemas/LunaOutputTypeEnum' + - type: 'null' + class_name_to_vocab_ix: + anyOf: + - additionalProperties: + items: + type: integer + type: array + uniqueItems: true + type: object + - additionalProperties: + type: integer + type: object + - type: 'null' + title: Class Name To Vocab Ix + executor: + anyOf: + - $ref: '#/components/schemas/ScorerName' + - type: 'null' + description: Executor pipeline. Defaults to finetuned scorer pipeline but + can run custom galileo score pipelines. + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + created_by: + type: string + format: uuid4 + title: Created By + type: object + required: + - id + - name + - lora_task_id + - prompt + - created_at + - updated_at + - created_by + title: FineTunedScorerResponse + GeneratedScorerAction: + type: string + enum: + - update + - delete + title: GeneratedScorerAction + GeneratedScorerConfiguration: + properties: + model_alias: + type: string + title: Model Alias + default: gpt-4.1-mini + num_judges: + type: integer + maximum: 10.0 + minimum: 1.0 + title: Num Judges + default: 3 + output_type: + $ref: '#/components/schemas/OutputTypeEnum' + description: Output type of the generated scorer. + default: boolean + scoreable_node_types: + items: + type: string + type: array + title: Scoreable Node Types + description: Types of nodes that can be scored by this scorer. + cot_enabled: + type: boolean + title: Cot Enabled + description: Whether chain of thought is enabled for this scorer. + default: false + ground_truth: + type: boolean + title: Ground Truth + description: Whether ground truth is enabled for this scorer. + default: false + multimodal_capabilities: + anyOf: + - items: + $ref: '#/components/schemas/MultimodalCapability' + type: array + - type: 'null' + title: Multimodal Capabilities + description: Multimodal capabilities required by this scorer. + type: object + title: GeneratedScorerConfiguration + GeneratedScorerResponse: + properties: + id: + type: string + format: uuid4 + title: Id + name: + type: string + title: Name + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + chain_poll_template: + $ref: '#/components/schemas/ChainPollTemplate' + user_prompt: + anyOf: + - type: string + - type: 'null' + title: User Prompt + created_by: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Created By + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + scoreable_node_types: + anyOf: + - items: + $ref: '#/components/schemas/NodeType' + type: array + - type: 'null' + title: Scoreable Node Types + scorer_configuration: + $ref: '#/components/schemas/GeneratedScorerConfiguration' + type: object + required: + - id + - name + - chain_poll_template + - created_by + - created_at + - updated_at + - scoreable_node_types + - scorer_configuration + title: GeneratedScorerResponse + GeneratedScorerValidationResponse: + properties: + task_result_id: + type: string + format: uuid4 + title: Task Result Id + type: object + required: + - task_result_id + title: GeneratedScorerValidationResponse + GenerationResponse: + properties: + task_result_id: + type: string + format: uuid4 + title: Task Result Id + type: object + required: + - task_result_id + title: GenerationResponse + GroundTruthAdherenceScorer: + properties: + name: + type: string + const: ground_truth_adherence + title: Name + default: ground_truth_adherence + filters: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' + type: array + - type: 'null' + title: Filters + description: List of filters to apply to the scorer. + type: + type: string + const: plus + title: Type + default: plus + model_name: + anyOf: + - type: string + - type: 'null' + title: Model Name + description: Alias of the model to use for the scorer. + num_judges: + anyOf: + - type: integer + maximum: 10.0 + minimum: 1.0 + - type: 'null' + title: Num Judges + description: Number of judges for the scorer. + type: object + title: GroundTruthAdherenceScorer + GroupAction: + type: string + enum: + - update + - list_members + - join + - request_to_join + title: GroupAction + GroupCollaborator: + properties: + id: + type: string + format: uuid4 + title: Id + permissions: + items: + $ref: '#/components/schemas/Permission' + type: array + title: Permissions + default: [] + role: + $ref: '#/components/schemas/CollaboratorRole' + created_at: + type: string + format: date-time + title: Created At + group_id: + type: string + format: uuid4 + title: Group Id + group_name: + type: string + title: Group Name + type: object + required: + - id + - role + - created_at + - group_id + - group_name + title: GroupCollaborator + GroupCollaboratorCreate: + properties: + role: + $ref: '#/components/schemas/CollaboratorRole' + default: viewer + group_id: + type: string + format: uuid4 + title: Group Id + type: object + required: + - group_id + title: GroupCollaboratorCreate + GroupMemberAction: + type: string + enum: + - update_role + - delete + title: GroupMemberAction + HTTPValidationError: + properties: + detail: + items: + $ref: '#/components/schemas/ValidationError' + type: array + title: Detail + type: object + title: HTTPValidationError + HallucinationSegment: + properties: + hallucination_severity: + type: integer + maximum: 2.0 + minimum: 0.0 + title: Hallucination Severity + default: 0 + start: + type: integer + title: Start + end: + type: integer + title: End + hallucination: + type: number + title: Hallucination + type: object + required: + - start + - end + - hallucination + title: HallucinationSegment + HealthScoreResult: + properties: + health_score_type: + anyOf: + - $ref: '#/components/schemas/HealthScoreType' + - type: 'null' + value: + anyOf: + - type: number + - type: 'null' + title: Value + description: Primary health score metric value, or None if no valid rows. + skipped_rows: + type: integer + title: Skipped Rows + description: Rows excluded because MGT or score could not be parsed. + secondary: + additionalProperties: + anyOf: + - type: number + - type: 'null' + type: object + title: Secondary + description: "Secondary metrics (MAE, RMSE, R², per-class F1, etc.)." + total_scored_rows: + type: integer + title: Total Scored Rows + description: Rows with a successful scorer result. + total_mgt_rows: + type: integer + title: Total Mgt Rows + description: Rows with a non-null MGT value after overlay. + joined_rows: + type: integer + title: Joined Rows + description: Rows with both a score and a MGT value (used for computation). + type: object + required: + - health_score_type + - value + - skipped_rows + - secondary + - total_scored_rows + - total_mgt_rows + - joined_rows + title: HealthScoreResult + HealthScoreType: + type: string + enum: + - macro_f1 + - micro_f1 + - mse + - mae + title: HealthScoreType + HealthcheckResponse: + properties: + api_version: + type: string + title: Api Version + message: + type: string + title: Message + version: + type: string + title: Version + type: object + required: + - api_version + - message + - version + title: HealthcheckResponse + Histogram: + properties: + strategy: + $ref: '#/components/schemas/HistogramStrategy' + description: The binning strategy used to create this histogram + edges: + items: + type: number + type: array + title: Edges + description: List of bin edges (monotonically increasing, length = number + of buckets + 1) + buckets: + items: + $ref: '#/components/schemas/HistogramBucket' + type: array + title: Buckets + description: List of histogram buckets containing the binned data + total: + type: integer + title: Total + description: Total number of data points in the histogram + type: object + required: + - strategy + - edges + - buckets + - total + title: Histogram + HistogramBucket: + properties: + lower: + type: number + title: Lower + description: Lower bound of the histogram bucket (inclusive) + upper: + type: number + title: Upper + description: Upper bound of the histogram bucket (exclusive, but inclusive + for the last bucket) + count: + type: integer + title: Count + description: Number of data points that fall within this bucket + type: object + required: + - lower + - upper + - count + title: HistogramBucket + HistogramStrategy: + type: string + enum: + - fixed + - trimmed + - quantile + title: HistogramStrategy + HttpSpan: + properties: + type: + type: string + const: http + title: Type + description: Type of the trace, span or session. + default: http + input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + title: Input + description: Input to the trace or span. + default: '' + redacted_input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - type: 'null' + title: Redacted Input + description: Redacted input of the trace or span. + output: + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Output + description: Output of the trace or span. + redacted_output: + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Redacted Output + description: Redacted output of the trace or span. + name: + type: string + title: Name + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: + anyOf: + - type: integer + - type: 'null' + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: + anyOf: + - type: string + - type: 'null' + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: + anyOf: + - type: string + - type: 'null' + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: + anyOf: + - type: string + - type: 'null' + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: ID + description: Galileo ID of the session, trace or span + session_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session ID + description: Galileo ID of the session containing the trace or span or session + trace_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + step_number: + anyOf: + - type: integer + - type: 'null' + title: Step Number + description: Topological step number of the span. + parent_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Parent ID + description: Galileo ID of the parent of this span + spans: + items: + oneOf: + - $ref: '#/components/schemas/AgentSpan' + - $ref: '#/components/schemas/WorkflowSpan' + - $ref: '#/components/schemas/LlmSpan' + - $ref: '#/components/schemas/RetrieverSpan' + - $ref: '#/components/schemas/ToolSpan' + - $ref: '#/components/schemas/ControlSpan' + - $ref: '#/components/schemas/HttpSpan' + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/AgentSpan' + control: '#/components/schemas/ControlSpan' + http: '#/components/schemas/HttpSpan' + llm: '#/components/schemas/LlmSpan' + retriever: '#/components/schemas/RetrieverSpan' + tool: '#/components/schemas/ToolSpan' + workflow: '#/components/schemas/WorkflowSpan' + type: array + title: Spans + description: Child spans. + type: object + title: HttpSpan + ImageGenerationEvent: + properties: + type: + type: string + const: image_generation + title: Type + default: image_generation + id: + anyOf: + - type: string + - type: 'null' + title: Id + description: Unique identifier for the event + status: + anyOf: + - $ref: '#/components/schemas/EventStatus' + - type: 'null' + description: Status of the event + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Provider-specific metadata and additional fields + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message if the event failed + prompt: + anyOf: + - type: string + - type: 'null' + title: Prompt + description: The prompt used for image generation + images: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Images + description: Generated images with URLs or base64 data + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: Image generation model used + type: object + title: ImageGenerationEvent + description: An image generation event from the model. + InputMap: + properties: + prompt: + type: string + title: Prompt + prefix: + type: string + title: Prefix + default: '' + suffix: + type: string + title: Suffix + default: '' + type: object + required: + - prompt + title: InputMap + InputPIIScorer: + properties: + name: + type: string + const: input_pii + title: Name + default: input_pii + filters: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' + type: array + - type: 'null' + title: Filters + description: List of filters to apply to the scorer. + type: object + title: InputPIIScorer + InputSexistScorer: + properties: + name: + type: string + const: input_sexist + title: Name + default: input_sexist + filters: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' + type: array + - type: 'null' + title: Filters + description: List of filters to apply to the scorer. + type: + type: string + enum: + - luna + - plus + title: Type + default: luna + model_name: + anyOf: + - type: string + - type: 'null' + title: Model Name + description: Alias of the model to use for the scorer. + num_judges: + anyOf: + - type: integer + maximum: 10.0 + minimum: 1.0 + - type: 'null' + title: Num Judges + description: Number of judges for the scorer. + type: object + title: InputSexistScorer + InputToneScorer: + properties: + name: + type: string + const: input_tone + title: Name + default: input_tone + filters: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' + type: array + - type: 'null' + title: Filters + description: List of filters to apply to the scorer. + type: object + title: InputToneScorer + InputToxicityScorer: + properties: + name: + type: string + const: input_toxicity + title: Name + default: input_toxicity + filters: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' + type: array + - type: 'null' + title: Filters + description: List of filters to apply to the scorer. + type: + type: string + enum: + - luna + - plus + title: Type + default: luna + model_name: + anyOf: + - type: string + - type: 'null' + title: Model Name + description: Alias of the model to use for the scorer. + num_judges: + anyOf: + - type: integer + maximum: 10.0 + minimum: 1.0 + - type: 'null' + title: Num Judges + description: Number of judges for the scorer. + type: object + title: InputToxicityScorer + InputTypeEnum: + type: string + enum: + - basic + - llm_spans + - retriever_spans + - sessions_normalized + - sessions_trace_io_only + - tool_spans + - trace_input_only + - trace_io_only + - trace_normalized + - trace_output_only + - agent_spans + - workflow_spans + - trace_selected_spans + title: InputTypeEnum + description: Enumeration of input types. + InsightSummary: + properties: + id: + type: string + format: uuid4 + title: Id + description: Signal ID. + title: + type: string + title: Title + observation: + type: string + title: Observation + details: + type: string + title: Details + suggested_action: + type: string + title: Suggested Action + priority: + type: integer + title: Priority + priority_category: + anyOf: + - type: string + enum: + - error + - warning + - info + - type: 'null' + title: Priority Category + label: + anyOf: + - type: string + enum: + - Instruction + - Retrieval + - Decision + - Output + - Tool + - Reliability + - Security + - Efficiency + - type: 'null' + title: Label + type: object + required: + - id + - title + - observation + - details + - suggested_action + - priority + title: InsightSummary + InsightType: + type: string + enum: + - vertical_bar + - horizontal_bar + title: InsightType + InstructionAdherenceScorer: + properties: + name: + type: string + const: instruction_adherence + title: Name + default: instruction_adherence + filters: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' + type: array + - type: 'null' + title: Filters + description: List of filters to apply to the scorer. + type: + type: string + const: plus + title: Type + default: plus + model_name: + anyOf: + - type: string + - type: 'null' + title: Model Name + description: Alias of the model to use for the scorer. + num_judges: + anyOf: + - type: integer + maximum: 10.0 + minimum: 1.0 + - type: 'null' + title: Num Judges + description: Number of judges for the scorer. + type: object + title: InstructionAdherenceScorer + IntegrationAction: + type: string + enum: + - update + - delete + - share + - read_secrets + title: IntegrationAction + IntegrationCostsDataPoint: + properties: + timestamp: + type: string + format: date-time + title: Timestamp + cost: + type: number + title: Cost + type: object + required: + - timestamp + - cost + title: IntegrationCostsDataPoint + IntegrationCostsResponse: + properties: + features: + items: + $ref: '#/components/schemas/FeatureIntegrationCosts' + type: array + title: Features + type: object + title: IntegrationCostsResponse + IntegrationDB: + properties: + id: + type: string + format: uuid4 + title: Id + permissions: + items: + $ref: '#/components/schemas/Permission' + type: array + title: Permissions + default: [] + name: + type: string + title: Name + provider: + $ref: '#/components/schemas/IntegrationProvider' + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + created_by: + type: string + format: uuid4 + title: Created By + is_selected: + type: boolean + title: Is Selected + default: false + is_disabled: + type: boolean + title: Is Disabled + default: false + type: object + required: + - id + - name + - provider + - created_at + - updated_at + - created_by + title: IntegrationDB + IntegrationDisableRequest: + properties: + integration_name: + type: string + title: Integration Name + type: object + required: + - integration_name + title: IntegrationDisableRequest + IntegrationModelsResponse: + properties: + integration_name: + type: string + title: Integration Name + integration_id: + type: string + format: uuid4 + title: Integration Id + provider: + $ref: '#/components/schemas/IntegrationProvider' + models: + items: + type: string + type: array + title: Models + scorer_models: + items: + type: string + type: array + title: Scorer Models + recommended_models: + additionalProperties: + items: + type: string + type: array + propertyNames: + $ref: '#/components/schemas/RecommendedModelPurpose' + type: object + title: Recommended Models + supports_num_judges: + type: boolean + title: Supports Num Judges + default: true + supports_file_uploads: + type: boolean + title: Supports File Uploads + default: false + model_properties: + items: + $ref: '#/components/schemas/api__schemas__integration__llm_integration__ModelProperties' + type: array + title: Model Properties + type: object + required: + - integration_name + - integration_id + - provider + - models + - scorer_models + title: IntegrationModelsResponse + IntegrationProvider: + type: string + enum: + - anthropic + - aws_bedrock + - aws_sagemaker + - azure + - custom + - databricks + - luna + - mistral + - nvidia + - openai + - typesafe + - vegas_gateway + - vertex_ai + - writer + title: IntegrationProvider + IntegrationSelectRequest: + properties: + integration_name: + type: string + title: Integration Name + integration_id: + type: string + format: uuid4 + title: Integration Id + type: object + required: + - integration_name + - integration_id + title: IntegrationSelectRequest + InternalToolCall: + properties: + type: + type: string + const: internal_tool_call + title: Type + default: internal_tool_call + id: + anyOf: + - type: string + - type: 'null' + title: Id + description: Unique identifier for the event + status: + anyOf: + - $ref: '#/components/schemas/EventStatus' + - type: 'null' + description: Status of the event + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Provider-specific metadata and additional fields + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message if the event failed + name: + type: string + title: Name + description: Name of the internal tool (e.g., 'web_search', 'code_interpreter', + 'file_search') + input: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Input + description: Input/arguments to the tool call + output: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Output + description: Output/results from the tool call + type: object + required: + - name + title: InternalToolCall + description: 'A tool call executed internally by the model during reasoning. + + + This represents internal tools like web search, code execution, file search, + etc. + + that the model invokes (not user-defined functions or MCP tools).' + InvalidResult: + properties: + result_type: + type: string + const: invalid + title: Result Type + default: invalid + error_message: + type: string + title: Error Message + error_code: + anyOf: + - type: string + const: environment_preparing + - type: 'null' + title: Error Code + type: object + required: + - error_message + title: InvalidResult + InvokeResponse: + properties: + status: + $ref: '#/components/schemas/ExecutionStatus' + default: skipped + api_version: + type: string + title: Api Version + default: 1.0.0 + text: + type: string + title: Text + description: Text from the request after processing the rules. + trace_metadata: + $ref: '#/components/schemas/TraceMetadata' + stage_metadata: + $ref: '#/components/schemas/StageMetadata' + ruleset_results: + items: + $ref: '#/components/schemas/RulesetResult' + type: array + title: Ruleset Results + description: Results of the rule execution. + metric_results: + additionalProperties: + $ref: '#/components/schemas/MetricComputation' + type: object + title: Metric Results + description: Results of the metric computation. + action_result: + $ref: '#/components/schemas/ActionResult' + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata + description: Optional additional metadata. This being echoed back from the + request. + headers: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Headers + description: Optional additional HTTP headers that should be included in + the response. + type: object + required: + - text + - trace_metadata + - stage_metadata + - action_result + title: InvokeResponse + JobProgress: + properties: + progress_message: + anyOf: + - type: string + - type: 'null' + title: Progress Message + steps_completed: + anyOf: + - type: integer + - type: 'null' + title: Steps Completed + steps_total: + anyOf: + - type: integer + - type: 'null' + title: Steps Total + type: object + title: JobProgress + JsonPrimitive: + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: 'null' + LLMExportFormat: + type: string + enum: + - csv + - jsonl + - jsonl_flat + title: LLMExportFormat + LLMIntegration: + type: string + enum: + - anthropic + - aws_bedrock + - aws_sagemaker + - azure + - custom + - databricks + - mistral + - nvidia + - openai + - vegas_gateway + - vertex_ai + - writer + title: LLMIntegration + LLMScorerLogRecordConfiguration: + properties: + model_alias: + type: string + title: Model Alias + default: gpt-4.1-mini + num_judges: + type: integer + maximum: 10.0 + minimum: 1.0 + title: Num Judges + default: 3 + output_type: + $ref: '#/components/schemas/OutputTypeEnum' + description: Output type of the generated scorer. + default: boolean + scoreable_node_types: + items: + type: string + type: array + title: Scoreable Node Types + description: Types of nodes that can be scored by this scorer. + cot_enabled: + type: boolean + title: Cot Enabled + description: Whether chain of thought is enabled for this scorer. + default: false + ground_truth: + type: boolean + title: Ground Truth + description: Whether ground truth is enabled for this scorer. + default: false + multimodal_capabilities: + anyOf: + - items: + $ref: '#/components/schemas/MultimodalCapability' + type: array + - type: 'null' + title: Multimodal Capabilities + description: Multimodal capabilities required by this scorer. + input_type: + anyOf: + - $ref: '#/components/schemas/InputTypeEnum' + - type: 'null' + metadata_selection: + anyOf: + - $ref: '#/components/schemas/ScorerMetadataSelection' + - type: 'null' + type: object + title: LLMScorerLogRecordConfiguration + LeftOutReason: + type: string + enum: + - child_of_leaf_span + - unreachable + - no_trace_row + title: LeftOutReason + description: Why ``create_trace_tree`` left a span out of every tree. + LikeDislikeAggregate: + properties: + feedback_type: + type: string + const: like_dislike + title: Feedback Type + default: like_dislike + like_count: + type: integer + title: Like Count + dislike_count: + type: integer + title: Dislike Count + unrated_count: + type: integer + title: Unrated Count + type: object + required: + - like_count + - dislike_count + - unrated_count + title: LikeDislikeAggregate + LikeDislikeConstraints: + properties: + annotation_type: + type: string + const: like_dislike + title: Annotation Type + type: object + required: + - annotation_type + title: LikeDislikeConstraints + LikeDislikeRating-Output: + properties: + feedback_type: + type: string + const: like_dislike + title: Feedback Type + default: like_dislike + value: + type: boolean + title: Value + type: object + required: + - value + title: LikeDislikeRating + ListAnnotationQueueCollaboratorsResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + collaborators: + items: + $ref: '#/components/schemas/UserAnnotationQueueCollaborator' + type: array + title: Collaborators + type: object + required: + - collaborators + title: ListAnnotationQueueCollaboratorsResponse + ListAnnotationQueueParams: + properties: + filters: + items: + oneOf: + - $ref: '#/components/schemas/AnnotationQueueIDFilter' + - $ref: '#/components/schemas/AnnotationQueueNameFilter' + - $ref: '#/components/schemas/AnnotationQueueProjectFilter' + - $ref: '#/components/schemas/AnnotationQueueCreatedAtFilter' + - $ref: '#/components/schemas/AnnotationQueueUpdatedAtFilter' + - $ref: '#/components/schemas/AnnotationQueueNumLogRecordsFilter' + - $ref: '#/components/schemas/AnnotationQueueNumAnnotatorsFilter' + - $ref: '#/components/schemas/AnnotationQueueNumUsersFilter' + - $ref: '#/components/schemas/AnnotationQueueOverallProgressFilter' + - $ref: '#/components/schemas/AnnotationQueueNumTemplatesFilter' + discriminator: + propertyName: name + mapping: + created_at: '#/components/schemas/AnnotationQueueCreatedAtFilter' + id: '#/components/schemas/AnnotationQueueIDFilter' + name: '#/components/schemas/AnnotationQueueNameFilter' + num_annotators: '#/components/schemas/AnnotationQueueNumAnnotatorsFilter' + num_log_records: '#/components/schemas/AnnotationQueueNumLogRecordsFilter' + num_templates: '#/components/schemas/AnnotationQueueNumTemplatesFilter' + num_users: '#/components/schemas/AnnotationQueueNumUsersFilter' + overall_progress: '#/components/schemas/AnnotationQueueOverallProgressFilter' + project_id: '#/components/schemas/AnnotationQueueProjectFilter' + updated_at: '#/components/schemas/AnnotationQueueUpdatedAtFilter' + type: array + title: Filters + sort: + anyOf: + - oneOf: + - $ref: '#/components/schemas/AnnotationQueueNameSort' + - $ref: '#/components/schemas/AnnotationQueueCreatedAtSort' + - $ref: '#/components/schemas/AnnotationQueueUpdatedAtSort' + - $ref: '#/components/schemas/AnnotationQueueCreatedBySort' + - $ref: '#/components/schemas/AnnotationQueueNumUsersSort' + - $ref: '#/components/schemas/AnnotationQueueNumLogRecordsSort' + - $ref: '#/components/schemas/AnnotationQueueNumTemplatesSort' + - $ref: '#/components/schemas/AnnotationQueueNumAnnotatorsSort' + - $ref: '#/components/schemas/AnnotationQueueOverallProgressSort' + discriminator: + propertyName: name + mapping: + created_at: '#/components/schemas/AnnotationQueueCreatedAtSort' + created_by: '#/components/schemas/AnnotationQueueCreatedBySort' + name: '#/components/schemas/AnnotationQueueNameSort' + num_annotators: '#/components/schemas/AnnotationQueueNumAnnotatorsSort' + num_log_records: '#/components/schemas/AnnotationQueueNumLogRecordsSort' + num_templates: '#/components/schemas/AnnotationQueueNumTemplatesSort' + num_users: '#/components/schemas/AnnotationQueueNumUsersSort' + overall_progress: '#/components/schemas/AnnotationQueueOverallProgressSort' + updated_at: '#/components/schemas/AnnotationQueueUpdatedAtSort' + - type: 'null' + title: Sort + default: None + type: object + title: ListAnnotationQueueParams + ListAnnotationQueueResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + annotation_queues: + items: + $ref: '#/components/schemas/AnnotationQueueResponse' + type: array + title: Annotation Queues + type: object + required: + - annotation_queues + title: ListAnnotationQueueResponse + ListDatasetParams: + properties: + filters: + items: + oneOf: + - $ref: '#/components/schemas/DatasetNameFilter' + - $ref: '#/components/schemas/DatasetDraftFilter' + - $ref: '#/components/schemas/DatasetUsedInProjectFilter' + - $ref: '#/components/schemas/DatasetIDFilter' + - $ref: '#/components/schemas/DatasetNotInProjectFilter' + discriminator: + propertyName: name + mapping: + draft: '#/components/schemas/DatasetDraftFilter' + id: '#/components/schemas/DatasetIDFilter' + name: '#/components/schemas/DatasetNameFilter' + not_in_project: '#/components/schemas/DatasetNotInProjectFilter' + used_in_project: '#/components/schemas/DatasetUsedInProjectFilter' + type: array + title: Filters + sort: + anyOf: + - oneOf: + - $ref: '#/components/schemas/DatasetNameSort' + - $ref: '#/components/schemas/DatasetCreatedAtSort' + - $ref: '#/components/schemas/DatasetUpdatedAtSort' + - $ref: '#/components/schemas/DatasetProjectLastUsedAtSort' + - $ref: '#/components/schemas/DatasetProjectsSort' + - $ref: '#/components/schemas/DatasetRowsSort' + - $ref: '#/components/schemas/DatasetLastEditedByUserAtSort' + discriminator: + propertyName: name + mapping: + created_at: '#/components/schemas/DatasetCreatedAtSort' + last_edited_by_user_at: '#/components/schemas/DatasetLastEditedByUserAtSort' + name: '#/components/schemas/DatasetNameSort' + num_rows: '#/components/schemas/DatasetRowsSort' + project_count: '#/components/schemas/DatasetProjectsSort' + project_last_used_at: '#/components/schemas/DatasetProjectLastUsedAtSort' + updated_at: '#/components/schemas/DatasetUpdatedAtSort' + - type: 'null' + title: Sort + default: None + type: object + title: ListDatasetParams + ListDatasetProjectsResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + projects: + items: + $ref: '#/components/schemas/DatasetProject' + type: array + title: Projects + type: object + title: ListDatasetProjectsResponse + ListDatasetResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + datasets: + items: + $ref: '#/components/schemas/DatasetDB' + type: array + title: Datasets + type: object + title: ListDatasetResponse + ListDatasetVersionParams: + properties: + sort: + anyOf: + - oneOf: + - $ref: '#/components/schemas/DatasetVersionIndexSort' + discriminator: + propertyName: name + mapping: + version_index: '#/components/schemas/DatasetVersionIndexSort' + - type: 'null' + title: Sort + type: object + title: ListDatasetVersionParams + ListDatasetVersionResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + versions: + items: + $ref: '#/components/schemas/DatasetVersionDB' + type: array + title: Versions + type: object + required: + - versions + title: ListDatasetVersionResponse + ListExperimentResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + experiments: + items: + $ref: '#/components/schemas/ExperimentResponse' + type: array + title: Experiments + type: object + title: ListExperimentResponse + ListGroupCollaboratorsResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + collaborators: + items: + $ref: '#/components/schemas/GroupCollaborator' + type: array + title: Collaborators + type: object + required: + - collaborators + title: ListGroupCollaboratorsResponse + ListLogStreamResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + log_streams: + items: + $ref: '#/components/schemas/LogStreamResponse' + type: array + title: Log Streams + type: object + required: + - log_streams + title: ListLogStreamResponse + ListProjectGroupCollaboratorsResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + collaborators: + items: + $ref: '#/components/schemas/ProjectGroupCollaborator' + type: array + title: Collaborators + type: object + required: + - collaborators + title: ListProjectGroupCollaboratorsResponse + ListProjectUserCollaboratorsResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + collaborators: + items: + $ref: '#/components/schemas/ProjectUserCollaborator' + type: array + title: Collaborators + type: object + required: + - collaborators + title: ListProjectUserCollaboratorsResponse + ListPromptTemplateParams: + properties: + filters: + items: + oneOf: + - $ref: '#/components/schemas/PromptTemplateNameFilter' + - $ref: '#/components/schemas/PromptTemplateCreatedByFilter' + - $ref: '#/components/schemas/PromptTemplateUsedInProjectFilter' + - $ref: '#/components/schemas/PromptTemplateNotInProjectFilter' + discriminator: + propertyName: name + mapping: + creator: '#/components/schemas/PromptTemplateCreatedByFilter' + name: '#/components/schemas/PromptTemplateNameFilter' + not_in_project: '#/components/schemas/PromptTemplateNotInProjectFilter' + used_in_project: '#/components/schemas/PromptTemplateUsedInProjectFilter' + type: array + title: Filters + sort: + anyOf: + - oneOf: + - $ref: '#/components/schemas/PromptTemplateNameSort' + - $ref: '#/components/schemas/PromptTemplateCreatedAtSort' + - $ref: '#/components/schemas/PromptTemplateUpdatedAtSort' + discriminator: + propertyName: name + mapping: + created_at: '#/components/schemas/PromptTemplateCreatedAtSort' + name: '#/components/schemas/PromptTemplateNameSort' + updated_at: '#/components/schemas/PromptTemplateUpdatedAtSort' + - type: 'null' + title: Sort + default: None + type: object + title: ListPromptTemplateParams + ListPromptTemplateResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + templates: + items: + $ref: '#/components/schemas/BasePromptTemplateResponse' + type: array + title: Templates + type: object + title: ListPromptTemplateResponse + ListPromptTemplateVersionParams: + properties: + sort: + anyOf: + - oneOf: + - $ref: '#/components/schemas/PromptTemplateVersionNumberSort' + - $ref: '#/components/schemas/PromptTemplateVersionCreatedAtSort' + - $ref: '#/components/schemas/PromptTemplateVersionUpdatedAtSort' + discriminator: + propertyName: name + mapping: + created_at: '#/components/schemas/PromptTemplateVersionCreatedAtSort' + updated_at: '#/components/schemas/PromptTemplateVersionUpdatedAtSort' + version: '#/components/schemas/PromptTemplateVersionNumberSort' + - type: 'null' + title: Sort + type: object + title: ListPromptTemplateVersionParams + ListPromptTemplateVersionResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + versions: + items: + $ref: '#/components/schemas/BasePromptTemplateVersionResponse' + type: array + title: Versions + type: object + title: ListPromptTemplateVersionResponse + ListScorerVersionsResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + versions: + items: + $ref: '#/components/schemas/ScorerVersionListItem' + type: array + title: Versions + type: object + title: ListScorerVersionsResponse + ListScorersRequest: + properties: + filters: + items: + oneOf: + - $ref: '#/components/schemas/ScorerNameFilter' + - $ref: '#/components/schemas/ScorerTypeFilter' + - $ref: '#/components/schemas/ScorerModelTypeFilter' + - $ref: '#/components/schemas/ScorerExcludeSlmScorersFilter' + - $ref: '#/components/schemas/ScorerExcludeNonO11ySlmScorersFilter' + - $ref: '#/components/schemas/ScorerExcludeMultimodalScorersFilter' + - $ref: '#/components/schemas/ScorerTagsFilter' + - $ref: '#/components/schemas/ScorerCreatorFilter' + - $ref: '#/components/schemas/ScorerCreatedAtFilter' + - $ref: '#/components/schemas/ScorerUpdatedAtFilter' + - $ref: '#/components/schemas/ScorerLabelFilter' + - $ref: '#/components/schemas/ScorerScoreableNodeTypesFilter' + - $ref: '#/components/schemas/ScorerMultimodalCapabilitiesFilter' + - $ref: '#/components/schemas/ScorerIDFilter' + - $ref: '#/components/schemas/ScorerIsGlobalFilter' + - $ref: '#/components/schemas/ScorerScopeProjectsFilter' + discriminator: + propertyName: name + mapping: + created_at: '#/components/schemas/ScorerCreatedAtFilter' + creator: '#/components/schemas/ScorerCreatorFilter' + exclude_multimodal_scorers: '#/components/schemas/ScorerExcludeMultimodalScorersFilter' + exclude_non_o11y_slm_scorers: '#/components/schemas/ScorerExcludeNonO11ySlmScorersFilter' + exclude_slm_scorers: '#/components/schemas/ScorerExcludeSlmScorersFilter' + id: '#/components/schemas/ScorerIDFilter' + is_global: '#/components/schemas/ScorerIsGlobalFilter' + label: '#/components/schemas/ScorerLabelFilter' + model_type: '#/components/schemas/ScorerModelTypeFilter' + multimodal_capabilities: '#/components/schemas/ScorerMultimodalCapabilitiesFilter' + name: '#/components/schemas/ScorerNameFilter' + scope_projects: '#/components/schemas/ScorerScopeProjectsFilter' + scoreable_node_types: '#/components/schemas/ScorerScoreableNodeTypesFilter' + scorer_type: '#/components/schemas/ScorerTypeFilter' + tags: '#/components/schemas/ScorerTagsFilter' + updated_at: '#/components/schemas/ScorerUpdatedAtFilter' + type: array + title: Filters + sort: + anyOf: + - oneOf: + - $ref: '#/components/schemas/ScorerNameSort' + - $ref: '#/components/schemas/ScorerUpdatedAtSort' + - $ref: '#/components/schemas/ScorerEnabledInRunSort' + - $ref: '#/components/schemas/ScorerEnabledInPlaygroundSort' + discriminator: + propertyName: name + mapping: + enabled_in_playground: '#/components/schemas/ScorerEnabledInPlaygroundSort' + enabled_in_run: '#/components/schemas/ScorerEnabledInRunSort' + name: '#/components/schemas/ScorerNameSort' + updated_at: '#/components/schemas/ScorerUpdatedAtSort' + - type: 'null' + title: Sort + type: object + title: ListScorersRequest + ListScorersResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + scorers: + items: + $ref: '#/components/schemas/ScorerResponse' + type: array + title: Scorers + type: object + title: ListScorersResponse + ListStageResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + stages: + items: + $ref: '#/components/schemas/StageDB' + type: array + title: Stages + type: object + required: + - stages + title: ListStageResponse + ListUserCollaboratorsResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + collaborators: + items: + $ref: '#/components/schemas/UserCollaborator' + type: array + title: Collaborators + type: object + required: + - collaborators + title: ListUserCollaboratorsResponse + LlmMetrics: + properties: + duration_ns: + anyOf: + - type: integer + - type: 'null' + title: Duration Ns + description: Duration of the trace or span in nanoseconds. Displayed as + 'Latency' in Galileo. + num_input_tokens: + anyOf: + - type: integer + - type: 'null' + title: Num Input Tokens + description: Number of input tokens. + num_output_tokens: + anyOf: + - type: integer + - type: 'null' + title: Num Output Tokens + description: Number of output tokens. + num_total_tokens: + anyOf: + - type: integer + - type: 'null' + title: Num Total Tokens + description: Total number of tokens. + time_to_first_token_ns: + anyOf: + - type: integer + - type: 'null' + title: Time To First Token Ns + description: Time until the first token was generated in nanoseconds. + num_image_input_tokens: + anyOf: + - type: integer + - type: 'null' + title: Num Image Input Tokens + description: Number of image input tokens. + num_audio_input_tokens: + anyOf: + - type: integer + - type: 'null' + title: Num Audio Input Tokens + description: Number of audio input tokens. + num_audio_output_tokens: + anyOf: + - type: integer + - type: 'null' + title: Num Audio Output Tokens + description: Number of audio output tokens. + num_image_output_tokens: + anyOf: + - type: integer + - type: 'null' + title: Num Image Output Tokens + description: Number of image output tokens. + additionalProperties: true + type: object + title: LlmMetrics + LlmSpan: + properties: + type: + type: string + const: llm + title: Type + description: Type of the trace, span or session. + default: llm + input: + items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + title: Input + description: Input to the trace or span. + redacted_input: + anyOf: + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - type: 'null' + title: Redacted Input + description: Redacted input of the trace or span. + output: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + description: Output of the trace or span. + redacted_output: + anyOf: + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - type: 'null' + description: Redacted output of the trace or span. + name: + type: string + title: Name + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: + anyOf: + - type: integer + - type: 'null' + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/LlmMetrics' + description: Metrics associated with this trace or span. + external_id: + anyOf: + - type: string + - type: 'null' + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: + anyOf: + - type: string + - type: 'null' + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: + anyOf: + - type: string + - type: 'null' + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: ID + description: Galileo ID of the session, trace or span + session_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session ID + description: Galileo ID of the session containing the trace or span or session + trace_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + step_number: + anyOf: + - type: integer + - type: 'null' + title: Step Number + description: Topological step number of the span. + parent_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Parent ID + description: Galileo ID of the parent of this span + tools: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Tools + description: List of available tools passed to the LLM on invocation. + events: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/MessageEvent' + - $ref: '#/components/schemas/ReasoningEvent' + - $ref: '#/components/schemas/InternalToolCall' + - $ref: '#/components/schemas/WebSearchCallEvent' + - $ref: '#/components/schemas/ImageGenerationEvent' + - $ref: '#/components/schemas/MCPCallEvent' + - $ref: '#/components/schemas/MCPListToolsEvent' + - $ref: '#/components/schemas/MCPApprovalRequestEvent' + discriminator: + propertyName: type + mapping: + image_generation: '#/components/schemas/ImageGenerationEvent' + internal_tool_call: '#/components/schemas/InternalToolCall' + mcp_approval_request: '#/components/schemas/MCPApprovalRequestEvent' + mcp_call: '#/components/schemas/MCPCallEvent' + mcp_list_tools: '#/components/schemas/MCPListToolsEvent' + message: '#/components/schemas/MessageEvent' + reasoning: '#/components/schemas/ReasoningEvent' + web_search_call: '#/components/schemas/WebSearchCallEvent' + type: array + - type: 'null' + title: Events + description: List of reasoning, internal tool call, or MCP events that occurred + during the LLM span. + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: Model used for this span. + provider: + anyOf: + - type: string + - type: 'null' + title: Provider + description: Provider used for this span. + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Temperature used for generation. + finish_reason: + anyOf: + - type: string + - type: 'null' + title: Finish Reason + description: Reason for finishing. + type: object + title: LlmSpan + LogRecordsAvailableColumnsRequest: + properties: + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + start_time: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Start Time + end_time: + anyOf: + - type: string + format: date-time + - type: 'null' + title: End Time + type: object + title: LogRecordsAvailableColumnsRequest + examples: + - log_stream_id: 00000000-0000-0000-0000-000000000000 + LogRecordsAvailableColumnsResponse: + properties: + columns: + items: + $ref: '#/components/schemas/LogRecordsColumnInfo' + type: array + title: Columns + type: object + title: LogRecordsAvailableColumnsResponse + examples: + - columns: + - applicable_types: - agent + - control + - http + - llm + - retriever - session - tool - - http + - trace + - workflow category: standard data_type: text description: Input to the trace or span. @@ -27290,15 +31431,15 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent + - control + - http + - llm + - retriever - session - tool - - http + - trace + - workflow category: standard data_type: text description: Output of the trace or span. @@ -27312,15 +31453,15 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent + - control + - http + - llm + - retriever - session - tool - - http + - trace + - workflow category: standard data_type: text description: Name of the trace, span or session. @@ -27334,15 +31475,15 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent + - control + - http + - llm + - retriever - session - tool - - http + - trace + - workflow category: standard data_type: timestamp description: Timestamp of the trace or span's creation. @@ -27356,14 +31497,14 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent - - tool + - control - http + - llm + - retriever + - tool + - trace + - workflow category: standard data_type: string_list description: Tags associated with this trace or span. @@ -27377,14 +31518,14 @@ components: multi_valued: true sortable: false - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent - - tool + - control - http + - llm + - retriever + - tool + - trace + - workflow category: standard data_type: integer description: Status code of the trace or span. Used for logging failure @@ -27399,15 +31540,15 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent + - control + - http + - llm + - retriever - session - tool - - http + - trace + - workflow category: standard data_type: text description: A user-provided session, trace or span ID. @@ -27421,14 +31562,14 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent - - tool + - control - http + - llm + - retriever + - tool + - trace + - workflow category: standard data_type: text description: Input to the dataset associated with this trace @@ -27442,14 +31583,14 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent - - tool + - control - http + - llm + - retriever + - tool + - trace + - workflow category: standard data_type: text description: Output from the dataset associated with this trace @@ -27463,15 +31604,15 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent + - control + - http + - llm + - retriever - session - tool - - http + - trace + - workflow category: standard data_type: uuid description: Galileo ID of the session, trace or span @@ -27485,14 +31626,14 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent - - tool + - control - http + - llm + - retriever + - tool + - trace + - workflow category: standard data_type: uuid description: Galileo ID of the session containing the trace (or the @@ -27507,14 +31648,14 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent - - tool + - control - http + - llm + - retriever + - tool + - trace + - workflow category: standard data_type: uuid description: Galileo ID of the project associated with this trace or @@ -27529,14 +31670,14 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent - - tool + - control - http + - llm + - retriever + - tool + - trace + - workflow category: standard data_type: uuid description: Galileo ID of the run (log stream or experiment) associated @@ -27551,14 +31692,14 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent - - tool + - control - http + - llm + - retriever + - tool + - trace + - workflow category: standard data_type: timestamp description: Timestamp of the session or trace or span's last update @@ -27572,14 +31713,14 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent - - tool + - control - http + - llm + - retriever + - tool + - trace + - workflow category: standard data_type: boolean description: Whether or not this trace or span has child spans @@ -27593,15 +31734,15 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent + - control + - http + - llm + - retriever - session - tool - - http + - trace + - workflow category: standard data_type: text description: Runner progress text written directly to CH span @@ -27615,15 +31756,15 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent + - control + - http + - llm + - retriever - session - tool - - http + - trace + - workflow category: standard data_type: text description: Runner error text written directly to CH span @@ -27652,14 +31793,14 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - - trace - agent - - tool + - control - http + - llm + - retriever + - tool + - trace + - workflow category: standard data_type: boolean description: Whether the parent trace is complete or not @@ -27673,23 +31814,23 @@ components: multi_valued: false sortable: true - allowed_values: - - workflow - - retriever - - llm - - control - - trace - agent + - control + - http + - llm + - retriever - session - tool - - http - applicable_types: + - trace - workflow - - retriever - - llm - - control + applicable_types: - agent - - tool + - control - http + - llm + - retriever + - tool + - workflow category: standard data_type: text description: Type of the trace, span or session. @@ -27703,13 +31844,13 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - agent - - tool + - control - http + - llm + - retriever + - tool + - workflow category: standard data_type: uuid description: Galileo ID of the trace containing the span (or the same @@ -27724,13 +31865,13 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - agent - - tool + - control - http + - llm + - retriever + - tool + - workflow category: standard data_type: uuid description: Galileo ID of the parent of this span @@ -27744,13 +31885,13 @@ components: multi_valued: false sortable: true - applicable_types: - - workflow - - retriever - - llm - - control - agent - - tool + - control - http + - llm + - retriever + - tool + - workflow category: standard data_type: integer description: Topological step number of the span. @@ -27765,12 +31906,12 @@ components: sortable: true - allowed_values: - classifier + - default + - judge + - planner - react - - router - reflection - - planner - - judge - - default + - router - supervisor applicable_types: - agent @@ -27901,8 +32042,8 @@ components: multi_valued: false sortable: true - allowed_values: - - pre - post + - pre applicable_types: - control category: standard @@ -27919,11 +32060,11 @@ components: multi_valued: false sortable: true - allowed_values: - - trace_call - - retriever_call - llm_call - - tool_call + - retriever_call - session_call + - tool_call + - trace_call applicable_types: - control category: standard @@ -27998,1034 +32139,4455 @@ components: inverted: true LogRecordsBooleanFilter: properties: - column_id: + column_id: + type: string + title: Column Id + description: ID of the column to filter. + operator: + type: string + enum: + - eq + - ne + title: Operator + default: eq + value: + type: boolean + title: Value + type: + type: string + const: boolean + title: Type + default: boolean + type: object + required: + - column_id + - value + title: LogRecordsBooleanFilter + LogRecordsCollectionFilter: + properties: + column_id: + type: string + title: Column Id + description: ID of the column to filter. + operator: + type: string + enum: + - eq + - contains + - one_of + - not_in + title: Operator + value: + anyOf: + - type: string + - items: + type: string + type: array + title: Value + case_sensitive: + type: boolean + title: Case Sensitive + default: true + type: + type: string + const: collection + title: Type + default: collection + type: object + required: + - column_id + - operator + - value + title: LogRecordsCollectionFilter + LogRecordsColumnInfo: + properties: + id: + type: string + title: Id + description: Column id. Must be universally unique. + label: + anyOf: + - type: string + - type: 'null' + title: Label + description: Display label of the column in the UI. + category: + $ref: '#/components/schemas/ColumnCategory' + description: Category of the column. + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Description of the column. + group_label: + anyOf: + - type: string + - type: 'null' + title: Group Label + description: Display label of the column group. + data_type: + anyOf: + - $ref: '#/components/schemas/DataType' + - type: 'null' + description: Data type of the column. This is used to determine how to format + the data on the UI. + data_unit: + anyOf: + - $ref: '#/components/schemas/DataUnit' + - type: 'null' + description: Data unit of the column (optional). + multi_valued: + type: boolean + title: Multi Valued + description: Whether the column is multi-valued. + default: false + allowed_values: + anyOf: + - items: {} + type: array + uniqueItems: true + - type: 'null' + title: Allowed Values + description: Allowed values for this column. + sortable: + type: boolean + title: Sortable + description: Whether the column is sortable. + filterable: + type: boolean + title: Filterable + description: Whether the column is filterable. + is_empty: + type: boolean + title: Is Empty + description: Indicates whether the column is empty and should be hidden. + default: false + applicable_types: + items: + $ref: '#/components/schemas/StepType' + type: array + uniqueItems: true + title: Applicable Types + description: List of types applicable for this column. + is_optional: + type: boolean + title: Is Optional + description: Whether the column is optional. + default: false + roll_up_method: + anyOf: + - type: string + - type: 'null' + title: Roll Up Method + description: Default roll-up aggregation method for this metric (e.g., 'sum', + 'average'). + metric_key_alias: + anyOf: + - type: string + - type: 'null' + title: Metric Key Alias + description: Alternate metric key for this column. When scorer UUIDs are + used as column IDs, this holds the legacy metric_name string for dual-key + ClickHouse query fallback. + threshold: + anyOf: + - $ref: '#/components/schemas/MetricThreshold' + - type: 'null' + description: Thresholds for the column, if this is a metrics column. + scorer_config: + anyOf: + - $ref: '#/components/schemas/RuntimeScorerConfig' + - type: 'null' + description: 'For metric columns only: Scorer config that produced the metric.' + scorer_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Scorer Id + description: 'For metric columns only: Scorer id that produced the metric. + This is deprecated and will be removed in future versions.' + insight_type: + anyOf: + - $ref: '#/components/schemas/InsightType' + - type: 'null' + description: Insight type. + filter_type: + anyOf: + - $ref: '#/components/schemas/LogRecordsFilterType' + - type: 'null' + description: Filter type. + label_color: + anyOf: + - type: string + enum: + - positive + - negative + - type: 'null' + title: Label Color + description: Type of label color for the column, if this is a multilabel + metric column. + type: object + required: + - id + - category + - data_type + title: LogRecordsColumnInfo + LogRecordsCustomMetricsQueryRequest: + properties: + start_time: + type: string + format: date-time + title: Start Time + description: Include traces from this time onward. + end_time: + type: string + format: date-time + title: End Time + description: Include traces up to this time. + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + access_view_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Access View Id + description: Assigned log view for restricted access. + filter_tree: + anyOf: + - $ref: '#/components/schemas/FilterExpression_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - type: 'null' + description: Filter expression tree for complex filtering + interval_minutes: + type: integer + title: Interval Minutes + description: Time interval in minutes for bucketing + default: 5 + metric_details: + items: + $ref: '#/components/schemas/MetricAggregationDetail' + type: array + maxItems: 100 + title: Metric Details + description: List of metrics to aggregate with their widget IDs and aggregation + types (max 100) + group_by: + anyOf: + - type: string + - type: 'null' + title: Group By + description: Column to group by + type: object + required: + - start_time + - end_time + - metric_details + title: LogRecordsCustomMetricsQueryRequest + examples: + - end_time: '2024-01-07T23:59:59Z' + filter_tree: + and_: + - filter: + case_sensitive: true + name: input + operator: contains + type: text + value: customer + group_by: model + interval_minutes: 1440 + log_stream_id: c5fef527-51f6-49d0-800a-1859b678a098 + metric_details: + - aggregation: Sum + id: w1 + metric_name: num_total_tokens + - aggregation: Average + id: w2 + metric_name: toxicity + start_time: '2024-01-01T00:00:00Z' + LogRecordsDateFilter: + properties: + column_id: + type: string + title: Column Id + description: ID of the column to filter. + operator: + type: string + enum: + - eq + - ne + - gt + - gte + - lt + - lte + title: Operator + value: + type: string + format: date-time + title: Value + type: + type: string + const: date + title: Type + default: date + type: object + required: + - column_id + - operator + - value + title: LogRecordsDateFilter + LogRecordsDeleteRequest: + properties: + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + filters: + items: + oneOf: + - $ref: '#/components/schemas/LogRecordsIDFilter' + - $ref: '#/components/schemas/LogRecordsDateFilter' + - $ref: '#/components/schemas/LogRecordsNumberFilter' + - $ref: '#/components/schemas/LogRecordsBooleanFilter' + - $ref: '#/components/schemas/LogRecordsCollectionFilter' + - $ref: '#/components/schemas/LogRecordsTextFilter' + - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + discriminator: + propertyName: type + mapping: + boolean: '#/components/schemas/LogRecordsBooleanFilter' + collection: '#/components/schemas/LogRecordsCollectionFilter' + date: '#/components/schemas/LogRecordsDateFilter' + fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + id: '#/components/schemas/LogRecordsIDFilter' + number: '#/components/schemas/LogRecordsNumberFilter' + text: '#/components/schemas/LogRecordsTextFilter' + type: array + title: Filters + filter_tree: + anyOf: + - $ref: '#/components/schemas/FilterExpression_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - type: 'null' + type: object + title: LogRecordsDeleteRequest + example: + filters: + - case_sensitive: true + name: input + operator: eq + type: text + value: example input + log_stream_id: 74aec44e-ec21-4c9f-a3e2-b2ab2b81b4db + LogRecordsDeleteResponse: + properties: + message: + type: string + title: Message + description: Message + type: object + required: + - message + title: LogRecordsDeleteResponse + LogRecordsExportRequest: + properties: + column_ids: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Column Ids + description: Column IDs to include in the export. Applies only to CSV exports. + export_format: + $ref: '#/components/schemas/LLMExportFormat' + description: Export format + default: jsonl + redact: + type: boolean + title: Redact + description: Redact sensitive data + default: true + file_name: + anyOf: + - type: string + - type: 'null' + title: File Name + description: Optional filename for the exported file + export_computed_metrics_only: + type: boolean + title: Export Computed Metrics Only + description: When true, export only enabled scorer metrics with computed + values (success or roll_up). For session exports, omit entire sessions + unless every enabled metric at session, trace, or span level is ready + (success, roll_up, or not_applicable). Not supported with export_format=jsonl_flat + (returns 422); use jsonl or csv instead. + default: false + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + access_view_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Access View Id + description: Assigned log view for restricted access. + filters: + items: + oneOf: + - $ref: '#/components/schemas/LogRecordsIDFilter' + - $ref: '#/components/schemas/LogRecordsDateFilter' + - $ref: '#/components/schemas/LogRecordsNumberFilter' + - $ref: '#/components/schemas/LogRecordsBooleanFilter' + - $ref: '#/components/schemas/LogRecordsCollectionFilter' + - $ref: '#/components/schemas/LogRecordsTextFilter' + - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + discriminator: + propertyName: type + mapping: + boolean: '#/components/schemas/LogRecordsBooleanFilter' + collection: '#/components/schemas/LogRecordsCollectionFilter' + date: '#/components/schemas/LogRecordsDateFilter' + fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + id: '#/components/schemas/LogRecordsIDFilter' + number: '#/components/schemas/LogRecordsNumberFilter' + text: '#/components/schemas/LogRecordsTextFilter' + type: array + title: Filters + description: Filters to apply on the export + sort: + anyOf: + - $ref: '#/components/schemas/LogRecordsSortClause' + - type: 'null' + description: Sort clause for the export. Defaults to native sort (created_at, + id descending). + root_type: + $ref: '#/components/schemas/RootType' + include_code_metric_metadata: + type: boolean + title: Include Code Metric Metadata + description: If True, include per-row scorer metadata (the dict returned + alongside the score by code-based scorers via the (score, metadata) tuple-return + contract) on each MetricSuccess in the export. Off by default to keep + payloads small for callers that don't need it. + default: false + type: object + required: + - root_type + title: LogRecordsExportRequest + description: Request schema for exporting log records (sessions, traces, spans). + examples: + - column_ids: + - input + - output + - created_at + export_format: jsonl + filters: + - case_sensitive: true + name: input + operator: eq + type: text + value: example input + log_stream_id: 00000000-0000-0000-0000-000000000000 + root_type: trace + sort: + ascending: false + name: created_at + sort_type: column + LogRecordsFilterType: + type: string + enum: + - id + - date + - number + - boolean + - text + - collection + - fully_annotated + title: LogRecordsFilterType + LogRecordsFullyAnnotatedFilter: + properties: + column_id: + type: string + const: fully_annotated + title: Column Id + description: Queue-scoped filter identifier. This filter only works for + annotation-queue searches that provide queue context. + default: fully_annotated + type: + type: string + const: fully_annotated + title: Type + default: fully_annotated + user_ids: + anyOf: + - items: + type: string + format: uuid4 + type: array + minItems: 1 + - type: 'null' + title: User Ids + description: Optional queue member IDs to require for full annotation in + a queue-scoped search. If omitted, all tracked queue members visible to + the requester are used. + type: object + title: LogRecordsFullyAnnotatedFilter + description: Queue-scoped filter for records rated across all queue templates. + LogRecordsIDFilter: + properties: + column_id: + type: string + title: Column Id + description: ID of the column to filter. + operator: + type: string + enum: + - eq + - ne + - one_of + - not_in + - contains + title: Operator + default: eq + value: + anyOf: + - type: string + format: uuid4 + - items: + anyOf: + - type: string + format: uuid4 + - type: string + type: array + - type: string + title: Value + type: + type: string + const: id + title: Type + default: id + type: object + required: + - column_id + - value + title: LogRecordsIDFilter + LogRecordsMetricsQueryRequest: + properties: + start_time: + type: string + format: date-time + title: Start Time + description: Include traces from this time onward. + end_time: + type: string + format: date-time + title: End Time + description: Include traces up to this time. + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + access_view_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Access View Id + description: Assigned log view for restricted access. + filters: + items: + oneOf: + - $ref: '#/components/schemas/LogRecordsIDFilter' + - $ref: '#/components/schemas/LogRecordsDateFilter' + - $ref: '#/components/schemas/LogRecordsNumberFilter' + - $ref: '#/components/schemas/LogRecordsBooleanFilter' + - $ref: '#/components/schemas/LogRecordsCollectionFilter' + - $ref: '#/components/schemas/LogRecordsTextFilter' + - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + discriminator: + propertyName: type + mapping: + boolean: '#/components/schemas/LogRecordsBooleanFilter' + collection: '#/components/schemas/LogRecordsCollectionFilter' + date: '#/components/schemas/LogRecordsDateFilter' + fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + id: '#/components/schemas/LogRecordsIDFilter' + number: '#/components/schemas/LogRecordsNumberFilter' + text: '#/components/schemas/LogRecordsTextFilter' + type: array + title: Filters + interval: + type: integer + title: Interval + default: 5 + group_by: + anyOf: + - type: string + - type: 'null' + title: Group By + type: object + required: + - start_time + - end_time + title: LogRecordsMetricsQueryRequest + examples: + - end_time: '2023-10-01T01:00:00Z' + filters: + - case_sensitive: true + name: input + operator: eq + type: text + value: example input + group_by: model + interval: 5 + log_stream_id: 00000000-0000-0000-0000-000000000000 + start_time: '2023-10-01T00:00:00Z' + LogRecordsMetricsResponse: + properties: + group_by_columns: + items: + type: string + type: array + title: Group By Columns + aggregate_metrics: + additionalProperties: + anyOf: + - type: number + - type: integer + - additionalProperties: + type: integer + type: object + type: object + title: Aggregate Metrics + bucketed_metrics: + additionalProperties: + items: + $ref: '#/components/schemas/BucketedMetrics' + type: array + type: object + title: Bucketed Metrics + ems_captured_error: + type: boolean + title: Ems Captured Error + description: Whether any EMS error codes were encountered in the queried + metrics + default: false + standard_errors: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/StandardError' + type: object + - type: 'null' + title: Standard Errors + description: Structured EMS errors for each error code encountered, keyed + by code + type: object + required: + - group_by_columns + - aggregate_metrics + - bucketed_metrics + title: LogRecordsMetricsResponse + LogRecordsNumberFilter: + properties: + column_id: + type: string + title: Column Id + description: ID of the column to filter. + operator: + type: string + enum: + - eq + - ne + - gt + - gte + - lt + - lte + - between + title: Operator + value: + anyOf: + - type: integer + - type: number + - items: + type: integer + type: array + - items: + type: number + type: array + title: Value + type: + type: string + const: number + title: Type + default: number + type: object + required: + - column_id + - operator + - value + title: LogRecordsNumberFilter + LogRecordsPartialQueryRequest: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + maximum: 1000.0 + minimum: 0.0 + title: Limit + description: Records per page, at most 1000. Page through larger result + sets with starting_token or previous_last_row_id. + default: 100 + previous_last_row_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Previous Last Row Id + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + access_view_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Access View Id + description: Assigned log view for restricted access. + filters: + items: + oneOf: + - $ref: '#/components/schemas/LogRecordsIDFilter' + - $ref: '#/components/schemas/LogRecordsDateFilter' + - $ref: '#/components/schemas/LogRecordsNumberFilter' + - $ref: '#/components/schemas/LogRecordsBooleanFilter' + - $ref: '#/components/schemas/LogRecordsCollectionFilter' + - $ref: '#/components/schemas/LogRecordsTextFilter' + - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + discriminator: + propertyName: type + mapping: + boolean: '#/components/schemas/LogRecordsBooleanFilter' + collection: '#/components/schemas/LogRecordsCollectionFilter' + date: '#/components/schemas/LogRecordsDateFilter' + fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + id: '#/components/schemas/LogRecordsIDFilter' + number: '#/components/schemas/LogRecordsNumberFilter' + text: '#/components/schemas/LogRecordsTextFilter' + type: array + title: Filters + filter_tree: + anyOf: + - $ref: '#/components/schemas/FilterExpression_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - type: 'null' + sort: + anyOf: + - $ref: '#/components/schemas/LogRecordsSortClause' + - type: 'null' + description: Sort for the query. Defaults to native sort (created_at, id + descending). + truncate_fields: + type: boolean + title: Truncate Fields + default: false + include_counts: + type: boolean + title: Include Counts + description: If True, include computed child counts (e.g., num_traces for + sessions, num_spans for traces). + default: false + include_code_metric_metadata: + type: boolean + title: Include Code Metric Metadata + description: If True, include per-row scorer metadata (the dict returned + alongside the score by code-based scorers via the (score, metadata) tuple-return + contract) on each MetricSuccess in the response. Off by default to keep + payloads small for callers that don't need it. + default: false + select_columns: + $ref: '#/components/schemas/SelectColumns' + type: object + required: + - select_columns + title: LogRecordsPartialQueryRequest + description: Request to query a genai project run (log stream or experiment) + with partial results. + examples: + - filters: + - case_sensitive: true + name: input + operator: eq + type: text + value: example input + log_stream_id: 00000000-0000-0000-0000-000000000000 + pagination: + limit: 5 + starting_token: 0 + select_columns: + column_ids: + - id + - metrics/agentic_session_success + - metrics/completeness_gpt + include_all_feedback: false + include_all_metrics: false + includes_metric_columns: true + metric_columns_names: + - agentic_session_success + - completeness_gpt + sort: + ascending: false + name: updated_at + sort_type: column + - filter_tree: + and: + - or: + - filter: + name: input + operator: contains + type: text + value: abx + - filter: + name: output + operator: contains + type: text + value: xyz + - filter: + name: session_id + operator: eq + type: id + value: 123e4567-e89b-42d3-a456-426614174000 + log_stream_id: 00000000-0000-0000-0000-000000000000 + pagination: + limit: 5 + starting_token: 0 + select_columns: + column_ids: + - id + include_all_feedback: false + include_all_metrics: true + includes_metric_columns: true + metric_columns_names: [] + sort: + ascending: false + name: updated_at + sort_type: column + LogRecordsPartialQueryResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + last_row_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Last Row Id + records: + items: + oneOf: + - $ref: '#/components/schemas/PartialExtendedTraceRecord-Output' + - $ref: '#/components/schemas/PartialExtendedAgentSpanRecord-Output' + - $ref: '#/components/schemas/PartialExtendedWorkflowSpanRecord-Output' + - $ref: '#/components/schemas/PartialExtendedLlmSpanRecord-Output' + - $ref: '#/components/schemas/PartialExtendedToolSpanRecord-Output' + - $ref: '#/components/schemas/PartialExtendedRetrieverSpanRecord-Output' + - $ref: '#/components/schemas/PartialExtendedControlSpanRecord-Output' + - $ref: '#/components/schemas/PartialExtendedHttpSpanRecord-Output' + - $ref: '#/components/schemas/PartialExtendedSessionRecord-Output' + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/PartialExtendedAgentSpanRecord-Output' + control: '#/components/schemas/PartialExtendedControlSpanRecord-Output' + http: '#/components/schemas/PartialExtendedHttpSpanRecord-Output' + llm: '#/components/schemas/PartialExtendedLlmSpanRecord-Output' + retriever: '#/components/schemas/PartialExtendedRetrieverSpanRecord-Output' + session: '#/components/schemas/PartialExtendedSessionRecord-Output' + tool: '#/components/schemas/PartialExtendedToolSpanRecord-Output' + trace: '#/components/schemas/PartialExtendedTraceRecord-Output' + workflow: '#/components/schemas/PartialExtendedWorkflowSpanRecord-Output' + type: array + title: Records + description: records matching the query + num_records: + type: integer + title: Num Records + description: number of records + readOnly: true + type: object + required: + - num_records + title: LogRecordsPartialQueryResponse + examples: + - next_starting_token: 2 + num_rows: 2 + paginated: true + records: + - annotation_aggregates: {} + annotation_agreement: {} + annotation_queue_ids: [] + annotations: {} + created_at: '2024-01-01T00:00:00Z' + dataset_metadata: {} + error_message: '' + feedback_rating_info: {} + file_ids: [] + file_modalities: [] + id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 + input: Who is a smart LLM? + is_complete: true + is_synthetic: false + metrics: {} + name: '' + progress_message: '' + tags: [] + type: trace + user_metadata: {} + - annotation_aggregates: {} + annotation_agreement: {} + annotation_queue_ids: [] + annotations: {} + created_at: '2024-01-01T00:00:00Z' + dataset_metadata: {} + error_message: '' + feedback_rating_info: {} + file_ids: [] + file_modalities: [] + id: 1edc2401-24b4-448c-a392-b36932293061 + input: + - content: Who is a smart LLM? + role: user + is_complete: true + metrics: {} + name: '' + output: + content: '' + role: assistant + progress_message: '' + tags: [] + type: llm + user_metadata: {} + LogRecordsQueryCountRequest: + properties: + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + access_view_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Access View Id + description: Assigned log view for restricted access. + filters: + items: + oneOf: + - $ref: '#/components/schemas/LogRecordsIDFilter' + - $ref: '#/components/schemas/LogRecordsDateFilter' + - $ref: '#/components/schemas/LogRecordsNumberFilter' + - $ref: '#/components/schemas/LogRecordsBooleanFilter' + - $ref: '#/components/schemas/LogRecordsCollectionFilter' + - $ref: '#/components/schemas/LogRecordsTextFilter' + - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + discriminator: + propertyName: type + mapping: + boolean: '#/components/schemas/LogRecordsBooleanFilter' + collection: '#/components/schemas/LogRecordsCollectionFilter' + date: '#/components/schemas/LogRecordsDateFilter' + fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + id: '#/components/schemas/LogRecordsIDFilter' + number: '#/components/schemas/LogRecordsNumberFilter' + text: '#/components/schemas/LogRecordsTextFilter' + type: array + title: Filters + filter_tree: + anyOf: + - $ref: '#/components/schemas/FilterExpression_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - type: 'null' + type: object + title: LogRecordsQueryCountRequest + example: + filters: + - case_sensitive: true + name: input + operator: eq + type: text + value: example input + log_stream_id: 74aec44e-ec21-4c9f-a3e2-b2ab2b81b4db + LogRecordsQueryCountResponse: + properties: + total_count: + type: integer + title: Total Count + description: Total number of records matching the query + type: object + required: + - total_count + title: LogRecordsQueryCountResponse + LogRecordsQueryRequest: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + maximum: 1000.0 + minimum: 0.0 + title: Limit + description: Records per page, at most 1000. Page through larger result + sets with starting_token or previous_last_row_id. + default: 100 + previous_last_row_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Previous Last Row Id + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + access_view_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Access View Id + description: Assigned log view for restricted access. + filters: + items: + oneOf: + - $ref: '#/components/schemas/LogRecordsIDFilter' + - $ref: '#/components/schemas/LogRecordsDateFilter' + - $ref: '#/components/schemas/LogRecordsNumberFilter' + - $ref: '#/components/schemas/LogRecordsBooleanFilter' + - $ref: '#/components/schemas/LogRecordsCollectionFilter' + - $ref: '#/components/schemas/LogRecordsTextFilter' + - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + discriminator: + propertyName: type + mapping: + boolean: '#/components/schemas/LogRecordsBooleanFilter' + collection: '#/components/schemas/LogRecordsCollectionFilter' + date: '#/components/schemas/LogRecordsDateFilter' + fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' + id: '#/components/schemas/LogRecordsIDFilter' + number: '#/components/schemas/LogRecordsNumberFilter' + text: '#/components/schemas/LogRecordsTextFilter' + type: array + title: Filters + filter_tree: + anyOf: + - $ref: '#/components/schemas/FilterExpression_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - type: 'null' + sort: + anyOf: + - $ref: '#/components/schemas/LogRecordsSortClause' + - type: 'null' + description: Sort for the query. Defaults to native sort (created_at, id + descending). + truncate_fields: + type: boolean + title: Truncate Fields + default: false + include_counts: + type: boolean + title: Include Counts + description: If True, include computed child counts (e.g., num_traces for + sessions, num_spans for traces). + default: false + include_code_metric_metadata: + type: boolean + title: Include Code Metric Metadata + description: If True, include per-row scorer metadata (the dict returned + alongside the score by code-based scorers via the (score, metadata) tuple-return + contract) on each MetricSuccess in the response. Off by default to keep + payloads small for callers that don't need it. + default: false + type: object + title: LogRecordsQueryRequest + examples: + - filters: + - case_sensitive: true + name: input + operator: eq + type: text + value: example input + log_stream_id: 00000000-0000-0000-0000-000000000000 + pagination: + limit: 5 + starting_token: 0 + sort: + ascending: false + name: updated_at + sort_type: column + - filter_tree: + and: + - or: + - filter: + name: input + operator: contains + type: text + value: abx + - filter: + name: output + operator: contains + type: text + value: xyz + - filter: + name: session_id + operator: eq + type: id + value: 123e4567-e89b-42d3-a456-426614174000 + log_stream_id: 00000000-0000-0000-0000-000000000000 + pagination: + limit: 5 + starting_token: 0 + sort: + ascending: false + name: updated_at + sort_type: column + LogRecordsQueryResponse: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + paginated: + type: boolean + title: Paginated + default: false + next_starting_token: + anyOf: + - type: integer + - type: 'null' + title: Next Starting Token + last_row_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Last Row Id + records: + items: + oneOf: + - $ref: '#/components/schemas/ExtendedTraceRecord-Output' + - $ref: '#/components/schemas/ExtendedAgentSpanRecord-Output' + - $ref: '#/components/schemas/ExtendedWorkflowSpanRecord-Output' + - $ref: '#/components/schemas/ExtendedLlmSpanRecord-Output' + - $ref: '#/components/schemas/ExtendedToolSpanRecord-Output' + - $ref: '#/components/schemas/ExtendedRetrieverSpanRecord-Output' + - $ref: '#/components/schemas/ExtendedControlSpanRecord-Output' + - $ref: '#/components/schemas/ExtendedHttpSpanRecord-Output' + - $ref: '#/components/schemas/ExtendedSessionRecord-Output' + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/ExtendedAgentSpanRecord-Output' + control: '#/components/schemas/ExtendedControlSpanRecord-Output' + http: '#/components/schemas/ExtendedHttpSpanRecord-Output' + llm: '#/components/schemas/ExtendedLlmSpanRecord-Output' + retriever: '#/components/schemas/ExtendedRetrieverSpanRecord-Output' + session: '#/components/schemas/ExtendedSessionRecord-Output' + tool: '#/components/schemas/ExtendedToolSpanRecord-Output' + trace: '#/components/schemas/ExtendedTraceRecord-Output' + workflow: '#/components/schemas/ExtendedWorkflowSpanRecord-Output' + type: array + title: Records + description: records matching the query + num_records: + type: integer + title: Num Records + description: number of records + readOnly: true + type: object + required: + - num_records + title: LogRecordsQueryResponse + examples: + - next_starting_token: 2 + num_rows: 2 + paginated: true + records: + - annotation_aggregates: {} + annotation_agreement: {} + annotation_queue_ids: [] + annotations: {} + created_at: '2024-01-01T00:00:00Z' + dataset_metadata: {} + error_message: '' + feedback_rating_info: {} + file_ids: [] + file_modalities: [] + id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 + input: Who is a smart LLM? + is_complete: true + is_synthetic: false + metrics: + duration_ns: 4 + name: '' + output: I am + progress_message: '' + project_id: 0d4e3799-3861-4759-875f-9ae14c167b0a + run_id: 74aec44e-ec21-4c9f-a3e2-b2ab2b81b4db + session_id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 + tags: [] + trace_id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 + type: trace + user_metadata: {} + - annotation_aggregates: {} + annotation_agreement: {} + annotation_queue_ids: [] + annotations: {} + created_at: '2024-01-01T00:00:00Z' + dataset_metadata: {} + error_message: '' + feedback_rating_info: {} + file_ids: [] + file_modalities: [] + id: 1edc2401-24b4-448c-a392-b36932293061 + input: + - content: Who is a smart LLM? + role: user + is_complete: true + is_placeholder: false + metrics: + duration_ns: 4 + num_input_tokens: 4 + num_output_tokens: 2 + num_total_tokens: 6 + name: '' + output: + content: I am + role: user + parent_id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 + progress_message: '' + project_id: 0d4e3799-3861-4759-875f-9ae14c167b0a + run_id: 74aec44e-ec21-4c9f-a3e2-b2ab2b81b4db + session_id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 + tags: [] + trace_id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 + type: llm + user_metadata: {} + LogRecordsSortClause: + properties: + column_id: + type: string + title: Column Id + description: ID of the column to sort. + ascending: + type: boolean + title: Ascending + default: true + sort_type: + type: string + const: column + title: Sort Type + default: column + type: object + required: + - column_id + title: LogRecordsSortClause + LogRecordsTextFilter: + properties: + column_id: + type: string + title: Column Id + description: ID of the column to filter. + operator: + type: string + enum: + - eq + - ne + - contains + - regex + - one_of + - not_in + title: Operator + value: + anyOf: + - type: string + - items: + type: string + type: array + title: Value + case_sensitive: + type: boolean + title: Case Sensitive + default: true + type: + type: string + const: text + title: Type + default: text + type: object + required: + - column_id + - operator + - value + title: LogRecordsTextFilter + LogSpanUpdateRequest: + properties: + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + logging_method: + $ref: '#/components/schemas/LoggingMethod' + default: api_direct + client_version: + anyOf: + - type: string + - type: 'null' + title: Client Version + reliable: + type: boolean + title: Reliable + description: Whether or not to use reliable logging. If set to False, the + method will respond immediately before verifying that the traces have + been successfully ingested, and no error message will be returned if ingestion + fails. If set to True, the method will wait for the traces to be durably + accepted or return an error message if there is an ingestion failure. + On the streaming write path (kafka_metrics_pipeline) accepted means acknowledged + by Kafka; the records become readable after the data-writer flush, about + GALILEO_STREAMING_EXPECTED_LAG_SECONDS (default 2.5 s) later, so a read + issued immediately after the response can miss them. + default: true + span_id: + type: string + format: uuid4 + title: Span Id + description: Span id to update. + input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - type: 'null' + title: Input + description: Input of the span. Overwrites previous value if present. + output: + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Output + description: Output of the span. Overwrites previous value if present. + tags: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tags + description: Tags to add to the span. + status_code: + anyOf: + - type: integer + - type: 'null' + title: Status Code + description: Status code of the span. Overwrites previous value if present. + duration_ns: + anyOf: + - type: integer + - type: 'null' + title: Duration Ns + description: Duration in nanoseconds. Overwrites previous value if present. + type: object + required: + - span_id + title: LogSpanUpdateRequest + description: Request model for updating a span. + LogSpanUpdateResponse: + properties: + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + project_id: + type: string + format: uuid4 + title: Project Id + description: Project id associated with the traces. + project_name: + type: string + title: Project Name + description: Project name associated with the traces. + session_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session Id + description: Session id associated with the traces. + records_count: + type: integer + title: Records Count + description: Total number of records ingested + span_id: + type: string + format: uuid4 + title: Span Id + description: Span id associated with the updated span. + type: object + required: + - project_id + - project_name + - records_count + - span_id + title: LogSpanUpdateResponse + LogSpansIngestRequest: + properties: + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + logging_method: + $ref: '#/components/schemas/LoggingMethod' + default: api_direct + client_version: + anyOf: + - type: string + - type: 'null' + title: Client Version + reliable: + type: boolean + title: Reliable + description: Whether or not to use reliable logging. If set to False, the + method will respond immediately before verifying that the traces have + been successfully ingested, and no error message will be returned if ingestion + fails. If set to True, the method will wait for the traces to be durably + accepted or return an error message if there is an ingestion failure. + On the streaming write path (kafka_metrics_pipeline) accepted means acknowledged + by Kafka; the records become readable after the data-writer flush, about + GALILEO_STREAMING_EXPECTED_LAG_SECONDS (default 2.5 s) later, so a read + issued immediately after the response can miss them. + default: true + spans: + items: + oneOf: + - $ref: '#/components/schemas/AgentSpan' + - $ref: '#/components/schemas/WorkflowSpan' + - $ref: '#/components/schemas/LlmSpan' + - $ref: '#/components/schemas/RetrieverSpan' + - $ref: '#/components/schemas/ToolSpan' + - $ref: '#/components/schemas/ControlSpan' + - $ref: '#/components/schemas/HttpSpan' + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/AgentSpan' + control: '#/components/schemas/ControlSpan' + http: '#/components/schemas/HttpSpan' + llm: '#/components/schemas/LlmSpan' + retriever: '#/components/schemas/RetrieverSpan' + tool: '#/components/schemas/ToolSpan' + workflow: '#/components/schemas/WorkflowSpan' + type: array + minItems: 1 + title: Spans + description: List of spans to log. + trace_id: + type: string + format: uuid4 + title: Trace Id + description: Trace id associated with the spans. + parent_id: + type: string + format: uuid4 + title: Parent Id + description: Parent trace or span id. + type: object + required: + - spans + - trace_id + - parent_id + title: LogSpansIngestRequest + description: Request model for ingesting spans. + examples: + - log_stream_id: 00000000-0000-0000-0000-000000000000 + parent_id: 11000011-0000-0000-0000-110000110000 + spans: + - created_at: '2024-01-01T00:00:00Z' + dataset_metadata: {} + input: who is a smart LLM? + metrics: {} + name: '' + output: I am! + spans: + - created_at: '2024-01-01T00:00:00Z' + dataset_metadata: {} + id: 22222222-2222-4222-a222-222222222222 + input: + - content: 'Question: who is a smart LLM?' + role: user + metrics: {} + name: '' + output: + content: I am! + role: user + tags: [] + type: llm + user_metadata: {} + tags: [] + type: workflow + user_metadata: {} + trace_id: 11000011-0000-0000-0000-110000110000 + LogSpansIngestResponse: + properties: + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + project_id: + type: string + format: uuid4 + title: Project Id + description: Project id associated with the traces. + project_name: + type: string + title: Project Name + description: Project name associated with the traces. + session_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session Id + description: Session id associated with the traces. + records_count: + type: integer + title: Records Count + description: Total number of records ingested + trace_id: + type: string + format: uuid4 + title: Trace Id + description: Trace id associated with the spans. + parent_id: + type: string + format: uuid4 + title: Parent Id + description: Parent trace or span id. + type: object + required: + - project_id + - project_name + - records_count + - trace_id + - parent_id + title: LogSpansIngestResponse + LogStreamCreateRequest: + properties: + name: + type: string + minLength: 1 + title: Name + type: object + required: + - name + title: LogStreamCreateRequest + LogStreamCreatedAtFilter: + properties: + name: + type: string + const: created_at + title: Name + default: created_at + operator: + type: string + enum: + - eq + - ne + - gt + - gte + - lt + - lte + title: Operator + value: + type: string + format: date-time + title: Value + type: object + required: + - operator + - value + title: RunCreatedAtFilter + LogStreamCreatedAtSort: + properties: + name: + type: string + const: created_at + title: Name + default: created_at + ascending: + type: boolean + title: Ascending + default: true + sort_type: + type: string + const: column + title: Sort Type + default: column + type: object + title: RunCreatedAtSort + LogStreamCreatedByFilter: + properties: + name: + type: string + const: created_by + title: Name + default: created_by + operator: + type: string + enum: + - eq + - ne + - one_of + - not_in + - contains + title: Operator + default: eq + value: + anyOf: + - type: string + format: uuid4 + - items: + anyOf: + - type: string + format: uuid4 + - type: string + type: array + - type: string + title: Value + type: object + required: + - value + title: RunCreatedByFilter + LogStreamIDFilter: + properties: + name: + type: string + const: id + title: Name + default: id + operator: + type: string + enum: + - eq + - ne + - one_of + - not_in + - contains + title: Operator + default: eq + value: + anyOf: + - type: string + format: uuid4 + - items: + anyOf: + - type: string + format: uuid4 + - type: string + type: array + - type: string + title: Value + type: object + required: + - value + title: RunIDFilter + LogStreamInfo: + properties: + id: + type: string + format: uuid4 + title: Id + name: + type: string + title: Name + type: object + required: + - id + - name + title: LogStreamInfo + description: Minimal log stream representation (id and name only). + LogStreamNameFilter: + properties: + name: + type: string + const: name + title: Name + default: name + operator: + type: string + enum: + - eq + - ne + - contains + - regex + - one_of + - not_in + title: Operator + value: + anyOf: + - type: string + - items: + type: string + type: array + title: Value + case_sensitive: + type: boolean + title: Case Sensitive + default: true + type: object + required: + - operator + - value + title: RunNameFilter + LogStreamNameSort: + properties: + name: + type: string + const: name + title: Name + default: name + ascending: + type: boolean + title: Ascending + default: true + sort_type: + type: string + const: column + title: Sort Type + default: column + type: object + title: RunNameSort + LogStreamResponse: + properties: + id: + type: string + format: uuid4 + title: Id + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + name: + type: string + title: Name + project_id: + type: string + format: uuid4 + title: Project Id + created_by: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Created By + created_by_user: + anyOf: + - $ref: '#/components/schemas/UserInfo' + - type: 'null' + num_spans: + anyOf: + - type: integer + - type: 'null' + title: Num Spans + num_traces: + anyOf: + - type: integer + - type: 'null' + title: Num Traces + has_user_created_sessions: + type: boolean + title: Has User Created Sessions + default: false + type: object + required: + - id + - created_at + - updated_at + - name + - project_id + title: LogStreamResponse + LogStreamSearchRequest: + properties: + starting_token: + type: integer + title: Starting Token + default: 0 + limit: + type: integer + title: Limit + default: 100 + filters: + items: + oneOf: + - $ref: '#/components/schemas/LogStreamIDFilter' + - $ref: '#/components/schemas/LogStreamNameFilter' + - $ref: '#/components/schemas/LogStreamCreatedByFilter' + - $ref: '#/components/schemas/LogStreamCreatedAtFilter' + - $ref: '#/components/schemas/LogStreamUpdatedAtFilter' + discriminator: + propertyName: name + mapping: + created_at: '#/components/schemas/LogStreamCreatedAtFilter' + created_by: '#/components/schemas/LogStreamCreatedByFilter' + id: '#/components/schemas/LogStreamIDFilter' + name: '#/components/schemas/LogStreamNameFilter' + updated_at: '#/components/schemas/LogStreamUpdatedAtFilter' + type: array + title: Filters + sort: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LogStreamNameSort' + - $ref: '#/components/schemas/LogStreamCreatedAtSort' + - $ref: '#/components/schemas/LogStreamUpdatedAtSort' + discriminator: + propertyName: name + mapping: + created_at: '#/components/schemas/LogStreamCreatedAtSort' + name: '#/components/schemas/LogStreamNameSort' + updated_at: '#/components/schemas/LogStreamUpdatedAtSort' + - type: 'null' + title: Sort + default: + name: created_at + ascending: false + sort_type: column + include_counts: + type: boolean + title: Include Counts + default: false + type: object + title: LogStreamSearchRequest + LogStreamUpdateRequest: + properties: + name: + type: string + minLength: 1 + title: Name + type: object + required: + - name + title: LogStreamUpdateRequest + LogStreamUpdatedAtFilter: + properties: + name: + type: string + const: updated_at + title: Name + default: updated_at + operator: + type: string + enum: + - eq + - ne + - gt + - gte + - lt + - lte + title: Operator + value: + type: string + format: date-time + title: Value + type: object + required: + - operator + - value + title: RunUpdatedAtFilter + LogStreamUpdatedAtSort: + properties: + name: + type: string + const: updated_at + title: Name + default: updated_at + ascending: + type: boolean + title: Ascending + default: true + sort_type: + type: string + const: column + title: Sort Type + default: column + type: object + title: RunUpdatedAtSort + LogTraceUpdateRequest: + properties: + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + logging_method: + $ref: '#/components/schemas/LoggingMethod' + default: api_direct + client_version: + anyOf: + - type: string + - type: 'null' + title: Client Version + reliable: + type: boolean + title: Reliable + description: Whether or not to use reliable logging. If set to False, the + method will respond immediately before verifying that the traces have + been successfully ingested, and no error message will be returned if ingestion + fails. If set to True, the method will wait for the traces to be durably + accepted or return an error message if there is an ingestion failure. + On the streaming write path (kafka_metrics_pipeline) accepted means acknowledged + by Kafka; the records become readable after the data-writer flush, about + GALILEO_STREAMING_EXPECTED_LAG_SECONDS (default 2.5 s) later, so a read + issued immediately after the response can miss them. + default: true + trace_id: + type: string + format: uuid4 + title: Trace Id + description: Trace id to update. + input: + anyOf: + - type: string + - type: 'null' + title: Input + description: Input of the trace. Overwrites previous value if present. + output: + anyOf: + - type: string + - type: 'null' + title: Output + description: Output of the trace. Overwrites previous value if present. + status_code: + anyOf: + - type: integer + - type: 'null' + title: Status Code + description: Status code of the trace. Overwrites previous value if present. + tags: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tags + description: Tags to add to the trace. + is_complete: + anyOf: + - type: boolean + - type: 'null' + title: Is Complete + description: Whether or not the records in this request are complete. + default: false + duration_ns: + anyOf: + - type: integer + - type: 'null' + title: Duration Ns + description: Duration in nanoseconds. Overwrites previous value if present. + type: object + required: + - trace_id + title: LogTraceUpdateRequest + description: Request model for updating a trace. + LogTraceUpdateResponse: + properties: + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + project_id: + type: string + format: uuid4 + title: Project Id + description: Project id associated with the traces. + project_name: + type: string + title: Project Name + description: Project name associated with the traces. + session_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session Id + description: Session id associated with the traces. + records_count: + type: integer + title: Records Count + description: Total number of records ingested + trace_id: + type: string + format: uuid4 + title: Trace Id + description: Trace id associated with the updated trace. + type: object + required: + - project_id + - project_name + - records_count + - trace_id + title: LogTraceUpdateResponse + LogTracesIngestRequest: + properties: + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + logging_method: + $ref: '#/components/schemas/LoggingMethod' + default: api_direct + client_version: + anyOf: + - type: string + - type: 'null' + title: Client Version + reliable: + type: boolean + title: Reliable + description: Whether or not to use reliable logging. If set to False, the + method will respond immediately before verifying that the traces have + been successfully ingested, and no error message will be returned if ingestion + fails. If set to True, the method will wait for the traces to be durably + accepted or return an error message if there is an ingestion failure. + On the streaming write path (kafka_metrics_pipeline) accepted means acknowledged + by Kafka; the records become readable after the data-writer flush, about + GALILEO_STREAMING_EXPECTED_LAG_SECONDS (default 2.5 s) later, so a read + issued immediately after the response can miss them. + default: true + session_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session Id + description: Session id associated with the traces. + session_external_id: + anyOf: + - type: string + - type: 'null' + title: Session External Id + description: External id of the session (e.g., OTEL session.id from span + attributes). + traces: + items: + $ref: '#/components/schemas/Trace' + type: array + minItems: 1 + title: Traces + description: List of traces to log. + is_complete: + type: boolean + title: Is Complete + description: Whether or not the records in this request are complete. + default: true + include_trace_ids: + type: boolean + title: Include Trace Ids + description: If True, include the list of ingested trace IDs in the response. + default: false + type: object + required: + - traces + title: LogTracesIngestRequest + description: Request model for ingesting traces. + examples: + - log_stream_id: 00000000-0000-0000-0000-000000000000 + session_id: 00000000-0000-0000-0000-000000000000 + traces: + - created_at: '2024-01-01T00:00:00Z' + dataset_metadata: {} + input: who is a smart LLM? + metrics: {} + name: '' + output: I am! + spans: + - created_at: '2024-01-01T00:00:00Z' + dataset_metadata: {} + input: + - content: 'Question: who is a smart LLM?' + role: user + metrics: {} + name: '' + output: + content: I am! + role: user + tags: [] + type: llm + user_metadata: {} + tags: [] + type: trace + user_metadata: {} + - experiment_id: 00000000-0000-0000-0000-000000000000 + traces: + - created_at: '2024-01-01T00:00:00Z' + dataset_metadata: {} + input: who is a smart LLM? + metrics: {} + name: '' + output: I am! + spans: + - created_at: '2024-01-01T00:00:00Z' + dataset_metadata: {} + id: 11111111-1111-4111-a111-111111111111 + input: + - content: 'Question: who is a smart LLM?' + role: user + metrics: {} + name: '' + output: + content: I am! + role: user + tags: [] + type: llm + user_metadata: {} + tags: [] + type: trace + user_metadata: {} + LogTracesIngestResponse: + properties: + log_stream_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Log Stream Id + description: Log stream id associated with the traces. + experiment_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Experiment Id + description: Experiment id associated with the traces. + metrics_testing_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Testing Id + description: Metrics testing id associated with the traces. + project_id: + type: string + format: uuid4 + title: Project Id + description: Project id associated with the traces. + project_name: + type: string + title: Project Name + description: Project name associated with the traces. + session_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session Id + description: Session id associated with the traces. + records_count: + type: integer + title: Records Count + description: Total number of records ingested + traces_count: + type: integer + title: Traces Count + description: total number of traces ingested + spans_count: + type: integer + title: Spans Count + description: total number of spans ingested + trace_ids: + anyOf: + - items: + type: string + format: uuid4 + type: array + - type: 'null' + title: Trace Ids + description: List of trace IDs that were ingested. Only included if include_trace_ids=True + in request. + type: object + required: + - project_id + - project_name + - records_count + - traces_count + - spans_count + title: LogTracesIngestResponse + LoggingMethod: + type: string + enum: + - playground + - python_client + - typescript_client + - api_direct + title: LoggingMethod + Luna3ScorerResponse: + properties: + instruction: + type: string + maxLength: 10000 + minLength: 1 + title: Instruction + adapter_path: + type: string + maxLength: 1024 + minLength: 1 + title: Adapter Path + class_name_to_vocab_ix: + additionalProperties: + items: + type: integer + type: array + uniqueItems: true + type: object + maxProperties: 256 + minProperties: 1 + title: Class Name To Vocab Ix + threshold: + anyOf: + - type: number + - type: 'null' + title: Threshold + id: + type: string + format: uuid4 + title: Id + organization_id: + type: string + format: uuid4 + title: Organization Id + created_by: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Created By + created_at: + type: string + format: date-time + title: Created At + updated_at: + type: string + format: date-time + title: Updated At + type: object + required: + - instruction + - adapter_path + - class_name_to_vocab_ix + - id + - organization_id + - created_at + - updated_at + title: Luna3ScorerResponse + LunaBillingUsageResponse: + properties: + metric: + type: string + const: luna_decision_input_tokens + title: Metric + default: luna_decision_input_tokens + projects: + items: + $ref: '#/components/schemas/ProjectBillingUsage' + type: array + title: Projects + available: + type: boolean + title: Available + default: true + unavailable_reason: + anyOf: + - type: string + - type: 'null' + title: Unavailable Reason + total: + anyOf: + - type: integer + - type: 'null' + title: Total + credits: + anyOf: + - $ref: '#/components/schemas/CreditBalance' + - type: 'null' + credits_unavailable_reason: + anyOf: + - type: string + - type: 'null' + title: Credits Unavailable Reason + type: object + required: + - total + - credits + - credits_unavailable_reason + title: LunaBillingUsageResponse + LunaDatasetMappings: + properties: + input: + anyOf: + - $ref: '#/components/schemas/LunaMappingConfig' + - type: 'null' + output: + anyOf: + - $ref: '#/components/schemas/LunaMappingConfig' + - type: 'null' + label: + anyOf: + - $ref: '#/components/schemas/LunaMappingConfig' + - type: 'null' + evaluator_ground_truth: + anyOf: + - $ref: '#/components/schemas/LunaMappingConfig' + - type: 'null' + metadata: + anyOf: + - $ref: '#/components/schemas/LunaMappingConfig' + - type: 'null' + tools: + anyOf: + - $ref: '#/components/schemas/LunaMappingConfig' + - type: 'null' + documents: + anyOf: + - $ref: '#/components/schemas/LunaMappingConfig' + - type: 'null' + mgt: + additionalProperties: + $ref: '#/components/schemas/LunaMappingConfig' + propertyNames: + format: uuid4 + type: object + maxProperties: 32 + title: Mgt + additionalProperties: false + type: object + title: LunaDatasetMappings + description: Semantic mappings shared by preview, validation, and dataset finalization. + LunaDatasetPreview: + properties: + dataset: + oneOf: + - $ref: '#/components/schemas/LunaPreviewDraftRef' + - $ref: '#/components/schemas/LunaPreviewVersionRef' + title: Dataset + discriminator: + propertyName: kind + mapping: + draft: '#/components/schemas/LunaPreviewDraftRef' + version: '#/components/schemas/LunaPreviewVersionRef' + columns: + items: + $ref: '#/components/schemas/LunaDatasetPreviewColumn' + type: array + title: Columns + rows: + items: + $ref: '#/components/schemas/LunaDatasetPreviewRow' + type: array + title: Rows + total_row_count: + type: integer + title: Total Row Count + column_count: + type: integer + title: Column Count + next_cursor: + anyOf: + - type: string + - type: 'null' + title: Next Cursor + type: object + required: + - dataset + - columns + - rows + - total_row_count + - column_count + title: LunaDatasetPreview + LunaDatasetPreviewColumn: + properties: + key: + type: string + title: Key + label: + type: string + title: Label + source_columns: + items: + type: string + type: array + title: Source Columns + source_column: + anyOf: + - type: string + - type: 'null' + title: Source Column + samples: + items: + $ref: '#/components/schemas/pydantic__types__JsonValue' + type: array + title: Samples + group: + anyOf: + - type: string + - type: 'null' + title: Group + scorer_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Scorer Id + type: object + required: + - key + - label + - source_columns + title: LunaDatasetPreviewColumn + LunaDatasetPreviewErrorDetail: + properties: + code: + type: string + title: Code + message: + anyOf: + - type: string + - type: 'null' + title: Message + current_revision: + anyOf: + - type: string + - type: 'null' + title: Current Revision + field_errors: + anyOf: + - items: + $ref: '#/components/schemas/LunaDatasetPreviewFieldError' + type: array + - type: 'null' + title: Field Errors + type: object + required: + - code + title: LunaDatasetPreviewErrorDetail + LunaDatasetPreviewErrorResponse: + properties: + detail: + anyOf: + - type: string + - $ref: '#/components/schemas/LunaDatasetPreviewErrorDetail' + - items: + $ref: '#/components/schemas/LunaDatasetPreviewRequestValidationError' + type: array + title: Detail + standard_error: + anyOf: + - $ref: '#/components/schemas/StandardError' + - type: 'null' + type: object + required: + - detail + title: LunaDatasetPreviewErrorResponse + description: Catalog failures and ordinary request-validation failures returned + by preview routes. + LunaDatasetPreviewFieldError: + properties: + field: + type: string + title: Field + message: + type: string + title: Message + type: object + required: + - field + - message + title: LunaDatasetPreviewFieldError + LunaDatasetPreviewRequest: + properties: + mappings: + anyOf: + - $ref: '#/components/schemas/LunaDatasetMappings' + - items: + $ref: '#/components/schemas/LunaSemanticMapping' + type: array + additionalProperties: false + type: object + required: + - mappings + title: LunaDatasetPreviewRequest + LunaDatasetPreviewRequestValidationError: + properties: + loc: + items: + anyOf: + - type: string + - type: integer + type: array + title: Loc + msg: + type: string + title: Msg + type: + type: string + title: Type + input: + anyOf: + - $ref: '#/components/schemas/pydantic__types__JsonValue' + - type: 'null' + ctx: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/pydantic__types__JsonValue' + type: object + - type: 'null' + title: Ctx + type: object + required: + - loc + - msg + - type + title: LunaDatasetPreviewRequestValidationError + LunaDatasetPreviewRow: + properties: + row_ref: + type: string + title: Row Ref + values: + additionalProperties: + $ref: '#/components/schemas/pydantic__types__JsonValue' + type: object + title: Values + truncated_columns: + items: + type: string + type: array + title: Truncated Columns + type: object + required: + - row_ref + - values + title: LunaDatasetPreviewRow + LunaInputTypeEnum: + type: string + enum: + - span + - trace_object + - trace_input_output_only + title: LunaInputTypeEnum + LunaMappingConfig: + properties: + columns: + items: + type: string + maxLength: 256 + minLength: 1 + type: array + maxItems: 32 + minItems: 1 + title: Columns + flatten: + type: boolean + title: Flatten + default: true + additionalProperties: false + type: object + required: + - columns + title: LunaMappingConfig + LunaOutputTypeEnum: + type: string + enum: + - float + - string + - string_list + - bool_list + title: LunaOutputTypeEnum + LunaPreviewDraftRef: + properties: + kind: + type: string + const: draft + title: Kind + default: draft + dataset_id: + type: string + format: uuid4 + title: Dataset Id + draft_revision: + type: string + title: Draft Revision + type: object + required: + - dataset_id + - draft_revision + title: LunaPreviewDraftRef + LunaPreviewVersionRef: + properties: + kind: + type: string + const: version + title: Kind + default: version + dataset_id: + type: string + format: uuid4 + title: Dataset Id + version_index: + type: integer + minimum: 1.0 + title: Version Index + type: object + required: + - dataset_id + - version_index + title: LunaPreviewVersionRef + LunaSemanticMapping: + properties: + source_column: type: string - title: Column Id - description: ID of the column to filter. + maxLength: 256 + minLength: 1 + title: Source Column + target_field: + type: string + enum: + - input + - output + - label + - evaluator_ground_truth + - metadata + - tools + - documents + - generated_output + - ground_truth + title: Target Field + additionalProperties: false + type: object + required: + - source_column + - target_field + title: LunaSemanticMapping + MCPApprovalRequestEvent: + properties: + type: + type: string + const: mcp_approval_request + title: Type + default: mcp_approval_request + id: + anyOf: + - type: string + - type: 'null' + title: Id + description: Unique identifier for the event + status: + anyOf: + - $ref: '#/components/schemas/EventStatus' + - type: 'null' + description: Status of the event + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Provider-specific metadata and additional fields + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message if the event failed + tool_name: + anyOf: + - type: string + - type: 'null' + title: Tool Name + description: Name of the MCP tool requiring approval + tool_invocation: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Tool Invocation + description: Details of the tool invocation requiring approval + approved: + anyOf: + - type: boolean + - type: 'null' + title: Approved + description: Whether the request was approved + type: object + title: MCPApprovalRequestEvent + description: MCP approval request - when human approval is needed for an MCP + tool call. + MCPCallEvent: + properties: + type: + type: string + const: mcp_call + title: Type + default: mcp_call + id: + anyOf: + - type: string + - type: 'null' + title: Id + description: Unique identifier for the event + status: + anyOf: + - $ref: '#/components/schemas/EventStatus' + - type: 'null' + description: Status of the event + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Provider-specific metadata and additional fields + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message if the event failed + tool_name: + anyOf: + - type: string + - type: 'null' + title: Tool Name + description: Name of the MCP tool being called + server_name: + anyOf: + - type: string + - type: 'null' + title: Server Name + description: Name of the MCP server + arguments: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Arguments + description: Arguments for the MCP tool call + result: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Result + description: Result from the MCP tool call + type: object + title: MCPCallEvent + description: 'A Model Context Protocol (MCP) tool call. + + + MCP is a protocol for connecting LLMs to external tools/data sources. + + This is distinct from internal tools because it involves external integrations.' + MCPListToolsEvent: + properties: + type: + type: string + const: mcp_list_tools + title: Type + default: mcp_list_tools + id: + anyOf: + - type: string + - type: 'null' + title: Id + description: Unique identifier for the event + status: + anyOf: + - $ref: '#/components/schemas/EventStatus' + - type: 'null' + description: Status of the event + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Provider-specific metadata and additional fields + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message if the event failed + server_name: + anyOf: + - type: string + - type: 'null' + title: Server Name + description: Name of the MCP server + tools: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Tools + description: List of available MCP tools + type: object + title: MCPListToolsEvent + description: MCP list tools event - when the model queries available MCP tools. + Message-Output: + properties: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + title: Content + role: + $ref: '#/components/schemas/MessageRole-Output' + tool_call_id: + anyOf: + - type: string + - type: 'null' + title: Tool Call Id + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object + required: + - content + - role + title: Message + MessageEvent: + properties: + type: + type: string + const: message + title: Type + default: message + id: + anyOf: + - type: string + - type: 'null' + title: Id + description: Unique identifier for the event + status: + anyOf: + - $ref: '#/components/schemas/EventStatus' + - type: 'null' + description: Status of the event + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Provider-specific metadata and additional fields + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message if the event failed + role: + $ref: '#/components/schemas/MessageRole-Output' + description: Role of the message sender + content: + anyOf: + - type: string + - type: 'null' + title: Content + description: Text content of the message + content_parts: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Content Parts + description: Structured content items (text, audio, images, etc.) + type: object + required: + - role + title: MessageEvent + description: An output message from the model. + MessageRole-Output: + type: string + enum: + - agent + - assistant + - developer + - function + - system + - tool + - user + title: MessageRole + Messages: + items: + $ref: '#/components/schemas/galileo_core__schemas__shared__message__Message' + type: array + title: Messages + MetadataFilter: + properties: + name: + type: string + const: metadata + title: Name + default: metadata operator: type: string enum: + - one_of + - not_in - eq - ne + - regex title: Operator - default: eq + key: + type: string + title: Key value: - type: boolean + anyOf: + - type: string + - items: + type: string + type: array title: Value + case_sensitive: + type: boolean + title: Case Sensitive + default: true + type: object + required: + - operator + - key + - value + title: MetadataFilter + description: Filters on metadata key-value pairs in scorer jobs. + MetricAggregates: + properties: + avg: + anyOf: + - type: number + - type: 'null' + title: Avg + sum: + anyOf: + - type: number + - type: 'null' + title: Sum + min: + anyOf: + - type: number + - type: 'null' + title: Min + max: + anyOf: + - type: number + - type: 'null' + title: Max + count: + anyOf: + - type: integer + - type: 'null' + title: Count + pct: + anyOf: + - type: number + - type: 'null' + title: Pct + p50: + anyOf: + - type: number + - type: 'null' + title: P50 + p90: + anyOf: + - type: number + - type: 'null' + title: P90 + p95: + anyOf: + - type: number + - type: 'null' + title: P95 + p99: + anyOf: + - type: number + - type: 'null' + title: P99 + value_distribution: + anyOf: + - additionalProperties: + type: integer + type: object + - type: 'null' + title: Value Distribution + description: 'Distribution of discrete values as {value: count}. For boolean + metrics: {''0'': 2, ''1'': 8}. For categorical metrics: {''low'': 5, ''medium'': + 3, ''high'': 2}.' + type: object + title: MetricAggregates + description: Structured aggregate values for a single metric, computed from + ClickHouse row-level data. + MetricAggregation: + type: string + enum: + - Count + - Sum + - Average + - Min + - Max + - P50 + - P90 + - P95 + - P99 + - PercentageFalse + - PercentageTrue + title: MetricAggregation + MetricAggregationDetail: + properties: + id: + type: string + title: Id + description: Identifier for the metric in the response (e.g., 'w1', 'w2') + metric_name: + type: string + title: Metric Name + description: Name of the metric to aggregate + aggregation: + $ref: '#/components/schemas/MetricAggregation' + description: Aggregation type to apply + type: object + required: + - id + - metric_name + - aggregation + title: MetricAggregationDetail + MetricColor: + type: string + enum: + - red + - yellow + - green + title: MetricColor + description: Allowed colors for metric threshold visualization in the UI. + MetricColorPickerBoolean: + properties: type: type: string const: boolean title: Type default: boolean + constraints: + items: + $ref: '#/components/schemas/BooleanColorConstraint' + type: array + minItems: 1 + title: Constraints + type: object + required: + - constraints + title: MetricColorPickerBoolean + description: "Color picker configuration for boolean metrics.\n\nEach constraint\ + \ maps a boolean value to a color.\n\nExample:\n {\n \"type\": \"\ + boolean\",\n \"constraints\": [\n {\"color\": \"green\"\ + , \"operator\": \"eq\", \"value\": true},\n {\"color\": \"red\"\ + , \"operator\": \"eq\", \"value\": false}\n ]\n }" + MetricColorPickerCategorical: + properties: + type: + type: string + const: categorical + title: Type + default: categorical + constraints: + items: + $ref: '#/components/schemas/CategoricalColorConstraint' + type: array + minItems: 1 + title: Constraints + type: object + required: + - constraints + title: MetricColorPickerCategorical + description: "Color picker configuration for categorical metrics.\n\nEach constraint\ + \ maps one or more category values to a color. A category\nvalue must not\ + \ appear in more than one constraint.\n\nExample:\n {\n \"type\"\ + : \"categorical\",\n \"constraints\": [\n {\"color\": \"\ + green\", \"operator\": \"eq\", \"value\": \"pass\"},\n {\"color\"\ + : \"red\", \"operator\": \"one_of\", \"value\": [\"fail\", \"error\"]}\n \ + \ ]\n }" + MetricColorPickerMultiLabel: + properties: + type: + type: string + const: multi_label + title: Type + default: multi_label + constraints: + items: + $ref: '#/components/schemas/CategoricalColorConstraint' + type: array + minItems: 1 + title: Constraints + type: object + required: + - constraints + title: MetricColorPickerMultiLabel + description: "Color picker configuration for multi-label metrics.\n\nBehaves\ + \ the same as categorical but intended for metrics that produce\nmultiple\ + \ labels. A category value must not appear in more than one constraint.\n\n\ + Example:\n {\n \"type\": \"multi_label\",\n \"constraints\"\ + : [\n {\"color\": \"green\", \"operator\": \"eq\", \"value\": \"\ + relevant\"},\n {\"color\": \"yellow\", \"operator\": \"one_of\"\ + , \"value\": [\"partial\", \"related\"]}\n ]\n }" + MetricColorPickerNumeric: + properties: + type: + type: string + const: numeric + title: Type + default: numeric + constraints: + items: + $ref: '#/components/schemas/NumericColorConstraint' + type: array + minItems: 1 + title: Constraints type: object required: - - column_id - - value - title: LogRecordsBooleanFilter - LogRecordsCollectionFilter: + - constraints + title: MetricColorPickerNumeric + description: "Color picker configuration for numeric metrics.\n\nEach constraint\ + \ maps a numeric condition to a color. The UI uses these\nconstraints to color-code\ + \ metric values (e.g. green for high scores,\nred for low scores).\n\nExample:\n\ + \ {\n \"type\": \"numeric\",\n \"constraints\": [\n \ + \ {\"color\": \"green\", \"operator\": \"gte\", \"value\": 0.8},\n \ + \ {\"color\": \"yellow\", \"operator\": \"between\", \"value\":\ + \ [0.3, 0.8]},\n {\"color\": \"red\", \"operator\": \"lt\", \"\ + value\": 0.3}\n ]\n }" + MetricComputation: properties: - column_id: - type: string - title: Column Id - description: ID of the column to filter. - operator: - type: string - enum: - - eq - - contains - - one_of - - not_in - title: Operator value: anyOf: + - type: number + - type: integer - type: string - items: - type: string + anyOf: + - type: number + - type: integer + - type: string + - type: 'null' type: array + - additionalProperties: + anyOf: + - type: number + - type: integer + - type: string + - type: 'null' + type: object + - type: 'null' title: Value - case_sensitive: - type: boolean - title: Case Sensitive - default: true - type: + execution_time: + anyOf: + - type: number + - type: 'null' + title: Execution Time + status: + anyOf: + - $ref: '#/components/schemas/MetricComputationStatus' + - type: 'null' + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + type: object + title: MetricComputation + MetricComputationStatus: + type: string + enum: + - success + - timeout + - failed + - error + title: MetricComputationStatus + MetricComputing: + properties: + status_type: type: string - const: collection - title: Type - default: collection + const: computing + title: Status Type + default: computing + metric_key_alias: + anyOf: + - type: string + - type: 'null' + title: Metric Key Alias + message: + type: string + title: Message + default: Metric is computing. type: object - required: - - column_id - - operator - - value - title: LogRecordsCollectionFilter - LogRecordsColumnInfo: + title: MetricComputing + MetricError: properties: - id: + status_type: type: string - title: Id - description: Column id. Must be universally unique. - label: + const: error + title: Status Type + default: error + metric_key_alias: anyOf: - type: string - type: 'null' - title: Label - description: Display label of the column in the UI. - category: - $ref: '#/components/schemas/ColumnCategory' - description: Category of the column. - description: + title: Metric Key Alias + message: anyOf: - type: string - type: 'null' - title: Description - description: Description of the column. - group_label: + title: Message + default: An error occured. + ems_error_code: + anyOf: + - type: integer + - type: 'null' + title: Ems Error Code + description: EMS error code from errors.yaml catalog for this metric error + standard_error: + anyOf: + - $ref: '#/components/schemas/StandardError' + - type: 'null' + description: Structured EMS error resolved on-the-fly from errors.yaml catalog + type: object + title: MetricError + MetricFailed: + properties: + status_type: + type: string + const: failed + title: Status Type + default: failed + metric_key_alias: anyOf: - type: string - type: 'null' - title: Group Label - description: Display label of the column group. - data_type: + title: Metric Key Alias + message: anyOf: - - $ref: '#/components/schemas/DataType' + - type: string - type: 'null' - description: Data type of the column. This is used to determine how to format - the data on the UI. - data_unit: + title: Message + default: Metric failed to compute. + ems_error_code: anyOf: - - $ref: '#/components/schemas/DataUnit' + - type: integer - type: 'null' - description: Data unit of the column (optional). - multi_valued: - type: boolean - title: Multi Valued - description: Whether the column is multi-valued. - default: false - allowed_values: + title: Ems Error Code + description: EMS error code from errors.yaml catalog for this metric failure + standard_error: anyOf: - - items: {} - type: array - uniqueItems: true + - $ref: '#/components/schemas/StandardError' - type: 'null' - title: Allowed Values - description: Allowed values for this column. - sortable: - type: boolean - title: Sortable - description: Whether the column is sortable. - filterable: - type: boolean - title: Filterable - description: Whether the column is filterable. - is_empty: - type: boolean - title: Is Empty - description: Indicates whether the column is empty and should be hidden. - default: false - applicable_types: - items: - $ref: '#/components/schemas/StepType' - type: array - uniqueItems: true - title: Applicable Types - description: List of types applicable for this column. - is_optional: - type: boolean - title: Is Optional - description: Whether the column is optional. - default: false - roll_up_method: + description: Structured EMS error resolved on-the-fly from errors.yaml catalog + type: object + title: MetricFailed + MetricNotApplicable: + properties: + status_type: + type: string + const: not_applicable + title: Status Type + default: not_applicable + metric_key_alias: anyOf: - type: string - type: 'null' - title: Roll Up Method - description: Default roll-up aggregation method for this metric (e.g., 'sum', - 'average'). + title: Metric Key Alias + message: + type: string + title: Message + default: Metric not applicable. + ems_error_code: + anyOf: + - type: integer + - type: 'null' + title: Ems Error Code + description: EMS error code from errors.yaml catalog for this not-applicable + reason + standard_error: + anyOf: + - $ref: '#/components/schemas/StandardError' + - type: 'null' + description: Structured EMS error resolved on-the-fly from errors.yaml catalog + type: object + title: MetricNotApplicable + MetricNotComputed: + properties: + status_type: + type: string + const: not_computed + title: Status Type + default: not_computed metric_key_alias: anyOf: - type: string - type: 'null' title: Metric Key Alias - description: Alternate metric key for this column. When scorer UUIDs are - used as column IDs, this holds the legacy metric_name string for dual-key - ClickHouse query fallback. - threshold: + message: + type: string + title: Message + default: Metric not computed. + ems_error_code: anyOf: - - $ref: '#/components/schemas/MetricThreshold' + - type: integer - type: 'null' - description: Thresholds for the column, if this is a metrics column. - scorer_config: + title: Ems Error Code + description: EMS error code from errors.yaml catalog for this not-computed + reason + standard_error: anyOf: - - $ref: '#/components/schemas/RuntimeScorerConfig' + - $ref: '#/components/schemas/StandardError' - type: 'null' - description: 'For metric columns only: Scorer config that produced the metric.' - scorer_id: + description: Structured EMS error resolved on-the-fly from errors.yaml catalog + type: object + title: MetricNotComputed + MetricPending: + properties: + status_type: + type: string + const: pending + title: Status Type + default: pending + metric_key_alias: anyOf: - type: string - format: uuid4 - type: 'null' - title: Scorer Id - description: 'For metric columns only: Scorer id that produced the metric. - This is deprecated and will be removed in future versions.' - insight_type: + title: Metric Key Alias + type: object + title: MetricPending + MetricRollUp-Input: + properties: + status_type: + type: string + const: roll_up + title: Status Type + default: roll_up + metric_key_alias: anyOf: - - $ref: '#/components/schemas/InsightType' + - type: string - type: 'null' - description: Insight type. - filter_type: + title: Metric Key Alias + value: anyOf: - - $ref: '#/components/schemas/LogRecordsFilterType' + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Input' + - $ref: '#/components/schemas/FeedbackRatingDB-Input' + - $ref: '#/components/schemas/FeedbackAggregate' + - items: + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Input' + - $ref: '#/components/schemas/FeedbackRatingDB-Input' + - $ref: '#/components/schemas/FeedbackAggregate' + - type: 'null' + type: array + - items: + items: + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Input' + - $ref: '#/components/schemas/FeedbackRatingDB-Input' + - $ref: '#/components/schemas/FeedbackAggregate' + - type: 'null' + type: array + type: array + - items: + items: + items: + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Input' + - $ref: '#/components/schemas/FeedbackRatingDB-Input' + - $ref: '#/components/schemas/FeedbackAggregate' + - type: 'null' + type: array + type: array + type: array - type: 'null' - description: Filter type. - label_color: + title: Value + explanation: anyOf: - type: string - enum: - - positive - - negative - type: 'null' - title: Label Color - description: Type of label color for the column, if this is a multilabel - metric column. + title: Explanation + cost: + anyOf: + - type: number + - type: 'null' + title: Cost + model_alias: + anyOf: + - type: string + - type: 'null' + title: Model Alias + num_judges: + anyOf: + - type: integer + - type: 'null' + title: Num Judges + multijudge_average: + anyOf: + - type: number + - type: 'null' + title: Multijudge Average + boolean_from_prob: + anyOf: + - type: boolean + - type: 'null' + title: Boolean From Prob + description: The Boolean verdict a probability-scored Evaluator's confidence + implies. Additional to `value`, which keeps carrying the confidence itself. + Absent on a rolled-up parent, which carries counts of its children's verdicts + instead. + input_tokens: + anyOf: + - type: integer + - type: 'null' + title: Input Tokens + output_tokens: + anyOf: + - type: integer + - type: 'null' + title: Output Tokens + total_tokens: + anyOf: + - type: integer + - type: 'null' + title: Total Tokens + batch_size: + anyOf: + - type: integer + - type: 'null' + title: Batch Size + description: Number of questions the provider call that produced this value + answered, 1 or more. Above 1, `cost` and the token counts are this metric's + share of that call. Absent on rolled-up parents, on non-decision metrics, + and on decision results written before batching. + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Optional per-row context returned alongside the score by code-based + scorers that return a (score, metadata) tuple. Sourced from the {metric_name}_metadata + auxiliary key, which is stored as a JSON string in ClickHouse. + roll_up_metrics: + additionalProperties: + anyOf: + - type: number + - additionalProperties: + type: integer + type: object + type: object + title: Roll Up Metrics + description: Roll up metrics e.g. sum, average, min, max for numeric, and + category_count for categorical metrics. type: object required: - - id - - category - - data_type - title: LogRecordsColumnInfo - LogRecordsCustomMetricsQueryRequest: + - value + title: MetricRollUp + MetricRollUp-Output: properties: - start_time: - type: string - format: date-time - title: Start Time - description: Include traces from this time onward. - end_time: + status_type: type: string - format: date-time - title: End Time - description: Include traces up to this time. - log_stream_id: + const: roll_up + title: Status Type + default: roll_up + metric_key_alias: + anyOf: + - type: string + - type: 'null' + title: Metric Key Alias + value: + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Output' + - $ref: '#/components/schemas/FeedbackRatingDB-Output' + - $ref: '#/components/schemas/FeedbackAggregate' + - items: + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Output' + - $ref: '#/components/schemas/FeedbackRatingDB-Output' + - $ref: '#/components/schemas/FeedbackAggregate' + - type: 'null' + type: array + - items: + items: + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Output' + - $ref: '#/components/schemas/FeedbackRatingDB-Output' + - $ref: '#/components/schemas/FeedbackAggregate' + - type: 'null' + type: array + type: array + - items: + items: + items: + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Output' + - $ref: '#/components/schemas/FeedbackRatingDB-Output' + - $ref: '#/components/schemas/FeedbackAggregate' + - type: 'null' + type: array + type: array + type: array + - type: 'null' + title: Value + explanation: anyOf: - type: string - format: uuid4 - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: + title: Explanation + cost: anyOf: - - type: string - format: uuid4 + - type: number - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: + title: Cost + model_alias: anyOf: - type: string - format: uuid4 - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - access_view_id: + title: Model Alias + num_judges: anyOf: - - type: string - format: uuid4 + - type: integer - type: 'null' - title: Access View Id - description: Assigned log view for restricted access. - filter_tree: + title: Num Judges + multijudge_average: anyOf: - - $ref: '#/components/schemas/FilterExpression_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - type: number - type: 'null' - description: Filter expression tree for complex filtering - interval_minutes: - type: integer - title: Interval Minutes - description: Time interval in minutes for bucketing - default: 5 - metric_details: - items: - $ref: '#/components/schemas/MetricAggregationDetail' - type: array - maxItems: 100 - title: Metric Details - description: List of metrics to aggregate with their widget IDs and aggregation - types (max 100) - group_by: + title: Multijudge Average + boolean_from_prob: anyOf: - - type: string + - type: boolean - type: 'null' - title: Group By - description: Column to group by - type: object - required: - - start_time - - end_time - - metric_details - title: LogRecordsCustomMetricsQueryRequest - examples: - - end_time: '2024-01-07T23:59:59Z' - filter_tree: - and_: - - filter: - case_sensitive: true - name: input - operator: contains - type: text - value: customer - group_by: model - interval_minutes: 1440 - log_stream_id: c5fef527-51f6-49d0-800a-1859b678a098 - metric_details: - - aggregation: Sum - id: w1 - metric_name: num_total_tokens - - aggregation: Average - id: w2 - metric_name: toxicity - start_time: '2024-01-01T00:00:00Z' - LogRecordsDateFilter: - properties: - column_id: - type: string - title: Column Id - description: ID of the column to filter. - operator: - type: string - enum: - - eq - - ne - - gt - - gte - - lt - - lte - title: Operator - value: - type: string - format: date-time - title: Value - type: - type: string - const: date - title: Type - default: date - type: object - required: - - column_id - - operator - - value - title: LogRecordsDateFilter - LogRecordsDeleteRequest: - properties: - log_stream_id: + title: Boolean From Prob + description: The Boolean verdict a probability-scored Evaluator's confidence + implies. Additional to `value`, which keeps carrying the confidence itself. + Absent on a rolled-up parent, which carries counts of its children's verdicts + instead. + input_tokens: anyOf: - - type: string - format: uuid4 + - type: integer - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: + title: Input Tokens + output_tokens: anyOf: - - type: string - format: uuid4 + - type: integer - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: + title: Output Tokens + total_tokens: anyOf: - - type: string - format: uuid4 + - type: integer - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - filters: - items: - oneOf: - - $ref: '#/components/schemas/LogRecordsIDFilter' - - $ref: '#/components/schemas/LogRecordsDateFilter' - - $ref: '#/components/schemas/LogRecordsNumberFilter' - - $ref: '#/components/schemas/LogRecordsBooleanFilter' - - $ref: '#/components/schemas/LogRecordsCollectionFilter' - - $ref: '#/components/schemas/LogRecordsTextFilter' - - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - discriminator: - propertyName: type - mapping: - boolean: '#/components/schemas/LogRecordsBooleanFilter' - collection: '#/components/schemas/LogRecordsCollectionFilter' - date: '#/components/schemas/LogRecordsDateFilter' - fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - id: '#/components/schemas/LogRecordsIDFilter' - number: '#/components/schemas/LogRecordsNumberFilter' - text: '#/components/schemas/LogRecordsTextFilter' - type: array - title: Filters - filter_tree: + title: Total Tokens + batch_size: anyOf: - - $ref: '#/components/schemas/FilterExpression_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - type: integer + - type: 'null' + title: Batch Size + description: Number of questions the provider call that produced this value + answered, 1 or more. Above 1, `cost` and the token counts are this metric's + share of that call. Absent on rolled-up parents, on non-decision metrics, + and on decision results written before batching. + metadata: + anyOf: + - additionalProperties: true + type: object - type: 'null' + title: Metadata + description: Optional per-row context returned alongside the score by code-based + scorers that return a (score, metadata) tuple. Sourced from the {metric_name}_metadata + auxiliary key, which is stored as a JSON string in ClickHouse. + roll_up_metrics: + additionalProperties: + anyOf: + - type: number + - additionalProperties: + type: integer + type: object + type: object + title: Roll Up Metrics + description: Roll up metrics e.g. sum, average, min, max for numeric, and + category_count for categorical metrics. type: object - title: LogRecordsDeleteRequest - example: - filters: - - case_sensitive: true - name: input - operator: eq - type: text - value: example input - log_stream_id: 74aec44e-ec21-4c9f-a3e2-b2ab2b81b4db - LogRecordsDeleteResponse: + required: + - value + title: MetricRollUp + MetricSettingsConflictResponse: properties: - message: + detail: type: string - title: Message - description: Message + title: Detail type: object required: - - message - title: LogRecordsDeleteResponse - LogRecordsExportRequest: + - detail + title: MetricSettingsConflictResponse + description: A replacement save rejected because its settings revision is stale. + MetricSettingsRequest: properties: - column_ids: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Column Ids - description: Column IDs to include in the export. Applies only to CSV exports. - export_format: - $ref: '#/components/schemas/LLMExportFormat' - description: Export format - default: jsonl - redact: - type: boolean - title: Redact - description: Redact sensitive data - default: true - file_name: - anyOf: - - type: string - - type: 'null' - title: File Name - description: Optional filename for the exported file - export_computed_metrics_only: - type: boolean - title: Export Computed Metrics Only - description: When true, export only enabled scorer metrics with computed - values (success or roll_up). For session exports, omit entire sessions - unless every enabled metric at session, trace, or span level is ready - (success, roll_up, or not_applicable). Not supported with export_format=jsonl_flat - (returns 422); use jsonl or csv instead. - default: false - log_stream_id: + expected_settings_revision: anyOf: - type: string - format: uuid4 + pattern: ^[0-9a-f]{64}$ - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: + title: Expected Settings Revision + description: Revision read before replacing settings. A stale revision returns + 409. + scorers: anyOf: - - type: string - format: uuid4 + - items: + $ref: '#/components/schemas/RuntimeScorerConfig' + type: array - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: + title: Scorers + description: List of Galileo scorers to enable. + segment_filters: anyOf: - - type: string - format: uuid4 + - items: + $ref: '#/components/schemas/SegmentFilter' + type: array - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - access_view_id: + title: Segment Filters + description: List of segment filters to apply to the run. + type: object + title: MetricSettingsRequest + MetricSettingsResponse: + properties: + expected_settings_revision: anyOf: - type: string - format: uuid4 + pattern: ^[0-9a-f]{64}$ - type: 'null' - title: Access View Id - description: Assigned log view for restricted access. - filters: + title: Expected Settings Revision + description: Revision read before replacing settings. A stale revision returns + 409. + scorers: items: - oneOf: - - $ref: '#/components/schemas/LogRecordsIDFilter' - - $ref: '#/components/schemas/LogRecordsDateFilter' - - $ref: '#/components/schemas/LogRecordsNumberFilter' - - $ref: '#/components/schemas/LogRecordsBooleanFilter' - - $ref: '#/components/schemas/LogRecordsCollectionFilter' - - $ref: '#/components/schemas/LogRecordsTextFilter' - - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - discriminator: - propertyName: type - mapping: - boolean: '#/components/schemas/LogRecordsBooleanFilter' - collection: '#/components/schemas/LogRecordsCollectionFilter' - date: '#/components/schemas/LogRecordsDateFilter' - fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - id: '#/components/schemas/LogRecordsIDFilter' - number: '#/components/schemas/LogRecordsNumberFilter' - text: '#/components/schemas/LogRecordsTextFilter' + $ref: '#/components/schemas/RuntimeScorerConfig' type: array - title: Filters - description: Filters to apply on the export - sort: + title: Scorers + segment_filters: anyOf: - - $ref: '#/components/schemas/LogRecordsSortClause' + - items: + $ref: '#/components/schemas/SegmentFilter' + type: array - type: 'null' - description: Sort clause for the export. Defaults to native sort (created_at, - id descending). - root_type: - $ref: '#/components/schemas/RootType' - include_code_metric_metadata: - type: boolean - title: Include Code Metric Metadata - description: If True, include per-row scorer metadata (the dict returned - alongside the score by code-based scorers via the (score, metadata) tuple-return - contract) on each MetricSuccess in the export. Off by default to keep - payloads small for callers that don't need it. - default: false + title: Segment Filters + description: List of segment filters to apply to the run. + settings_revision: + anyOf: + - type: string + - type: 'null' + title: Settings Revision + description: Revision of the persisted evaluator settings. type: object required: - - root_type - title: LogRecordsExportRequest - description: Request schema for exporting log records (sessions, traces, spans). - examples: - - column_ids: - - input - - output - - created_at - export_format: jsonl - filters: - - case_sensitive: true - name: input - operator: eq - type: text - value: example input - log_stream_id: 00000000-0000-0000-0000-000000000000 - root_type: trace - sort: - ascending: false - name: created_at - sort_type: column - LogRecordsFilterType: - type: string - enum: - - id - - date - - number - - boolean - - text - - collection - - fully_annotated - title: LogRecordsFilterType - LogRecordsFullyAnnotatedFilter: + - scorers + title: MetricSettingsResponse + MetricSuccess-Input: properties: - column_id: - type: string - const: fully_annotated - title: Column Id - description: Queue-scoped filter identifier. This filter only works for - annotation-queue searches that provide queue context. - default: fully_annotated - type: + status_type: type: string - const: fully_annotated - title: Type - default: fully_annotated - user_ids: + const: success + title: Status Type + default: success + metric_key_alias: anyOf: - - items: - type: string - format: uuid4 - type: array - minItems: 1 + - type: string - type: 'null' - title: User Ids - description: Optional queue member IDs to require for full annotation in - a queue-scoped search. If omitted, all tracked queue members visible to - the requester are used. - type: object - title: LogRecordsFullyAnnotatedFilter - description: Queue-scoped filter for records rated across all queue templates. - LogRecordsIDFilter: - properties: - column_id: - type: string - title: Column Id - description: ID of the column to filter. - operator: - type: string - enum: - - eq - - ne - - one_of - - not_in - - contains - title: Operator - default: eq + title: Metric Key Alias value: anyOf: - type: string - format: uuid4 + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Input' + - $ref: '#/components/schemas/FeedbackRatingDB-Input' + - $ref: '#/components/schemas/FeedbackAggregate' - items: anyOf: - type: string - format: uuid4 + - type: integer + - type: number + - type: boolean + - type: string + format: uuid - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Input' + - $ref: '#/components/schemas/FeedbackRatingDB-Input' + - $ref: '#/components/schemas/FeedbackAggregate' + - type: 'null' type: array - - type: string - title: Value - type: - type: string - const: id - title: Type - default: id - type: object - required: - - column_id - - value - title: LogRecordsIDFilter - LogRecordsMetricsQueryRequest: - properties: - start_time: - type: string - format: date-time - title: Start Time - description: Include traces from this time onward. - end_time: - type: string - format: date-time - title: End Time - description: Include traces up to this time. - log_stream_id: + - items: + items: + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Input' + - $ref: '#/components/schemas/FeedbackRatingDB-Input' + - $ref: '#/components/schemas/FeedbackAggregate' + - type: 'null' + type: array + type: array + - items: + items: + items: + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Input' + - $ref: '#/components/schemas/FeedbackRatingDB-Input' + - $ref: '#/components/schemas/FeedbackAggregate' + - type: 'null' + type: array + type: array + type: array + - type: 'null' + title: Value + explanation: anyOf: - type: string - format: uuid4 - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: + title: Explanation + cost: anyOf: - - type: string - format: uuid4 + - type: number - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: + title: Cost + model_alias: anyOf: - type: string - format: uuid4 - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - access_view_id: + title: Model Alias + num_judges: + anyOf: + - type: integer + - type: 'null' + title: Num Judges + multijudge_average: + anyOf: + - type: number + - type: 'null' + title: Multijudge Average + boolean_from_prob: + anyOf: + - type: boolean + - type: 'null' + title: Boolean From Prob + description: The Boolean verdict a probability-scored Evaluator's confidence + implies. Additional to `value`, which keeps carrying the confidence itself. + Absent on a rolled-up parent, which carries counts of its children's verdicts + instead. + input_tokens: + anyOf: + - type: integer + - type: 'null' + title: Input Tokens + output_tokens: + anyOf: + - type: integer + - type: 'null' + title: Output Tokens + total_tokens: + anyOf: + - type: integer + - type: 'null' + title: Total Tokens + batch_size: + anyOf: + - type: integer + - type: 'null' + title: Batch Size + description: Number of questions the provider call that produced this value + answered, 1 or more. Above 1, `cost` and the token counts are this metric's + share of that call. Absent on rolled-up parents, on non-decision metrics, + and on decision results written before batching. + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Optional per-row context returned alongside the score by code-based + scorers that return a (score, metadata) tuple. Sourced from the {metric_name}_metadata + auxiliary key, which is stored as a JSON string in ClickHouse. + display_value: anyOf: - type: string - format: uuid4 - type: 'null' - title: Access View Id - description: Assigned log view for restricted access. - filters: - items: - oneOf: - - $ref: '#/components/schemas/LogRecordsIDFilter' - - $ref: '#/components/schemas/LogRecordsDateFilter' - - $ref: '#/components/schemas/LogRecordsNumberFilter' - - $ref: '#/components/schemas/LogRecordsBooleanFilter' - - $ref: '#/components/schemas/LogRecordsCollectionFilter' - - $ref: '#/components/schemas/LogRecordsTextFilter' - - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - discriminator: - propertyName: type - mapping: - boolean: '#/components/schemas/LogRecordsBooleanFilter' - collection: '#/components/schemas/LogRecordsCollectionFilter' - date: '#/components/schemas/LogRecordsDateFilter' - fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - id: '#/components/schemas/LogRecordsIDFilter' - number: '#/components/schemas/LogRecordsNumberFilter' - text: '#/components/schemas/LogRecordsTextFilter' - type: array - title: Filters - interval: - type: integer - title: Interval - default: 5 - group_by: + title: Display Value + rationale: anyOf: - type: string - type: 'null' - title: Group By - type: object - required: - - start_time - - end_time - title: LogRecordsMetricsQueryRequest - examples: - - end_time: '2023-10-01T01:00:00Z' - filters: - - case_sensitive: true - name: input - operator: eq - type: text - value: example input - group_by: model - interval: 5 - log_stream_id: 00000000-0000-0000-0000-000000000000 - start_time: '2023-10-01T00:00:00Z' - LogRecordsMetricsResponse: - properties: - group_by_columns: - items: - type: string - type: array - title: Group By Columns - aggregate_metrics: - additionalProperties: - anyOf: - - type: number - - type: integer - - additionalProperties: - type: integer - type: object - type: object - title: Aggregate Metrics - bucketed_metrics: - additionalProperties: - items: - $ref: '#/components/schemas/BucketedMetrics' - type: array - type: object - title: Bucketed Metrics - ems_captured_error: - type: boolean - title: Ems Captured Error - description: Whether any EMS error codes were encountered in the queried - metrics - default: false - standard_errors: + title: Rationale + value_description: anyOf: - - additionalProperties: - $ref: '#/components/schemas/StandardError' - type: object + - type: string - type: 'null' - title: Standard Errors - description: Structured EMS errors for each error code encountered, keyed - by code + title: Value Description + description: 'The description of the answer that `value` names, written + when the record is scored. Decision evaluators write it: the true or false + criteria of a Boolean evaluator, the description of the category, or the + description of the level. Sourced from the {metric_name}_value_description + auxiliary key. Absent when that answer has none.' type: object required: - - group_by_columns - - aggregate_metrics - - bucketed_metrics - title: LogRecordsMetricsResponse - LogRecordsNumberFilter: + - value + title: MetricSuccess + MetricSuccess-Output: properties: - column_id: - type: string - title: Column Id - description: ID of the column to filter. - operator: + status_type: type: string - enum: - - eq - - ne - - gt - - gte - - lt - - lte - - between - title: Operator + const: success + title: Status Type + default: success + metric_key_alias: + anyOf: + - type: string + - type: 'null' + title: Metric Key Alias value: anyOf: + - type: string - type: integer - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Output' + - $ref: '#/components/schemas/FeedbackRatingDB-Output' + - $ref: '#/components/schemas/FeedbackAggregate' - items: - type: integer + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Output' + - $ref: '#/components/schemas/FeedbackRatingDB-Output' + - $ref: '#/components/schemas/FeedbackAggregate' + - type: 'null' type: array - items: - type: number + items: + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Output' + - $ref: '#/components/schemas/FeedbackRatingDB-Output' + - $ref: '#/components/schemas/FeedbackAggregate' + - type: 'null' + type: array + type: array + - items: + items: + items: + anyOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: string + format: uuid + - type: string + format: date-time + - $ref: '#/components/schemas/Segment' + - $ref: '#/components/schemas/HallucinationSegment' + - $ref: '#/components/schemas/Document-Output' + - $ref: '#/components/schemas/FeedbackRatingDB-Output' + - $ref: '#/components/schemas/FeedbackAggregate' + - type: 'null' + type: array + type: array type: array + - type: 'null' title: Value - type: - type: string - const: number - title: Type - default: number - type: object - required: - - column_id - - operator - - value - title: LogRecordsNumberFilter - LogRecordsPartialQueryRequest: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - maximum: 1000.0 - minimum: 0.0 - title: Limit - description: Records per page, at most 1000. Page through larger result - sets with starting_token or previous_last_row_id. - default: 100 - previous_last_row_id: + explanation: anyOf: - type: string - format: uuid4 - type: 'null' - title: Previous Last Row Id - log_stream_id: + title: Explanation + cost: anyOf: - - type: string - format: uuid4 + - type: number - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: + title: Cost + model_alias: anyOf: - type: string - format: uuid4 - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: + title: Model Alias + num_judges: anyOf: - - type: string - format: uuid4 + - type: integer - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - access_view_id: + title: Num Judges + multijudge_average: + anyOf: + - type: number + - type: 'null' + title: Multijudge Average + boolean_from_prob: + anyOf: + - type: boolean + - type: 'null' + title: Boolean From Prob + description: The Boolean verdict a probability-scored Evaluator's confidence + implies. Additional to `value`, which keeps carrying the confidence itself. + Absent on a rolled-up parent, which carries counts of its children's verdicts + instead. + input_tokens: + anyOf: + - type: integer + - type: 'null' + title: Input Tokens + output_tokens: + anyOf: + - type: integer + - type: 'null' + title: Output Tokens + total_tokens: + anyOf: + - type: integer + - type: 'null' + title: Total Tokens + batch_size: + anyOf: + - type: integer + - type: 'null' + title: Batch Size + description: Number of questions the provider call that produced this value + answered, 1 or more. Above 1, `cost` and the token counts are this metric's + share of that call. Absent on rolled-up parents, on non-decision metrics, + and on decision results written before batching. + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Optional per-row context returned alongside the score by code-based + scorers that return a (score, metadata) tuple. Sourced from the {metric_name}_metadata + auxiliary key, which is stored as a JSON string in ClickHouse. + display_value: anyOf: - type: string - format: uuid4 - type: 'null' - title: Access View Id - description: Assigned log view for restricted access. - filters: - items: - oneOf: - - $ref: '#/components/schemas/LogRecordsIDFilter' - - $ref: '#/components/schemas/LogRecordsDateFilter' - - $ref: '#/components/schemas/LogRecordsNumberFilter' - - $ref: '#/components/schemas/LogRecordsBooleanFilter' - - $ref: '#/components/schemas/LogRecordsCollectionFilter' - - $ref: '#/components/schemas/LogRecordsTextFilter' - - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - discriminator: - propertyName: type - mapping: - boolean: '#/components/schemas/LogRecordsBooleanFilter' - collection: '#/components/schemas/LogRecordsCollectionFilter' - date: '#/components/schemas/LogRecordsDateFilter' - fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - id: '#/components/schemas/LogRecordsIDFilter' - number: '#/components/schemas/LogRecordsNumberFilter' - text: '#/components/schemas/LogRecordsTextFilter' - type: array - title: Filters - filter_tree: + title: Display Value + rationale: anyOf: - - $ref: '#/components/schemas/FilterExpression_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - type: string - type: 'null' - sort: + title: Rationale + value_description: anyOf: - - $ref: '#/components/schemas/LogRecordsSortClause' + - type: string - type: 'null' - description: Sort for the query. Defaults to native sort (created_at, id - descending). - truncate_fields: - type: boolean - title: Truncate Fields - default: false - include_counts: - type: boolean - title: Include Counts - description: If True, include computed child counts (e.g., num_traces for - sessions, num_spans for traces). - default: false - include_code_metric_metadata: - type: boolean - title: Include Code Metric Metadata - description: If True, include per-row scorer metadata (the dict returned - alongside the score by code-based scorers via the (score, metadata) tuple-return - contract) on each MetricSuccess in the response. Off by default to keep - payloads small for callers that don't need it. - default: false - select_columns: - $ref: '#/components/schemas/SelectColumns' + title: Value Description + description: 'The description of the answer that `value` names, written + when the record is scored. Decision evaluators write it: the true or false + criteria of a Boolean evaluator, the description of the category, or the + description of the level. Sourced from the {metric_name}_value_description + auxiliary key. Absent when that answer has none.' type: object required: - - select_columns - title: LogRecordsPartialQueryRequest - description: Request to query a genai project run (log stream or experiment) - with partial results. - examples: - - filters: - - case_sensitive: true - name: input - operator: eq - type: text - value: example input - log_stream_id: 00000000-0000-0000-0000-000000000000 - pagination: - limit: 5 - starting_token: 0 - select_columns: - column_ids: - - id - - metrics/agentic_session_success - - metrics/completeness_gpt - include_all_feedback: false - include_all_metrics: false - includes_metric_columns: true - metric_columns_names: - - agentic_session_success - - completeness_gpt - sort: - ascending: false - name: updated_at - sort_type: column - - filter_tree: - and: - - or: - - filter: - name: input - operator: contains - type: text - value: abx - - filter: - name: output - operator: contains - type: text - value: xyz - - filter: - name: session_id - operator: eq - type: id - value: 123e4567-e89b-42d3-a456-426614174000 - log_stream_id: 00000000-0000-0000-0000-000000000000 - pagination: - limit: 5 - starting_token: 0 - select_columns: - column_ids: - - id - include_all_feedback: false - include_all_metrics: true - includes_metric_columns: true - metric_columns_names: [] - sort: - ascending: false - name: updated_at - sort_type: column - LogRecordsPartialQueryResponse: + - value + title: MetricSuccess + MetricThreshold: + properties: + inverted: + type: boolean + title: Inverted + description: Whether the column should be inverted for thresholds, i.e. + if True, lower is better. + default: false + buckets: + items: + anyOf: + - type: integer + - type: number + type: array + title: Buckets + description: Threshold buckets for the column. If the column is a metric, + these are the thresholds for the column. + display_value_levels: + items: + type: string + type: array + title: Display Value Levels + description: Ordered list of strings that raw values get transformed to + for displaying. + type: object + title: MetricThreshold + description: 'Threshold configuration for metrics. + + + Defines how metric values are bucketed and displayed, including whether + + lower or higher values are considered better.' + Metrics: properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - paginated: - type: boolean - title: Paginated - default: false - next_starting_token: + duration_ns: anyOf: - type: integer - type: 'null' - title: Next Starting Token - last_row_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Last Row Id - records: - items: - oneOf: - - $ref: '#/components/schemas/PartialExtendedTraceRecord' - - $ref: '#/components/schemas/PartialExtendedAgentSpanRecord' - - $ref: '#/components/schemas/PartialExtendedWorkflowSpanRecord' - - $ref: '#/components/schemas/PartialExtendedLlmSpanRecord' - - $ref: '#/components/schemas/PartialExtendedToolSpanRecord' - - $ref: '#/components/schemas/PartialExtendedRetrieverSpanRecord' - - $ref: '#/components/schemas/PartialExtendedControlSpanRecord' - - $ref: '#/components/schemas/PartialExtendedHttpSpanRecord' - - $ref: '#/components/schemas/PartialExtendedSessionRecord' - discriminator: - propertyName: type - mapping: - agent: '#/components/schemas/PartialExtendedAgentSpanRecord' - control: '#/components/schemas/PartialExtendedControlSpanRecord' - http: '#/components/schemas/PartialExtendedHttpSpanRecord' - llm: '#/components/schemas/PartialExtendedLlmSpanRecord' - retriever: '#/components/schemas/PartialExtendedRetrieverSpanRecord' - session: '#/components/schemas/PartialExtendedSessionRecord' - tool: '#/components/schemas/PartialExtendedToolSpanRecord' - trace: '#/components/schemas/PartialExtendedTraceRecord' - workflow: '#/components/schemas/PartialExtendedWorkflowSpanRecord' - type: array - title: Records - description: records matching the query + title: Duration Ns + description: Duration of the trace or span in nanoseconds. Displayed as + 'Latency' in Galileo. + additionalProperties: true type: object - title: LogRecordsPartialQueryResponse - examples: - - next_starting_token: 2 - num_rows: 2 - paginated: true - records: - - annotation_aggregates: {} - annotation_agreement: {} - annotation_queue_ids: [] - annotations: {} - created_at: '2026-11-11T20:11:40.340519Z' - dataset_metadata: {} - error_message: '' - feedback_rating_info: {} - file_ids: [] - file_modalities: [] - id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 - input: Who is a smart LLM? - is_complete: true - metrics: {} - name: '' - progress_message: '' - tags: [] - type: trace - user_metadata: {} - - annotation_aggregates: {} - annotation_agreement: {} - annotation_queue_ids: [] - annotations: {} - created_at: '2026-11-11T20:11:40.340670Z' - dataset_metadata: {} - error_message: '' - feedback_rating_info: {} - file_ids: [] - file_modalities: [] - id: 1edc2401-24b4-448c-a392-b36932293061 - input: - - content: Who is a smart LLM? - role: user - is_complete: true - metrics: {} - name: '' - output: - content: '' - role: assistant - progress_message: '' - tags: [] - type: llm - user_metadata: {} - LogRecordsQueryCountRequest: + title: Metrics + MetricsTestingAvailableColumnsRequest: properties: log_stream_id: anyOf: @@ -29048,348 +36610,341 @@ components: - type: 'null' title: Metrics Testing Id description: Metrics testing id associated with the traces. - access_view_id: + name: + type: string + title: Name + description: Name of the metric that we are testing. + output_type: + anyOf: + - $ref: '#/components/schemas/OutputTypeEnum' + - type: 'null' + description: Output type of the scorer. Required when metric_key is REGISTERED_SCORER_VALIDATION + or DECISION_SCORER_VALIDATION; used to determine the data_type for validation + columns. + cot_enabled: + type: boolean + title: Cot Enabled + description: Whether the metrics testing table is using chain of thought + (CoT) enabled scorers. If True, the columns will be generated for CoT + enabled scorers. + default: false + metric_key: + type: string + title: Metric Key + description: The metric key to use for column generation (e.g., 'generated_scorer_validation', + 'registered_scorer_validation' or 'decision_scorer_validation'). + default: generated_scorer_validation + required_scorers: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Required Scorers + description: List of required scorer names for composite scorers. Columns + will be generated for these scorers. + score_type: + anyOf: + - type: string + - type: 'null' + title: Score Type + description: The score type for registered scorers (e.g., 'bool', 'int', + 'float', 'str'). Used to determine the correct data_type for the column. + Provided by validation result. + type: object + required: + - name + title: MetricsTestingAvailableColumnsRequest + description: Request to get the available columns for the metrics testing table. + MistralIntegration: + properties: + id: anyOf: - type: string format: uuid4 - type: 'null' - title: Access View Id - description: Assigned log view for restricted access. - filters: - items: - oneOf: - - $ref: '#/components/schemas/LogRecordsIDFilter' - - $ref: '#/components/schemas/LogRecordsDateFilter' - - $ref: '#/components/schemas/LogRecordsNumberFilter' - - $ref: '#/components/schemas/LogRecordsBooleanFilter' - - $ref: '#/components/schemas/LogRecordsCollectionFilter' - - $ref: '#/components/schemas/LogRecordsTextFilter' - - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - discriminator: - propertyName: type - mapping: - boolean: '#/components/schemas/LogRecordsBooleanFilter' - collection: '#/components/schemas/LogRecordsCollectionFilter' - date: '#/components/schemas/LogRecordsDateFilter' - fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - id: '#/components/schemas/LogRecordsIDFilter' - number: '#/components/schemas/LogRecordsNumberFilter' - text: '#/components/schemas/LogRecordsTextFilter' - type: array - title: Filters - filter_tree: + title: Id + name: + type: string + const: mistral + title: Name + default: mistral + provider: + type: string + const: mistral + title: Provider + default: mistral + extra: anyOf: - - $ref: '#/components/schemas/FilterExpression_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - additionalProperties: true + type: object - type: 'null' + title: Extra type: object - title: LogRecordsQueryCountRequest - example: - filters: - - case_sensitive: true - name: input - operator: eq - type: text - value: example input - log_stream_id: 74aec44e-ec21-4c9f-a3e2-b2ab2b81b4db - LogRecordsQueryCountResponse: + title: MistralIntegration + MistralIntegrationCreate: properties: - total_count: - type: integer - title: Total Count - description: Total number of records matching the query + token: + type: string + title: Token type: object required: - - total_count - title: LogRecordsQueryCountResponse - LogRecordsQueryRequest: + - token + title: MistralIntegrationCreate + ModalityFilter: properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - maximum: 1000.0 - minimum: 0.0 - title: Limit - description: Records per page, at most 1000. Page through larger result - sets with starting_token or previous_last_row_id. - default: 100 - previous_last_row_id: + name: + type: string + const: modality + title: Name + default: modality + operator: + type: string + enum: + - eq + - ne + - one_of + - not_in + title: Operator + value: + anyOf: + - type: string + description: Single enum value - specific options depend on the concrete + enum type used + example: ENUM_VALUE + - items: + type: string + example: ENUM_VALUE + type: array + description: Array of enum values + example: + - ENUM_VALUE_1 + - ENUM_VALUE_2 + title: Value + type: object + required: + - operator + - value + title: ModalityFilter + description: 'Filters on content modalities in scorer jobs. + + Matches if at least one of the specified modalities is present.' + Model: + properties: + lifecycle_state: + $ref: '#/components/schemas/ModelLifecycleState' + default: active + replacement_alias: anyOf: - type: string - format: uuid4 - type: 'null' - title: Previous Last Row Id - log_stream_id: + title: Replacement Alias + deprecation_date: anyOf: - type: string - format: uuid4 + format: date - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: + title: Deprecation Date + retirement_date: anyOf: - type: string - format: uuid4 + format: date - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: + title: Retirement Date + name: + type: string + title: Name + description: Provider model identifier used to match the model to its configured + provider deployment or profile. + alias: + type: string + title: Alias + description: Galileo model identifier used in settings and API requests + to select this model. + display_name: + type: string + title: Display Name + description: Human-readable model name shown in the UI. Defaults to the + alias for legacy registrations. + default: '' + integration: + $ref: '#/components/schemas/LLMIntegration' + default: openai + user_role: anyOf: - type: string - format: uuid4 - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - access_view_id: + title: User Role + assistant_role: anyOf: - type: string - format: uuid4 - type: 'null' - title: Access View Id - description: Assigned log view for restricted access. - filters: + title: Assistant Role + system_supported: + type: boolean + title: System Supported + default: false + input_modalities: items: - oneOf: - - $ref: '#/components/schemas/LogRecordsIDFilter' - - $ref: '#/components/schemas/LogRecordsDateFilter' - - $ref: '#/components/schemas/LogRecordsNumberFilter' - - $ref: '#/components/schemas/LogRecordsBooleanFilter' - - $ref: '#/components/schemas/LogRecordsCollectionFilter' - - $ref: '#/components/schemas/LogRecordsTextFilter' - - $ref: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - discriminator: - propertyName: type - mapping: - boolean: '#/components/schemas/LogRecordsBooleanFilter' - collection: '#/components/schemas/LogRecordsCollectionFilter' - date: '#/components/schemas/LogRecordsDateFilter' - fully_annotated: '#/components/schemas/LogRecordsFullyAnnotatedFilter' - id: '#/components/schemas/LogRecordsIDFilter' - number: '#/components/schemas/LogRecordsNumberFilter' - text: '#/components/schemas/LogRecordsTextFilter' + $ref: '#/components/schemas/ContentModality' type: array - title: Filters - filter_tree: + title: Input Modalities + description: Input modalities that the model can accept. + alternative_names: + items: + type: string + type: array + title: Alternative Names + description: Alternative names for the model, used for matching with various + current, versioned or legacy names. + input_token_limit: anyOf: - - $ref: '#/components/schemas/FilterExpression_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - type: integer - type: 'null' - sort: + title: Input Token Limit + output_token_limit: anyOf: - - $ref: '#/components/schemas/LogRecordsSortClause' + - type: integer - type: 'null' - description: Sort for the query. Defaults to native sort (created_at, id - descending). - truncate_fields: - type: boolean - title: Truncate Fields - default: false - include_counts: + title: Output Token Limit + token_limit: + anyOf: + - type: integer + - type: 'null' + title: Token Limit + cost_by: + $ref: '#/components/schemas/ModelCostBy' + default: tokens + is_chat: type: boolean - title: Include Counts - description: If True, include computed child counts (e.g., num_traces for - sessions, num_spans for traces). + title: Is Chat default: false - include_code_metric_metadata: + provides_log_probs: type: boolean - title: Include Code Metric Metadata - description: If True, include per-row scorer metadata (the dict returned - alongside the score by code-based scorers via the (score, metadata) tuple-return - contract) on each MetricSuccess in the response. Off by default to keep - payloads small for callers that don't need it. + title: Provides Log Probs default: false - type: object - title: LogRecordsQueryRequest - examples: - - filters: - - case_sensitive: true - name: input - operator: eq - type: text - value: example input - log_stream_id: 00000000-0000-0000-0000-000000000000 - pagination: - limit: 5 - starting_token: 0 - sort: - ascending: false - name: updated_at - sort_type: column - - filter_tree: - and: - - or: - - filter: - name: input - operator: contains - type: text - value: abx - - filter: - name: output - operator: contains - type: text - value: xyz - - filter: - name: session_id - operator: eq - type: id - value: 123e4567-e89b-42d3-a456-426614174000 - log_stream_id: 00000000-0000-0000-0000-000000000000 - pagination: - limit: 5 - starting_token: 0 - sort: - ascending: false - name: updated_at - sort_type: column - LogRecordsQueryResponse: - properties: - starting_token: + formatting_tokens: type: integer - title: Starting Token + title: Formatting Tokens default: 0 - limit: + response_prefix_tokens: type: integer - title: Limit - default: 100 - paginated: + title: Response Prefix Tokens + default: 0 + api_version: + anyOf: + - type: string + - type: 'null' + title: Api Version + legacy_mistral_prompt_format: type: boolean - title: Paginated + title: Legacy Mistral Prompt Format default: false - next_starting_token: + requires_max_tokens: + type: boolean + title: Requires Max Tokens + default: false + supports_structured_output: + type: boolean + title: Supports Structured Output + default: false + max_top_p: + anyOf: + - type: number + - type: 'null' + title: Max Top P + params_map: + $ref: '#/components/schemas/RunParamsMap' + output_map: + anyOf: + - $ref: '#/components/schemas/OutputMap' + - type: 'null' + input_map: + anyOf: + - $ref: '#/components/schemas/InputMap' + - type: 'null' + type: object + required: + - name + - alias + title: Model + ModelCostBy: + type: string + enum: + - tokens + - characters + title: ModelCostBy + ModelLifecycleState: + type: string + enum: + - active + - deprecated + - retired + title: ModelLifecycleState + ModelType: + type: string + enum: + - slm + - llm + - code + - decision + title: ModelType + MultiModalModelIntegrationConfig: + properties: + max_files: + anyOf: + - type: integer + minimum: 1.0 + - type: 'null' + title: Max Files + description: Maximum number of files allowed per request. None means no + limit. + max_file_size_bytes: anyOf: - type: integer + minimum: 1.0 - type: 'null' - title: Next Starting Token - last_row_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Last Row Id - records: - items: - oneOf: - - $ref: '#/components/schemas/ExtendedTraceRecord' - - $ref: '#/components/schemas/ExtendedAgentSpanRecord' - - $ref: '#/components/schemas/ExtendedWorkflowSpanRecord' - - $ref: '#/components/schemas/ExtendedLlmSpanRecord' - - $ref: '#/components/schemas/ExtendedToolSpanRecord' - - $ref: '#/components/schemas/ExtendedRetrieverSpanRecord' - - $ref: '#/components/schemas/ExtendedControlSpanRecord' - - $ref: '#/components/schemas/ExtendedHttpSpanRecord' - - $ref: '#/components/schemas/ExtendedSessionRecord' - discriminator: - propertyName: type - mapping: - agent: '#/components/schemas/ExtendedAgentSpanRecord' - control: '#/components/schemas/ExtendedControlSpanRecord' - http: '#/components/schemas/ExtendedHttpSpanRecord' - llm: '#/components/schemas/ExtendedLlmSpanRecord' - retriever: '#/components/schemas/ExtendedRetrieverSpanRecord' - session: '#/components/schemas/ExtendedSessionRecord' - tool: '#/components/schemas/ExtendedToolSpanRecord' - trace: '#/components/schemas/ExtendedTraceRecord' - workflow: '#/components/schemas/ExtendedWorkflowSpanRecord' - type: array - title: Records - description: records matching the query + title: Max File Size Bytes + description: Maximum file size in bytes per file. None means no limit. type: object - title: LogRecordsQueryResponse - examples: - - next_starting_token: 2 - num_rows: 2 - paginated: true - records: - - annotation_aggregates: {} - annotation_agreement: {} - annotation_queue_ids: [] - annotations: {} - created_at: '2026-11-11T20:11:40.337604Z' - dataset_metadata: {} - error_message: '' - feedback_rating_info: {} - file_ids: [] - file_modalities: [] - id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 - input: Who is a smart LLM? - is_complete: true - metrics: - duration_ns: 4 - name: '' - output: I am - progress_message: '' - project_id: 0d4e3799-3861-4759-875f-9ae14c167b0a - run_id: 74aec44e-ec21-4c9f-a3e2-b2ab2b81b4db - session_id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 - tags: [] - trace_id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 - type: trace - user_metadata: {} - - annotation_aggregates: {} - annotation_agreement: {} - annotation_queue_ids: [] - annotations: {} - created_at: '2026-11-11T20:11:40.337807Z' - dataset_metadata: {} - error_message: '' - feedback_rating_info: {} - file_ids: [] - file_modalities: [] - id: 1edc2401-24b4-448c-a392-b36932293061 - input: - - content: Who is a smart LLM? - role: user - is_complete: true - metrics: - duration_ns: 4 - num_input_tokens: 4 - num_output_tokens: 2 - num_total_tokens: 6 - name: '' - output: - content: I am - role: user - parent_id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 - progress_message: '' - project_id: 0d4e3799-3861-4759-875f-9ae14c167b0a - run_id: 74aec44e-ec21-4c9f-a3e2-b2ab2b81b4db - session_id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 - tags: [] - trace_id: 1a0939d1-8b43-4fe3-a91c-196e2d9847e3 - type: llm - user_metadata: {} - LogRecordsSortClause: + title: MultiModalModelIntegrationConfig + description: Configuration for multi-modal capabilities (file uploads). + MultimodalCapability: + type: string + enum: + - vision + - audio + title: MultimodalCapability + Name: properties: - column_id: + value: type: string - title: Column Id - description: ID of the column to sort. - ascending: + maxLength: 128 + minLength: 1 + title: Value + append_suffix_if_duplicate: type: boolean - title: Ascending - default: true - sort_type: - type: string - const: column - title: Sort Type - default: column + title: Append Suffix If Duplicate + default: false type: object required: - - column_id - title: LogRecordsSortClause - LogRecordsTextFilter: + - value + title: Name + description: Global name class for handling unique naming across the application. + NodeNameFilter: properties: - column_id: + name: type: string - title: Column Id - description: ID of the column to filter. + const: node_name + title: Name + default: node_name operator: type: string enum: - eq - ne - contains + - regex - one_of - not_in title: Operator @@ -29404,3445 +36959,3416 @@ components: type: boolean title: Case Sensitive default: true - type: - type: string - const: text - title: Type - default: text type: object required: - - column_id - operator - value - title: LogRecordsTextFilter - LogSpanUpdateRequest: + title: NodeNameFilter + description: Filters on node names in scorer jobs. + NodeType: + type: string + enum: + - chain + - chat + - http + - llm + - retriever + - tool + - agent + - workflow + - trace + - session + title: NodeType + NonLunaBillingUsageResponse: properties: - log_stream_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - logging_method: - $ref: '#/components/schemas/LoggingMethod' - default: api_direct - client_version: - anyOf: - - type: string - - type: 'null' - title: Client Version - reliable: + metric: + type: string + enum: + - traces + - spans + - luna_tokens + - luna_fine_tuning_runs + - total_users + - monthly_active_users + title: Metric + projects: + items: + $ref: '#/components/schemas/ProjectBillingUsage' + type: array + title: Projects + available: type: boolean - title: Reliable - description: Whether or not to use reliable logging. If set to False, the - method will respond immediately before verifying that the traces have - been successfully ingested, and no error message will be returned if ingestion - fails. If set to True, the method will wait for the traces to be durably - accepted or return an error message if there is an ingestion failure. - On the streaming write path (kafka_metrics_pipeline) accepted means acknowledged - by Kafka; the records become readable after the data-writer flush, about - GALILEO_STREAMING_EXPECTED_LAG_SECONDS (default 2.5 s) later, so a read - issued immediately after the response can miss them. + title: Available default: true - span_id: - type: string - format: uuid4 - title: Span Id - description: Span id to update. - input: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - - type: 'null' - title: Input - description: Input of the span. Overwrites previous value if present. - output: + unavailable_reason: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - - $ref: '#/components/schemas/ControlResult' - - type: 'null' - title: Output - description: Output of the span. Overwrites previous value if present. - tags: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Tags - description: Tags to add to the span. - status_code: - anyOf: - - type: integer - - type: 'null' - title: Status Code - description: Status code of the span. Overwrites previous value if present. - duration_ns: - anyOf: - - type: integer - type: 'null' - title: Duration Ns - description: Duration in nanoseconds. Overwrites previous value if present. + title: Unavailable Reason + total: + type: integer + title: Total + default: 0 type: object required: - - span_id - title: LogSpanUpdateRequest - description: Request model for updating a span. - LogSpanUpdateResponse: - properties: - log_stream_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - project_id: - type: string - format: uuid4 - title: Project Id - description: Project id associated with the traces. - project_name: - type: string - title: Project Name - description: Project name associated with the traces. - session_id: + - metric + title: NonLunaBillingUsageResponse + ? NotNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____ + : properties: + not: anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Session Id - description: Session id associated with the traces. - records_count: - type: integer - title: Records Count - description: Total number of records ingested - span_id: - type: string - format: uuid4 - title: Span Id - description: Span id associated with the updated span. + - $ref: '#/components/schemas/FilterLeaf_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - $ref: '#/components/schemas/AndNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - $ref: '#/components/schemas/OrNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - $ref: '#/components/schemas/NotNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + title: Not type: object required: - - project_id - - project_name - - records_count - - span_id - title: LogSpanUpdateResponse - LogSpansIngestRequest: + - not + title: NotNodeLogRecordsFilter + NumericColorConstraint: properties: - log_stream_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - logging_method: - $ref: '#/components/schemas/LoggingMethod' - default: api_direct - client_version: - anyOf: - - type: string - - type: 'null' - title: Client Version - reliable: - type: boolean - title: Reliable - description: Whether or not to use reliable logging. If set to False, the - method will respond immediately before verifying that the traces have - been successfully ingested, and no error message will be returned if ingestion - fails. If set to True, the method will wait for the traces to be durably - accepted or return an error message if there is an ingestion failure. - On the streaming write path (kafka_metrics_pipeline) accepted means acknowledged - by Kafka; the records become readable after the data-writer flush, about - GALILEO_STREAMING_EXPECTED_LAG_SECONDS (default 2.5 s) later, so a read - issued immediately after the response can miss them. - default: true - spans: - items: - oneOf: - - $ref: '#/components/schemas/AgentSpan' - - $ref: '#/components/schemas/WorkflowSpan' - - $ref: '#/components/schemas/LlmSpan' - - $ref: '#/components/schemas/RetrieverSpan' - - $ref: '#/components/schemas/ToolSpan' - - $ref: '#/components/schemas/ControlSpan' - - $ref: '#/components/schemas/HttpSpan' - discriminator: - propertyName: type - mapping: - agent: '#/components/schemas/AgentSpan' - control: '#/components/schemas/ControlSpan' - http: '#/components/schemas/HttpSpan' - llm: '#/components/schemas/LlmSpan' - retriever: '#/components/schemas/RetrieverSpan' - tool: '#/components/schemas/ToolSpan' - workflow: '#/components/schemas/WorkflowSpan' - type: array - minItems: 1 - title: Spans - description: List of spans to log. - trace_id: - type: string - format: uuid4 - title: Trace Id - description: Trace id associated with the spans. - parent_id: + color: + $ref: '#/components/schemas/MetricColor' + operator: type: string - format: uuid4 - title: Parent Id - description: Parent trace or span id. + enum: + - eq + - gt + - gte + - lt + - lte + - between + title: Operator + value: + anyOf: + - type: number + - items: + type: number + type: array + title: Value type: object required: - - spans - - trace_id - - parent_id - title: LogSpansIngestRequest - description: Request model for ingesting spans. - examples: - - log_stream_id: 00000000-0000-0000-0000-000000000000 - parent_id: 11000011-0000-0000-0000-110000110000 - spans: - - created_at: '2026-11-11T20:11:40.315272Z' - dataset_metadata: {} - input: who is a smart LLM? - metrics: {} - name: '' - output: I am! - spans: - - created_at: '2026-11-11T20:11:40.302135Z' - dataset_metadata: {} - id: 22222222-2222-4222-a222-222222222222 - input: - - content: 'Question: who is a smart LLM?' - role: user - metrics: {} - name: '' - output: - content: I am! - role: user - tags: [] - type: llm - user_metadata: {} - tags: [] - type: workflow - user_metadata: {} - trace_id: 11000011-0000-0000-0000-110000110000 - LogSpansIngestResponse: - properties: - log_stream_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: - anyOf: - - type: string - format: uuid4 - - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - project_id: - type: string - format: uuid4 - title: Project Id - description: Project id associated with the traces. - project_name: - type: string - title: Project Name - description: Project name associated with the traces. - session_id: + - color + - operator + - value + title: NumericColorConstraint + description: "A color constraint for numeric metric values.\n\nAssigns a color\ + \ when a numeric score matches the given operator and value.\n\nOperators\ + \ and expected value shapes:\n - eq, gt, gte, lt, lte: value must be a single\ + \ float.\n - between: value must be a list of exactly 2 floats [low, high]\ + \ where low < high.\n The range is inclusive on both ends.\n\nExample:\n\ + \ {\"color\": \"green\", \"operator\": \"gte\", \"value\": 0.8}\n {\"\ + color\": \"yellow\", \"operator\": \"between\", \"value\": [0.3, 0.7]}" + NumericRollUpMethod: + type: string + enum: + - average + - sum + - max + - min + title: NumericRollUpMethod + description: Roll up methods for aggregating numeric metrics up the session/trace/span + hierarchy. + NvidiaIntegration: + properties: + id: anyOf: - type: string format: uuid4 - type: 'null' - title: Session Id - description: Session id associated with the traces. - records_count: - type: integer - title: Records Count - description: Total number of records ingested - trace_id: + title: Id + name: type: string - format: uuid4 - title: Trace Id - description: Trace id associated with the spans. - parent_id: + const: nvidia + title: Name + default: nvidia + provider: type: string - format: uuid4 - title: Parent Id - description: Parent trace or span id. + const: nvidia + title: Provider + default: nvidia + extra: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Extra + type: object + title: NvidiaIntegration + NvidiaIntegrationCreate: + properties: + token: + type: string + title: Token + hostname: + type: string + maxLength: 2083 + minLength: 1 + format: uri + title: Hostname type: object required: - - project_id - - project_name - - records_count - - trace_id - - parent_id - title: LogSpansIngestResponse - LogStreamCreateRequest: + - token + - hostname + title: NvidiaIntegrationCreate + OpenAIFunction: properties: name: type: string - minLength: 1 title: Name type: object required: - name - title: LogStreamCreateRequest - LogStreamCreatedAtFilter: + title: OpenAIFunction + OpenAIIntegration: properties: + organization_id: + anyOf: + - type: string + - type: 'null' + title: Organization Id + id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Id name: type: string - const: created_at + const: openai title: Name - default: created_at - operator: + default: openai + provider: type: string - enum: - - eq - - ne - - gt - - gte - - lt - - lte - title: Operator - value: + const: openai + title: Provider + default: openai + extra: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Extra + type: object + title: OpenAIIntegration + OpenAIIntegrationCreate: + properties: + organization_id: + anyOf: + - type: string + - type: 'null' + title: Organization Id + token: type: string - format: date-time - title: Value + title: Token type: object required: - - operator - - value - title: RunCreatedAtFilter - LogStreamCreatedAtSort: + - token + title: OpenAIIntegrationCreate + OpenAIToolChoice: properties: - name: + type: type: string - const: created_at - title: Name - default: created_at - ascending: - type: boolean - title: Ascending - default: true - sort_type: + title: Type + default: function + function: + $ref: '#/components/schemas/OpenAIFunction' + type: object + required: + - function + title: OpenAIToolChoice + ? OrNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____ + : properties: + or: + items: + anyOf: + - $ref: '#/components/schemas/FilterLeaf_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - $ref: '#/components/schemas/AndNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - $ref: '#/components/schemas/OrNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + - $ref: '#/components/schemas/NotNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' + type: array + title: Or + type: object + required: + - or + title: OrNodeLogRecordsFilter + OrganizationAction: + type: string + enum: + - rename + - delete + - delete_log_data + - read_settings + - update_settings + - read_cost_settings + - read_ai_usage + - read_ai_usage_organization + - read_unredacted_data + - update_evaluator_cost_cap + title: OrganizationAction + OutputMap: + properties: + response: type: string - const: column - title: Sort Type - default: column + title: Response + token_count: + anyOf: + - type: string + - type: 'null' + title: Token Count + input_token_count: + anyOf: + - type: string + - type: 'null' + title: Input Token Count + output_token_count: + anyOf: + - type: string + - type: 'null' + title: Output Token Count + completion_reason: + anyOf: + - type: string + - type: 'null' + title: Completion Reason type: object - title: RunCreatedAtSort - LogStreamCreatedByFilter: + required: + - response + title: OutputMap + OutputPIIScorer: properties: name: type: string - const: created_by + const: output_pii title: Name - default: created_by - operator: - type: string - enum: - - eq - - ne - - one_of - - not_in - - contains - title: Operator - default: eq - value: + default: output_pii + filters: anyOf: - - type: string - format: uuid4 - items: - anyOf: - - type: string - format: uuid4 - - type: string + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' type: array - - type: string - title: Value + - type: 'null' + title: Filters + description: List of filters to apply to the scorer. type: object - required: - - value - title: RunCreatedByFilter - LogStreamIDFilter: + title: OutputPIIScorer + OutputSexistScorer: properties: name: type: string - const: id + const: output_sexist title: Name - default: id - operator: - type: string - enum: - - eq - - ne - - one_of - - not_in - - contains - title: Operator - default: eq - value: + default: output_sexist + filters: anyOf: - - type: string - format: uuid4 - items: - anyOf: - - type: string - format: uuid4 - - type: string + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' type: array + - type: 'null' + title: Filters + description: List of filters to apply to the scorer. + type: + type: string + enum: + - luna + - plus + title: Type + default: luna + model_name: + anyOf: - type: string - title: Value + - type: 'null' + title: Model Name + description: Alias of the model to use for the scorer. + num_judges: + anyOf: + - type: integer + maximum: 10.0 + minimum: 1.0 + - type: 'null' + title: Num Judges + description: Number of judges for the scorer. type: object - required: - - value - title: RunIDFilter - LogStreamInfo: + title: OutputSexistScorer + OutputToneScorer: properties: - id: - type: string - format: uuid4 - title: Id name: type: string + const: output_tone title: Name + default: output_tone + filters: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' + type: array + - type: 'null' + title: Filters + description: List of filters to apply to the scorer. type: object - required: - - id - - name - title: LogStreamInfo - description: Minimal log stream representation (id and name only). - LogStreamNameFilter: + title: OutputToneScorer + OutputToxicityScorer: properties: name: type: string - const: name + const: output_toxicity title: Name - default: name - operator: + default: output_toxicity + filters: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' + type: array + - type: 'null' + title: Filters + description: List of filters to apply to the scorer. + type: type: string enum: - - eq - - ne - - contains - - one_of - - not_in - title: Operator - value: + - luna + - plus + title: Type + default: luna + model_name: anyOf: - type: string - - items: - type: string - type: array - title: Value - case_sensitive: - type: boolean - title: Case Sensitive - default: true + - type: 'null' + title: Model Name + description: Alias of the model to use for the scorer. + num_judges: + anyOf: + - type: integer + maximum: 10.0 + minimum: 1.0 + - type: 'null' + title: Num Judges + description: Number of judges for the scorer. + type: object + title: OutputToxicityScorer + OutputTypeEnum: + type: string + enum: + - boolean + - categorical + - count + - discrete + - freeform + - percentage + - multilabel + - retrieved_chunk_list_boolean + - boolean_multilabel + - boolean_probability + title: OutputTypeEnum + description: Enumeration of output types. + OverrideAction: + properties: + type: + type: string + const: OVERRIDE + title: Type + default: OVERRIDE + subscriptions: + items: + $ref: '#/components/schemas/SubscriptionConfig' + type: array + title: Subscriptions + description: List of subscriptions to send a notification to when this action + is applied and the ruleset status matches any of the configured statuses. + choices: + items: + type: string + type: array + minItems: 1 + title: Choices + description: List of choices to override the response with. If there are + multiple choices, one will be chosen at random when applying this action. type: object required: - - operator - - value - title: RunNameFilter - LogStreamNameSort: + - choices + title: OverrideAction + PartialExtendedAgentSpanRecord-Input: properties: + type: + type: string + const: agent + title: Type + description: Type of the trace, span or session. + default: agent + input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + title: Input + description: Input to the trace or span. + default: '' + redacted_input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - type: 'null' + title: Redacted Input + description: Redacted input of the trace or span. + output: + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Output + description: Output of the trace or span. + redacted_output: + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Redacted Output + description: Redacted output of the trace or span. name: type: string - const: name title: Name - default: name - ascending: - type: boolean - title: Ascending - default: true - sort_type: - type: string - const: column - title: Sort Type - default: column - type: object - title: RunNameSort - LogStreamResponse: - properties: - id: - type: string - format: uuid4 - title: Id + description: Name of the trace, span or session. + default: '' created_at: type: string format: date-time - title: Created At - updated_at: - type: string - format: date-time - title: Updated At - name: - type: string - title: Name - project_id: - type: string - format: uuid4 - title: Project Id - created_by: + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: + anyOf: + - type: integer + - type: 'null' + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: anyOf: - type: string - format: uuid4 - type: 'null' - title: Created By - created_by_user: + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: anyOf: - - $ref: '#/components/schemas/UserInfo' + - type: string - type: 'null' - num_spans: + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: anyOf: - - type: integer + - type: string - type: 'null' - title: Num Spans - num_traces: + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: anyOf: - - type: integer + - type: string + format: uuid - type: 'null' - title: Num Traces - has_user_created_sessions: - type: boolean - title: Has User Created Sessions - default: false - type: object - required: - - id - - created_at - - updated_at - - name - - project_id - title: LogStreamResponse - LogStreamSearchRequest: - properties: - starting_token: - type: integer - title: Starting Token - default: 0 - limit: - type: integer - title: Limit - default: 100 - filters: - items: - oneOf: - - $ref: '#/components/schemas/LogStreamIDFilter' - - $ref: '#/components/schemas/LogStreamNameFilter' - - $ref: '#/components/schemas/LogStreamCreatedByFilter' - - $ref: '#/components/schemas/LogStreamCreatedAtFilter' - - $ref: '#/components/schemas/LogStreamUpdatedAtFilter' - discriminator: - propertyName: name - mapping: - created_at: '#/components/schemas/LogStreamCreatedAtFilter' - created_by: '#/components/schemas/LogStreamCreatedByFilter' - id: '#/components/schemas/LogStreamIDFilter' - name: '#/components/schemas/LogStreamNameFilter' - updated_at: '#/components/schemas/LogStreamUpdatedAtFilter' - type: array - title: Filters - sort: + title: ID + description: Galileo ID of the session, trace or span + session_id: anyOf: - - oneOf: - - $ref: '#/components/schemas/LogStreamNameSort' - - $ref: '#/components/schemas/LogStreamCreatedAtSort' - - $ref: '#/components/schemas/LogStreamUpdatedAtSort' - discriminator: - propertyName: name - mapping: - created_at: '#/components/schemas/LogStreamCreatedAtSort' - name: '#/components/schemas/LogStreamNameSort' - updated_at: '#/components/schemas/LogStreamUpdatedAtSort' + - type: string + format: uuid - type: 'null' - title: Sort - default: - name: created_at - ascending: false - sort_type: column - include_counts: - type: boolean - title: Include Counts - default: false - type: object - title: LogStreamSearchRequest - LogStreamUpdateRequest: - properties: - name: - type: string - minLength: 1 - title: Name - type: object - required: - - name - title: LogStreamUpdateRequest - LogStreamUpdatedAtFilter: - properties: - name: - type: string - const: updated_at - title: Name - default: updated_at - operator: - type: string - enum: - - eq - - ne - - gt - - gte - - lt - - lte - title: Operator - value: - type: string - format: date-time - title: Value - type: object - required: - - operator - - value - title: RunUpdatedAtFilter - LogStreamUpdatedAtSort: - properties: - name: - type: string - const: updated_at - title: Name - default: updated_at - ascending: - type: boolean - title: Ascending - default: true - sort_type: - type: string - const: column - title: Sort Type - default: column - type: object - title: RunUpdatedAtSort - LogTraceUpdateRequest: - properties: - log_stream_id: + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: anyOf: - type: string format: uuid4 - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: + anyOf: + - type: string + format: uuid + - type: 'null' + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: + anyOf: + - type: string + format: uuid + - type: 'null' + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: + anyOf: + - type: boolean + - type: 'null' + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: anyOf: - type: string format: uuid4 - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: anyOf: - type: string format: uuid4 - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - logging_method: - $ref: '#/components/schemas/LoggingMethod' - default: api_direct - client_version: + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: + items: + type: string + format: uuid4 + type: array + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: + anyOf: + - type: number + - type: 'null' + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: + anyOf: + - type: boolean + - type: 'null' + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: + anyOf: + - $ref: '#/components/schemas/AnnotationStatus' + - type: 'null' + description: Annotation review status of the record + annotated_members: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: + type: string + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: + type: string + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Input' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Input' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' + type: object + - type: 'null' + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object + - type: 'null' + title: Files + description: File metadata keyed by file ID for files associated with this + record + parent_id: anyOf: - type: string + format: uuid - type: 'null' - title: Client Version - reliable: + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: type: boolean - title: Reliable - description: Whether or not to use reliable logging. If set to False, the - method will respond immediately before verifying that the traces have - been successfully ingested, and no error message will be returned if ingestion - fails. If set to True, the method will wait for the traces to be durably - accepted or return an error message if there is an ingestion failure. - On the streaming write path (kafka_metrics_pipeline) accepted means acknowledged - by Kafka; the records become readable after the data-writer flush, about - GALILEO_STREAMING_EXPECTED_LAG_SECONDS (default 2.5 s) later, so a read - issued immediately after the response can miss them. + title: Is Complete + description: Whether the parent trace is complete or not default: true - trace_id: + step_number: + anyOf: + - type: integer + - type: 'null' + title: Step Number + description: Topological step number of the span. + agent_type: + $ref: '#/components/schemas/AgentType' + description: Agent type. + default: default + agent_name: + anyOf: + - type: string + - type: 'null' + title: Agent Name + description: Name of the agent. + type: object + title: PartialExtendedAgentSpanRecord + PartialExtendedAgentSpanRecord-Output: + properties: + type: type: string - format: uuid4 - title: Trace Id - description: Trace id to update. + const: agent + title: Type + description: Type of the trace, span or session. + default: agent input: anyOf: - type: string - - type: 'null' + - items: + $ref: '#/components/schemas/Message-Output' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array title: Input - description: Input of the trace. Overwrites previous value if present. + description: Input to the trace or span. + default: '' + redacted_input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/Message-Output' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - type: 'null' + title: Redacted Input + description: Redacted input of the trace or span. output: anyOf: - type: string + - $ref: '#/components/schemas/Message-Output' + - items: + $ref: '#/components/schemas/Document-Output' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Output - description: Output of the trace. Overwrites previous value if present. + description: Output of the trace or span. + redacted_output: + anyOf: + - type: string + - $ref: '#/components/schemas/Message-Output' + - items: + $ref: '#/components/schemas/Document-Output' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Redacted Output + description: Redacted output of the trace or span. + name: + type: string + title: Name + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. status_code: anyOf: - type: integer - type: 'null' title: Status Code - description: Status code of the trace. Overwrites previous value if present. - tags: + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: anyOf: - - items: - type: string - type: array + - type: string - type: 'null' - title: Tags - description: Tags to add to the trace. - is_complete: + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: anyOf: - - type: boolean + - type: string - type: 'null' - title: Is Complete - description: Whether or not the records in this request are complete. - default: false - duration_ns: + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: anyOf: - - type: integer + - type: string - type: 'null' - title: Duration Ns - description: Duration in nanoseconds. Overwrites previous value if present. - type: object - required: - - trace_id - title: LogTraceUpdateRequest - description: Request model for updating a trace. - LogTraceUpdateResponse: - properties: - log_stream_id: + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: anyOf: - type: string - format: uuid4 + format: uuid - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: + title: ID + description: Galileo ID of the session, trace or span + session_id: anyOf: - type: string - format: uuid4 + format: uuid - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: anyOf: - type: string format: uuid4 - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) project_id: - type: string - format: uuid4 - title: Project Id - description: Project id associated with the traces. - project_name: - type: string - title: Project Name - description: Project name associated with the traces. - session_id: anyOf: - type: string - format: uuid4 + format: uuid - type: 'null' - title: Session Id - description: Session id associated with the traces. - records_count: - type: integer - title: Records Count - description: Total number of records ingested - trace_id: - type: string - format: uuid4 - title: Trace Id - description: Trace id associated with the updated trace. - type: object - required: - - project_id - - project_name - - records_count - - trace_id - title: LogTraceUpdateResponse - LogTracesIngestRequest: - properties: - log_stream_id: + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: anyOf: - type: string - format: uuid4 + format: uuid - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: anyOf: - type: string - format: uuid4 + format: date-time - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: anyOf: - - type: string - format: uuid4 + - type: boolean - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - logging_method: - $ref: '#/components/schemas/LoggingMethod' - default: api_direct - client_version: + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Client Version - reliable: - type: boolean - title: Reliable - description: Whether or not to use reliable logging. If set to False, the - method will respond immediately before verifying that the traces have - been successfully ingested, and no error message will be returned if ingestion - fails. If set to True, the method will wait for the traces to be durably - accepted or return an error message if there is an ingestion failure. - On the streaming write path (kafka_metrics_pipeline) accepted means acknowledged - by Kafka; the records become readable after the data-writer flush, about - GALILEO_STREAMING_EXPECTED_LAG_SECONDS (default 2.5 s) later, so a read - issued immediately after the response can miss them. - default: true - session_id: + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: anyOf: - type: string format: uuid4 - type: 'null' - title: Session Id - description: Session id associated with the traces. - session_external_id: + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: + items: + type: string + format: uuid4 + type: array + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: anyOf: - - type: string + - type: number - type: 'null' - title: Session External Id - description: External id of the session (e.g., OTEL session.id from span - attributes). - traces: + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: items: - $ref: '#/components/schemas/Trace' + type: string + format: uuid4 type: array - minItems: 1 - title: Traces - description: List of traces to log. - is_complete: - type: boolean - title: Is Complete - description: Whether or not the records in this request are complete. - default: true - include_trace_ids: - type: boolean - title: Include Trace Ids - description: If True, include the list of ingested trace IDs in the response. - default: false - type: object - required: - - traces - title: LogTracesIngestRequest - description: Request model for ingesting traces. - examples: - - log_stream_id: 00000000-0000-0000-0000-000000000000 - session_id: 00000000-0000-0000-0000-000000000000 - traces: - - created_at: '2026-11-11T20:11:40.298206Z' - dataset_metadata: {} - input: who is a smart LLM? - metrics: {} - name: '' - output: I am! - spans: - - created_at: '2026-11-11T20:11:40.298165Z' - dataset_metadata: {} - input: - - content: 'Question: who is a smart LLM?' - role: user - metrics: {} - name: '' - output: - content: I am! - role: user - tags: [] - type: llm - user_metadata: {} - tags: [] - type: trace - user_metadata: {} - - experiment_id: 00000000-0000-0000-0000-000000000000 - traces: - - created_at: '2026-11-11T20:11:40.298679Z' - dataset_metadata: {} - input: who is a smart LLM? - metrics: {} - name: '' - output: I am! - spans: - - created_at: '2026-11-11T20:11:40.298642Z' - dataset_metadata: {} - id: 11111111-1111-4111-a111-111111111111 - input: - - content: 'Question: who is a smart LLM?' - role: user - metrics: {} - name: '' - output: - content: I am! - role: user - tags: [] - type: llm - user_metadata: {} - tags: [] - type: trace - user_metadata: {} - LogTracesIngestResponse: - properties: - log_stream_id: + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: anyOf: - - type: string - format: uuid4 + - type: boolean - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: anyOf: - - type: string - format: uuid4 + - $ref: '#/components/schemas/AnnotationStatus' - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: + description: Annotation review status of the record + annotated_members: anyOf: - - type: string - format: uuid4 + - items: + type: string + type: array - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - project_id: + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: type: string - format: uuid4 - title: Project Id - description: Project id associated with the traces. - project_name: + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: type: string - title: Project Name - description: Project name associated with the traces. - session_id: + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: anyOf: - - type: string - format: uuid4 + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Output' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Output' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' + type: object - type: 'null' - title: Session Id - description: Session id associated with the traces. - records_count: - type: integer - title: Records Count - description: Total number of records ingested - traces_count: - type: integer - title: Traces Count - description: total number of traces ingested - spans_count: - type: integer - title: Spans Count - description: total number of spans ingested - trace_ids: + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: anyOf: - - items: - type: string + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: format: uuid4 - type: array + type: object - type: 'null' - title: Trace Ids - description: List of trace IDs that were ingested. Only included if include_trace_ids=True - in request. - type: object - required: - - project_id - - project_name - - records_count - - traces_count - - spans_count - title: LogTracesIngestResponse - LoggingMethod: - type: string - enum: - - playground - - python_client - - typescript_client - - api_direct - title: LoggingMethod - Luna3ScorerResponse: - properties: - instruction: - type: string - maxLength: 10000 - minLength: 1 - title: Instruction - adapter_path: - type: string - maxLength: 1024 - minLength: 1 - title: Adapter Path - class_name_to_vocab_ix: - additionalProperties: - items: - type: integer - type: array - uniqueItems: true - type: object - maxProperties: 256 - minProperties: 1 - title: Class Name To Vocab Ix - threshold: + title: Files + description: File metadata keyed by file ID for files associated with this + record + parent_id: anyOf: - - type: number + - type: string + format: uuid - type: 'null' - title: Threshold - id: - type: string - format: uuid4 - title: Id - organization_id: - type: string - format: uuid4 - title: Organization Id - created_by: + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: + anyOf: + - type: integer + - type: 'null' + title: Step Number + description: Topological step number of the span. + agent_type: + $ref: '#/components/schemas/AgentType' + description: Agent type. + default: default + agent_name: anyOf: - type: string - format: uuid4 - type: 'null' - title: Created By - created_at: - type: string - format: date-time - title: Created At - updated_at: - type: string - format: date-time - title: Updated At + title: Agent Name + description: Name of the agent. type: object - required: - - instruction - - adapter_path - - class_name_to_vocab_ix - - id - - organization_id - - created_at - - updated_at - title: Luna3ScorerResponse - LunaDatasetMappings: + title: PartialExtendedAgentSpanRecord + PartialExtendedControlSpanRecord-Input: properties: + type: + type: string + const: control + title: Type + description: Type of the trace, span or session. + default: control input: anyOf: - - $ref: '#/components/schemas/LunaMappingConfig' + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + title: Input + description: Input to the trace or span. + default: '' + redacted_input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' + title: Redacted Input + description: Redacted input of the trace or span. output: anyOf: - - $ref: '#/components/schemas/LunaMappingConfig' + - $ref: '#/components/schemas/ControlResult' - type: 'null' - label: + description: Output of the trace or span. + redacted_output: anyOf: - - $ref: '#/components/schemas/LunaMappingConfig' + - $ref: '#/components/schemas/ControlResult' - type: 'null' - evaluator_ground_truth: + description: Redacted output of the trace or span. + name: + type: string + title: Name + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: anyOf: - - $ref: '#/components/schemas/LunaMappingConfig' + - type: integer - type: 'null' - metadata: + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: anyOf: - - $ref: '#/components/schemas/LunaMappingConfig' + - type: string - type: 'null' - tools: + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: anyOf: - - $ref: '#/components/schemas/LunaMappingConfig' + - type: string - type: 'null' - documents: + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: anyOf: - - $ref: '#/components/schemas/LunaMappingConfig' + - type: string - type: 'null' - mgt: + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: additionalProperties: - $ref: '#/components/schemas/LunaMappingConfig' - propertyNames: - format: uuid4 + type: string type: object - maxProperties: 32 - title: Mgt - additionalProperties: false - type: object - title: LunaDatasetMappings - description: Semantic mappings shared by preview, validation, and dataset finalization. - LunaDatasetPreview: - properties: - dataset: - oneOf: - - $ref: '#/components/schemas/LunaPreviewDraftRef' - - $ref: '#/components/schemas/LunaPreviewVersionRef' - title: Dataset - discriminator: - propertyName: kind - mapping: - draft: '#/components/schemas/LunaPreviewDraftRef' - version: '#/components/schemas/LunaPreviewVersionRef' - columns: - items: - $ref: '#/components/schemas/LunaDatasetPreviewColumn' - type: array - title: Columns - rows: - items: - $ref: '#/components/schemas/LunaDatasetPreviewRow' - type: array - title: Rows - total_row_count: - type: integer - title: Total Row Count - column_count: - type: integer - title: Column Count - next_cursor: + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: anyOf: - type: string + format: uuid - type: 'null' - title: Next Cursor - type: object - required: - - dataset - - columns - - rows - - total_row_count - - column_count - title: LunaDatasetPreview - LunaDatasetPreviewColumn: - properties: - key: - type: string - title: Key - label: - type: string - title: Label - source_columns: - items: - type: string - type: array - title: Source Columns - source_column: + title: ID + description: Galileo ID of the session, trace or span + session_id: anyOf: - type: string + format: uuid - type: 'null' - title: Source Column - samples: - items: - $ref: '#/components/schemas/pydantic__types__JsonValue' - type: array - title: Samples - group: + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Group - scorer_id: + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: anyOf: - type: string - format: uuid4 + format: uuid - type: 'null' - title: Scorer Id - type: object - required: - - key - - label - - source_columns - title: LunaDatasetPreviewColumn - LunaDatasetPreviewErrorDetail: - properties: - code: - type: string - title: Code - message: + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: anyOf: - type: string + format: uuid - type: 'null' - title: Message - current_revision: + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: anyOf: - type: string + format: date-time - type: 'null' - title: Current Revision - field_errors: + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: anyOf: - - items: - $ref: '#/components/schemas/LunaDatasetPreviewFieldError' - type: array + - type: boolean - type: 'null' - title: Field Errors - type: object - required: - - code - title: LunaDatasetPreviewErrorDetail - LunaDatasetPreviewErrorResponse: - properties: - detail: + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: anyOf: - type: string - - $ref: '#/components/schemas/LunaDatasetPreviewErrorDetail' - - items: - $ref: '#/components/schemas/LunaDatasetPreviewRequestValidationError' - type: array - title: Detail - standard_error: - anyOf: - - $ref: '#/components/schemas/StandardError' - - type: 'null' - type: object - required: - - detail - title: LunaDatasetPreviewErrorResponse - description: Catalog failures and ordinary request-validation failures returned - by preview routes. - LunaDatasetPreviewFieldError: - properties: - field: - type: string - title: Field - message: - type: string - title: Message - type: object - required: - - field - - message - title: LunaDatasetPreviewFieldError - LunaDatasetPreviewRequest: - properties: - mappings: - anyOf: - - $ref: '#/components/schemas/LunaDatasetMappings' - - items: - $ref: '#/components/schemas/LunaSemanticMapping' - type: array - additionalProperties: false - type: object - required: - - mappings - title: LunaDatasetPreviewRequest - LunaDatasetPreviewRequestValidationError: - properties: - loc: - items: - anyOf: - - type: string - - type: integer - type: array - title: Loc - msg: - type: string - title: Msg - type: - type: string - title: Type - input: - anyOf: - - $ref: '#/components/schemas/pydantic__types__JsonValue' + format: uuid4 - type: 'null' - ctx: + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: anyOf: - - additionalProperties: - $ref: '#/components/schemas/pydantic__types__JsonValue' - type: object + - type: string + format: uuid4 - type: 'null' - title: Ctx - type: object - required: - - loc - - msg - - type - title: LunaDatasetPreviewRequestValidationError - LunaDatasetPreviewRow: - properties: - row_ref: - type: string - title: Row Ref - values: + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: additionalProperties: - $ref: '#/components/schemas/pydantic__types__JsonValue' + $ref: '#/components/schemas/FeedbackRatingInfo' type: object - title: Values - truncated_columns: + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: items: type: string + format: uuid4 type: array - title: Truncated Columns - type: object - required: - - row_ref - - values - title: LunaDatasetPreviewRow - LunaInputTypeEnum: - type: string - enum: - - span - - trace_object - - trace_input_output_only - title: LunaInputTypeEnum - LunaMappingConfig: - properties: - columns: + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: + anyOf: + - type: number + - type: 'null' + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: items: type: string - maxLength: 256 - minLength: 1 + format: uuid4 type: array - maxItems: 32 - minItems: 1 - title: Columns - flatten: - type: boolean - title: Flatten - default: true - additionalProperties: false - type: object - required: - - columns - title: LunaMappingConfig - LunaOutputTypeEnum: - type: string - enum: - - float - - string - - string_list - - bool_list - title: LunaOutputTypeEnum - LunaPreviewDraftRef: - properties: - kind: - type: string - const: draft - title: Kind - default: draft - dataset_id: - type: string - format: uuid4 - title: Dataset Id - draft_revision: - type: string - title: Draft Revision - type: object - required: - - dataset_id - - draft_revision - title: LunaPreviewDraftRef - LunaPreviewVersionRef: - properties: - kind: - type: string - const: version - title: Kind - default: version - dataset_id: - type: string - format: uuid4 - title: Dataset Id - version_index: - type: integer - minimum: 1.0 - title: Version Index - type: object - required: - - dataset_id - - version_index - title: LunaPreviewVersionRef - LunaSemanticMapping: - properties: - source_column: - type: string - maxLength: 256 - minLength: 1 - title: Source Column - target_field: + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: + anyOf: + - type: boolean + - type: 'null' + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: + anyOf: + - $ref: '#/components/schemas/AnnotationStatus' + - type: 'null' + description: Annotation review status of the record + annotated_members: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: type: string - enum: - - input - - output - - label - - evaluator_ground_truth - - metadata - - tools - - documents - - generated_output - - ground_truth - title: Target Field - additionalProperties: false - type: object - required: - - source_column - - target_field - title: LunaSemanticMapping - MCPApprovalRequestEvent: - properties: - type: + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: type: string - const: mcp_approval_request - title: Type - default: mcp_approval_request - id: + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Input' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Input' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' + type: object + - type: 'null' + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object + - type: 'null' + title: Files + description: File metadata keyed by file ID for files associated with this + record + parent_id: anyOf: - type: string + format: uuid - type: 'null' - title: Id - description: Unique identifier for the event - status: + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: anyOf: - - $ref: '#/components/schemas/EventStatus' + - type: integer - type: 'null' - description: Status of the event - metadata: + title: Step Number + description: Topological step number of the span. + control_id: anyOf: - - additionalProperties: true - type: object + - type: integer - type: 'null' - title: Metadata - description: Provider-specific metadata and additional fields - error_message: + title: Control Id + description: Identifier of the control definition that produced this span. + agent_name: anyOf: - type: string - type: 'null' - title: Error Message - description: Error message if the event failed - tool_name: + title: Agent Name + description: Normalized agent name associated with this control execution. + check_stage: anyOf: - - type: string + - $ref: '#/components/schemas/ControlCheckStage' - type: 'null' - title: Tool Name - description: Name of the MCP tool requiring approval - tool_invocation: + description: Execution stage where the control ran, typically 'pre' or 'post'. + applies_to: anyOf: - - additionalProperties: true - type: object + - $ref: '#/components/schemas/ControlAppliesTo' - type: 'null' - title: Tool Invocation - description: Details of the tool invocation requiring approval - approved: + description: Parent execution type the control applied to, for example 'llm_call' + or 'tool_call'. + evaluator_name: anyOf: - - type: boolean + - type: string - type: 'null' - title: Approved - description: Whether the request was approved + title: Evaluator Name + description: Representative evaluator name for this control span. For composite + controls, this is the primary evaluator chosen for observability identity. + selector_path: + anyOf: + - type: string + - type: 'null' + title: Selector Path + description: Representative selector path for this control span. For composite + controls, this is the primary selector path chosen for observability identity. type: object - title: MCPApprovalRequestEvent - description: MCP approval request - when human approval is needed for an MCP - tool call. - MCPCallEvent: + title: PartialExtendedControlSpanRecord + PartialExtendedControlSpanRecord-Output: properties: type: type: string - const: mcp_call + const: control title: Type - default: mcp_call - id: + description: Type of the trace, span or session. + default: control + input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/Message-Output' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + title: Input + description: Input to the trace or span. + default: '' + redacted_input: anyOf: - type: string + - items: + $ref: '#/components/schemas/Message-Output' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' - title: Id - description: Unique identifier for the event - status: + title: Redacted Input + description: Redacted input of the trace or span. + output: anyOf: - - $ref: '#/components/schemas/EventStatus' + - $ref: '#/components/schemas/ControlResult' - type: 'null' - description: Status of the event - metadata: + description: Output of the trace or span. + redacted_output: anyOf: - - additionalProperties: true - type: object + - $ref: '#/components/schemas/ControlResult' - type: 'null' - title: Metadata - description: Provider-specific metadata and additional fields - error_message: + description: Redacted output of the trace or span. + name: + type: string + title: Name + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: anyOf: - - type: string + - type: integer - type: 'null' - title: Error Message - description: Error message if the event failed - tool_name: + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: anyOf: - type: string - type: 'null' - title: Tool Name - description: Name of the MCP tool being called - server_name: + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: anyOf: - type: string - type: 'null' - title: Server Name - description: Name of the MCP server - arguments: + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: anyOf: - - additionalProperties: true - type: object + - type: string - type: 'null' - title: Arguments - description: Arguments for the MCP tool call - result: + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: anyOf: - - additionalProperties: true - type: object + - type: string + format: uuid - type: 'null' - title: Result - description: Result from the MCP tool call - type: object - title: MCPCallEvent - description: 'A Model Context Protocol (MCP) tool call. - - - MCP is a protocol for connecting LLMs to external tools/data sources. - - This is distinct from internal tools because it involves external integrations.' - MCPListToolsEvent: - properties: - type: - type: string - const: mcp_list_tools - title: Type - default: mcp_list_tools - id: + title: ID + description: Galileo ID of the session, trace or span + session_id: anyOf: - type: string + format: uuid - type: 'null' - title: Id - description: Unique identifier for the event - status: + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: anyOf: - - $ref: '#/components/schemas/EventStatus' + - type: string + format: uuid4 - type: 'null' - description: Status of the event - metadata: + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: anyOf: - - additionalProperties: true - type: object + - type: string + format: uuid - type: 'null' - title: Metadata - description: Provider-specific metadata and additional fields - error_message: + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: anyOf: - type: string + format: uuid - type: 'null' - title: Error Message - description: Error message if the event failed - server_name: + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: anyOf: - type: string + format: date-time - type: 'null' - title: Server Name - description: Name of the MCP server - tools: + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: anyOf: - - items: - additionalProperties: true - type: object - type: array + - type: boolean - type: 'null' - title: Tools - description: List of available MCP tools - type: object - title: MCPListToolsEvent - description: MCP list tools event - when the model queries available MCP tools. - MessageEvent: - properties: - type: - type: string - const: message - title: Type - default: message - id: + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Id - description: Unique identifier for the event - status: + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: anyOf: - - $ref: '#/components/schemas/EventStatus' + - type: string + format: uuid4 - type: 'null' - description: Status of the event - metadata: + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: + items: + type: string + format: uuid4 + type: array + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: anyOf: - - additionalProperties: true - type: object + - type: number - type: 'null' - title: Metadata - description: Provider-specific metadata and additional fields - error_message: + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: anyOf: - - type: string + - type: boolean - type: 'null' - title: Error Message - description: Error message if the event failed - role: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__MessageRole' - description: Role of the message sender - content: + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: anyOf: - - type: string + - $ref: '#/components/schemas/AnnotationStatus' - type: 'null' - title: Content - description: Text content of the message - content_parts: + description: Annotation review status of the record + annotated_members: anyOf: - items: - additionalProperties: true - type: object + type: string type: array - type: 'null' - title: Content Parts - description: Structured content items (text, audio, images, etc.) - type: object - required: - - role - title: MessageEvent - description: An output message from the model. - Messages: - items: - $ref: '#/components/schemas/galileo_core__schemas__shared__message__Message' - type: array - title: Messages - MetadataFilter: - properties: - name: - type: string - const: metadata - title: Name - default: metadata - operator: + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: type: string - enum: - - one_of - - not_in - - eq - - ne - title: Operator - key: + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: type: string - title: Key - value: - anyOf: - - type: string - - items: - type: string - type: array - title: Value - type: object - required: - - operator - - key - - value - title: MetadataFilter - description: Filters on metadata key-value pairs in scorer jobs. - MetricAggregates: - properties: - avg: - anyOf: - - type: number - - type: 'null' - title: Avg - sum: + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: anyOf: - - type: number + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Output' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Output' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' + type: object - type: 'null' - title: Sum - min: + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: anyOf: - - type: number + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object - type: 'null' - title: Min - max: + title: Files + description: File metadata keyed by file ID for files associated with this + record + parent_id: anyOf: - - type: number + - type: string + format: uuid - type: 'null' - title: Max - count: + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: anyOf: - type: integer - type: 'null' - title: Count - pct: + title: Step Number + description: Topological step number of the span. + control_id: anyOf: - - type: number + - type: integer - type: 'null' - title: Pct - p50: + title: Control Id + description: Identifier of the control definition that produced this span. + agent_name: anyOf: - - type: number + - type: string - type: 'null' - title: P50 - p90: + title: Agent Name + description: Normalized agent name associated with this control execution. + check_stage: anyOf: - - type: number + - $ref: '#/components/schemas/ControlCheckStage' - type: 'null' - title: P90 - p95: + description: Execution stage where the control ran, typically 'pre' or 'post'. + applies_to: anyOf: - - type: number + - $ref: '#/components/schemas/ControlAppliesTo' - type: 'null' - title: P95 - p99: + description: Parent execution type the control applied to, for example 'llm_call' + or 'tool_call'. + evaluator_name: anyOf: - - type: number + - type: string - type: 'null' - title: P99 - value_distribution: + title: Evaluator Name + description: Representative evaluator name for this control span. For composite + controls, this is the primary evaluator chosen for observability identity. + selector_path: anyOf: - - additionalProperties: - type: integer - type: object + - type: string - type: 'null' - title: Value Distribution - description: 'Distribution of discrete values as {value: count}. For boolean - metrics: {''0'': 2, ''1'': 8}. For categorical metrics: {''low'': 5, ''medium'': - 3, ''high'': 2}.' - type: object - title: MetricAggregates - description: Structured aggregate values for a single metric, computed from - ClickHouse row-level data. - MetricAggregation: - type: string - enum: - - Count - - Sum - - Average - - Min - - Max - - P50 - - P90 - - P95 - - P99 - - PercentageFalse - - PercentageTrue - title: MetricAggregation - MetricAggregationDetail: - properties: - id: - type: string - title: Id - description: Identifier for the metric in the response (e.g., 'w1', 'w2') - metric_name: - type: string - title: Metric Name - description: Name of the metric to aggregate - aggregation: - $ref: '#/components/schemas/MetricAggregation' - description: Aggregation type to apply - type: object - required: - - id - - metric_name - - aggregation - title: MetricAggregationDetail - MetricColor: - type: string - enum: - - red - - yellow - - green - title: MetricColor - description: Allowed colors for metric threshold visualization in the UI. - MetricColorPickerBoolean: - properties: - type: - type: string - const: boolean - title: Type - default: boolean - constraints: - items: - $ref: '#/components/schemas/BooleanColorConstraint' - type: array - minItems: 1 - title: Constraints + title: Selector Path + description: Representative selector path for this control span. For composite + controls, this is the primary selector path chosen for observability identity. type: object - required: - - constraints - title: MetricColorPickerBoolean - description: "Color picker configuration for boolean metrics.\n\nEach constraint\ - \ maps a boolean value to a color.\n\nExample:\n {\n \"type\": \"\ - boolean\",\n \"constraints\": [\n {\"color\": \"green\"\ - , \"operator\": \"eq\", \"value\": true},\n {\"color\": \"red\"\ - , \"operator\": \"eq\", \"value\": false}\n ]\n }" - MetricColorPickerCategorical: + title: PartialExtendedControlSpanRecord + PartialExtendedHttpSpanRecord-Input: properties: type: type: string - const: categorical + const: http title: Type - default: categorical - constraints: - items: - $ref: '#/components/schemas/CategoricalColorConstraint' - type: array - minItems: 1 - title: Constraints - type: object - required: - - constraints - title: MetricColorPickerCategorical - description: "Color picker configuration for categorical metrics.\n\nEach constraint\ - \ maps one or more category values to a color. A category\nvalue must not\ - \ appear in more than one constraint.\n\nExample:\n {\n \"type\"\ - : \"categorical\",\n \"constraints\": [\n {\"color\": \"\ - green\", \"operator\": \"eq\", \"value\": \"pass\"},\n {\"color\"\ - : \"red\", \"operator\": \"one_of\", \"value\": [\"fail\", \"error\"]}\n \ - \ ]\n }" - MetricColorPickerMultiLabel: - properties: - type: + description: Type of the trace, span or session. + default: http + input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + title: Input + description: Input to the trace or span. + default: '' + redacted_input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - type: 'null' + title: Redacted Input + description: Redacted input of the trace or span. + output: + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Output + description: Output of the trace or span. + redacted_output: + anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' + - type: 'null' + title: Redacted Output + description: Redacted output of the trace or span. + name: type: string - const: multi_label - title: Type - default: multi_label - constraints: - items: - $ref: '#/components/schemas/CategoricalColorConstraint' - type: array - minItems: 1 - title: Constraints - type: object - required: - - constraints - title: MetricColorPickerMultiLabel - description: "Color picker configuration for multi-label metrics.\n\nBehaves\ - \ the same as categorical but intended for metrics that produce\nmultiple\ - \ labels. A category value must not appear in more than one constraint.\n\n\ - Example:\n {\n \"type\": \"multi_label\",\n \"constraints\"\ - : [\n {\"color\": \"green\", \"operator\": \"eq\", \"value\": \"\ - relevant\"},\n {\"color\": \"yellow\", \"operator\": \"one_of\"\ - , \"value\": [\"partial\", \"related\"]}\n ]\n }" - MetricColorPickerNumeric: - properties: - type: + title: Name + description: Name of the trace, span or session. + default: '' + created_at: type: string - const: numeric - title: Type - default: numeric - constraints: + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: items: - $ref: '#/components/schemas/NumericColorConstraint' + type: string type: array - minItems: 1 - title: Constraints - type: object - required: - - constraints - title: MetricColorPickerNumeric - description: "Color picker configuration for numeric metrics.\n\nEach constraint\ - \ maps a numeric condition to a color. The UI uses these\nconstraints to color-code\ - \ metric values (e.g. green for high scores,\nred for low scores).\n\nExample:\n\ - \ {\n \"type\": \"numeric\",\n \"constraints\": [\n \ - \ {\"color\": \"green\", \"operator\": \"gte\", \"value\": 0.8},\n \ - \ {\"color\": \"yellow\", \"operator\": \"between\", \"value\":\ - \ [0.3, 0.8]},\n {\"color\": \"red\", \"operator\": \"lt\", \"\ - value\": 0.3}\n ]\n }" - MetricComputation: - properties: - value: + title: Tags + description: Tags associated with this trace or span. + status_code: anyOf: - - type: number - type: integer - - type: string - - items: - anyOf: - - type: number - - type: integer - - type: string - - type: 'null' - type: array - - additionalProperties: - anyOf: - - type: number - - type: integer - - type: string - - type: 'null' - type: object - type: 'null' - title: Value - execution_time: + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: anyOf: - - type: number + - type: string - type: 'null' - title: Execution Time - status: + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: anyOf: - - $ref: '#/components/schemas/MetricComputationStatus' + - type: string - type: 'null' - error_message: + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: anyOf: - type: string - type: 'null' - title: Error Message - type: object - title: MetricComputation - MetricComputationStatus: - type: string - enum: - - success - - timeout - - failed - - error - title: MetricComputationStatus - MetricComputing: - properties: - status_type: - type: string - const: computing - title: Status Type - default: computing - metric_key_alias: + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: anyOf: - type: string + format: uuid - type: 'null' - title: Metric Key Alias - message: - type: string - title: Message - default: Metric is computing. - type: object - title: MetricComputing - MetricError: - properties: - status_type: - type: string - const: error - title: Status Type - default: error - metric_key_alias: + title: ID + description: Galileo ID of the session, trace or span + session_id: anyOf: - type: string + format: uuid - type: 'null' - title: Metric Key Alias - message: + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Message - default: An error occured. - ems_error_code: + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: anyOf: - - type: integer + - type: string + format: uuid - type: 'null' - title: Ems Error Code - description: EMS error code from errors.yaml catalog for this metric error - standard_error: + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: anyOf: - - $ref: '#/components/schemas/StandardError' + - type: string + format: uuid - type: 'null' - description: Structured EMS error resolved on-the-fly from errors.yaml catalog - type: object - title: MetricError - MetricFailed: - properties: - status_type: - type: string - const: failed - title: Status Type - default: failed - metric_key_alias: + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: anyOf: - type: string + format: date-time - type: 'null' - title: Metric Key Alias - message: + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: + anyOf: + - type: boolean + - type: 'null' + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Message - default: Metric failed to compute. - ems_error_code: + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: anyOf: - - type: integer + - type: string + format: uuid4 - type: 'null' - title: Ems Error Code - description: EMS error code from errors.yaml catalog for this metric failure - standard_error: + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: + items: + type: string + format: uuid4 + type: array + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: anyOf: - - $ref: '#/components/schemas/StandardError' + - type: number - type: 'null' - description: Structured EMS error resolved on-the-fly from errors.yaml catalog - type: object - title: MetricFailed - MetricNotApplicable: - properties: - status_type: - type: string - const: not_applicable - title: Status Type - default: not_applicable - metric_key_alias: + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: anyOf: - - type: string + - type: boolean - type: 'null' - title: Metric Key Alias - message: - type: string - title: Message - default: Metric not applicable. - ems_error_code: + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: anyOf: - - type: integer + - $ref: '#/components/schemas/AnnotationStatus' - type: 'null' - title: Ems Error Code - description: EMS error code from errors.yaml catalog for this not-applicable - reason - standard_error: + description: Annotation review status of the record + annotated_members: anyOf: - - $ref: '#/components/schemas/StandardError' + - items: + type: string + type: array - type: 'null' - description: Structured EMS error resolved on-the-fly from errors.yaml catalog - type: object - title: MetricNotApplicable - MetricNotComputed: - properties: - status_type: + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: type: string - const: not_computed - title: Status Type - default: not_computed - metric_key_alias: - anyOf: - - type: string - - type: 'null' - title: Metric Key Alias - message: + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: type: string - title: Message - default: Metric not computed. - ems_error_code: + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: anyOf: - - type: integer + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Input' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Input' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' + type: object - type: 'null' - title: Ems Error Code - description: EMS error code from errors.yaml catalog for this not-computed - reason - standard_error: + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: anyOf: - - $ref: '#/components/schemas/StandardError' + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object - type: 'null' - description: Structured EMS error resolved on-the-fly from errors.yaml catalog - type: object - title: MetricNotComputed - MetricPending: - properties: - status_type: - type: string - const: pending - title: Status Type - default: pending - metric_key_alias: + title: Files + description: File metadata keyed by file ID for files associated with this + record + parent_id: anyOf: - type: string + format: uuid - type: 'null' - title: Metric Key Alias + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: + anyOf: + - type: integer + - type: 'null' + title: Step Number + description: Topological step number of the span. type: object - title: MetricPending - MetricRollUp: + title: PartialExtendedHttpSpanRecord + PartialExtendedHttpSpanRecord-Output: properties: - status_type: + type: type: string - const: roll_up - title: Status Type - default: roll_up - metric_key_alias: - anyOf: - - type: string - - type: 'null' - title: Metric Key Alias - value: + const: http + title: Type + description: Type of the trace, span or session. + default: http + input: anyOf: - type: string - - type: integer - - type: number - - type: boolean - - type: string - format: uuid - - type: string - format: date-time - - $ref: '#/components/schemas/Segment' - - $ref: '#/components/schemas/HallucinationSegment' - - $ref: '#/components/schemas/Document' - - $ref: '#/components/schemas/FeedbackRatingDB' - - $ref: '#/components/schemas/FeedbackAggregate' - items: - anyOf: - - type: string - - type: integer - - type: number - - type: boolean - - type: string - format: uuid - - type: string - format: date-time - - $ref: '#/components/schemas/Segment' - - $ref: '#/components/schemas/HallucinationSegment' - - $ref: '#/components/schemas/Document' - - $ref: '#/components/schemas/FeedbackRatingDB' - - $ref: '#/components/schemas/FeedbackAggregate' - - type: 'null' + $ref: '#/components/schemas/Message-Output' type: array - items: - items: - anyOf: - - type: string - - type: integer - - type: number - - type: boolean - - type: string - format: uuid - - type: string - format: date-time - - $ref: '#/components/schemas/Segment' - - $ref: '#/components/schemas/HallucinationSegment' - - $ref: '#/components/schemas/Document' - - $ref: '#/components/schemas/FeedbackRatingDB' - - $ref: '#/components/schemas/FeedbackAggregate' - - type: 'null' - type: array + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + title: Input + description: Input to the trace or span. + default: '' + redacted_input: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/Message-Output' type: array - items: - items: - items: - anyOf: - - type: string - - type: integer - - type: number - - type: boolean - - type: string - format: uuid - - type: string - format: date-time - - $ref: '#/components/schemas/Segment' - - $ref: '#/components/schemas/HallucinationSegment' - - $ref: '#/components/schemas/Document' - - $ref: '#/components/schemas/FeedbackRatingDB' - - $ref: '#/components/schemas/FeedbackAggregate' - - type: 'null' - type: array - type: array + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' type: array - type: 'null' - title: Value - explanation: + title: Redacted Input + description: Redacted input of the trace or span. + output: anyOf: - type: string + - $ref: '#/components/schemas/Message-Output' + - items: + $ref: '#/components/schemas/Document-Output' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' - type: 'null' - title: Explanation - cost: - anyOf: - - type: number - - type: 'null' - title: Cost - model_alias: + title: Output + description: Output of the trace or span. + redacted_output: anyOf: - type: string + - $ref: '#/components/schemas/Message-Output' + - items: + $ref: '#/components/schemas/Document-Output' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array + - $ref: '#/components/schemas/ControlResult' - type: 'null' - title: Model Alias - num_judges: - anyOf: - - type: integer - - type: 'null' - title: Num Judges - multijudge_average: - anyOf: - - type: number - - type: 'null' - title: Multijudge Average - boolean_from_prob: - anyOf: - - type: boolean - - type: 'null' - title: Boolean From Prob - description: The Boolean verdict a probability-scored Evaluator's confidence - implies. Additional to `value`, which keeps carrying the confidence itself. - Absent on a rolled-up parent, which carries counts of its children's verdicts - instead. - input_tokens: - anyOf: - - type: integer - - type: 'null' - title: Input Tokens - output_tokens: + title: Redacted Output + description: Redacted output of the trace or span. + name: + type: string + title: Name + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: anyOf: - type: integer - type: 'null' - title: Output Tokens - total_tokens: + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: anyOf: - - type: integer + - type: string - type: 'null' - title: Total Tokens - batch_size: + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: anyOf: - - type: integer + - type: string - type: 'null' - title: Batch Size - description: Number of questions the provider call that produced this value - answered, 1 or more. Above 1, `cost` and the token counts are this metric's - share of that call. Absent on rolled-up parents, on non-decision metrics, - and on decision results written before batching. - metadata: + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: anyOf: - - additionalProperties: true - type: object + - type: string - type: 'null' - title: Metadata - description: Optional per-row context returned alongside the score by code-based - scorers that return a (score, metadata) tuple. Sourced from the {metric_name}_metadata - auxiliary key, which is stored as a JSON string in ClickHouse. - roll_up_metrics: + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: additionalProperties: - anyOf: - - type: number - - additionalProperties: - type: integer - type: object + type: string type: object - title: Roll Up Metrics - description: Roll up metrics e.g. sum, average, min, max for numeric, and - category_count for categorical metrics. - type: object - required: - - value - title: MetricRollUp - MetricSettingsRequest: - properties: - scorers: + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: anyOf: - - items: - $ref: '#/components/schemas/RuntimeScorerConfig' - type: array + - type: string + format: uuid - type: 'null' - title: Scorers - description: List of Galileo scorers to enable. - segment_filters: + title: ID + description: Galileo ID of the session, trace or span + session_id: anyOf: - - items: - $ref: '#/components/schemas/SegmentFilter' - type: array + - type: string + format: uuid - type: 'null' - title: Segment Filters - description: List of segment filters to apply to the run. - type: object - title: MetricSettingsRequest - MetricSettingsResponse: - properties: - scorers: - items: - $ref: '#/components/schemas/RuntimeScorerConfig' - type: array - title: Scorers - segment_filters: + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: anyOf: - - items: - $ref: '#/components/schemas/SegmentFilter' - type: array + - type: string + format: uuid4 - type: 'null' - title: Segment Filters - description: List of segment filters to apply to the run. - type: object - required: - - scorers - title: MetricSettingsResponse - MetricSuccess: - properties: - status_type: - type: string - const: success - title: Status Type - default: success - metric_key_alias: + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: anyOf: - type: string + format: uuid - type: 'null' - title: Metric Key Alias - value: + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: anyOf: - - type: string - - type: integer - - type: number - - type: boolean - type: string format: uuid + - type: 'null' + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: + anyOf: - type: string format: date-time - - $ref: '#/components/schemas/Segment' - - $ref: '#/components/schemas/HallucinationSegment' - - $ref: '#/components/schemas/Document' - - $ref: '#/components/schemas/FeedbackRatingDB' - - $ref: '#/components/schemas/FeedbackAggregate' - - items: - anyOf: - - type: string - - type: integer - - type: number - - type: boolean - - type: string - format: uuid - - type: string - format: date-time - - $ref: '#/components/schemas/Segment' - - $ref: '#/components/schemas/HallucinationSegment' - - $ref: '#/components/schemas/Document' - - $ref: '#/components/schemas/FeedbackRatingDB' - - $ref: '#/components/schemas/FeedbackAggregate' - - type: 'null' - type: array - - items: - items: - anyOf: - - type: string - - type: integer - - type: number - - type: boolean - - type: string - format: uuid - - type: string - format: date-time - - $ref: '#/components/schemas/Segment' - - $ref: '#/components/schemas/HallucinationSegment' - - $ref: '#/components/schemas/Document' - - $ref: '#/components/schemas/FeedbackRatingDB' - - $ref: '#/components/schemas/FeedbackAggregate' - - type: 'null' - type: array - type: array - - items: - items: - items: - anyOf: - - type: string - - type: integer - - type: number - - type: boolean - - type: string - format: uuid - - type: string - format: date-time - - $ref: '#/components/schemas/Segment' - - $ref: '#/components/schemas/HallucinationSegment' - - $ref: '#/components/schemas/Document' - - $ref: '#/components/schemas/FeedbackRatingDB' - - $ref: '#/components/schemas/FeedbackAggregate' - - type: 'null' - type: array - type: array - type: array - type: 'null' - title: Value - explanation: + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: + anyOf: + - type: boolean + - type: 'null' + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Explanation - cost: + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: + items: + type: string + format: uuid4 + type: array + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: anyOf: - type: number - type: 'null' - title: Cost - model_alias: + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: anyOf: - - type: string + - type: boolean - type: 'null' - title: Model Alias - num_judges: + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: anyOf: - - type: integer + - $ref: '#/components/schemas/AnnotationStatus' - type: 'null' - title: Num Judges - multijudge_average: + description: Annotation review status of the record + annotated_members: anyOf: - - type: number + - items: + type: string + type: array - type: 'null' - title: Multijudge Average - boolean_from_prob: + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: + type: string + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: + type: string + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: anyOf: - - type: boolean + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Output' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Output' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' + type: object - type: 'null' - title: Boolean From Prob - description: The Boolean verdict a probability-scored Evaluator's confidence - implies. Additional to `value`, which keeps carrying the confidence itself. - Absent on a rolled-up parent, which carries counts of its children's verdicts - instead. - input_tokens: + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: anyOf: - - type: integer + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object - type: 'null' - title: Input Tokens - output_tokens: + title: Files + description: File metadata keyed by file ID for files associated with this + record + parent_id: anyOf: - - type: integer + - type: string + format: uuid - type: 'null' - title: Output Tokens - total_tokens: + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: anyOf: - type: integer - type: 'null' - title: Total Tokens - batch_size: + title: Step Number + description: Topological step number of the span. + type: object + title: PartialExtendedHttpSpanRecord + PartialExtendedLlmSpanRecord-Input: + properties: + type: + type: string + const: llm + title: Type + description: Type of the trace, span or session. + default: llm + input: + items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array + title: Input + description: Input to the trace or span. + redacted_input: anyOf: - - type: integer + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array - type: 'null' - title: Batch Size - description: Number of questions the provider call that produced this value - answered, 1 or more. Above 1, `cost` and the token counts are this metric's - share of that call. Absent on rolled-up parents, on non-decision metrics, - and on decision results written before batching. - metadata: + title: Redacted Input + description: Redacted input of the trace or span. + output: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + description: Output of the trace or span. + redacted_output: anyOf: - - additionalProperties: true - type: object + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: 'null' - title: Metadata - description: Optional per-row context returned alongside the score by code-based - scorers that return a (score, metadata) tuple. Sourced from the {metric_name}_metadata - auxiliary key, which is stored as a JSON string in ClickHouse. - display_value: + description: Redacted output of the trace or span. + name: + type: string + title: Name + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: + anyOf: + - type: integer + - type: 'null' + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/LlmMetrics' + description: Metrics associated with this trace or span. + external_id: anyOf: - type: string - type: 'null' - title: Display Value - rationale: + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: anyOf: - type: string - type: 'null' - title: Rationale - value_description: + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: anyOf: - type: string - type: 'null' - title: Value Description - description: 'The description of the answer that `value` names, written - when the record is scored. Decision evaluators write it: the true or false - criteria of a Boolean evaluator, the description of the category, or the - description of the level. Sourced from the {metric_name}_value_description - auxiliary key. Absent when that answer has none.' - type: object - required: - - value - title: MetricSuccess - MetricThreshold: - properties: - inverted: - type: boolean - title: Inverted - description: Whether the column should be inverted for thresholds, i.e. - if True, lower is better. - default: false - buckets: - items: - anyOf: - - type: integer - - type: number - type: array - title: Buckets - description: Threshold buckets for the column. If the column is a metric, - these are the thresholds for the column. - display_value_levels: - items: + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: type: string - type: array - title: Display Value Levels - description: Ordered list of strings that raw values get transformed to - for displaying. - type: object - title: MetricThreshold - description: 'Threshold configuration for metrics. - - - Defines how metric values are bucketed and displayed, including whether - - lower or higher values are considered better.' - Metrics: - properties: - duration_ns: + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: anyOf: - - type: integer + - type: string + format: uuid - type: 'null' - title: Duration Ns - description: Duration of the trace or span in nanoseconds. Displayed as - 'Latency' in Galileo. - additionalProperties: true - type: object - title: Metrics - MetricsTestingAvailableColumnsRequest: - properties: - log_stream_id: + title: ID + description: Galileo ID of the session, trace or span + session_id: anyOf: - type: string - format: uuid4 + format: uuid - type: 'null' - title: Log Stream Id - description: Log stream id associated with the traces. - experiment_id: + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: anyOf: - type: string format: uuid4 - type: 'null' - title: Experiment Id - description: Experiment id associated with the traces. - metrics_testing_id: + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: anyOf: - type: string - format: uuid4 + format: uuid - type: 'null' - title: Metrics Testing Id - description: Metrics testing id associated with the traces. - name: - type: string - title: Name - description: Name of the metric that we are testing. - output_type: + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: anyOf: - - $ref: '#/components/schemas/OutputTypeEnum' + - type: string + format: uuid - type: 'null' - description: Output type of the scorer. Required when metric_key is REGISTERED_SCORER_VALIDATION - or DECISION_SCORER_VALIDATION; used to determine the data_type for validation - columns. - cot_enabled: - type: boolean - title: Cot Enabled - description: Whether the metrics testing table is using chain of thought - (CoT) enabled scorers. If True, the columns will be generated for CoT - enabled scorers. - default: false - metric_key: - type: string - title: Metric Key - description: The metric key to use for column generation (e.g., 'generated_scorer_validation', - 'registered_scorer_validation' or 'decision_scorer_validation'). - default: generated_scorer_validation - required_scorers: + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: anyOf: - - items: - type: string - type: array + - type: string + format: date-time - type: 'null' - title: Required Scorers - description: List of required scorer names for composite scorers. Columns - will be generated for these scorers. - score_type: + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: anyOf: - - type: string + - type: boolean - type: 'null' - title: Score Type - description: The score type for registered scorers (e.g., 'bool', 'int', - 'float', 'str'). Used to determine the correct data_type for the column. - Provided by validation result. - type: object - required: - - name - title: MetricsTestingAvailableColumnsRequest - description: Request to get the available columns for the metrics testing table. - MistralIntegration: - properties: - id: + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: anyOf: - type: string format: uuid4 - type: 'null' - title: Id - name: - type: string - const: mistral - title: Name - default: mistral - provider: - type: string - const: mistral - title: Provider - default: mistral - extra: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Extra - type: object - title: MistralIntegration - MistralIntegrationCreate: - properties: - token: - type: string - title: Token - type: object - required: - - token - title: MistralIntegrationCreate - ModalityFilter: - properties: - name: - type: string - const: modality - title: Name - default: modality - operator: - type: string - enum: - - eq - - ne - - one_of - - not_in - title: Operator - value: + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: anyOf: - type: string - description: Single enum value - specific options depend on the concrete - enum type used - example: ENUM_VALUE - - items: - type: string - example: ENUM_VALUE - type: array - description: Array of enum values - example: - - ENUM_VALUE_1 - - ENUM_VALUE_2 - title: Value - type: object - required: - - operator - - value - title: ModalityFilter - description: 'Filters on content modalities in scorer jobs. - - Matches if at least one of the specified modalities is present.' - Model: - properties: - lifecycle_state: - $ref: '#/components/schemas/ModelLifecycleState' - default: active - replacement_alias: + format: uuid4 + - type: 'null' + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: + items: + type: string + format: uuid4 + type: array + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: anyOf: - - type: string + - type: number - type: 'null' - title: Replacement Alias - deprecation_date: + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: anyOf: - - type: string - format: date + - type: boolean - type: 'null' - title: Deprecation Date - retirement_date: + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: anyOf: - - type: string - format: date + - $ref: '#/components/schemas/AnnotationStatus' - type: 'null' - title: Retirement Date - name: - type: string - title: Name - description: Provider model identifier used to match the model to its configured - provider deployment or profile. - alias: + description: Annotation review status of the record + annotated_members: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: type: string - title: Alias - description: Galileo model identifier used in settings and API requests - to select this model. - display_name: + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: type: string - title: Display Name - description: Human-readable model name shown in the UI. Defaults to the - alias for legacy registrations. + title: Error Message + description: Runner error text written directly to CH span default: '' - integration: - $ref: '#/components/schemas/LLMIntegration' - default: openai - user_role: + metric_info: anyOf: - - type: string + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Input' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Input' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' + type: object - type: 'null' - title: User Role - assistant_role: + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object + - type: 'null' + title: Files + description: File metadata keyed by file ID for files associated with this + record + parent_id: anyOf: - type: string + format: uuid - type: 'null' - title: Assistant Role - system_supported: + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: type: boolean - title: System Supported - default: false - input_modalities: - items: - $ref: '#/components/schemas/ContentModality' - type: array - title: Input Modalities - description: Input modalities that the model can accept. - alternative_names: - items: - type: string - type: array - title: Alternative Names - description: Alternative names for the model, used for matching with various - current, versioned or legacy names. - input_token_limit: + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: anyOf: - type: integer - type: 'null' - title: Input Token Limit - output_token_limit: + title: Step Number + description: Topological step number of the span. + tools: anyOf: - - type: integer + - items: + additionalProperties: true + type: object + type: array - type: 'null' - title: Output Token Limit - token_limit: + title: Tools + description: List of available tools passed to the LLM on invocation. + events: anyOf: - - type: integer + - items: + oneOf: + - $ref: '#/components/schemas/MessageEvent' + - $ref: '#/components/schemas/ReasoningEvent' + - $ref: '#/components/schemas/InternalToolCall' + - $ref: '#/components/schemas/WebSearchCallEvent' + - $ref: '#/components/schemas/ImageGenerationEvent' + - $ref: '#/components/schemas/MCPCallEvent' + - $ref: '#/components/schemas/MCPListToolsEvent' + - $ref: '#/components/schemas/MCPApprovalRequestEvent' + discriminator: + propertyName: type + mapping: + image_generation: '#/components/schemas/ImageGenerationEvent' + internal_tool_call: '#/components/schemas/InternalToolCall' + mcp_approval_request: '#/components/schemas/MCPApprovalRequestEvent' + mcp_call: '#/components/schemas/MCPCallEvent' + mcp_list_tools: '#/components/schemas/MCPListToolsEvent' + message: '#/components/schemas/MessageEvent' + reasoning: '#/components/schemas/ReasoningEvent' + web_search_call: '#/components/schemas/WebSearchCallEvent' + type: array - type: 'null' - title: Token Limit - cost_by: - $ref: '#/components/schemas/ModelCostBy' - default: tokens - is_chat: - type: boolean - title: Is Chat - default: false - provides_log_probs: - type: boolean - title: Provides Log Probs - default: false - formatting_tokens: - type: integer - title: Formatting Tokens - default: 0 - response_prefix_tokens: - type: integer - title: Response Prefix Tokens - default: 0 - api_version: + title: Events + description: List of reasoning, internal tool call, or MCP events that occurred + during the LLM span. + model: anyOf: - type: string - type: 'null' - title: Api Version - legacy_mistral_prompt_format: - type: boolean - title: Legacy Mistral Prompt Format - default: false - requires_max_tokens: - type: boolean - title: Requires Max Tokens - default: false - supports_structured_output: - type: boolean - title: Supports Structured Output - default: false - max_top_p: + title: Model + description: Model used for this span. + provider: anyOf: - - type: number + - type: string - type: 'null' - title: Max Top P - params_map: - $ref: '#/components/schemas/RunParamsMap' - output_map: + title: Provider + description: Provider used for this span. + temperature: anyOf: - - $ref: '#/components/schemas/OutputMap' + - type: number - type: 'null' - input_map: + title: Temperature + description: Temperature used for generation. + finish_reason: anyOf: - - $ref: '#/components/schemas/InputMap' + - type: string - type: 'null' + title: Finish Reason + description: Reason for finishing. type: object - required: - - name - - alias - title: Model - ModelCostBy: - type: string - enum: - - tokens - - characters - title: ModelCostBy - ModelLifecycleState: - type: string - enum: - - active - - deprecated - - retired - title: ModelLifecycleState - ModelType: - type: string - enum: - - slm - - llm - - code - - decision - title: ModelType - MultiModalModelIntegrationConfig: + title: PartialExtendedLlmSpanRecord + PartialExtendedLlmSpanRecord-Output: properties: - max_files: + type: + type: string + const: llm + title: Type + description: Type of the trace, span or session. + default: llm + input: + items: + $ref: '#/components/schemas/Message-Output' + type: array + title: Input + description: Input to the trace or span. + redacted_input: anyOf: - - type: integer - minimum: 1.0 + - items: + $ref: '#/components/schemas/Message-Output' + type: array - type: 'null' - title: Max Files - description: Maximum number of files allowed per request. None means no - limit. - max_file_size_bytes: + title: Redacted Input + description: Redacted input of the trace or span. + output: + $ref: '#/components/schemas/Message-Output' + description: Output of the trace or span. + redacted_output: anyOf: - - type: integer - minimum: 1.0 + - $ref: '#/components/schemas/Message-Output' - type: 'null' - title: Max File Size Bytes - description: Maximum file size in bytes per file. None means no limit. - type: object - title: MultiModalModelIntegrationConfig - description: Configuration for multi-modal capabilities (file uploads). - MultimodalCapability: - type: string - enum: - - vision - - audio - title: MultimodalCapability - Name: - properties: - value: - type: string - maxLength: 128 - minLength: 1 - title: Value - append_suffix_if_duplicate: - type: boolean - title: Append Suffix If Duplicate - default: false - type: object - required: - - value - title: Name - description: Global name class for handling unique naming across the application. - NodeNameFilter: - properties: + description: Redacted output of the trace or span. name: type: string - const: node_name title: Name - default: node_name - operator: + description: Name of the trace, span or session. + default: '' + created_at: type: string - enum: - - eq - - ne - - contains - - one_of - - not_in - title: Operator - value: + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: + anyOf: + - type: integer + - type: 'null' + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/LlmMetrics' + description: Metrics associated with this trace or span. + external_id: anyOf: - type: string - - items: - type: string - type: array - title: Value - case_sensitive: - type: boolean - title: Case Sensitive - default: true - type: object - required: - - operator - - value - title: NodeNameFilter - description: Filters on node names in scorer jobs. - NodeType: - type: string - enum: - - chain - - chat - - http - - llm - - retriever - - tool - - agent - - workflow - - trace - - session - title: NodeType - ? NotNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____ - : properties: - not: + - type: 'null' + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: anyOf: - - $ref: '#/components/schemas/FilterLeaf_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' - - $ref: '#/components/schemas/AndNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' - - $ref: '#/components/schemas/OrNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' - - $ref: '#/components/schemas/NotNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' - title: Not - type: object - required: - - not - title: NotNodeLogRecordsFilter - NumericColorConstraint: - properties: - color: - $ref: '#/components/schemas/MetricColor' - operator: - type: string - enum: - - eq - - gt - - gte - - lt - - lte - - between - title: Operator - value: + - type: string + - type: 'null' + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: anyOf: - - type: number - - items: - type: number - type: array - title: Value - type: object - required: - - color - - operator - - value - title: NumericColorConstraint - description: "A color constraint for numeric metric values.\n\nAssigns a color\ - \ when a numeric score matches the given operator and value.\n\nOperators\ - \ and expected value shapes:\n - eq, gt, gte, lt, lte: value must be a single\ - \ float.\n - between: value must be a list of exactly 2 floats [low, high]\ - \ where low < high.\n The range is inclusive on both ends.\n\nExample:\n\ - \ {\"color\": \"green\", \"operator\": \"gte\", \"value\": 0.8}\n {\"\ - color\": \"yellow\", \"operator\": \"between\", \"value\": [0.3, 0.7]}" - NumericRollUpMethod: - type: string - enum: - - average - - sum - - max - - min - title: NumericRollUpMethod - description: Roll up methods for aggregating numeric metrics up the session/trace/span - hierarchy. - NvidiaIntegration: - properties: + - type: string + - type: 'null' + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace id: anyOf: - type: string - format: uuid4 + format: uuid - type: 'null' - title: Id - name: - type: string - const: nvidia - title: Name - default: nvidia - provider: - type: string - const: nvidia - title: Provider - default: nvidia - extra: + title: ID + description: Galileo ID of the session, trace or span + session_id: anyOf: - - additionalProperties: true - type: object + - type: string + format: uuid - type: 'null' - title: Extra - type: object - title: NvidiaIntegration - NvidiaIntegrationCreate: - properties: - token: - type: string - title: Token - hostname: - type: string - maxLength: 2083 - minLength: 1 - format: uri - title: Hostname - type: object - required: - - token - - hostname - title: NvidiaIntegrationCreate - OpenAIFunction: - properties: - name: - type: string - title: Name - type: object - required: - - name - title: OpenAIFunction - OpenAIIntegration: - properties: - organization_id: + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Organization Id - id: + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: anyOf: - type: string - format: uuid4 + format: uuid - type: 'null' - title: Id - name: - type: string - const: openai - title: Name - default: openai - provider: - type: string - const: openai - title: Provider - default: openai - extra: + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: anyOf: - - additionalProperties: true - type: object + - type: string + format: uuid - type: 'null' - title: Extra - type: object - title: OpenAIIntegration - OpenAIIntegrationCreate: - properties: - organization_id: + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: anyOf: - type: string + format: date-time - type: 'null' - title: Organization Id - token: - type: string - title: Token - type: object - required: - - token - title: OpenAIIntegrationCreate - OpenAIToolChoice: - properties: - type: - type: string - title: Type - default: function - function: - $ref: '#/components/schemas/OpenAIFunction' - type: object - required: - - function - title: OpenAIToolChoice - ? OrNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____ - : properties: - or: - items: - anyOf: - - $ref: '#/components/schemas/FilterLeaf_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' - - $ref: '#/components/schemas/AndNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' - - $ref: '#/components/schemas/OrNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' - - $ref: '#/components/schemas/NotNode_Annotated_Union_LogRecordsIDFilter__LogRecordsDateFilter__LogRecordsNumberFilter__LogRecordsBooleanFilter__LogRecordsCollectionFilter__LogRecordsTextFilter__LogRecordsFullyAnnotatedFilter___FieldInfo_annotation_NoneType__required_True__discriminator__type____' - type: array - title: Or - type: object - required: - - or - title: OrNodeLogRecordsFilter - OrganizationAction: - type: string - enum: - - rename - - delete - - delete_log_data - - read_settings - - update_settings - - read_cost_settings - - read_ai_usage - - read_ai_usage_organization - - read_unredacted_data - title: OrganizationAction - OutputMap: - properties: - response: - type: string - title: Response - token_count: + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: anyOf: - - type: string + - type: boolean - type: 'null' - title: Token Count - input_token_count: + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Input Token Count - output_token_count: + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: anyOf: - type: string + format: uuid4 - type: 'null' - title: Output Token Count - completion_reason: + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: + items: + type: string + format: uuid4 + type: array + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: anyOf: - - type: string + - type: number - type: 'null' - title: Completion Reason - type: object - required: - - response - title: OutputMap - OutputPIIScorer: - properties: - name: - type: string - const: output_pii - title: Name - default: output_pii - filters: + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: + anyOf: + - type: boolean + - type: 'null' + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: + anyOf: + - $ref: '#/components/schemas/AnnotationStatus' + - type: 'null' + description: Annotation review status of the record + annotated_members: anyOf: - items: - oneOf: - - $ref: '#/components/schemas/NodeNameFilter' - - $ref: '#/components/schemas/MetadataFilter' - - $ref: '#/components/schemas/ModalityFilter' - discriminator: - propertyName: name - mapping: - metadata: '#/components/schemas/MetadataFilter' - modality: '#/components/schemas/ModalityFilter' - node_name: '#/components/schemas/NodeNameFilter' + type: string type: array - type: 'null' - title: Filters - description: List of filters to apply to the scorer. - type: object - title: OutputPIIScorer - OutputSexistScorer: - properties: - name: + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: type: string - const: output_sexist - title: Name - default: output_sexist - filters: + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: + type: string + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: anyOf: - - items: + - additionalProperties: oneOf: - - $ref: '#/components/schemas/NodeNameFilter' - - $ref: '#/components/schemas/MetadataFilter' - - $ref: '#/components/schemas/ModalityFilter' + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Output' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Output' discriminator: - propertyName: name + propertyName: status_type mapping: - metadata: '#/components/schemas/MetadataFilter' - modality: '#/components/schemas/ModalityFilter' - node_name: '#/components/schemas/NodeNameFilter' - type: array + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' + type: object - type: 'null' - title: Filters - description: List of filters to apply to the scorer. - type: - type: string - enum: - - luna - - plus - title: Type - default: luna - model_name: + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object + - type: 'null' + title: Files + description: File metadata keyed by file ID for files associated with this + record + parent_id: anyOf: - type: string + format: uuid - type: 'null' - title: Model Name - description: Alias of the model to use for the scorer. - num_judges: + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: anyOf: - type: integer - maximum: 10.0 - minimum: 1.0 - type: 'null' - title: Num Judges - description: Number of judges for the scorer. - type: object - title: OutputSexistScorer - OutputToneScorer: - properties: - name: - type: string - const: output_tone - title: Name - default: output_tone - filters: + title: Step Number + description: Topological step number of the span. + tools: anyOf: - items: - oneOf: - - $ref: '#/components/schemas/NodeNameFilter' - - $ref: '#/components/schemas/MetadataFilter' - - $ref: '#/components/schemas/ModalityFilter' - discriminator: - propertyName: name - mapping: - metadata: '#/components/schemas/MetadataFilter' - modality: '#/components/schemas/ModalityFilter' - node_name: '#/components/schemas/NodeNameFilter' + additionalProperties: true + type: object type: array - type: 'null' - title: Filters - description: List of filters to apply to the scorer. - type: object - title: OutputToneScorer - OutputToxicityScorer: - properties: - name: - type: string - const: output_toxicity - title: Name - default: output_toxicity - filters: + title: Tools + description: List of available tools passed to the LLM on invocation. + events: anyOf: - items: oneOf: - - $ref: '#/components/schemas/NodeNameFilter' - - $ref: '#/components/schemas/MetadataFilter' - - $ref: '#/components/schemas/ModalityFilter' + - $ref: '#/components/schemas/MessageEvent' + - $ref: '#/components/schemas/ReasoningEvent' + - $ref: '#/components/schemas/InternalToolCall' + - $ref: '#/components/schemas/WebSearchCallEvent' + - $ref: '#/components/schemas/ImageGenerationEvent' + - $ref: '#/components/schemas/MCPCallEvent' + - $ref: '#/components/schemas/MCPListToolsEvent' + - $ref: '#/components/schemas/MCPApprovalRequestEvent' discriminator: - propertyName: name + propertyName: type mapping: - metadata: '#/components/schemas/MetadataFilter' - modality: '#/components/schemas/ModalityFilter' - node_name: '#/components/schemas/NodeNameFilter' + image_generation: '#/components/schemas/ImageGenerationEvent' + internal_tool_call: '#/components/schemas/InternalToolCall' + mcp_approval_request: '#/components/schemas/MCPApprovalRequestEvent' + mcp_call: '#/components/schemas/MCPCallEvent' + mcp_list_tools: '#/components/schemas/MCPListToolsEvent' + message: '#/components/schemas/MessageEvent' + reasoning: '#/components/schemas/ReasoningEvent' + web_search_call: '#/components/schemas/WebSearchCallEvent' type: array - type: 'null' - title: Filters - description: List of filters to apply to the scorer. - type: - type: string - enum: - - luna - - plus - title: Type - default: luna - model_name: + title: Events + description: List of reasoning, internal tool call, or MCP events that occurred + during the LLM span. + model: anyOf: - type: string - type: 'null' - title: Model Name - description: Alias of the model to use for the scorer. - num_judges: + title: Model + description: Model used for this span. + provider: anyOf: - - type: integer - maximum: 10.0 - minimum: 1.0 + - type: string - type: 'null' - title: Num Judges - description: Number of judges for the scorer. - type: object - title: OutputToxicityScorer - OutputTypeEnum: - type: string - enum: - - boolean - - categorical - - count - - discrete - - freeform - - percentage - - multilabel - - retrieved_chunk_list_boolean - - boolean_multilabel - - boolean_probability - title: OutputTypeEnum - description: Enumeration of output types. - OverrideAction: - properties: - type: - type: string - const: OVERRIDE - title: Type - default: OVERRIDE - subscriptions: - items: - $ref: '#/components/schemas/SubscriptionConfig' - type: array - title: Subscriptions - description: List of subscriptions to send a notification to when this action - is applied and the ruleset status matches any of the configured statuses. - choices: - items: - type: string - type: array - minItems: 1 - title: Choices - description: List of choices to override the response with. If there are - multiple choices, one will be chosen at random when applying this action. + title: Provider + description: Provider used for this span. + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Temperature used for generation. + finish_reason: + anyOf: + - type: string + - type: 'null' + title: Finish Reason + description: Reason for finishing. type: object - required: - - choices - title: OverrideAction - PartialExtendedAgentSpanRecord: + title: PartialExtendedLlmSpanRecord + PartialExtendedRetrieverSpanRecord-Input: properties: type: type: string - const: agent + const: retriever title: Type description: Type of the trace, span or session. - default: agent + default: retriever input: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array + type: string title: Input description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string - - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: - anyOf: - - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' - type: array - - $ref: '#/components/schemas/ControlResult' - - type: 'null' + items: + $ref: '#/components/schemas/Document-Input' + type: array title: Output description: Output of the trace or span. redacted_output: anyOf: - - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - items: - oneOf: - - $ref: '#/components/schemas/TextContentPart' - - $ref: '#/components/schemas/FileContentPart' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileContentPart' - text: '#/components/schemas/TextContentPart' + $ref: '#/components/schemas/Document-Input' type: array - - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Redacted Output description: Redacted output of the trace or span. @@ -33067,10 +40593,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -33080,8 +40606,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -33116,26 +40642,321 @@ components: - type: 'null' title: Step Number description: Topological step number of the span. - agent_type: - $ref: '#/components/schemas/AgentType' - description: Agent type. - default: default - agent_name: + type: object + title: PartialExtendedRetrieverSpanRecord + PartialExtendedRetrieverSpanRecord-Output: + properties: + type: + type: string + const: retriever + title: Type + description: Type of the trace, span or session. + default: retriever + input: + type: string + title: Input + description: Input to the trace or span. + default: '' + redacted_input: anyOf: - type: string - type: 'null' - title: Agent Name - description: Name of the agent. + title: Redacted Input + description: Redacted input of the trace or span. + output: + items: + $ref: '#/components/schemas/Document-Output' + type: array + title: Output + description: Output of the trace or span. + redacted_output: + anyOf: + - items: + $ref: '#/components/schemas/Document-Output' + type: array + - type: 'null' + title: Redacted Output + description: Redacted output of the trace or span. + name: + type: string + title: Name + description: Name of the trace, span or session. + default: '' + created_at: + type: string + format: date-time + title: Created + description: Timestamp of the trace or span's creation. + user_metadata: + additionalProperties: + type: string + type: object + title: User Metadata + description: Metadata associated with this trace or span. + tags: + items: + type: string + type: array + title: Tags + description: Tags associated with this trace or span. + status_code: + anyOf: + - type: integer + - type: 'null' + title: Status Code + description: Status code of the trace or span. Used for logging failure + or error states. + metrics: + $ref: '#/components/schemas/Metrics' + description: Metrics associated with this trace or span. + external_id: + anyOf: + - type: string + - type: 'null' + title: External Id + description: A user-provided session, trace or span ID. + dataset_input: + anyOf: + - type: string + - type: 'null' + title: Dataset Input + description: Input to the dataset associated with this trace + dataset_output: + anyOf: + - type: string + - type: 'null' + title: Dataset Output + description: Output from the dataset associated with this trace + dataset_metadata: + additionalProperties: + type: string + type: object + title: Dataset Metadata + description: Metadata from the dataset associated with this trace + id: + anyOf: + - type: string + format: uuid + - type: 'null' + title: ID + description: Galileo ID of the session, trace or span + session_id: + anyOf: + - type: string + format: uuid + - type: 'null' + title: Session ID + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) + trace_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Trace ID + description: Galileo ID of the trace containing the span (or the same value + as id for a trace) + project_id: + anyOf: + - type: string + format: uuid + - type: 'null' + title: Project ID + description: Galileo ID of the project associated with this trace or span + run_id: + anyOf: + - type: string + format: uuid + - type: 'null' + title: Run ID + description: Galileo ID of the run (log stream or experiment) associated + with this trace or span + updated_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Last Updated + description: Timestamp of the session or trace or span's last update + has_children: + anyOf: + - type: boolean + - type: 'null' + title: Has Children + description: Whether or not this trace or span has child spans + metrics_batch_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Metrics Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + session_batch_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Session Batch Id + description: Galileo ID of the metrics batch associated with this trace + or span + feedback_rating_info: + additionalProperties: + $ref: '#/components/schemas/FeedbackRatingInfo' + type: object + title: Feedback Rating Info + description: Feedback information related to the record + annotations: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/AnnotationRatingInfo' + propertyNames: + format: uuid4 + type: object + propertyNames: + format: uuid4 + type: object + title: Annotations + description: Annotations keyed by template ID and annotator ID + file_ids: + items: + type: string + format: uuid4 + type: array + title: File Ids + description: IDs of files associated with this record + file_modalities: + items: + $ref: '#/components/schemas/ContentModality' + type: array + title: File Modalities + description: Modalities of files associated with this record + annotation_aggregates: + additionalProperties: + $ref: '#/components/schemas/AnnotationAggregate' + propertyNames: + format: uuid4 + type: object + title: Annotation Aggregates + description: Annotation aggregate information keyed by template ID + annotation_agreement: + additionalProperties: + type: number + propertyNames: + format: uuid4 + type: object + title: Annotation Agreement + description: Annotation agreement scores keyed by template ID + overall_annotation_agreement: + anyOf: + - type: number + - type: 'null' + title: Overall Annotation Agreement + description: Average annotation agreement across all templates in the queue + annotation_queue_ids: + items: + type: string + format: uuid4 + type: array + title: Annotation Queue Ids + description: IDs of annotation queues this record is in + fully_annotated: + anyOf: + - type: boolean + - type: 'null' + title: Fully Annotated + description: Whether every field is annotated by every annotator in the + queue + annotation_status: + anyOf: + - $ref: '#/components/schemas/AnnotationStatus' + - type: 'null' + description: Annotation review status of the record + annotated_members: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Annotated Members + description: Emails of tracked queue members who rated the record + progress_message: + type: string + title: Progress Message + description: Runner progress text written directly to CH span + default: '' + error_message: + type: string + title: Error Message + description: Runner error text written directly to CH span + default: '' + metric_info: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/MetricNotComputed' + - $ref: '#/components/schemas/MetricPending' + - $ref: '#/components/schemas/MetricComputing' + - $ref: '#/components/schemas/MetricNotApplicable' + - $ref: '#/components/schemas/MetricSuccess-Output' + - $ref: '#/components/schemas/MetricError' + - $ref: '#/components/schemas/MetricFailed' + - $ref: '#/components/schemas/MetricRollUp-Output' + discriminator: + propertyName: status_type + mapping: + computing: '#/components/schemas/MetricComputing' + error: '#/components/schemas/MetricError' + failed: '#/components/schemas/MetricFailed' + not_applicable: '#/components/schemas/MetricNotApplicable' + not_computed: '#/components/schemas/MetricNotComputed' + pending: '#/components/schemas/MetricPending' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' + type: object + - type: 'null' + title: Metric Info + description: Detailed information about the metrics associated with this + trace or span + files: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/FileMetadata' + propertyNames: + format: uuid4 + type: object + - type: 'null' + title: Files + description: File metadata keyed by file ID for files associated with this + record + parent_id: + anyOf: + - type: string + format: uuid + - type: 'null' + title: Parent ID + description: Galileo ID of the parent of this span + is_complete: + type: boolean + title: Is Complete + description: Whether the parent trace is complete or not + default: true + step_number: + anyOf: + - type: integer + - type: 'null' + title: Step Number + description: Topological step number of the span. type: object - title: PartialExtendedAgentSpanRecord - PartialExtendedControlSpanRecord: + title: PartialExtendedRetrieverSpanRecord + PartialExtendedSessionRecord-Input: properties: type: type: string - const: control + const: session title: Type description: Type of the trace, span or session. - default: control + default: session input: anyOf: - type: string @@ -33153,7 +40974,6 @@ components: text: '#/components/schemas/TextContentPart' type: array title: Input - description: Input to the trace or span. default: '' redacted_input: anyOf: @@ -33176,13 +40996,45 @@ components: description: Redacted input of the trace or span. output: anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - $ref: '#/components/schemas/ControlResult' - type: 'null' + title: Output description: Output of the trace or span. redacted_output: anyOf: + - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - $ref: '#/components/schemas/ControlResult' - type: 'null' + title: Redacted Output description: Redacted output of the trace or span. name: type: string @@ -33246,15 +41098,14 @@ components: format: uuid - type: 'null' title: ID - description: Galileo ID of the session, trace or span + description: Galileo ID of the session session_id: anyOf: - type: string - format: uuid + format: uuid4 - type: 'null' title: Session ID - description: Galileo ID of the session containing the trace (or the same - value as id for a trace) + description: Galileo ID of the session containing the trace or span or session trace_id: anyOf: - type: string @@ -33405,10 +41256,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -33418,8 +41269,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -33436,76 +41287,32 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - parent_id: + previous_session_id: anyOf: - type: string - format: uuid - - type: 'null' - title: Parent ID - description: Galileo ID of the parent of this span - is_complete: - type: boolean - title: Is Complete - description: Whether the parent trace is complete or not - default: true - step_number: - anyOf: - - type: integer + format: uuid4 - type: 'null' - title: Step Number - description: Topological step number of the span. - control_id: + title: Previous Session Id + num_traces: anyOf: - type: integer - type: 'null' - title: Control Id - description: Identifier of the control definition that produced this span. - agent_name: - anyOf: - - type: string - - type: 'null' - title: Agent Name - description: Normalized agent name associated with this control execution. - check_stage: - anyOf: - - $ref: '#/components/schemas/ControlCheckStage' - - type: 'null' - description: Execution stage where the control ran, typically 'pre' or 'post'. - applies_to: - anyOf: - - $ref: '#/components/schemas/ControlAppliesTo' - - type: 'null' - description: Parent execution type the control applied to, for example 'llm_call' - or 'tool_call'. - evaluator_name: - anyOf: - - type: string - - type: 'null' - title: Evaluator Name - description: Representative evaluator name for this control span. For composite - controls, this is the primary evaluator chosen for observability identity. - selector_path: - anyOf: - - type: string - - type: 'null' - title: Selector Path - description: Representative selector path for this control span. For composite - controls, this is the primary selector path chosen for observability identity. + title: Num Traces type: object - title: PartialExtendedControlSpanRecord - PartialExtendedHttpSpanRecord: + title: PartialExtendedSessionRecord + PartialExtendedSessionRecord-Output: properties: type: type: string - const: http + const: session title: Type description: Type of the trace, span or session. - default: http + default: session input: anyOf: - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + $ref: '#/components/schemas/Message-Output' type: array - items: oneOf: @@ -33518,13 +41325,12 @@ components: text: '#/components/schemas/TextContentPart' type: array title: Input - description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + $ref: '#/components/schemas/Message-Output' type: array - items: oneOf: @@ -33542,9 +41348,9 @@ components: output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - $ref: '#/components/schemas/Message-Output' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Output' type: array - items: oneOf: @@ -33563,9 +41369,9 @@ components: redacted_output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - $ref: '#/components/schemas/Message-Output' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Output' type: array - items: oneOf: @@ -33643,15 +41449,14 @@ components: format: uuid - type: 'null' title: ID - description: Galileo ID of the session, trace or span + description: Galileo ID of the session session_id: anyOf: - type: string - format: uuid + format: uuid4 - type: 'null' title: Session ID - description: Galileo ID of the session containing the trace (or the same - value as id for a trace) + description: Galileo ID of the session containing the trace or span or session trace_id: anyOf: - type: string @@ -33802,10 +41607,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Output' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Output' discriminator: propertyName: status_type mapping: @@ -33815,8 +41620,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' type: object - type: 'null' title: Metric Info @@ -33833,55 +41638,49 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - parent_id: + previous_session_id: anyOf: - type: string - format: uuid + format: uuid4 - type: 'null' - title: Parent ID - description: Galileo ID of the parent of this span - is_complete: - type: boolean - title: Is Complete - description: Whether the parent trace is complete or not - default: true - step_number: + title: Previous Session Id + num_traces: anyOf: - type: integer - type: 'null' - title: Step Number - description: Topological step number of the span. + title: Num Traces type: object - title: PartialExtendedHttpSpanRecord - PartialExtendedLlmSpanRecord: + title: PartialExtendedSessionRecord + PartialExtendedToolSpanRecord-Input: properties: type: type: string - const: llm + const: tool title: Type description: Type of the trace, span or session. - default: llm + default: tool input: - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array + type: string title: Input description: Input to the trace or span. + default: '' redacted_input: anyOf: - - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array + - type: string - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + anyOf: + - type: string + - type: 'null' + title: Output description: Output of the trace or span. redacted_output: anyOf: - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - type: string - type: 'null' + title: Redacted Output description: Redacted output of the trace or span. name: type: string @@ -33913,7 +41712,7 @@ components: description: Status code of the trace or span. Used for logging failure or error states. metrics: - $ref: '#/components/schemas/LlmMetrics' + $ref: '#/components/schemas/Metrics' description: Metrics associated with this trace or span. external_id: anyOf: @@ -34104,10 +41903,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -34117,8 +41916,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -34153,77 +41952,22 @@ components: - type: 'null' title: Step Number description: Topological step number of the span. - tools: - anyOf: - - items: - additionalProperties: true - type: object - type: array - - type: 'null' - title: Tools - description: List of available tools passed to the LLM on invocation. - events: - anyOf: - - items: - oneOf: - - $ref: '#/components/schemas/MessageEvent' - - $ref: '#/components/schemas/ReasoningEvent' - - $ref: '#/components/schemas/InternalToolCall' - - $ref: '#/components/schemas/WebSearchCallEvent' - - $ref: '#/components/schemas/ImageGenerationEvent' - - $ref: '#/components/schemas/MCPCallEvent' - - $ref: '#/components/schemas/MCPListToolsEvent' - - $ref: '#/components/schemas/MCPApprovalRequestEvent' - discriminator: - propertyName: type - mapping: - image_generation: '#/components/schemas/ImageGenerationEvent' - internal_tool_call: '#/components/schemas/InternalToolCall' - mcp_approval_request: '#/components/schemas/MCPApprovalRequestEvent' - mcp_call: '#/components/schemas/MCPCallEvent' - mcp_list_tools: '#/components/schemas/MCPListToolsEvent' - message: '#/components/schemas/MessageEvent' - reasoning: '#/components/schemas/ReasoningEvent' - web_search_call: '#/components/schemas/WebSearchCallEvent' - type: array - - type: 'null' - title: Events - description: List of reasoning, internal tool call, or MCP events that occurred - during the LLM span. - model: - anyOf: - - type: string - - type: 'null' - title: Model - description: Model used for this span. - provider: - anyOf: - - type: string - - type: 'null' - title: Provider - description: Provider used for this span. - temperature: - anyOf: - - type: number - - type: 'null' - title: Temperature - description: Temperature used for generation. - finish_reason: + tool_call_id: anyOf: - type: string - type: 'null' - title: Finish Reason - description: Reason for finishing. + title: Tool Call Id + description: ID of the tool call. type: object - title: PartialExtendedLlmSpanRecord - PartialExtendedRetrieverSpanRecord: + title: PartialExtendedToolSpanRecord + PartialExtendedToolSpanRecord-Output: properties: type: type: string - const: retriever + const: tool title: Type description: Type of the trace, span or session. - default: retriever + default: tool input: type: string title: Input @@ -34236,16 +41980,14 @@ components: title: Redacted Input description: Redacted input of the trace or span. output: - items: - $ref: '#/components/schemas/Document' - type: array + anyOf: + - type: string + - type: 'null' title: Output description: Output of the trace or span. redacted_output: anyOf: - - items: - $ref: '#/components/schemas/Document' - type: array + - type: string - type: 'null' title: Redacted Output description: Redacted output of the trace or span. @@ -34470,10 +42212,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Output' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Output' discriminator: propertyName: status_type mapping: @@ -34483,8 +42225,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' type: object - type: 'null' title: Metric Info @@ -34519,22 +42261,25 @@ components: - type: 'null' title: Step Number description: Topological step number of the span. + tool_call_id: + anyOf: + - type: string + - type: 'null' + title: Tool Call Id + description: ID of the tool call. type: object - title: PartialExtendedRetrieverSpanRecord - PartialExtendedSessionRecord: + title: PartialExtendedToolSpanRecord + PartialExtendedTraceRecord-Input: properties: type: type: string - const: session + const: trace title: Type description: Type of the trace, span or session. - default: session + default: trace input: anyOf: - type: string - - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array - items: oneOf: - $ref: '#/components/schemas/TextContentPart' @@ -34546,13 +42291,11 @@ components: text: '#/components/schemas/TextContentPart' type: array title: Input + description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string - - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - type: array - items: oneOf: - $ref: '#/components/schemas/TextContentPart' @@ -34569,10 +42312,6 @@ components: output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - items: oneOf: - $ref: '#/components/schemas/TextContentPart' @@ -34583,17 +42322,12 @@ components: file: '#/components/schemas/FileContentPart' text: '#/components/schemas/TextContentPart' type: array - - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Output description: Output of the trace or span. redacted_output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - - items: - $ref: '#/components/schemas/Document' - type: array - items: oneOf: - $ref: '#/components/schemas/TextContentPart' @@ -34604,7 +42338,6 @@ components: file: '#/components/schemas/FileContentPart' text: '#/components/schemas/TextContentPart' type: array - - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Redacted Output description: Redacted output of the trace or span. @@ -34670,18 +42403,19 @@ components: format: uuid - type: 'null' title: ID - description: Galileo ID of the session + description: Galileo ID of the trace session_id: anyOf: - type: string - format: uuid4 + format: uuid - type: 'null' title: Session ID - description: Galileo ID of the session containing the trace or span or session + description: Galileo ID of the session containing the trace (or the same + value as id for a trace) trace_id: anyOf: - type: string - format: uuid4 + format: uuid - type: 'null' title: Trace ID description: Galileo ID of the trace containing the span (or the same value @@ -34828,10 +42562,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -34841,8 +42575,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -34859,47 +42593,99 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - previous_session_id: + dataset_generated_output: anyOf: - type: string - format: uuid4 - type: 'null' - title: Previous Session Id - num_traces: + title: Dataset Generated Output + description: Generated output from the dataset associated with this trace + is_complete: + type: boolean + title: Is Complete + description: Whether the trace is complete or not + default: true + num_spans: anyOf: - type: integer - type: 'null' - title: Num Traces + title: Num Spans + is_synthetic: + type: boolean + title: Is Synthetic + description: Whether ingest created this trace row because the trace's root + span was missing + default: false type: object - title: PartialExtendedSessionRecord - PartialExtendedToolSpanRecord: + title: PartialExtendedTraceRecord + PartialExtendedTraceRecord-Output: properties: type: type: string - const: tool + const: trace title: Type description: Type of the trace, span or session. - default: tool + default: trace input: - type: string + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array title: Input description: Input to the trace or span. default: '' redacted_input: anyOf: - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' title: Redacted Input description: Redacted input of the trace or span. output: anyOf: - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' title: Output description: Output of the trace or span. redacted_output: anyOf: - type: string + - items: + oneOf: + - $ref: '#/components/schemas/TextContentPart' + - $ref: '#/components/schemas/FileContentPart' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/FileContentPart' + text: '#/components/schemas/TextContentPart' + type: array - type: 'null' title: Redacted Output description: Redacted output of the trace or span. @@ -34965,7 +42751,7 @@ components: format: uuid - type: 'null' title: ID - description: Galileo ID of the session, trace or span + description: Galileo ID of the trace session_id: anyOf: - type: string @@ -34977,7 +42763,7 @@ components: trace_id: anyOf: - type: string - format: uuid4 + format: uuid - type: 'null' title: Trace ID description: Galileo ID of the trace containing the span (or the same value @@ -35124,10 +42910,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Output' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Output' discriminator: propertyName: status_type mapping: @@ -35137,8 +42923,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' type: object - type: 'null' title: Metric Info @@ -35155,43 +42941,44 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - parent_id: + dataset_generated_output: anyOf: - type: string - format: uuid - type: 'null' - title: Parent ID - description: Galileo ID of the parent of this span + title: Dataset Generated Output + description: Generated output from the dataset associated with this trace is_complete: type: boolean title: Is Complete - description: Whether the parent trace is complete or not + description: Whether the trace is complete or not default: true - step_number: + num_spans: anyOf: - type: integer - type: 'null' - title: Step Number - description: Topological step number of the span. - tool_call_id: - anyOf: - - type: string - - type: 'null' - title: Tool Call Id - description: ID of the tool call. + title: Num Spans + is_synthetic: + type: boolean + title: Is Synthetic + description: Whether ingest created this trace row because the trace's root + span was missing + default: false type: object - title: PartialExtendedToolSpanRecord - PartialExtendedTraceRecord: + title: PartialExtendedTraceRecord + PartialExtendedWorkflowSpanRecord-Input: properties: type: type: string - const: trace + const: workflow title: Type description: Type of the trace, span or session. - default: trace + default: workflow input: anyOf: - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array - items: oneOf: - $ref: '#/components/schemas/TextContentPart' @@ -35208,6 +42995,9 @@ components: redacted_input: anyOf: - type: string + - items: + $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + type: array - items: oneOf: - $ref: '#/components/schemas/TextContentPart' @@ -35224,6 +43014,10 @@ components: output: anyOf: - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array - items: oneOf: - $ref: '#/components/schemas/TextContentPart' @@ -35234,12 +43028,17 @@ components: file: '#/components/schemas/FileContentPart' text: '#/components/schemas/TextContentPart' type: array + - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Output description: Output of the trace or span. redacted_output: anyOf: - type: string + - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - items: + $ref: '#/components/schemas/Document-Input' + type: array - items: oneOf: - $ref: '#/components/schemas/TextContentPart' @@ -35250,6 +43049,7 @@ components: file: '#/components/schemas/FileContentPart' text: '#/components/schemas/TextContentPart' type: array + - $ref: '#/components/schemas/ControlResult' - type: 'null' title: Redacted Output description: Redacted output of the trace or span. @@ -35315,7 +43115,7 @@ components: format: uuid - type: 'null' title: ID - description: Galileo ID of the trace + description: Galileo ID of the session, trace or span session_id: anyOf: - type: string @@ -35327,7 +43127,7 @@ components: trace_id: anyOf: - type: string - format: uuid + format: uuid4 - type: 'null' title: Trace ID description: Galileo ID of the trace containing the span (or the same value @@ -35474,10 +43274,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Input' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Input' discriminator: propertyName: status_type mapping: @@ -35487,8 +43287,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Input' + success: '#/components/schemas/MetricSuccess-Input' type: object - type: 'null' title: Metric Info @@ -35505,25 +43305,27 @@ components: title: Files description: File metadata keyed by file ID for files associated with this record - dataset_generated_output: + parent_id: anyOf: - type: string + format: uuid - type: 'null' - title: Dataset Generated Output - description: Generated output from the dataset associated with this trace + title: Parent ID + description: Galileo ID of the parent of this span is_complete: type: boolean title: Is Complete - description: Whether the trace is complete or not + description: Whether the parent trace is complete or not default: true - num_spans: + step_number: anyOf: - type: integer - type: 'null' - title: Num Spans + title: Step Number + description: Topological step number of the span. type: object - title: PartialExtendedTraceRecord - PartialExtendedWorkflowSpanRecord: + title: PartialExtendedWorkflowSpanRecord + PartialExtendedWorkflowSpanRecord-Output: properties: type: type: string @@ -35535,7 +43337,7 @@ components: anyOf: - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + $ref: '#/components/schemas/Message-Output' type: array - items: oneOf: @@ -35554,7 +43356,7 @@ components: anyOf: - type: string - items: - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + $ref: '#/components/schemas/Message-Output' type: array - items: oneOf: @@ -35572,9 +43374,9 @@ components: output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - $ref: '#/components/schemas/Message-Output' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Output' type: array - items: oneOf: @@ -35593,9 +43395,9 @@ components: redacted_output: anyOf: - type: string - - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' + - $ref: '#/components/schemas/Message-Output' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Output' type: array - items: oneOf: @@ -35832,10 +43634,10 @@ components: - $ref: '#/components/schemas/MetricPending' - $ref: '#/components/schemas/MetricComputing' - $ref: '#/components/schemas/MetricNotApplicable' - - $ref: '#/components/schemas/MetricSuccess' + - $ref: '#/components/schemas/MetricSuccess-Output' - $ref: '#/components/schemas/MetricError' - $ref: '#/components/schemas/MetricFailed' - - $ref: '#/components/schemas/MetricRollUp' + - $ref: '#/components/schemas/MetricRollUp-Output' discriminator: propertyName: status_type mapping: @@ -35845,8 +43647,8 @@ components: not_applicable: '#/components/schemas/MetricNotApplicable' not_computed: '#/components/schemas/MetricNotComputed' pending: '#/components/schemas/MetricPending' - roll_up: '#/components/schemas/MetricRollUp' - success: '#/components/schemas/MetricSuccess' + roll_up: '#/components/schemas/MetricRollUp-Output' + success: '#/components/schemas/MetricSuccess-Output' type: object - type: 'null' title: Metric Info @@ -35933,6 +43735,8 @@ components: - $ref: '#/components/schemas/OrganizationAction' - $ref: '#/components/schemas/AnnotationQueueAction' - $ref: '#/components/schemas/ControlResourceAction' + - $ref: '#/components/schemas/CustomDashboardAction' + - $ref: '#/components/schemas/TokenomicsDelegationAction' title: Action allowed: type: boolean @@ -35947,6 +43751,35 @@ components: - action - allowed title: Permission + PolicyPackageNotice: + properties: + package: + type: string + title: Package + version: + type: string + title: Version + reason: + $ref: '#/components/schemas/ViolationReason' + advisory_id: + anyOf: + - type: string + - type: 'null' + title: Advisory Id + blocked_from: + anyOf: + - type: string + format: date + - type: 'null' + title: Blocked From + type: object + required: + - package + - version + - reason + - advisory_id + - blocked_from + title: PolicyPackageNotice PreviewDatasetRequest: properties: column_mapping: @@ -35960,10 +43793,12 @@ components: enum: - read_all_logs - read_filtered_logs + - manage_log_views - delete - rename - share - create_run + - create_evaluator - delete_run - rename_run - move_run @@ -35985,6 +43820,7 @@ components: - edit_edit - update_control_bindings - use_control_runtime + - update_evaluator_cost_cap title: ProjectAction ProjectBillingUsage: properties: @@ -36584,6 +44420,7 @@ components: - eq - ne - contains + - regex - one_of - not_in title: Operator @@ -37130,6 +44967,7 @@ components: - eq - ne - contains + - regex - one_of - not_in title: Operator @@ -37434,6 +45272,8 @@ components: - autotune - signals - signals_v2 + - agent_intent + - genai_lens_suggestions - ai_assistant title: RecommendedModelPurpose RecommendedModelsResponse: @@ -37655,6 +45495,16 @@ components: - type: string - type: 'null' title: Result + stage: + anyOf: + - $ref: '#/components/schemas/RegisteredScorerValidationStage' + - type: 'null' + stage_started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Stage Started At type: object required: - id @@ -37662,6 +45512,16 @@ components: - updated_at - status title: RegisteredScorerTaskResultResponse + RegisteredScorerValidationStage: + type: string + enum: + - checking_dependencies + - scanning_code + - preparing_environment + - running_test + title: RegisteredScorerValidationStage + description: The step a code scorer save validation runs now, reported while + the task result is pending. RemoveRecordsFromQueueRequest: properties: record_selector: @@ -37770,14 +45630,14 @@ components: description: Redacted input of the trace or span. output: items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Input' type: array title: Output description: Output of the trace or span. redacted_output: anyOf: - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Input' type: array - type: 'null' title: Redacted Output @@ -38294,6 +46154,152 @@ components: - last_updated_by - creator title: RunDBThin + RunEnabledEvaluator: + properties: + scorer_id: + type: string + format: uuid4 + title: Scorer Id + scorer_version_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Scorer Version Id + scoreable_node_types: + items: + type: string + type: array + title: Scoreable Node Types + additionalProperties: false + type: object + required: + - scorer_id + - scoreable_node_types + title: RunEnabledEvaluator + RunEvaluatorBinding: + properties: + scorer_id: + type: string + format: uuid4 + title: Scorer Id + scorer_version_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Scorer Version Id + name: + type: string + title: Name + label: + anyOf: + - type: string + - type: 'null' + title: Label + enabled: + type: boolean + title: Enabled + compatible: + type: boolean + title: Compatible + output_type: + anyOf: + - type: string + - type: 'null' + title: Output Type + scoreable_node_types: + items: + type: string + type: array + title: Scoreable Node Types + required_metric_ids: + items: + type: string + type: array + title: Required Metric Ids + filters: + anyOf: + - items: + $ref: '#/components/schemas/pydantic__types__JsonValue' + type: array + - type: 'null' + title: Filters + additionalProperties: false + type: object + required: + - scorer_id + - name + - label + - enabled + - compatible + - output_type + - scoreable_node_types + - required_metric_ids + - filters + title: RunEvaluatorBinding + RunEvaluatorsEnabled: + properties: + project_id: + type: string + format: uuid4 + title: Project Id + log_stream_id: + type: string + format: uuid4 + title: Log Stream Id + evaluators: + items: + $ref: '#/components/schemas/RunEnabledEvaluator' + type: array + title: Evaluators + additionalProperties: false + type: object + required: + - project_id + - log_stream_id + - evaluators + title: RunEvaluatorsEnabled + RunEvaluatorsInspection: + properties: + project_id: + type: string + format: uuid4 + title: Project Id + log_stream_id: + type: string + format: uuid4 + title: Log Stream Id + log_stream_name: + type: string + title: Log Stream Name + bindings: + items: + $ref: '#/components/schemas/RunEvaluatorBinding' + type: array + title: Bindings + additionalProperties: false + type: object + required: + - project_id + - log_stream_id + - log_stream_name + - bindings + title: RunEvaluatorsInspection + RunEvaluatorsRequest: + properties: + evaluators: + items: + $ref: '#/components/schemas/SavedEvaluatorReference' + type: array + maxItems: 20 + minItems: 1 + title: Evaluators + additionalProperties: false + type: object + required: + - evaluators + title: RunEvaluatorsRequest RunParamsMap: properties: model: @@ -38399,6 +46405,14 @@ components: requests.' RunScorerSettingsPatchRequest: properties: + expected_settings_revision: + anyOf: + - type: string + pattern: ^[0-9a-f]{64}$ + - type: 'null' + title: Expected Settings Revision + description: Revision read before replacing settings. A stale revision returns + 409. scorers: anyOf: - items: @@ -38420,12 +46434,25 @@ components: format: uuid4 title: Run Id description: ID of the run. + signals_novelty_enabled: + type: boolean + title: Signals Novelty Enabled + description: Enable online Signals scoring for this run. + default: false type: object required: - run_id title: RunScorerSettingsPatchRequest RunScorerSettingsResponse: properties: + expected_settings_revision: + anyOf: + - type: string + pattern: ^[0-9a-f]{64}$ + - type: 'null' + title: Expected Settings Revision + description: Revision read before replacing settings. A stale revision returns + 409. scorers: items: $ref: '#/components/schemas/RuntimeScorerConfig' @@ -38444,6 +46471,17 @@ components: format: uuid4 title: Run Id description: ID of the run. + signals_novelty_enabled: + type: boolean + title: Signals Novelty Enabled + description: Enable online Signals scoring for this run. + default: false + settings_revision: + anyOf: + - type: string + - type: 'null' + title: Settings Revision + description: Revision of the persisted evaluator settings. type: object required: - scorers @@ -38603,6 +46641,37 @@ components: - type: 'null' description: What type of input to use for model-based scorers (sessions_normalized, trace_io_only, etc..). + metadata_selection: + anyOf: + - $ref: '#/components/schemas/ScorerMetadataSelection' + - type: 'null' + span_input_selections: + anyOf: + - items: + $ref: '#/components/schemas/SpanInputSelection' + type: array + - type: 'null' + title: Span Input Selections + require_matching_span: + type: boolean + title: Require Matching Span + default: false + child_span_filters: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' + type: array + - type: 'null' + title: Child Span Filters multimodal_capabilities: anyOf: - items: @@ -38771,6 +46840,25 @@ components: Produced by hydrate_scorer_config from a StoredScorerConfig + live DB rows.' + SavedEvaluatorReference: + properties: + scorer_id: + type: string + format: uuid4 + title: Scorer Id + scorer_version_id: + anyOf: + - type: string + format: uuid4 + - type: 'null' + title: Scorer Version Id + additionalProperties: false + type: object + required: + - scorer_id + title: SavedEvaluatorReference + description: A saved Evaluator and the optional exact version selected by its + caller. ScoreAggregate: properties: feedback_type: @@ -38828,6 +46916,20 @@ components: - min - max title: ScoreConstraints + ScoreRating-Output: + properties: + feedback_type: + type: string + const: score + title: Feedback Type + default: score + value: + type: integer + title: Value + type: object + required: + - value + title: ScoreRating ScorerAction: type: string enum: @@ -38839,6 +46941,84 @@ components: - export - autotune_apply title: ScorerAction + ScorerCatalogVersionResponse: + properties: + id: + type: string + format: uuid4 + title: Id + version: + type: integer + title: Version + scorer_id: + type: string + format: uuid4 + title: Scorer Id + generated_scorer: + anyOf: + - $ref: '#/components/schemas/BaseGeneratedScorerDB' + - type: 'null' + registered_scorer: + anyOf: + - $ref: '#/components/schemas/BaseRegisteredScorerDB' + - type: 'null' + finetuned_scorer: + anyOf: + - $ref: '#/components/schemas/BaseFinetunedScorerDB' + - type: 'null' + luna3_scorer: + anyOf: + - $ref: '#/components/schemas/BaseLuna3ScorerDB' + - type: 'null' + decision_scorer: + anyOf: + - $ref: '#/components/schemas/DecisionScorerDB' + - type: 'null' + model_name: + anyOf: + - type: string + - type: 'null' + title: Model Name + num_judges: + anyOf: + - type: integer + - type: 'null' + title: Num Judges + cot_enabled: + anyOf: + - type: boolean + - type: 'null' + title: Cot Enabled + description: Whether to enable chain of thought for this scorer. Defaults + to False for llm scorers. + runtime: + anyOf: + - type: string + - type: 'null' + title: Runtime + description: The runtime a code metric version runs on, such as python3.14. + Null for a version saved before runtimes were recorded, which runs on + the legacy Python 3.12 runtime. + code_sha256: + anyOf: + - type: string + - type: 'null' + title: Code Sha256 + description: SHA-256 of the code bytes uploaded for a code metric version. + Null for a version saved before digests were recorded. + luna_validation_contract: + anyOf: + - additionalProperties: + $ref: '#/components/schemas/pydantic__types__JsonValue' + type: object + - type: 'null' + title: Luna Validation Contract + type: object + required: + - id + - version + - scorer_id + title: ScorerCatalogVersionResponse ScorerCreatedAtFilter: properties: name: @@ -38927,6 +47107,23 @@ components: - type: 'null' title: Filters description: List of filters to apply to the scorer. + child_span_filters: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' + type: array + - type: 'null' + title: Child Span Filters + description: Filters applied to descendants of the trace. scoreable_node_types: anyOf: - items: @@ -38955,6 +47152,23 @@ components: - type: 'null' description: What type of input to use for model-based scorers (sessions_normalized, trace_io_only, etc..). + metadata_selection: + anyOf: + - $ref: '#/components/schemas/ScorerMetadataSelection' + - type: 'null' + span_input_selections: + anyOf: + - items: + $ref: '#/components/schemas/SpanInputSelection' + type: array + - type: 'null' + title: Span Input Selections + require_matching_span: + type: boolean + title: Require Matching Span + description: For trace scorers with named span selections, require a matching + child span. + default: false invocation: anyOf: - $ref: '#/components/schemas/ScorerInvocationConfig' @@ -38963,6 +47177,108 @@ components: Use ScorerInfo.invocation or BaseScorerDB.invocation instead. type: object title: ScorerDefaults + ScorerDefaultsRequest: + properties: + model_name: + anyOf: + - type: string + - type: 'null' + title: Model Name + num_judges: + anyOf: + - type: integer + - type: 'null' + title: Num Judges + filters: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' + type: array + - type: 'null' + title: Filters + description: List of filters to apply to the scorer. + child_span_filters: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/NodeNameFilter' + - $ref: '#/components/schemas/MetadataFilter' + - $ref: '#/components/schemas/ModalityFilter' + discriminator: + propertyName: name + mapping: + metadata: '#/components/schemas/MetadataFilter' + modality: '#/components/schemas/ModalityFilter' + node_name: '#/components/schemas/NodeNameFilter' + type: array + - type: 'null' + title: Child Span Filters + description: Filters applied to descendants of the trace. + scoreable_node_types: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Scoreable Node Types + description: List of node types that can be scored by this scorer. Defaults + to llm/chat. + cot_enabled: + anyOf: + - type: boolean + - type: 'null' + title: Cot Enabled + description: Whether to enable chain of thought for this scorer. Defaults + to False for llm scorers. + output_type: + anyOf: + - $ref: '#/components/schemas/OutputTypeEnum' + - type: 'null' + description: What type of output to use for model-based scorers (boolean, + categorical, etc.). + input_type: + anyOf: + - $ref: '#/components/schemas/InputTypeEnum' + - type: 'null' + description: What type of input to use for model-based scorers (sessions_normalized, + trace_io_only, etc..). + metadata_selection: + anyOf: + - $ref: '#/components/schemas/ScorerMetadataSelection' + - type: 'null' + span_input_selections: + anyOf: + - items: + $ref: '#/components/schemas/SpanInputSelectionRequest' + type: array + maxItems: 100 + - type: 'null' + title: Span Input Selections + require_matching_span: + type: boolean + title: Require Matching Span + description: For trace scorers with named span selections, require a matching + child span. + default: false + invocation: + anyOf: + - $ref: '#/components/schemas/ScorerInvocationConfig' + - type: 'null' + description: Deprecated compatibility location for direct-invocation metadata. + Use ScorerInfo.invocation or BaseScorerDB.invocation instead. + type: object + title: ScorerDefaultsRequest + description: Apply span selection limits to new settings while allowing stored + defaults to load. ScorerEnabledInPlaygroundSort: properties: name: @@ -39213,6 +47529,7 @@ components: - eq - ne - contains + - regex - one_of - not_in title: Operator @@ -39236,6 +47553,36 @@ components: - operator - value title: ScorerLabelFilter + ScorerMetadataSelection: + properties: + trace: + anyOf: + - type: boolean + - items: + type: string + maxLength: 128 + minLength: 1 + type: array + maxItems: 100 + title: Trace + default: false + spans: + anyOf: + - type: boolean + - items: + type: string + maxLength: 128 + minLength: 1 + type: array + maxItems: 100 + - type: 'null' + title: Spans + description: Omit or set to null to follow the named span fields. Set to + false to disable span metadata. + type: object + title: ScorerMetadataSelection + description: Select all metadata or specific user-metadata keys for trace and + span inputs. ScorerModelTypeFilter: properties: name: @@ -39433,6 +47780,7 @@ components: - eq - ne - contains + - regex - one_of - not_in title: Operator @@ -39470,6 +47818,99 @@ components: default: column type: object title: ScorerNameSort + ScorerPromptMessage: + properties: + role: + type: string + title: Role + content: + anyOf: + - type: string + - items: + additionalProperties: true + type: object + type: array + title: Content + type: object + required: + - role + - content + title: ScorerPromptMessage + ScorerPromptPreviewResponse: + properties: + status: + type: string + const: available + title: Status + default: available + label: + type: string + const: Reconstructed evaluator prompt + title: Label + default: Reconstructed evaluator prompt + description: + type: string + const: Uses the selected evaluator version with current run settings and + log data. + title: Description + default: Uses the selected evaluator version with current run settings and + log data. + scorer_id: + type: string + title: Scorer Id + scorer_version_id: + type: string + title: Scorer Version Id + messages: + items: + $ref: '#/components/schemas/ScorerPromptMessage' + type: array + title: Messages + normalized_input: + items: + additionalProperties: true + type: object + type: array + title: Normalized Input + type: object + required: + - scorer_id + - scorer_version_id + - messages + - normalized_input + title: ScorerPromptPreviewResponse + ScorerPromptPreviewUnavailableReason: + type: string + enum: + - run_settings_unavailable + - score_not_directly_attributable + - roll_up + title: ScorerPromptPreviewUnavailableReason + ScorerPromptPreviewUnavailableResponse: + properties: + status: + type: string + const: unavailable + title: Status + default: unavailable + scorer_id: + type: string + title: Scorer Id + scorer_version_id: + type: string + title: Scorer Version Id + reason: + $ref: '#/components/schemas/ScorerPromptPreviewUnavailableReason' + message: + type: string + title: Message + type: object + required: + - scorer_id + - scorer_version_id + - reason + - message + title: ScorerPromptPreviewUnavailableResponse ScorerResponse: properties: id: @@ -39505,7 +47946,7 @@ components: and response inputs. latest_version: anyOf: - - $ref: '#/components/schemas/BaseScorerVersionDB' + - $ref: '#/components/schemas/ScorerCatalogVersionResponse' - type: 'null' model_type: anyOf: @@ -39524,7 +47965,7 @@ components: title: Default Version Id default_version: anyOf: - - $ref: '#/components/schemas/BaseScorerVersionDB' + - $ref: '#/components/schemas/ScorerCatalogVersionResponse' - type: 'null' user_prompt: anyOf: @@ -39580,6 +48021,12 @@ components: anyOf: - $ref: '#/components/schemas/BaseMetricRollUpConfigDB' - type: 'null' + registration_origin: + anyOf: + - type: string + const: luna_studio + - type: 'null' + title: Registration Origin tags: items: type: string @@ -40221,6 +48668,49 @@ components: - project_id - project_name title: SessionCreateResponse + SpanInputSelection: + properties: + span_name: + type: string + maxLength: 256 + minLength: 1 + title: Span Name + fields: + items: + type: string + enum: + - input + - output + - metadata + type: array + title: Fields + type: object + required: + - span_name + title: SpanInputSelection + description: Select the input fields included for spans with this name. + SpanInputSelectionRequest: + properties: + span_name: + type: string + maxLength: 256 + minLength: 1 + title: Span Name + fields: + items: + type: string + enum: + - input + - output + - metadata + type: array + minItems: 1 + title: Fields + type: object + required: + - span_name + title: SpanInputSelectionRequest + description: Select at least one input field for the named span. StageDB: properties: name: @@ -40461,6 +48951,22 @@ components: required: - annotation_type title: StarConstraints + StarRating-Output: + properties: + feedback_type: + type: string + const: star + title: Feedback Type + default: star + value: + type: integer + maximum: 5.0 + minimum: 1.0 + title: Value + type: object + required: + - value + title: StarRating StepType: type: string enum: @@ -40492,18 +48998,18 @@ components: oneOf: - $ref: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - $ref: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedLlmSpanRecord' + - $ref: '#/components/schemas/ExtendedLlmSpanRecord-Input' - $ref: '#/components/schemas/ExtendedToolSpanRecordWithChildren' - $ref: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' - - $ref: '#/components/schemas/ExtendedControlSpanRecord' + - $ref: '#/components/schemas/ExtendedControlSpanRecord-Input' - $ref: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' discriminator: propertyName: type mapping: agent: '#/components/schemas/ExtendedAgentSpanRecordWithChildren' - control: '#/components/schemas/ExtendedControlSpanRecord' + control: '#/components/schemas/ExtendedControlSpanRecord-Input' http: '#/components/schemas/ExtendedHttpSpanRecordWithChildren' - llm: '#/components/schemas/ExtendedLlmSpanRecord' + llm: '#/components/schemas/ExtendedLlmSpanRecord-Input' retriever: '#/components/schemas/ExtendedRetrieverSpanRecordWithChildren' tool: '#/components/schemas/ExtendedToolSpanRecordWithChildren' workflow: '#/components/schemas/ExtendedWorkflowSpanRecordWithChildren' @@ -40527,23 +49033,21 @@ components: format: uuid4 - type: 'null' title: Project Id - description: Project ID inferred from child spans, if all agree; otherwise - None. + description: Project ID of the trace's earliest span. run_id: anyOf: - type: string format: uuid4 - type: 'null' title: Run Id - description: Run ID inferred from child spans, if all agree; otherwise None. + description: Run ID of the trace's earliest span. session_id: anyOf: - type: string format: uuid4 - type: 'null' title: Session Id - description: Session ID inferred from child spans, if all agree; otherwise - None. + description: Session ID of the trace's earliest span. created_at: type: string format: date-time @@ -40808,6 +49312,24 @@ components: - annotation_type - tags title: TagsConstraints + TagsRating-Output: + properties: + feedback_type: + type: string + const: tags + title: Feedback Type + default: tags + value: + items: + type: string + maxLength: 255 + minLength: 1 + type: array + title: Value + type: object + required: + - value + title: TagsRating TaskResourceLimits: properties: cpu_time: @@ -40912,6 +49434,21 @@ components: - text title: TextContentPart description: A text segment within a message. + TextRating-Output: + properties: + feedback_type: + type: string + const: text + title: Feedback Type + default: text + value: + type: string + minLength: 1 + title: Value + type: object + required: + - value + title: TextRating Token: properties: access_token: @@ -40925,6 +49462,25 @@ components: required: - access_token title: Token + TokenomicsDelegationAction: + type: string + enum: + - read + - request + - assign + - approve + - reject + - withdraw + - revoke + - relinquish + - list_all + - admin_assign + - admin_approve + - admin_reject + - admin_revoke + title: TokenomicsDelegationAction + description: Actions on the org-scoped ``tokenomics_delegation`` resource (HR + delegation management). ToolCall: properties: id: @@ -41496,6 +50052,21 @@ components: - label - id title: TreeChoiceNode + TreeChoiceRating-Output: + properties: + feedback_type: + type: string + const: tree_choice + title: Feedback Type + default: tree_choice + value: + type: string + minLength: 1 + title: Value + type: object + required: + - value + title: TreeChoiceRating TypeSafeIntegration: properties: id: @@ -41547,6 +50118,43 @@ components: title: Description type: object title: UpdateAnnotationQueueRequest + UpdateAnnotationQueueSettingsRequest: + properties: + show_full_session: + type: boolean + title: Show Full Session + default: true + show_conversation_history: + type: boolean + title: Show Conversation History + default: true + show_span_types: + type: boolean + title: Show Span Types + default: true + span_types: + items: + $ref: '#/components/schemas/AnnotatorViewSpanType' + type: array + maxItems: 7 + title: Span Types + show_parameters: + type: boolean + title: Show Parameters + default: true + show_span_metadata: + type: boolean + title: Show Span Metadata + default: true + show_evaluators: + type: boolean + title: Show Evaluators + default: true + additionalProperties: false + type: object + title: UpdateAnnotationQueueSettingsRequest + description: PUT body. Rejects unknown keys; the base model must not, since + it also validates stored JSON on GET. UpdateDatasetContentRequest: properties: edits: @@ -41647,7 +50255,7 @@ components: title: Tags defaults: anyOf: - - $ref: '#/components/schemas/ScorerDefaults' + - $ref: '#/components/schemas/ScorerDefaultsRequest' - type: 'null' model_type: anyOf: @@ -41936,6 +50544,9 @@ components: - type: boolean - type: 'null' title: Email Is Verified + lifecycle_state: + $ref: '#/components/schemas/UserLifecycleState' + default: active organization_id: type: string format: uuid4 @@ -41966,6 +50577,9 @@ components: type: string format: uuid4 title: Id + lifecycle_state: + $ref: '#/components/schemas/UserLifecycleState' + default: active email: type: string title: Email @@ -41985,6 +50599,22 @@ components: - email title: UserInfo description: A user's basic information, used for display purposes. + UserLifecycleState: + type: string + enum: + - active + - deactivated + - removed + title: UserLifecycleState + description: 'Retention state, separate from invitation, verification, and sign-in + status. + + + Active identities are neither deactivated nor removed. Deactivated identities + retain + + their profile with access revoked. Removed identities have an anonymized live + profile.' UserRole: type: string enum: @@ -42092,7 +50722,7 @@ components: title: Model Name question: type: string - maxLength: 2000 + maxLength: 10000 minLength: 1 title: Question answer_options: @@ -42231,7 +50861,7 @@ components: title: Model Name question: type: string - maxLength: 2000 + maxLength: 10000 minLength: 1 title: Question answer_options: @@ -42308,7 +50938,7 @@ components: title: Model Name question: type: string - maxLength: 2000 + maxLength: 10000 minLength: 1 title: Question answer_options: @@ -42548,7 +51178,7 @@ components: chain_poll_template: $ref: '#/components/schemas/ChainPollTemplate' scorer_configuration: - $ref: '#/components/schemas/GeneratedScorerConfiguration' + $ref: '#/components/schemas/LLMScorerLogRecordConfiguration' normalized_input: anyOf: - items: @@ -42793,6 +51423,15 @@ components: required: - token title: VertexAIIntegrationCreate + ViolationReason: + type: string + enum: + - not_allowed + - advisory + - end_of_life + - yanked + - security_decision + title: ViolationReason WebSearchAction: properties: type: @@ -42907,7 +51546,7 @@ components: - type: string - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Input' type: array - items: oneOf: @@ -42928,7 +51567,7 @@ components: - type: string - $ref: '#/components/schemas/galileo_core__schemas__logging__llm__Message' - items: - $ref: '#/components/schemas/Document' + $ref: '#/components/schemas/Document-Input' type: array - items: oneOf: @@ -43625,6 +52264,17 @@ components: such as those of LLM-as-a-judge metrics, as response_format with type 'json_schema'. Works with based_on and with supported_parameters. default: false + fallback_models: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Fallback Models + description: Names of other models on this integration. When this model + is called, these names are sent as the request body field fallbacks. Set + this only when the endpoint accepts a fallbacks body field. A strict endpoint + can reject the whole request. type: object required: - name @@ -43637,8 +52287,18 @@ components: \ supported_parameters: Explicit list of parameter names this model supports.\n\ \ Mutually exclusive with ``based_on``.\n supports_json_schema:\ \ Whether the endpoint supports an OpenAI-style ``json_schema``\n \ - \ ``response_format`` for this model. Defaults to False." + \ ``response_format`` for this model. Defaults to False.\n\ + \ fallback_models: Other models on this integration, sent as the request\ + \ body\n field ``fallbacks`` when this model is called.\ + \ Set this only when\n the endpoint accepts that field.\ + \ A strict endpoint can reject the request." pydantic__types__JsonValue: {} + Document: + properties: + content: + title: Content + required: + - content securitySchemes: OAuth2PasswordBearer: type: oauth2 diff --git a/src/splunk_ao/resources/api/annotation_queue/get_settings_annotation_queues_queue_id_settings_get.py b/src/splunk_ao/resources/api/annotation_queue/get_settings_annotation_queues_queue_id_settings_get.py new file mode 100644 index 00000000..18d8890c --- /dev/null +++ b/src/splunk_ao/resources/api/annotation_queue/get_settings_annotation_queues_queue_id_settings_get.py @@ -0,0 +1,181 @@ +from http import HTTPStatus +from typing import Any, Optional + +import httpx + +from galileo_core.constants.request_method import RequestMethod +from galileo_core.helpers.api_client import ApiClient +from splunk_ao.exceptions import ( + AuthenticationError, + BadRequestError, + ConflictError, + ForbiddenError, + NotFoundError, + RateLimitError, + ServerError, +) +from splunk_ao.utils.headers_data import get_sdk_header + +from ... import errors +from ...models.annotation_queue_settings_response import AnnotationQueueSettingsResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs(queue_id: str) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": RequestMethod.GET, + "return_raw_response": True, + "path": "/annotation_queues/{queue_id}/settings".format(queue_id=queue_id), + } + + headers["Splunk-AO-SDK"] = get_sdk_header() + + _kwargs["content_headers"] = headers + return _kwargs + + +def _parse_response( + *, client: ApiClient, response: httpx.Response +) -> AnnotationQueueSettingsResponse | HTTPValidationError: + if response.status_code == 200: + response_200 = AnnotationQueueSettingsResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + # Handle common HTTP errors with actionable messages + if response.status_code == 400: + raise BadRequestError(response.status_code, response.content) + if response.status_code == 401: + raise AuthenticationError(response.status_code, response.content) + if response.status_code == 403: + raise ForbiddenError(response.status_code, response.content) + if response.status_code == 404: + raise NotFoundError(response.status_code, response.content) + if response.status_code == 409: + raise ConflictError(response.status_code, response.content) + if response.status_code == 429: + raise RateLimitError(response.status_code, response.content) + if response.status_code >= 500: + raise ServerError(response.status_code, response.content) + raise errors.UnexpectedStatus(response.status_code, response.content) + + +def _build_response( + *, client: ApiClient, response: httpx.Response +) -> Response[AnnotationQueueSettingsResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + queue_id: str, *, client: ApiClient +) -> Response[AnnotationQueueSettingsResponse | HTTPValidationError]: + """Get Settings + + Get the settings for an annotation queue. + + Returns the default settings if none have been saved yet. Any user who can read the queue can fetch + them. + + Args: + queue_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AnnotationQueueSettingsResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs(queue_id=queue_id) + + response = client.request(**kwargs) + + return _build_response(client=client, response=response) + + +def sync(queue_id: str, *, client: ApiClient) -> Optional[AnnotationQueueSettingsResponse | HTTPValidationError]: + """Get Settings + + Get the settings for an annotation queue. + + Returns the default settings if none have been saved yet. Any user who can read the queue can fetch + them. + + Args: + queue_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AnnotationQueueSettingsResponse | HTTPValidationError + """ + + return sync_detailed(queue_id=queue_id, client=client).parsed + + +async def asyncio_detailed( + queue_id: str, *, client: ApiClient +) -> Response[AnnotationQueueSettingsResponse | HTTPValidationError]: + """Get Settings + + Get the settings for an annotation queue. + + Returns the default settings if none have been saved yet. Any user who can read the queue can fetch + them. + + Args: + queue_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AnnotationQueueSettingsResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs(queue_id=queue_id) + + response = await client.arequest(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + queue_id: str, *, client: ApiClient +) -> Optional[AnnotationQueueSettingsResponse | HTTPValidationError]: + """Get Settings + + Get the settings for an annotation queue. + + Returns the default settings if none have been saved yet. Any user who can read the queue can fetch + them. + + Args: + queue_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AnnotationQueueSettingsResponse | HTTPValidationError + """ + + return (await asyncio_detailed(queue_id=queue_id, client=client)).parsed diff --git a/src/splunk_ao/resources/api/annotation_queue/update_queue_template_annotation_queues_queue_id_templates_template_id_patch.py b/src/splunk_ao/resources/api/annotation_queue/update_queue_template_annotation_queues_queue_id_templates_template_id_patch.py index 1b8c08f7..53341a9f 100644 --- a/src/splunk_ao/resources/api/annotation_queue/update_queue_template_annotation_queues_queue_id_templates_template_id_patch.py +++ b/src/splunk_ao/resources/api/annotation_queue/update_queue_template_annotation_queues_queue_id_templates_template_id_patch.py @@ -94,6 +94,7 @@ def sync_detailed( Can update: - Template name (must be unique within the queue) - Template criteria + - Whether the template is required Note: Constraints and other fields cannot be updated. @@ -127,6 +128,7 @@ def sync( Can update: - Template name (must be unique within the queue) - Template criteria + - Whether the template is required Note: Constraints and other fields cannot be updated. @@ -156,6 +158,7 @@ async def asyncio_detailed( Can update: - Template name (must be unique within the queue) - Template criteria + - Whether the template is required Note: Constraints and other fields cannot be updated. @@ -189,6 +192,7 @@ async def asyncio( Can update: - Template name (must be unique within the queue) - Template criteria + - Whether the template is required Note: Constraints and other fields cannot be updated. diff --git a/src/splunk_ao/resources/api/annotation_queue/update_settings_annotation_queues_queue_id_settings_put.py b/src/splunk_ao/resources/api/annotation_queue/update_settings_annotation_queues_queue_id_settings_put.py new file mode 100644 index 00000000..db10a154 --- /dev/null +++ b/src/splunk_ao/resources/api/annotation_queue/update_settings_annotation_queues_queue_id_settings_put.py @@ -0,0 +1,194 @@ +from http import HTTPStatus +from typing import Any, Optional + +import httpx + +from galileo_core.constants.request_method import RequestMethod +from galileo_core.helpers.api_client import ApiClient +from splunk_ao.exceptions import ( + AuthenticationError, + BadRequestError, + ConflictError, + ForbiddenError, + NotFoundError, + RateLimitError, + ServerError, +) +from splunk_ao.utils.headers_data import get_sdk_header + +from ... import errors +from ...models.http_validation_error import HTTPValidationError +from ...models.update_annotation_queue_settings_request import UpdateAnnotationQueueSettingsRequest +from ...types import Response + + +def _get_kwargs(queue_id: str, *, body: UpdateAnnotationQueueSettingsRequest) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": RequestMethod.PUT, + "return_raw_response": True, + "path": "/annotation_queues/{queue_id}/settings".format(queue_id=queue_id), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + headers["Splunk-AO-SDK"] = get_sdk_header() + + _kwargs["content_headers"] = headers + return _kwargs + + +def _parse_response(*, client: ApiClient, response: httpx.Response) -> Any | HTTPValidationError: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + # Handle common HTTP errors with actionable messages + if response.status_code == 400: + raise BadRequestError(response.status_code, response.content) + if response.status_code == 401: + raise AuthenticationError(response.status_code, response.content) + if response.status_code == 403: + raise ForbiddenError(response.status_code, response.content) + if response.status_code == 404: + raise NotFoundError(response.status_code, response.content) + if response.status_code == 409: + raise ConflictError(response.status_code, response.content) + if response.status_code == 429: + raise RateLimitError(response.status_code, response.content) + if response.status_code >= 500: + raise ServerError(response.status_code, response.content) + raise errors.UnexpectedStatus(response.status_code, response.content) + + +def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + queue_id: str, *, client: ApiClient, body: UpdateAnnotationQueueSettingsRequest +) -> Response[Any | HTTPValidationError]: + """Update Settings + + Save the settings for an annotation queue. + + Merges the fields in the body into the saved settings. Returns 403 unless the user is an org admin + or a queue + owner. Fetch the settings with the GET endpoint. + + Args: + queue_id (str): + body (UpdateAnnotationQueueSettingsRequest): PUT body. Rejects unknown keys; the base + model must not, since it also validates stored JSON on GET. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs(queue_id=queue_id, body=body) + + response = client.request(**kwargs) + + return _build_response(client=client, response=response) + + +def sync( + queue_id: str, *, client: ApiClient, body: UpdateAnnotationQueueSettingsRequest +) -> Optional[Any | HTTPValidationError]: + """Update Settings + + Save the settings for an annotation queue. + + Merges the fields in the body into the saved settings. Returns 403 unless the user is an org admin + or a queue + owner. Fetch the settings with the GET endpoint. + + Args: + queue_id (str): + body (UpdateAnnotationQueueSettingsRequest): PUT body. Rejects unknown keys; the base + model must not, since it also validates stored JSON on GET. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed(queue_id=queue_id, client=client, body=body).parsed + + +async def asyncio_detailed( + queue_id: str, *, client: ApiClient, body: UpdateAnnotationQueueSettingsRequest +) -> Response[Any | HTTPValidationError]: + """Update Settings + + Save the settings for an annotation queue. + + Merges the fields in the body into the saved settings. Returns 403 unless the user is an org admin + or a queue + owner. Fetch the settings with the GET endpoint. + + Args: + queue_id (str): + body (UpdateAnnotationQueueSettingsRequest): PUT body. Rejects unknown keys; the base + model must not, since it also validates stored JSON on GET. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs(queue_id=queue_id, body=body) + + response = await client.arequest(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + queue_id: str, *, client: ApiClient, body: UpdateAnnotationQueueSettingsRequest +) -> Optional[Any | HTTPValidationError]: + """Update Settings + + Save the settings for an annotation queue. + + Merges the fields in the body into the saved settings. Returns 403 unless the user is an org admin + or a queue + owner. Fetch the settings with the GET endpoint. + + Args: + queue_id (str): + body (UpdateAnnotationQueueSettingsRequest): PUT body. Rejects unknown keys; the base + model must not, since it also validates stored JSON on GET. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return (await asyncio_detailed(queue_id=queue_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/annotation_queue_records/create_annotation_queue_record_rating_annotation_queues_queue_id_records_record_id_rating_put.py b/src/splunk_ao/resources/api/annotation_queue_records/create_annotation_queue_record_rating_annotation_queues_queue_id_records_record_id_rating_put.py deleted file mode 100644 index 7da4ad2c..00000000 --- a/src/splunk_ao/resources/api/annotation_queue_records/create_annotation_queue_record_rating_annotation_queues_queue_id_records_record_id_rating_put.py +++ /dev/null @@ -1,219 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional - -import httpx - -from galileo_core.constants.request_method import RequestMethod -from galileo_core.helpers.api_client import ApiClient -from splunk_ao.exceptions import ( - AuthenticationError, - BadRequestError, - ConflictError, - ForbiddenError, - NotFoundError, - RateLimitError, - ServerError, -) -from splunk_ao.utils.headers_data import get_sdk_header - -from ... import errors -from ...models.annotation_rating_create import AnnotationRatingCreate -from ...models.annotation_rating_db import AnnotationRatingDB -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response - - -def _get_kwargs( - queue_id: str, record_id: str, *, body: AnnotationRatingCreate, annotation_template_id: str -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - params: dict[str, Any] = {} - - params["annotation_template_id"] = annotation_template_id - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": RequestMethod.PUT, - "return_raw_response": True, - "path": "/annotation_queues/{queue_id}/records/{record_id}/rating".format( - queue_id=queue_id, record_id=record_id - ), - "params": params, - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - headers["Splunk-AO-SDK"] = get_sdk_header() - - _kwargs["content_headers"] = headers - return _kwargs - - -def _parse_response(*, client: ApiClient, response: httpx.Response) -> AnnotationRatingDB | HTTPValidationError: - if response.status_code == 200: - response_200 = AnnotationRatingDB.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - # Handle common HTTP errors with actionable messages - if response.status_code == 400: - raise BadRequestError(response.status_code, response.content) - if response.status_code == 401: - raise AuthenticationError(response.status_code, response.content) - if response.status_code == 403: - raise ForbiddenError(response.status_code, response.content) - if response.status_code == 404: - raise NotFoundError(response.status_code, response.content) - if response.status_code == 409: - raise ConflictError(response.status_code, response.content) - if response.status_code == 429: - raise RateLimitError(response.status_code, response.content) - if response.status_code >= 500: - raise ServerError(response.status_code, response.content) - raise errors.UnexpectedStatus(response.status_code, response.content) - - -def _build_response( - *, client: ApiClient, response: httpx.Response -) -> Response[AnnotationRatingDB | HTTPValidationError]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - queue_id: str, record_id: str, *, client: ApiClient, body: AnnotationRatingCreate, annotation_template_id: str -) -> Response[AnnotationRatingDB | HTTPValidationError]: - """Create Annotation Queue Record Rating - - Create an annotation rating for a record in an annotation queue. - - This endpoint is project-unaware and takes the template_id in the query params. - - Args: - queue_id (str): - record_id (str): - annotation_template_id (str): - body (AnnotationRatingCreate): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AnnotationRatingDB | HTTPValidationError] - """ - - kwargs = _get_kwargs( - queue_id=queue_id, record_id=record_id, body=body, annotation_template_id=annotation_template_id - ) - - response = client.request(**kwargs) - - return _build_response(client=client, response=response) - - -def sync( - queue_id: str, record_id: str, *, client: ApiClient, body: AnnotationRatingCreate, annotation_template_id: str -) -> Optional[AnnotationRatingDB | HTTPValidationError]: - """Create Annotation Queue Record Rating - - Create an annotation rating for a record in an annotation queue. - - This endpoint is project-unaware and takes the template_id in the query params. - - Args: - queue_id (str): - record_id (str): - annotation_template_id (str): - body (AnnotationRatingCreate): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AnnotationRatingDB | HTTPValidationError - """ - - return sync_detailed( - queue_id=queue_id, record_id=record_id, client=client, body=body, annotation_template_id=annotation_template_id - ).parsed - - -async def asyncio_detailed( - queue_id: str, record_id: str, *, client: ApiClient, body: AnnotationRatingCreate, annotation_template_id: str -) -> Response[AnnotationRatingDB | HTTPValidationError]: - """Create Annotation Queue Record Rating - - Create an annotation rating for a record in an annotation queue. - - This endpoint is project-unaware and takes the template_id in the query params. - - Args: - queue_id (str): - record_id (str): - annotation_template_id (str): - body (AnnotationRatingCreate): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AnnotationRatingDB | HTTPValidationError] - """ - - kwargs = _get_kwargs( - queue_id=queue_id, record_id=record_id, body=body, annotation_template_id=annotation_template_id - ) - - response = await client.arequest(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - queue_id: str, record_id: str, *, client: ApiClient, body: AnnotationRatingCreate, annotation_template_id: str -) -> Optional[AnnotationRatingDB | HTTPValidationError]: - """Create Annotation Queue Record Rating - - Create an annotation rating for a record in an annotation queue. - - This endpoint is project-unaware and takes the template_id in the query params. - - Args: - queue_id (str): - record_id (str): - annotation_template_id (str): - body (AnnotationRatingCreate): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AnnotationRatingDB | HTTPValidationError - """ - - return ( - await asyncio_detailed( - queue_id=queue_id, - record_id=record_id, - client=client, - body=body, - annotation_template_id=annotation_template_id, - ) - ).parsed diff --git a/src/splunk_ao/resources/api/annotation_queue_records/get_annotation_queue_record_annotation_queues_queue_id_records_record_id_get.py b/src/splunk_ao/resources/api/annotation_queue_records/get_annotation_queue_record_annotation_queues_queue_id_records_record_id_get.py index 944cde8a..fd8bc262 100644 --- a/src/splunk_ao/resources/api/annotation_queue_records/get_annotation_queue_record_annotation_queues_queue_id_records_record_id_get.py +++ b/src/splunk_ao/resources/api/annotation_queue_records/get_annotation_queue_record_annotation_queues_queue_id_records_record_id_get.py @@ -18,15 +18,6 @@ from ... import errors from ...models.http_validation_error import HTTPValidationError -from ...models.partial_extended_agent_span_record import PartialExtendedAgentSpanRecord -from ...models.partial_extended_control_span_record import PartialExtendedControlSpanRecord -from ...models.partial_extended_http_span_record import PartialExtendedHttpSpanRecord -from ...models.partial_extended_llm_span_record import PartialExtendedLlmSpanRecord -from ...models.partial_extended_retriever_span_record import PartialExtendedRetrieverSpanRecord -from ...models.partial_extended_session_record import PartialExtendedSessionRecord -from ...models.partial_extended_tool_span_record import PartialExtendedToolSpanRecord -from ...models.partial_extended_trace_record import PartialExtendedTraceRecord -from ...models.partial_extended_workflow_span_record import PartialExtendedWorkflowSpanRecord from ...types import Response @@ -45,171 +36,7 @@ def _get_kwargs(queue_id: str, record_id: str) -> dict[str, Any]: return _kwargs -def _parse_response( - *, client: ApiClient, response: httpx.Response -) -> ( - HTTPValidationError - | PartialExtendedAgentSpanRecord - | PartialExtendedControlSpanRecord - | PartialExtendedHttpSpanRecord - | PartialExtendedLlmSpanRecord - | PartialExtendedRetrieverSpanRecord - | PartialExtendedSessionRecord - | PartialExtendedToolSpanRecord - | PartialExtendedTraceRecord - | PartialExtendedWorkflowSpanRecord -): - if response.status_code == 200: - - def _parse_response_200( - data: object, - ) -> ( - PartialExtendedAgentSpanRecord - | PartialExtendedControlSpanRecord - | PartialExtendedHttpSpanRecord - | PartialExtendedLlmSpanRecord - | PartialExtendedRetrieverSpanRecord - | PartialExtendedSessionRecord - | PartialExtendedToolSpanRecord - | PartialExtendedTraceRecord - | PartialExtendedWorkflowSpanRecord - ): - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_0 = PartialExtendedTraceRecord.from_dict(data) - - return response_200_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_1 = PartialExtendedAgentSpanRecord.from_dict(data) - - return response_200_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_2 = PartialExtendedWorkflowSpanRecord.from_dict(data) - - return response_200_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_3 = PartialExtendedLlmSpanRecord.from_dict(data) - - return response_200_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_4 = PartialExtendedToolSpanRecord.from_dict(data) - - return response_200_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_5 = PartialExtendedRetrieverSpanRecord.from_dict(data) - - return response_200_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_6 = PartialExtendedControlSpanRecord.from_dict(data) - - return response_200_type_6 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_7 = PartialExtendedHttpSpanRecord.from_dict(data) - - return response_200_type_7 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_8 = PartialExtendedSessionRecord.from_dict(data) - - return response_200_type_8 - except: # noqa: E722 - pass - # If we reach here, none of the parsers succeeded - discriminator_info = f" (type={data.get('type')})" if isinstance(data, dict) and "type" in data else "" - raise ValueError(f"Could not parse union type for response_200{discriminator_info}") - - response_200 = _parse_response_200(response.json()) - - return response_200 - +def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError: if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -233,20 +60,7 @@ def _parse_response_200( raise errors.UnexpectedStatus(response.status_code, response.content) -def _build_response( - *, client: ApiClient, response: httpx.Response -) -> Response[ - HTTPValidationError - | PartialExtendedAgentSpanRecord - | PartialExtendedControlSpanRecord - | PartialExtendedHttpSpanRecord - | PartialExtendedLlmSpanRecord - | PartialExtendedRetrieverSpanRecord - | PartialExtendedSessionRecord - | PartialExtendedToolSpanRecord - | PartialExtendedTraceRecord - | PartialExtendedWorkflowSpanRecord -]: +def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[HTTPValidationError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -255,20 +69,7 @@ def _build_response( ) -def sync_detailed( - queue_id: str, record_id: str, *, client: ApiClient -) -> Response[ - HTTPValidationError - | PartialExtendedAgentSpanRecord - | PartialExtendedControlSpanRecord - | PartialExtendedHttpSpanRecord - | PartialExtendedLlmSpanRecord - | PartialExtendedRetrieverSpanRecord - | PartialExtendedSessionRecord - | PartialExtendedToolSpanRecord - | PartialExtendedTraceRecord - | PartialExtendedWorkflowSpanRecord -]: +def sync_detailed(queue_id: str, record_id: str, *, client: ApiClient) -> Response[HTTPValidationError]: """Get Annotation Queue Record Get a single record in an annotation queue. @@ -285,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | PartialExtendedAgentSpanRecord | PartialExtendedControlSpanRecord | PartialExtendedHttpSpanRecord | PartialExtendedLlmSpanRecord | PartialExtendedRetrieverSpanRecord | PartialExtendedSessionRecord | PartialExtendedToolSpanRecord | PartialExtendedTraceRecord | PartialExtendedWorkflowSpanRecord] + Response[HTTPValidationError] """ kwargs = _get_kwargs(queue_id=queue_id, record_id=record_id) @@ -295,20 +96,7 @@ def sync_detailed( return _build_response(client=client, response=response) -def sync( - queue_id: str, record_id: str, *, client: ApiClient -) -> Optional[ - HTTPValidationError - | PartialExtendedAgentSpanRecord - | PartialExtendedControlSpanRecord - | PartialExtendedHttpSpanRecord - | PartialExtendedLlmSpanRecord - | PartialExtendedRetrieverSpanRecord - | PartialExtendedSessionRecord - | PartialExtendedToolSpanRecord - | PartialExtendedTraceRecord - | PartialExtendedWorkflowSpanRecord -]: +def sync(queue_id: str, record_id: str, *, client: ApiClient) -> Optional[HTTPValidationError]: """Get Annotation Queue Record Get a single record in an annotation queue. @@ -325,26 +113,13 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | PartialExtendedAgentSpanRecord | PartialExtendedControlSpanRecord | PartialExtendedHttpSpanRecord | PartialExtendedLlmSpanRecord | PartialExtendedRetrieverSpanRecord | PartialExtendedSessionRecord | PartialExtendedToolSpanRecord | PartialExtendedTraceRecord | PartialExtendedWorkflowSpanRecord + HTTPValidationError """ return sync_detailed(queue_id=queue_id, record_id=record_id, client=client).parsed -async def asyncio_detailed( - queue_id: str, record_id: str, *, client: ApiClient -) -> Response[ - HTTPValidationError - | PartialExtendedAgentSpanRecord - | PartialExtendedControlSpanRecord - | PartialExtendedHttpSpanRecord - | PartialExtendedLlmSpanRecord - | PartialExtendedRetrieverSpanRecord - | PartialExtendedSessionRecord - | PartialExtendedToolSpanRecord - | PartialExtendedTraceRecord - | PartialExtendedWorkflowSpanRecord -]: +async def asyncio_detailed(queue_id: str, record_id: str, *, client: ApiClient) -> Response[HTTPValidationError]: """Get Annotation Queue Record Get a single record in an annotation queue. @@ -361,7 +136,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | PartialExtendedAgentSpanRecord | PartialExtendedControlSpanRecord | PartialExtendedHttpSpanRecord | PartialExtendedLlmSpanRecord | PartialExtendedRetrieverSpanRecord | PartialExtendedSessionRecord | PartialExtendedToolSpanRecord | PartialExtendedTraceRecord | PartialExtendedWorkflowSpanRecord] + Response[HTTPValidationError] """ kwargs = _get_kwargs(queue_id=queue_id, record_id=record_id) @@ -371,20 +146,7 @@ async def asyncio_detailed( return _build_response(client=client, response=response) -async def asyncio( - queue_id: str, record_id: str, *, client: ApiClient -) -> Optional[ - HTTPValidationError - | PartialExtendedAgentSpanRecord - | PartialExtendedControlSpanRecord - | PartialExtendedHttpSpanRecord - | PartialExtendedLlmSpanRecord - | PartialExtendedRetrieverSpanRecord - | PartialExtendedSessionRecord - | PartialExtendedToolSpanRecord - | PartialExtendedTraceRecord - | PartialExtendedWorkflowSpanRecord -]: +async def asyncio(queue_id: str, record_id: str, *, client: ApiClient) -> Optional[HTTPValidationError]: """Get Annotation Queue Record Get a single record in an annotation queue. @@ -401,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | PartialExtendedAgentSpanRecord | PartialExtendedControlSpanRecord | PartialExtendedHttpSpanRecord | PartialExtendedLlmSpanRecord | PartialExtendedRetrieverSpanRecord | PartialExtendedSessionRecord | PartialExtendedToolSpanRecord | PartialExtendedTraceRecord | PartialExtendedWorkflowSpanRecord + HTTPValidationError """ return (await asyncio_detailed(queue_id=queue_id, record_id=record_id, client=client)).parsed diff --git a/src/splunk_ao/resources/api/annotation_queue_records/partial_search_annotation_queue_records_annotation_queues_queue_id_partial_search_post.py b/src/splunk_ao/resources/api/annotation_queue_records/partial_search_annotation_queue_records_annotation_queues_queue_id_partial_search_post.py index e796407b..0303a922 100644 --- a/src/splunk_ao/resources/api/annotation_queue_records/partial_search_annotation_queue_records_annotation_queues_queue_id_partial_search_post.py +++ b/src/splunk_ao/resources/api/annotation_queue_records/partial_search_annotation_queue_records_annotation_queues_queue_id_partial_search_post.py @@ -19,7 +19,6 @@ from ... import errors from ...models.annotation_queue_partial_search_request import AnnotationQueuePartialSearchRequest from ...models.http_validation_error import HTTPValidationError -from ...models.log_records_partial_query_response import LogRecordsPartialQueryResponse from ...types import Response @@ -42,14 +41,7 @@ def _get_kwargs(queue_id: str, *, body: AnnotationQueuePartialSearchRequest) -> return _kwargs -def _parse_response( - *, client: ApiClient, response: httpx.Response -) -> HTTPValidationError | LogRecordsPartialQueryResponse: - if response.status_code == 200: - response_200 = LogRecordsPartialQueryResponse.from_dict(response.json()) - - return response_200 - +def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError: if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -73,9 +65,7 @@ def _parse_response( raise errors.UnexpectedStatus(response.status_code, response.content) -def _build_response( - *, client: ApiClient, response: httpx.Response -) -> Response[HTTPValidationError | LogRecordsPartialQueryResponse]: +def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[HTTPValidationError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +76,7 @@ def _build_response( def sync_detailed( queue_id: str, *, client: ApiClient, body: AnnotationQueuePartialSearchRequest -) -> Response[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Response[HTTPValidationError]: """Partial Search Annotation Queue Records Search records in an annotation queue with partial field selection. @@ -113,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsPartialQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(queue_id=queue_id, body=body) @@ -125,7 +115,7 @@ def sync_detailed( def sync( queue_id: str, *, client: ApiClient, body: AnnotationQueuePartialSearchRequest -) -> Optional[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Optional[HTTPValidationError]: """Partial Search Annotation Queue Records Search records in an annotation queue with partial field selection. @@ -152,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsPartialQueryResponse + HTTPValidationError """ return sync_detailed(queue_id=queue_id, client=client, body=body).parsed @@ -160,7 +150,7 @@ def sync( async def asyncio_detailed( queue_id: str, *, client: ApiClient, body: AnnotationQueuePartialSearchRequest -) -> Response[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Response[HTTPValidationError]: """Partial Search Annotation Queue Records Search records in an annotation queue with partial field selection. @@ -187,7 +177,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsPartialQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(queue_id=queue_id, body=body) @@ -199,7 +189,7 @@ async def asyncio_detailed( async def asyncio( queue_id: str, *, client: ApiClient, body: AnnotationQueuePartialSearchRequest -) -> Optional[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Optional[HTTPValidationError]: """Partial Search Annotation Queue Records Search records in an annotation queue with partial field selection. @@ -226,7 +216,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsPartialQueryResponse + HTTPValidationError """ return (await asyncio_detailed(queue_id=queue_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/data/get_package_policy_notices_scorers_package_policy_notices_get.py b/src/splunk_ao/resources/api/data/get_package_policy_notices_scorers_package_policy_notices_get.py new file mode 100644 index 00000000..e8bb63c7 --- /dev/null +++ b/src/splunk_ao/resources/api/data/get_package_policy_notices_scorers_package_policy_notices_get.py @@ -0,0 +1,142 @@ +from http import HTTPStatus +from typing import Any, Optional + +import httpx + +from galileo_core.constants.request_method import RequestMethod +from galileo_core.helpers.api_client import ApiClient +from splunk_ao.exceptions import ( + AuthenticationError, + BadRequestError, + ConflictError, + ForbiddenError, + NotFoundError, + RateLimitError, + ServerError, +) +from splunk_ao.utils.headers_data import get_scorer_capabilities_header, get_sdk_header + +from ... import errors +from ...models.code_metric_policy_notices_response import CodeMetricPolicyNoticesResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": RequestMethod.GET, + "return_raw_response": True, + "path": "/scorers/package-policy-notices", + } + + headers["Splunk-AO-SDK"] = get_sdk_header() + headers["X-Galileo-Scorer-Capabilities"] = get_scorer_capabilities_header() + + _kwargs["content_headers"] = headers + return _kwargs + + +def _parse_response(*, client: ApiClient, response: httpx.Response) -> CodeMetricPolicyNoticesResponse: + if response.status_code == 200: + response_200 = CodeMetricPolicyNoticesResponse.from_dict(response.json()) + + return response_200 + + # Handle common HTTP errors with actionable messages + if response.status_code == 400: + raise BadRequestError(response.status_code, response.content) + if response.status_code == 401: + raise AuthenticationError(response.status_code, response.content) + if response.status_code == 403: + raise ForbiddenError(response.status_code, response.content) + if response.status_code == 404: + raise NotFoundError(response.status_code, response.content) + if response.status_code == 409: + raise ConflictError(response.status_code, response.content) + if response.status_code == 429: + raise RateLimitError(response.status_code, response.content) + if response.status_code >= 500: + raise ServerError(response.status_code, response.content) + raise errors.UnexpectedStatus(response.status_code, response.content) + + +def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[CodeMetricPolicyNoticesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed(*, client: ApiClient) -> Response[CodeMetricPolicyNoticesResponse]: + """Get Package Policy Notices + + The package-policy notices of the caller's code metrics, or of the organization's for an org admin. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CodeMetricPolicyNoticesResponse] + """ + + kwargs = _get_kwargs() + + response = client.request(**kwargs) + + return _build_response(client=client, response=response) + + +def sync(*, client: ApiClient) -> Optional[CodeMetricPolicyNoticesResponse]: + """Get Package Policy Notices + + The package-policy notices of the caller's code metrics, or of the organization's for an org admin. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CodeMetricPolicyNoticesResponse + """ + + return sync_detailed(client=client).parsed + + +async def asyncio_detailed(*, client: ApiClient) -> Response[CodeMetricPolicyNoticesResponse]: + """Get Package Policy Notices + + The package-policy notices of the caller's code metrics, or of the organization's for an org admin. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CodeMetricPolicyNoticesResponse] + """ + + kwargs = _get_kwargs() + + response = await client.arequest(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio(*, client: ApiClient) -> Optional[CodeMetricPolicyNoticesResponse]: + """Get Package Policy Notices + + The package-policy notices of the caller's code metrics, or of the organization's for an org admin. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CodeMetricPolicyNoticesResponse + """ + + return (await asyncio_detailed(client=client)).parsed diff --git a/src/splunk_ao/resources/api/data/get_package_policy_status_scorers_package_policy_status_post.py b/src/splunk_ao/resources/api/data/get_package_policy_status_scorers_package_policy_status_post.py new file mode 100644 index 00000000..0684f0f0 --- /dev/null +++ b/src/splunk_ao/resources/api/data/get_package_policy_status_scorers_package_policy_status_post.py @@ -0,0 +1,181 @@ +from http import HTTPStatus +from typing import Any, Optional + +import httpx + +from galileo_core.constants.request_method import RequestMethod +from galileo_core.helpers.api_client import ApiClient +from splunk_ao.exceptions import ( + AuthenticationError, + BadRequestError, + ConflictError, + ForbiddenError, + NotFoundError, + RateLimitError, + ServerError, +) +from splunk_ao.utils.headers_data import get_scorer_capabilities_header, get_sdk_header + +from ... import errors +from ...models.code_metric_policy_status_request import CodeMetricPolicyStatusRequest +from ...models.code_metric_policy_status_response import CodeMetricPolicyStatusResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs(*, body: CodeMetricPolicyStatusRequest) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": RequestMethod.POST, + "return_raw_response": True, + "path": "/scorers/package-policy-status", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + headers["Splunk-AO-SDK"] = get_sdk_header() + headers["X-Galileo-Scorer-Capabilities"] = get_scorer_capabilities_header() + + _kwargs["content_headers"] = headers + return _kwargs + + +def _parse_response( + *, client: ApiClient, response: httpx.Response +) -> CodeMetricPolicyStatusResponse | HTTPValidationError: + if response.status_code == 200: + response_200 = CodeMetricPolicyStatusResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + # Handle common HTTP errors with actionable messages + if response.status_code == 400: + raise BadRequestError(response.status_code, response.content) + if response.status_code == 401: + raise AuthenticationError(response.status_code, response.content) + if response.status_code == 403: + raise ForbiddenError(response.status_code, response.content) + if response.status_code == 404: + raise NotFoundError(response.status_code, response.content) + if response.status_code == 409: + raise ConflictError(response.status_code, response.content) + if response.status_code == 429: + raise RateLimitError(response.status_code, response.content) + if response.status_code >= 500: + raise ServerError(response.status_code, response.content) + raise errors.UnexpectedStatus(response.status_code, response.content) + + +def _build_response( + *, client: ApiClient, response: httpx.Response +) -> Response[CodeMetricPolicyStatusResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, client: ApiClient, body: CodeMetricPolicyStatusRequest +) -> Response[CodeMetricPolicyStatusResponse | HTTPValidationError]: + """Get Package Policy Status + + The code-metric package-policy state of each listed code metric that has one and that the caller can + read. + + Args: + body (CodeMetricPolicyStatusRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CodeMetricPolicyStatusResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs(body=body) + + response = client.request(**kwargs) + + return _build_response(client=client, response=response) + + +def sync( + *, client: ApiClient, body: CodeMetricPolicyStatusRequest +) -> Optional[CodeMetricPolicyStatusResponse | HTTPValidationError]: + """Get Package Policy Status + + The code-metric package-policy state of each listed code metric that has one and that the caller can + read. + + Args: + body (CodeMetricPolicyStatusRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CodeMetricPolicyStatusResponse | HTTPValidationError + """ + + return sync_detailed(client=client, body=body).parsed + + +async def asyncio_detailed( + *, client: ApiClient, body: CodeMetricPolicyStatusRequest +) -> Response[CodeMetricPolicyStatusResponse | HTTPValidationError]: + """Get Package Policy Status + + The code-metric package-policy state of each listed code metric that has one and that the caller can + read. + + Args: + body (CodeMetricPolicyStatusRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CodeMetricPolicyStatusResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs(body=body) + + response = await client.arequest(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, client: ApiClient, body: CodeMetricPolicyStatusRequest +) -> Optional[CodeMetricPolicyStatusResponse | HTTPValidationError]: + """Get Package Policy Status + + The code-metric package-policy state of each listed code metric that has one and that the caller can + read. + + Args: + body (CodeMetricPolicyStatusRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CodeMetricPolicyStatusResponse | HTTPValidationError + """ + + return (await asyncio_detailed(client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/data/get_scorer_prompt_preview_scorers_versions_scorer_version_id_prompt_preview_get.py b/src/splunk_ao/resources/api/data/get_scorer_prompt_preview_scorers_versions_scorer_version_id_prompt_preview_get.py new file mode 100644 index 00000000..76e49a58 --- /dev/null +++ b/src/splunk_ao/resources/api/data/get_scorer_prompt_preview_scorers_versions_scorer_version_id_prompt_preview_get.py @@ -0,0 +1,222 @@ +from http import HTTPStatus +from typing import Any, Optional + +import httpx + +from galileo_core.constants.request_method import RequestMethod +from galileo_core.helpers.api_client import ApiClient +from splunk_ao.exceptions import ( + AuthenticationError, + BadRequestError, + ConflictError, + ForbiddenError, + NotFoundError, + RateLimitError, + ServerError, +) +from splunk_ao.utils.headers_data import get_scorer_capabilities_header, get_sdk_header + +from ... import errors +from ...models.http_validation_error import HTTPValidationError +from ...models.scorer_prompt_preview_response import ScorerPromptPreviewResponse +from ...models.scorer_prompt_preview_unavailable_response import ScorerPromptPreviewUnavailableResponse +from ...types import UNSET, Response + + +def _get_kwargs(scorer_version_id: str, *, project_id: str, run_id: str, record_id: str) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["project_id"] = project_id + + params["run_id"] = run_id + + params["record_id"] = record_id + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": RequestMethod.GET, + "return_raw_response": True, + "path": "/scorers/versions/{scorer_version_id}/prompt-preview".format(scorer_version_id=scorer_version_id), + "params": params, + } + + headers["Splunk-AO-SDK"] = get_sdk_header() + headers["X-Galileo-Scorer-Capabilities"] = get_scorer_capabilities_header() + + _kwargs["content_headers"] = headers + return _kwargs + + +def _parse_response( + *, client: ApiClient, response: httpx.Response +) -> HTTPValidationError | ScorerPromptPreviewResponse | ScorerPromptPreviewUnavailableResponse: + if response.status_code == 200: + + def _parse_response_200(data: object) -> ScorerPromptPreviewResponse | ScorerPromptPreviewUnavailableResponse: + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0 = ScorerPromptPreviewResponse.from_dict(data) + + return response_200_type_0 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + response_200_type_1 = ScorerPromptPreviewUnavailableResponse.from_dict(data) + + return response_200_type_1 + + response_200 = _parse_response_200(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + # Handle common HTTP errors with actionable messages + if response.status_code == 400: + raise BadRequestError(response.status_code, response.content) + if response.status_code == 401: + raise AuthenticationError(response.status_code, response.content) + if response.status_code == 403: + raise ForbiddenError(response.status_code, response.content) + if response.status_code == 404: + raise NotFoundError(response.status_code, response.content) + if response.status_code == 409: + raise ConflictError(response.status_code, response.content) + if response.status_code == 429: + raise RateLimitError(response.status_code, response.content) + if response.status_code >= 500: + raise ServerError(response.status_code, response.content) + raise errors.UnexpectedStatus(response.status_code, response.content) + + +def _build_response( + *, client: ApiClient, response: httpx.Response +) -> Response[HTTPValidationError | ScorerPromptPreviewResponse | ScorerPromptPreviewUnavailableResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + scorer_version_id: str, *, client: ApiClient, project_id: str, run_id: str, record_id: str +) -> Response[HTTPValidationError | ScorerPromptPreviewResponse | ScorerPromptPreviewUnavailableResponse]: + """Get Scorer Prompt Preview + + Return this version's prompt using the run's effective scorer settings. + + Args: + scorer_version_id (str): + project_id (str): + run_id (str): + record_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | ScorerPromptPreviewResponse | ScorerPromptPreviewUnavailableResponse] + """ + + kwargs = _get_kwargs(scorer_version_id=scorer_version_id, project_id=project_id, run_id=run_id, record_id=record_id) + + response = client.request(**kwargs) + + return _build_response(client=client, response=response) + + +def sync( + scorer_version_id: str, *, client: ApiClient, project_id: str, run_id: str, record_id: str +) -> Optional[HTTPValidationError | ScorerPromptPreviewResponse | ScorerPromptPreviewUnavailableResponse]: + """Get Scorer Prompt Preview + + Return this version's prompt using the run's effective scorer settings. + + Args: + scorer_version_id (str): + project_id (str): + run_id (str): + record_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | ScorerPromptPreviewResponse | ScorerPromptPreviewUnavailableResponse + """ + + return sync_detailed( + scorer_version_id=scorer_version_id, client=client, project_id=project_id, run_id=run_id, record_id=record_id + ).parsed + + +async def asyncio_detailed( + scorer_version_id: str, *, client: ApiClient, project_id: str, run_id: str, record_id: str +) -> Response[HTTPValidationError | ScorerPromptPreviewResponse | ScorerPromptPreviewUnavailableResponse]: + """Get Scorer Prompt Preview + + Return this version's prompt using the run's effective scorer settings. + + Args: + scorer_version_id (str): + project_id (str): + run_id (str): + record_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | ScorerPromptPreviewResponse | ScorerPromptPreviewUnavailableResponse] + """ + + kwargs = _get_kwargs(scorer_version_id=scorer_version_id, project_id=project_id, run_id=run_id, record_id=record_id) + + response = await client.arequest(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + scorer_version_id: str, *, client: ApiClient, project_id: str, run_id: str, record_id: str +) -> Optional[HTTPValidationError | ScorerPromptPreviewResponse | ScorerPromptPreviewUnavailableResponse]: + """Get Scorer Prompt Preview + + Return this version's prompt using the run's effective scorer settings. + + Args: + scorer_version_id (str): + project_id (str): + run_id (str): + record_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | ScorerPromptPreviewResponse | ScorerPromptPreviewUnavailableResponse + """ + + return ( + await asyncio_detailed( + scorer_version_id=scorer_version_id, + client=client, + project_id=project_id, + run_id=run_id, + record_id=record_id, + ) + ).parsed diff --git a/src/splunk_ao/resources/api/data/list_scorers_with_filters_scorers_list_post.py b/src/splunk_ao/resources/api/data/list_scorers_with_filters_scorers_list_post.py index ca39ac5c..02c5dc9d 100644 --- a/src/splunk_ao/resources/api/data/list_scorers_with_filters_scorers_list_post.py +++ b/src/splunk_ao/resources/api/data/list_scorers_with_filters_scorers_list_post.py @@ -28,6 +28,7 @@ def _get_kwargs( *, body: ListScorersRequest, actions: list[ScorerAction] | Unset = UNSET, + include_luna_validation_contract: bool | Unset = False, starting_token: int | Unset = 0, limit: int | Unset = 100, ) -> dict[str, Any]: @@ -44,6 +45,8 @@ def _get_kwargs( params["actions"] = json_actions + params["include_luna_validation_contract"] = include_luna_validation_contract + params["starting_token"] = starting_token params["limit"] = limit @@ -113,6 +116,7 @@ def sync_detailed( client: ApiClient, body: ListScorersRequest, actions: list[ScorerAction] | Unset = UNSET, + include_luna_validation_contract: bool | Unset = False, starting_token: int | Unset = 0, limit: int | Unset = 100, ) -> Response[HTTPValidationError | ListScorersResponse]: @@ -121,6 +125,8 @@ def sync_detailed( Args: actions (list[ScorerAction] | Unset): Actions to include in the 'permissions' field of the scorers. + include_luna_validation_contract (bool | Unset): Include exact training contracts on + default and latest versions for Luna eligibility. Default: False. starting_token (int | Unset): Default: 0. limit (int | Unset): Default: 100. body (ListScorersRequest): @@ -133,7 +139,13 @@ def sync_detailed( Response[HTTPValidationError | ListScorersResponse] """ - kwargs = _get_kwargs(body=body, actions=actions, starting_token=starting_token, limit=limit) + kwargs = _get_kwargs( + body=body, + actions=actions, + include_luna_validation_contract=include_luna_validation_contract, + starting_token=starting_token, + limit=limit, + ) response = client.request(**kwargs) @@ -145,6 +157,7 @@ def sync( client: ApiClient, body: ListScorersRequest, actions: list[ScorerAction] | Unset = UNSET, + include_luna_validation_contract: bool | Unset = False, starting_token: int | Unset = 0, limit: int | Unset = 100, ) -> Optional[HTTPValidationError | ListScorersResponse]: @@ -153,6 +166,8 @@ def sync( Args: actions (list[ScorerAction] | Unset): Actions to include in the 'permissions' field of the scorers. + include_luna_validation_contract (bool | Unset): Include exact training contracts on + default and latest versions for Luna eligibility. Default: False. starting_token (int | Unset): Default: 0. limit (int | Unset): Default: 100. body (ListScorersRequest): @@ -165,7 +180,14 @@ def sync( HTTPValidationError | ListScorersResponse """ - return sync_detailed(client=client, body=body, actions=actions, starting_token=starting_token, limit=limit).parsed + return sync_detailed( + client=client, + body=body, + actions=actions, + include_luna_validation_contract=include_luna_validation_contract, + starting_token=starting_token, + limit=limit, + ).parsed async def asyncio_detailed( @@ -173,6 +195,7 @@ async def asyncio_detailed( client: ApiClient, body: ListScorersRequest, actions: list[ScorerAction] | Unset = UNSET, + include_luna_validation_contract: bool | Unset = False, starting_token: int | Unset = 0, limit: int | Unset = 100, ) -> Response[HTTPValidationError | ListScorersResponse]: @@ -181,6 +204,8 @@ async def asyncio_detailed( Args: actions (list[ScorerAction] | Unset): Actions to include in the 'permissions' field of the scorers. + include_luna_validation_contract (bool | Unset): Include exact training contracts on + default and latest versions for Luna eligibility. Default: False. starting_token (int | Unset): Default: 0. limit (int | Unset): Default: 100. body (ListScorersRequest): @@ -193,7 +218,13 @@ async def asyncio_detailed( Response[HTTPValidationError | ListScorersResponse] """ - kwargs = _get_kwargs(body=body, actions=actions, starting_token=starting_token, limit=limit) + kwargs = _get_kwargs( + body=body, + actions=actions, + include_luna_validation_contract=include_luna_validation_contract, + starting_token=starting_token, + limit=limit, + ) response = await client.arequest(**kwargs) @@ -205,6 +236,7 @@ async def asyncio( client: ApiClient, body: ListScorersRequest, actions: list[ScorerAction] | Unset = UNSET, + include_luna_validation_contract: bool | Unset = False, starting_token: int | Unset = 0, limit: int | Unset = 100, ) -> Optional[HTTPValidationError | ListScorersResponse]: @@ -213,6 +245,8 @@ async def asyncio( Args: actions (list[ScorerAction] | Unset): Actions to include in the 'permissions' field of the scorers. + include_luna_validation_contract (bool | Unset): Include exact training contracts on + default and latest versions for Luna eligibility. Default: False. starting_token (int | Unset): Default: 0. limit (int | Unset): Default: 100. body (ListScorersRequest): @@ -226,5 +260,12 @@ async def asyncio( """ return ( - await asyncio_detailed(client=client, body=body, actions=actions, starting_token=starting_token, limit=limit) + await asyncio_detailed( + client=client, + body=body, + actions=actions, + include_luna_validation_contract=include_luna_validation_contract, + starting_token=starting_token, + limit=limit, + ) ).parsed diff --git a/src/splunk_ao/resources/api/data/validate_decision_scorer_log_record_scorers_decision_validate_log_record_post.py b/src/splunk_ao/resources/api/data/validate_decision_scorer_log_record_scorers_decision_validate_log_record_post.py index 7151f9ce..6a6be94a 100644 --- a/src/splunk_ao/resources/api/data/validate_decision_scorer_log_record_scorers_decision_validate_log_record_post.py +++ b/src/splunk_ao/resources/api/data/validate_decision_scorer_log_record_scorers_decision_validate_log_record_post.py @@ -93,9 +93,9 @@ def sync_detailed( Test a decision evaluator on log records. The results go to a new metrics_testing run. The body has the LLM request's shape (ERD S6). model_name, question and answer_options are at the - top level, in place of the prompt fields. output_type, scoreable_node_types, input_type and - ground_truth are in scorer_configuration. scoreable_node_types holds exactly one node type. The - fields that select the records (log_stream_id or experiment_id, and filters) are at the top level. + top level, in place of the prompt fields. output_type, scoreable_node_types, input_type, + ground_truth and metadata_selection are in scorer_configuration. scoreable_node_types holds + exactly one node type. The record source and filters are at the top level. Args: body (ValidateDecisionScorerLogRecordRequest): Test a decision evaluator on log records. @@ -124,9 +124,9 @@ def sync( Test a decision evaluator on log records. The results go to a new metrics_testing run. The body has the LLM request's shape (ERD S6). model_name, question and answer_options are at the - top level, in place of the prompt fields. output_type, scoreable_node_types, input_type and - ground_truth are in scorer_configuration. scoreable_node_types holds exactly one node type. The - fields that select the records (log_stream_id or experiment_id, and filters) are at the top level. + top level, in place of the prompt fields. output_type, scoreable_node_types, input_type, + ground_truth and metadata_selection are in scorer_configuration. scoreable_node_types holds + exactly one node type. The record source and filters are at the top level. Args: body (ValidateDecisionScorerLogRecordRequest): Test a decision evaluator on log records. @@ -151,9 +151,9 @@ async def asyncio_detailed( Test a decision evaluator on log records. The results go to a new metrics_testing run. The body has the LLM request's shape (ERD S6). model_name, question and answer_options are at the - top level, in place of the prompt fields. output_type, scoreable_node_types, input_type and - ground_truth are in scorer_configuration. scoreable_node_types holds exactly one node type. The - fields that select the records (log_stream_id or experiment_id, and filters) are at the top level. + top level, in place of the prompt fields. output_type, scoreable_node_types, input_type, + ground_truth and metadata_selection are in scorer_configuration. scoreable_node_types holds + exactly one node type. The record source and filters are at the top level. Args: body (ValidateDecisionScorerLogRecordRequest): Test a decision evaluator on log records. @@ -182,9 +182,9 @@ async def asyncio( Test a decision evaluator on log records. The results go to a new metrics_testing run. The body has the LLM request's shape (ERD S6). model_name, question and answer_options are at the - top level, in place of the prompt fields. output_type, scoreable_node_types, input_type and - ground_truth are in scorer_configuration. scoreable_node_types holds exactly one node type. The - fields that select the records (log_stream_id or experiment_id, and filters) are at the top level. + top level, in place of the prompt fields. output_type, scoreable_node_types, input_type, + ground_truth and metadata_selection are in scorer_configuration. scoreable_node_types holds + exactly one node type. The record source and filters are at the top level. Args: body (ValidateDecisionScorerLogRecordRequest): Test a decision evaluator on log records. diff --git a/src/splunk_ao/resources/api/datasets/create_dataset_datasets_post.py b/src/splunk_ao/resources/api/datasets/create_dataset_datasets_post.py index e457778b..93d093dc 100644 --- a/src/splunk_ao/resources/api/datasets/create_dataset_datasets_post.py +++ b/src/splunk_ao/resources/api/datasets/create_dataset_datasets_post.py @@ -104,7 +104,7 @@ def sync_detailed( ) -> Response[DatasetDB | HTTPValidationError]: """Create Dataset - Creates a standalone dataset. + Create a dataset with an optional project link. Args: format_ (DatasetFormat | Unset): @@ -135,7 +135,7 @@ def sync( ) -> Optional[DatasetDB | HTTPValidationError]: """Create Dataset - Creates a standalone dataset. + Create a dataset with an optional project link. Args: format_ (DatasetFormat | Unset): @@ -162,7 +162,7 @@ async def asyncio_detailed( ) -> Response[DatasetDB | HTTPValidationError]: """Create Dataset - Creates a standalone dataset. + Create a dataset with an optional project link. Args: format_ (DatasetFormat | Unset): @@ -193,7 +193,7 @@ async def asyncio( ) -> Optional[DatasetDB | HTTPValidationError]: """Create Dataset - Creates a standalone dataset. + Create a dataset with an optional project link. Args: format_ (DatasetFormat | Unset): diff --git a/src/splunk_ao/resources/api/integrations/get_billing_usage_billing_usage_metric_get.py b/src/splunk_ao/resources/api/integrations/get_billing_usage_billing_usage_metric_get.py index c73fd0d4..7faa3e62 100644 --- a/src/splunk_ao/resources/api/integrations/get_billing_usage_billing_usage_metric_get.py +++ b/src/splunk_ao/resources/api/integrations/get_billing_usage_billing_usage_metric_get.py @@ -20,9 +20,10 @@ from ... import errors from ...models.billing_usage_metric import BillingUsageMetric -from ...models.billing_usage_response import BillingUsageResponse from ...models.cost_interval import CostInterval from ...models.http_validation_error import HTTPValidationError +from ...models.luna_billing_usage_response import LunaBillingUsageResponse +from ...models.non_luna_billing_usage_response import NonLunaBillingUsageResponse from ...types import UNSET, Response, Unset @@ -71,9 +72,27 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: ApiClient, response: httpx.Response) -> BillingUsageResponse | HTTPValidationError: +def _parse_response( + *, client: ApiClient, response: httpx.Response +) -> HTTPValidationError | LunaBillingUsageResponse | NonLunaBillingUsageResponse: if response.status_code == 200: - response_200 = BillingUsageResponse.from_dict(response.json()) + + def _parse_response_200(data: object) -> LunaBillingUsageResponse | NonLunaBillingUsageResponse: + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0 = NonLunaBillingUsageResponse.from_dict(data) + + return response_200_type_0 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + response_200_type_1 = LunaBillingUsageResponse.from_dict(data) + + return response_200_type_1 + + response_200 = _parse_response_200(response.json()) return response_200 @@ -102,7 +121,7 @@ def _parse_response(*, client: ApiClient, response: httpx.Response) -> BillingUs def _build_response( *, client: ApiClient, response: httpx.Response -) -> Response[BillingUsageResponse | HTTPValidationError]: +) -> Response[HTTPValidationError | LunaBillingUsageResponse | NonLunaBillingUsageResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -119,7 +138,7 @@ def sync_detailed( end_time: datetime.datetime, interval: CostInterval, project_id: None | Unset | UUID = UNSET, -) -> Response[BillingUsageResponse | HTTPValidationError]: +) -> Response[HTTPValidationError | LunaBillingUsageResponse | NonLunaBillingUsageResponse]: """Get Billing Usage Args: @@ -134,7 +153,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BillingUsageResponse | HTTPValidationError] + Response[HTTPValidationError | LunaBillingUsageResponse | NonLunaBillingUsageResponse] """ kwargs = _get_kwargs( @@ -154,7 +173,7 @@ def sync( end_time: datetime.datetime, interval: CostInterval, project_id: None | Unset | UUID = UNSET, -) -> Optional[BillingUsageResponse | HTTPValidationError]: +) -> Optional[HTTPValidationError | LunaBillingUsageResponse | NonLunaBillingUsageResponse]: """Get Billing Usage Args: @@ -169,7 +188,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BillingUsageResponse | HTTPValidationError + HTTPValidationError | LunaBillingUsageResponse | NonLunaBillingUsageResponse """ return sync_detailed( @@ -185,7 +204,7 @@ async def asyncio_detailed( end_time: datetime.datetime, interval: CostInterval, project_id: None | Unset | UUID = UNSET, -) -> Response[BillingUsageResponse | HTTPValidationError]: +) -> Response[HTTPValidationError | LunaBillingUsageResponse | NonLunaBillingUsageResponse]: """Get Billing Usage Args: @@ -200,7 +219,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BillingUsageResponse | HTTPValidationError] + Response[HTTPValidationError | LunaBillingUsageResponse | NonLunaBillingUsageResponse] """ kwargs = _get_kwargs( @@ -220,7 +239,7 @@ async def asyncio( end_time: datetime.datetime, interval: CostInterval, project_id: None | Unset | UUID = UNSET, -) -> Optional[BillingUsageResponse | HTTPValidationError]: +) -> Optional[HTTPValidationError | LunaBillingUsageResponse | NonLunaBillingUsageResponse]: """Get Billing Usage Args: @@ -235,7 +254,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BillingUsageResponse | HTTPValidationError + HTTPValidationError | LunaBillingUsageResponse | NonLunaBillingUsageResponse """ return ( diff --git a/src/splunk_ao/resources/api/log_stream/update_metric_settings_projects_project_id_log_streams_log_stream_id_metric_settings_patch.py b/src/splunk_ao/resources/api/log_stream/update_metric_settings_projects_project_id_log_streams_log_stream_id_metric_settings_patch.py index 8bc32a20..9d2042d2 100644 --- a/src/splunk_ao/resources/api/log_stream/update_metric_settings_projects_project_id_log_streams_log_stream_id_metric_settings_patch.py +++ b/src/splunk_ao/resources/api/log_stream/update_metric_settings_projects_project_id_log_streams_log_stream_id_metric_settings_patch.py @@ -18,6 +18,7 @@ from ... import errors from ...models.http_validation_error import HTTPValidationError +from ...models.metric_settings_conflict_response import MetricSettingsConflictResponse from ...models.metric_settings_request import MetricSettingsRequest from ...models.metric_settings_response import MetricSettingsResponse from ...types import Response @@ -45,12 +46,19 @@ def _get_kwargs(project_id: str, log_stream_id: str, *, body: MetricSettingsRequ return _kwargs -def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | MetricSettingsResponse: +def _parse_response( + *, client: ApiClient, response: httpx.Response +) -> HTTPValidationError | MetricSettingsConflictResponse | MetricSettingsResponse: if response.status_code == 200: response_200 = MetricSettingsResponse.from_dict(response.json()) return response_200 + if response.status_code == 409: + response_409 = MetricSettingsConflictResponse.from_dict(response.json()) + + return response_409 + if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -76,7 +84,7 @@ def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValid def _build_response( *, client: ApiClient, response: httpx.Response -) -> Response[HTTPValidationError | MetricSettingsResponse]: +) -> Response[HTTPValidationError | MetricSettingsConflictResponse | MetricSettingsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -87,7 +95,7 @@ def _build_response( def sync_detailed( project_id: str, log_stream_id: str, *, client: ApiClient, body: MetricSettingsRequest -) -> Response[HTTPValidationError | MetricSettingsResponse]: +) -> Response[HTTPValidationError | MetricSettingsConflictResponse | MetricSettingsResponse]: """Update Metric Settings Args: @@ -100,7 +108,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MetricSettingsResponse] + Response[HTTPValidationError | MetricSettingsConflictResponse | MetricSettingsResponse] """ kwargs = _get_kwargs(project_id=project_id, log_stream_id=log_stream_id, body=body) @@ -112,7 +120,7 @@ def sync_detailed( def sync( project_id: str, log_stream_id: str, *, client: ApiClient, body: MetricSettingsRequest -) -> Optional[HTTPValidationError | MetricSettingsResponse]: +) -> Optional[HTTPValidationError | MetricSettingsConflictResponse | MetricSettingsResponse]: """Update Metric Settings Args: @@ -125,7 +133,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MetricSettingsResponse + HTTPValidationError | MetricSettingsConflictResponse | MetricSettingsResponse """ return sync_detailed(project_id=project_id, log_stream_id=log_stream_id, client=client, body=body).parsed @@ -133,7 +141,7 @@ def sync( async def asyncio_detailed( project_id: str, log_stream_id: str, *, client: ApiClient, body: MetricSettingsRequest -) -> Response[HTTPValidationError | MetricSettingsResponse]: +) -> Response[HTTPValidationError | MetricSettingsConflictResponse | MetricSettingsResponse]: """Update Metric Settings Args: @@ -146,7 +154,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | MetricSettingsResponse] + Response[HTTPValidationError | MetricSettingsConflictResponse | MetricSettingsResponse] """ kwargs = _get_kwargs(project_id=project_id, log_stream_id=log_stream_id, body=body) @@ -158,7 +166,7 @@ async def asyncio_detailed( async def asyncio( project_id: str, log_stream_id: str, *, client: ApiClient, body: MetricSettingsRequest -) -> Optional[HTTPValidationError | MetricSettingsResponse]: +) -> Optional[HTTPValidationError | MetricSettingsConflictResponse | MetricSettingsResponse]: """Update Metric Settings Args: @@ -171,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | MetricSettingsResponse + HTTPValidationError | MetricSettingsConflictResponse | MetricSettingsResponse """ return (await asyncio_detailed(project_id=project_id, log_stream_id=log_stream_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/prompts/create_global_prompt_template_templates_post.py b/src/splunk_ao/resources/api/prompts/create_global_prompt_template_templates_post.py index 3bf2080e..c40a5e34 100644 --- a/src/splunk_ao/resources/api/prompts/create_global_prompt_template_templates_post.py +++ b/src/splunk_ao/resources/api/prompts/create_global_prompt_template_templates_post.py @@ -101,7 +101,7 @@ def sync_detailed( ) -> Response[BasePromptTemplateResponse | HTTPValidationError]: """Create Global Prompt Template - Create a global prompt template. + Create a prompt template, optionally linked to a project. Parameters ---------- @@ -142,7 +142,7 @@ def sync( ) -> Optional[BasePromptTemplateResponse | HTTPValidationError]: """Create Global Prompt Template - Create a global prompt template. + Create a prompt template, optionally linked to a project. Parameters ---------- @@ -179,7 +179,7 @@ async def asyncio_detailed( ) -> Response[BasePromptTemplateResponse | HTTPValidationError]: """Create Global Prompt Template - Create a global prompt template. + Create a prompt template, optionally linked to a project. Parameters ---------- @@ -220,7 +220,7 @@ async def asyncio( ) -> Optional[BasePromptTemplateResponse | HTTPValidationError]: """Create Global Prompt Template - Create a global prompt template. + Create a prompt template, optionally linked to a project. Parameters ---------- diff --git a/src/splunk_ao/resources/api/trace/update_span_projects_project_id_spans_span_id_patch.py b/src/splunk_ao/resources/api/run_scorer_settings/enable_evaluators_projects_project_id_runs_run_id_scorer_settings_evaluators_enable_post.py similarity index 60% rename from src/splunk_ao/resources/api/trace/update_span_projects_project_id_spans_span_id_patch.py rename to src/splunk_ao/resources/api/run_scorer_settings/enable_evaluators_projects_project_id_runs_run_id_scorer_settings_evaluators_enable_post.py index d58a2d86..db870dff 100644 --- a/src/splunk_ao/resources/api/trace/update_span_projects_project_id_spans_span_id_patch.py +++ b/src/splunk_ao/resources/api/run_scorer_settings/enable_evaluators_projects_project_id_runs_run_id_scorer_settings_evaluators_enable_post.py @@ -18,18 +18,20 @@ from ... import errors from ...models.http_validation_error import HTTPValidationError -from ...models.log_span_update_request import LogSpanUpdateRequest -from ...models.log_span_update_response import LogSpanUpdateResponse +from ...models.run_evaluators_enabled import RunEvaluatorsEnabled +from ...models.run_evaluators_request import RunEvaluatorsRequest from ...types import Response -def _get_kwargs(project_id: str, span_id: str, *, body: LogSpanUpdateRequest) -> dict[str, Any]: +def _get_kwargs(project_id: str, run_id: str, *, body: RunEvaluatorsRequest) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { - "method": RequestMethod.PATCH, + "method": RequestMethod.POST, "return_raw_response": True, - "path": "/projects/{project_id}/spans/{span_id}".format(project_id=project_id, span_id=span_id), + "path": "/projects/{project_id}/runs/{run_id}/scorer-settings/evaluators/enable".format( + project_id=project_id, run_id=run_id + ), } _kwargs["json"] = body.to_dict() @@ -42,9 +44,9 @@ def _get_kwargs(project_id: str, span_id: str, *, body: LogSpanUpdateRequest) -> return _kwargs -def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | LogSpanUpdateResponse: +def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | RunEvaluatorsEnabled: if response.status_code == 200: - response_200 = LogSpanUpdateResponse.from_dict(response.json()) + response_200 = RunEvaluatorsEnabled.from_dict(response.json()) return response_200 @@ -73,7 +75,7 @@ def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValid def _build_response( *, client: ApiClient, response: httpx.Response -) -> Response[HTTPValidationError | LogSpanUpdateResponse]: +) -> Response[HTTPValidationError | RunEvaluatorsEnabled]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -83,26 +85,26 @@ def _build_response( def sync_detailed( - project_id: str, span_id: str, *, client: ApiClient, body: LogSpanUpdateRequest -) -> Response[HTTPValidationError | LogSpanUpdateResponse]: - """Update Span + project_id: str, run_id: str, *, client: ApiClient, body: RunEvaluatorsRequest +) -> Response[HTTPValidationError | RunEvaluatorsEnabled]: + """Enable Evaluators - Update a span with the given ID. + Add exact saved Evaluators while preserving settings and historical scores. Args: project_id (str): - span_id (str): - body (LogSpanUpdateRequest): Request model for updating a span. + run_id (str): + body (RunEvaluatorsRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogSpanUpdateResponse] + Response[HTTPValidationError | RunEvaluatorsEnabled] """ - kwargs = _get_kwargs(project_id=project_id, span_id=span_id, body=body) + kwargs = _get_kwargs(project_id=project_id, run_id=run_id, body=body) response = client.request(**kwargs) @@ -110,49 +112,49 @@ def sync_detailed( def sync( - project_id: str, span_id: str, *, client: ApiClient, body: LogSpanUpdateRequest -) -> Optional[HTTPValidationError | LogSpanUpdateResponse]: - """Update Span + project_id: str, run_id: str, *, client: ApiClient, body: RunEvaluatorsRequest +) -> Optional[HTTPValidationError | RunEvaluatorsEnabled]: + """Enable Evaluators - Update a span with the given ID. + Add exact saved Evaluators while preserving settings and historical scores. Args: project_id (str): - span_id (str): - body (LogSpanUpdateRequest): Request model for updating a span. + run_id (str): + body (RunEvaluatorsRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogSpanUpdateResponse + HTTPValidationError | RunEvaluatorsEnabled """ - return sync_detailed(project_id=project_id, span_id=span_id, client=client, body=body).parsed + return sync_detailed(project_id=project_id, run_id=run_id, client=client, body=body).parsed async def asyncio_detailed( - project_id: str, span_id: str, *, client: ApiClient, body: LogSpanUpdateRequest -) -> Response[HTTPValidationError | LogSpanUpdateResponse]: - """Update Span + project_id: str, run_id: str, *, client: ApiClient, body: RunEvaluatorsRequest +) -> Response[HTTPValidationError | RunEvaluatorsEnabled]: + """Enable Evaluators - Update a span with the given ID. + Add exact saved Evaluators while preserving settings and historical scores. Args: project_id (str): - span_id (str): - body (LogSpanUpdateRequest): Request model for updating a span. + run_id (str): + body (RunEvaluatorsRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogSpanUpdateResponse] + Response[HTTPValidationError | RunEvaluatorsEnabled] """ - kwargs = _get_kwargs(project_id=project_id, span_id=span_id, body=body) + kwargs = _get_kwargs(project_id=project_id, run_id=run_id, body=body) response = await client.arequest(**kwargs) @@ -160,23 +162,23 @@ async def asyncio_detailed( async def asyncio( - project_id: str, span_id: str, *, client: ApiClient, body: LogSpanUpdateRequest -) -> Optional[HTTPValidationError | LogSpanUpdateResponse]: - """Update Span + project_id: str, run_id: str, *, client: ApiClient, body: RunEvaluatorsRequest +) -> Optional[HTTPValidationError | RunEvaluatorsEnabled]: + """Enable Evaluators - Update a span with the given ID. + Add exact saved Evaluators while preserving settings and historical scores. Args: project_id (str): - span_id (str): - body (LogSpanUpdateRequest): Request model for updating a span. + run_id (str): + body (RunEvaluatorsRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogSpanUpdateResponse + HTTPValidationError | RunEvaluatorsEnabled """ - return (await asyncio_detailed(project_id=project_id, span_id=span_id, client=client, body=body)).parsed + return (await asyncio_detailed(project_id=project_id, run_id=run_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/run_scorer_settings/inspect_evaluators_projects_project_id_runs_run_id_scorer_settings_evaluators_inspect_post.py b/src/splunk_ao/resources/api/run_scorer_settings/inspect_evaluators_projects_project_id_runs_run_id_scorer_settings_evaluators_inspect_post.py new file mode 100644 index 00000000..2f2da282 --- /dev/null +++ b/src/splunk_ao/resources/api/run_scorer_settings/inspect_evaluators_projects_project_id_runs_run_id_scorer_settings_evaluators_inspect_post.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, Optional + +import httpx + +from galileo_core.constants.request_method import RequestMethod +from galileo_core.helpers.api_client import ApiClient +from splunk_ao.exceptions import ( + AuthenticationError, + BadRequestError, + ConflictError, + ForbiddenError, + NotFoundError, + RateLimitError, + ServerError, +) +from splunk_ao.utils.headers_data import get_sdk_header + +from ... import errors +from ...models.http_validation_error import HTTPValidationError +from ...models.run_evaluators_inspection import RunEvaluatorsInspection +from ...models.run_evaluators_request import RunEvaluatorsRequest +from ...types import Response + + +def _get_kwargs(project_id: str, run_id: str, *, body: RunEvaluatorsRequest) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": RequestMethod.POST, + "return_raw_response": True, + "path": "/projects/{project_id}/runs/{run_id}/scorer-settings/evaluators/inspect".format( + project_id=project_id, run_id=run_id + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + headers["Splunk-AO-SDK"] = get_sdk_header() + + _kwargs["content_headers"] = headers + return _kwargs + + +def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | RunEvaluatorsInspection: + if response.status_code == 200: + response_200 = RunEvaluatorsInspection.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + # Handle common HTTP errors with actionable messages + if response.status_code == 400: + raise BadRequestError(response.status_code, response.content) + if response.status_code == 401: + raise AuthenticationError(response.status_code, response.content) + if response.status_code == 403: + raise ForbiddenError(response.status_code, response.content) + if response.status_code == 404: + raise NotFoundError(response.status_code, response.content) + if response.status_code == 409: + raise ConflictError(response.status_code, response.content) + if response.status_code == 429: + raise RateLimitError(response.status_code, response.content) + if response.status_code >= 500: + raise ServerError(response.status_code, response.content) + raise errors.UnexpectedStatus(response.status_code, response.content) + + +def _build_response( + *, client: ApiClient, response: httpx.Response +) -> Response[HTTPValidationError | RunEvaluatorsInspection]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, run_id: str, *, client: ApiClient, body: RunEvaluatorsRequest +) -> Response[HTTPValidationError | RunEvaluatorsInspection]: + """Inspect Evaluators + + Resolve exact visible Evaluators on the primary before approval. + + Args: + project_id (str): + run_id (str): + body (RunEvaluatorsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | RunEvaluatorsInspection] + """ + + kwargs = _get_kwargs(project_id=project_id, run_id=run_id, body=body) + + response = client.request(**kwargs) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, run_id: str, *, client: ApiClient, body: RunEvaluatorsRequest +) -> Optional[HTTPValidationError | RunEvaluatorsInspection]: + """Inspect Evaluators + + Resolve exact visible Evaluators on the primary before approval. + + Args: + project_id (str): + run_id (str): + body (RunEvaluatorsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | RunEvaluatorsInspection + """ + + return sync_detailed(project_id=project_id, run_id=run_id, client=client, body=body).parsed + + +async def asyncio_detailed( + project_id: str, run_id: str, *, client: ApiClient, body: RunEvaluatorsRequest +) -> Response[HTTPValidationError | RunEvaluatorsInspection]: + """Inspect Evaluators + + Resolve exact visible Evaluators on the primary before approval. + + Args: + project_id (str): + run_id (str): + body (RunEvaluatorsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | RunEvaluatorsInspection] + """ + + kwargs = _get_kwargs(project_id=project_id, run_id=run_id, body=body) + + response = await client.arequest(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, run_id: str, *, client: ApiClient, body: RunEvaluatorsRequest +) -> Optional[HTTPValidationError | RunEvaluatorsInspection]: + """Inspect Evaluators + + Resolve exact visible Evaluators on the primary before approval. + + Args: + project_id (str): + run_id (str): + body (RunEvaluatorsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | RunEvaluatorsInspection + """ + + return (await asyncio_detailed(project_id=project_id, run_id=run_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/run_scorer_settings/upsert_scorers_config_projects_project_id_runs_run_id_scorer_settings_patch.py b/src/splunk_ao/resources/api/run_scorer_settings/upsert_scorers_config_projects_project_id_runs_run_id_scorer_settings_patch.py index a12b4600..cffa7679 100644 --- a/src/splunk_ao/resources/api/run_scorer_settings/upsert_scorers_config_projects_project_id_runs_run_id_scorer_settings_patch.py +++ b/src/splunk_ao/resources/api/run_scorer_settings/upsert_scorers_config_projects_project_id_runs_run_id_scorer_settings_patch.py @@ -18,6 +18,7 @@ from ... import errors from ...models.http_validation_error import HTTPValidationError +from ...models.metric_settings_conflict_response import MetricSettingsConflictResponse from ...models.run_scorer_settings_patch_request import RunScorerSettingsPatchRequest from ...models.run_scorer_settings_response import RunScorerSettingsResponse from ...types import Response @@ -43,12 +44,19 @@ def _get_kwargs(project_id: str, run_id: str, *, body: RunScorerSettingsPatchReq return _kwargs -def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | RunScorerSettingsResponse: +def _parse_response( + *, client: ApiClient, response: httpx.Response +) -> HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse: if response.status_code == 200: response_200 = RunScorerSettingsResponse.from_dict(response.json()) return response_200 + if response.status_code == 409: + response_409 = MetricSettingsConflictResponse.from_dict(response.json()) + + return response_409 + if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -74,7 +82,7 @@ def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValid def _build_response( *, client: ApiClient, response: httpx.Response -) -> Response[HTTPValidationError | RunScorerSettingsResponse]: +) -> Response[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -85,7 +93,7 @@ def _build_response( def sync_detailed( project_id: str, run_id: str, *, client: ApiClient, body: RunScorerSettingsPatchRequest -) -> Response[HTTPValidationError | RunScorerSettingsResponse]: +) -> Response[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse]: """Upsert Scorers Config Enable or disable a run's scorers, recomputing metrics for any newly enabled ones. @@ -110,7 +118,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | RunScorerSettingsResponse] + Response[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse] """ kwargs = _get_kwargs(project_id=project_id, run_id=run_id, body=body) @@ -122,7 +130,7 @@ def sync_detailed( def sync( project_id: str, run_id: str, *, client: ApiClient, body: RunScorerSettingsPatchRequest -) -> Optional[HTTPValidationError | RunScorerSettingsResponse]: +) -> Optional[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse]: """Upsert Scorers Config Enable or disable a run's scorers, recomputing metrics for any newly enabled ones. @@ -147,7 +155,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | RunScorerSettingsResponse + HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse """ return sync_detailed(project_id=project_id, run_id=run_id, client=client, body=body).parsed @@ -155,7 +163,7 @@ def sync( async def asyncio_detailed( project_id: str, run_id: str, *, client: ApiClient, body: RunScorerSettingsPatchRequest -) -> Response[HTTPValidationError | RunScorerSettingsResponse]: +) -> Response[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse]: """Upsert Scorers Config Enable or disable a run's scorers, recomputing metrics for any newly enabled ones. @@ -180,7 +188,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | RunScorerSettingsResponse] + Response[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse] """ kwargs = _get_kwargs(project_id=project_id, run_id=run_id, body=body) @@ -192,7 +200,7 @@ async def asyncio_detailed( async def asyncio( project_id: str, run_id: str, *, client: ApiClient, body: RunScorerSettingsPatchRequest -) -> Optional[HTTPValidationError | RunScorerSettingsResponse]: +) -> Optional[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse]: """Upsert Scorers Config Enable or disable a run's scorers, recomputing metrics for any newly enabled ones. @@ -217,7 +225,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | RunScorerSettingsResponse + HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse """ return (await asyncio_detailed(project_id=project_id, run_id=run_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/run_scorer_settings/upsert_scorers_config_projects_project_id_runs_run_id_scorer_settings_post.py b/src/splunk_ao/resources/api/run_scorer_settings/upsert_scorers_config_projects_project_id_runs_run_id_scorer_settings_post.py index 8be7fcba..465bda9d 100644 --- a/src/splunk_ao/resources/api/run_scorer_settings/upsert_scorers_config_projects_project_id_runs_run_id_scorer_settings_post.py +++ b/src/splunk_ao/resources/api/run_scorer_settings/upsert_scorers_config_projects_project_id_runs_run_id_scorer_settings_post.py @@ -18,6 +18,7 @@ from ... import errors from ...models.http_validation_error import HTTPValidationError +from ...models.metric_settings_conflict_response import MetricSettingsConflictResponse from ...models.run_scorer_settings_patch_request import RunScorerSettingsPatchRequest from ...models.run_scorer_settings_response import RunScorerSettingsResponse from ...types import Response @@ -43,12 +44,19 @@ def _get_kwargs(project_id: str, run_id: str, *, body: RunScorerSettingsPatchReq return _kwargs -def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | RunScorerSettingsResponse: +def _parse_response( + *, client: ApiClient, response: httpx.Response +) -> HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse: if response.status_code == 200: response_200 = RunScorerSettingsResponse.from_dict(response.json()) return response_200 + if response.status_code == 409: + response_409 = MetricSettingsConflictResponse.from_dict(response.json()) + + return response_409 + if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -74,7 +82,7 @@ def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValid def _build_response( *, client: ApiClient, response: httpx.Response -) -> Response[HTTPValidationError | RunScorerSettingsResponse]: +) -> Response[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -85,7 +93,7 @@ def _build_response( def sync_detailed( project_id: str, run_id: str, *, client: ApiClient, body: RunScorerSettingsPatchRequest -) -> Response[HTTPValidationError | RunScorerSettingsResponse]: +) -> Response[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse]: """Upsert Scorers Config Enable or disable a run's scorers, recomputing metrics for any newly enabled ones. @@ -110,7 +118,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | RunScorerSettingsResponse] + Response[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse] """ kwargs = _get_kwargs(project_id=project_id, run_id=run_id, body=body) @@ -122,7 +130,7 @@ def sync_detailed( def sync( project_id: str, run_id: str, *, client: ApiClient, body: RunScorerSettingsPatchRequest -) -> Optional[HTTPValidationError | RunScorerSettingsResponse]: +) -> Optional[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse]: """Upsert Scorers Config Enable or disable a run's scorers, recomputing metrics for any newly enabled ones. @@ -147,7 +155,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | RunScorerSettingsResponse + HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse """ return sync_detailed(project_id=project_id, run_id=run_id, client=client, body=body).parsed @@ -155,7 +163,7 @@ def sync( async def asyncio_detailed( project_id: str, run_id: str, *, client: ApiClient, body: RunScorerSettingsPatchRequest -) -> Response[HTTPValidationError | RunScorerSettingsResponse]: +) -> Response[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse]: """Upsert Scorers Config Enable or disable a run's scorers, recomputing metrics for any newly enabled ones. @@ -180,7 +188,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | RunScorerSettingsResponse] + Response[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse] """ kwargs = _get_kwargs(project_id=project_id, run_id=run_id, body=body) @@ -192,7 +200,7 @@ async def asyncio_detailed( async def asyncio( project_id: str, run_id: str, *, client: ApiClient, body: RunScorerSettingsPatchRequest -) -> Optional[HTTPValidationError | RunScorerSettingsResponse]: +) -> Optional[HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse]: """Upsert Scorers Config Enable or disable a run's scorers, recomputing metrics for any newly enabled ones. @@ -217,7 +225,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | RunScorerSettingsResponse + HTTPValidationError | MetricSettingsConflictResponse | RunScorerSettingsResponse """ return (await asyncio_detailed(project_id=project_id, run_id=run_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/trace/get_session_projects_project_id_sessions_session_id_get.py b/src/splunk_ao/resources/api/trace/get_session_projects_project_id_sessions_session_id_get.py index 5c537270..d5814508 100644 --- a/src/splunk_ao/resources/api/trace/get_session_projects_project_id_sessions_session_id_get.py +++ b/src/splunk_ao/resources/api/trace/get_session_projects_project_id_sessions_session_id_get.py @@ -17,7 +17,6 @@ from splunk_ao.utils.headers_data import get_sdk_header from ... import errors -from ...models.extended_read_session_record_with_children import ExtendedReadSessionRecordWithChildren from ...models.http_validation_error import HTTPValidationError from ...types import UNSET, Response, Unset @@ -60,14 +59,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: ApiClient, response: httpx.Response -) -> ExtendedReadSessionRecordWithChildren | HTTPValidationError: - if response.status_code == 200: - response_200 = ExtendedReadSessionRecordWithChildren.from_dict(response.json()) - - return response_200 - +def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError: if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -91,9 +83,7 @@ def _parse_response( raise errors.UnexpectedStatus(response.status_code, response.content) -def _build_response( - *, client: ApiClient, response: httpx.Response -) -> Response[ExtendedReadSessionRecordWithChildren | HTTPValidationError]: +def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[HTTPValidationError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -110,7 +100,7 @@ def sync_detailed( include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, include_redacted_io: bool | Unset = True, -) -> Response[ExtendedReadSessionRecordWithChildren | HTTPValidationError]: +) -> Response[HTTPValidationError]: """Get Session Args: @@ -128,7 +118,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExtendedReadSessionRecordWithChildren | HTTPValidationError] + Response[HTTPValidationError] """ kwargs = _get_kwargs( @@ -152,7 +142,7 @@ def sync( include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, include_redacted_io: bool | Unset = True, -) -> Optional[ExtendedReadSessionRecordWithChildren | HTTPValidationError]: +) -> Optional[HTTPValidationError]: """Get Session Args: @@ -170,7 +160,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExtendedReadSessionRecordWithChildren | HTTPValidationError + HTTPValidationError """ return sync_detailed( @@ -191,7 +181,7 @@ async def asyncio_detailed( include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, include_redacted_io: bool | Unset = True, -) -> Response[ExtendedReadSessionRecordWithChildren | HTTPValidationError]: +) -> Response[HTTPValidationError]: """Get Session Args: @@ -209,7 +199,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExtendedReadSessionRecordWithChildren | HTTPValidationError] + Response[HTTPValidationError] """ kwargs = _get_kwargs( @@ -233,7 +223,7 @@ async def asyncio( include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, include_redacted_io: bool | Unset = True, -) -> Optional[ExtendedReadSessionRecordWithChildren | HTTPValidationError]: +) -> Optional[HTTPValidationError]: """Get Session Args: @@ -251,7 +241,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExtendedReadSessionRecordWithChildren | HTTPValidationError + HTTPValidationError """ return ( diff --git a/src/splunk_ao/resources/api/trace/get_span_projects_project_id_spans_span_id_get.py b/src/splunk_ao/resources/api/trace/get_span_projects_project_id_spans_span_id_get.py index 3afbf18e..52a9a8bf 100644 --- a/src/splunk_ao/resources/api/trace/get_span_projects_project_id_spans_span_id_get.py +++ b/src/splunk_ao/resources/api/trace/get_span_projects_project_id_spans_span_id_get.py @@ -17,13 +17,6 @@ from splunk_ao.utils.headers_data import get_sdk_header from ... import errors -from ...models.extended_agent_span_record_with_children import ExtendedAgentSpanRecordWithChildren -from ...models.extended_control_span_record import ExtendedControlSpanRecord -from ...models.extended_http_span_record_with_children import ExtendedHttpSpanRecordWithChildren -from ...models.extended_llm_span_record import ExtendedLlmSpanRecord -from ...models.extended_retriever_span_record_with_children import ExtendedRetrieverSpanRecordWithChildren -from ...models.extended_tool_span_record_with_children import ExtendedToolSpanRecordWithChildren -from ...models.extended_workflow_span_record_with_children import ExtendedWorkflowSpanRecordWithChildren from ...models.http_validation_error import HTTPValidationError from ...types import UNSET, Response, Unset @@ -63,151 +56,7 @@ def _get_kwargs( return _kwargs -def _parse_response( - *, client: ApiClient, response: httpx.Response -) -> ( - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - | HTTPValidationError -): - if response.status_code == 200: - - def _parse_response_200( - data: object, - ) -> ( - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - ): - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_0 = ExtendedAgentSpanRecordWithChildren.from_dict(data) - - return response_200_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_1 = ExtendedWorkflowSpanRecordWithChildren.from_dict(data) - - return response_200_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_2 = ExtendedLlmSpanRecord.from_dict(data) - - return response_200_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_3 = ExtendedToolSpanRecordWithChildren.from_dict(data) - - return response_200_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_4 = ExtendedRetrieverSpanRecordWithChildren.from_dict(data) - - return response_200_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_5 = ExtendedControlSpanRecord.from_dict(data) - - return response_200_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_6 = ExtendedHttpSpanRecordWithChildren.from_dict(data) - - return response_200_type_6 - except: # noqa: E722 - pass - # If we reach here, none of the parsers succeeded - discriminator_info = f" (type={data.get('type')})" if isinstance(data, dict) and "type" in data else "" - raise ValueError(f"Could not parse union type for response_200{discriminator_info}") - - response_200 = _parse_response_200(response.json()) - - return response_200 - +def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError: if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -231,18 +80,7 @@ def _parse_response_200( raise errors.UnexpectedStatus(response.status_code, response.content) -def _build_response( - *, client: ApiClient, response: httpx.Response -) -> Response[ - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - | HTTPValidationError -]: +def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[HTTPValidationError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -258,16 +96,7 @@ def sync_detailed( client: ApiClient, include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, -) -> Response[ - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - | HTTPValidationError -]: +) -> Response[HTTPValidationError]: """Get Span Args: @@ -281,7 +110,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExtendedAgentSpanRecordWithChildren | ExtendedControlSpanRecord | ExtendedHttpSpanRecordWithChildren | ExtendedLlmSpanRecord | ExtendedRetrieverSpanRecordWithChildren | ExtendedToolSpanRecordWithChildren | ExtendedWorkflowSpanRecordWithChildren | HTTPValidationError] + Response[HTTPValidationError] """ kwargs = _get_kwargs( @@ -303,16 +132,7 @@ def sync( client: ApiClient, include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, -) -> Optional[ - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - | HTTPValidationError -]: +) -> Optional[HTTPValidationError]: """Get Span Args: @@ -326,7 +146,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExtendedAgentSpanRecordWithChildren | ExtendedControlSpanRecord | ExtendedHttpSpanRecordWithChildren | ExtendedLlmSpanRecord | ExtendedRetrieverSpanRecordWithChildren | ExtendedToolSpanRecordWithChildren | ExtendedWorkflowSpanRecordWithChildren | HTTPValidationError + HTTPValidationError """ return sync_detailed( @@ -345,16 +165,7 @@ async def asyncio_detailed( client: ApiClient, include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, -) -> Response[ - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - | HTTPValidationError -]: +) -> Response[HTTPValidationError]: """Get Span Args: @@ -368,7 +179,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExtendedAgentSpanRecordWithChildren | ExtendedControlSpanRecord | ExtendedHttpSpanRecordWithChildren | ExtendedLlmSpanRecord | ExtendedRetrieverSpanRecordWithChildren | ExtendedToolSpanRecordWithChildren | ExtendedWorkflowSpanRecordWithChildren | HTTPValidationError] + Response[HTTPValidationError] """ kwargs = _get_kwargs( @@ -390,16 +201,7 @@ async def asyncio( client: ApiClient, include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, -) -> Optional[ - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - | HTTPValidationError -]: +) -> Optional[HTTPValidationError]: """Get Span Args: @@ -413,7 +215,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExtendedAgentSpanRecordWithChildren | ExtendedControlSpanRecord | ExtendedHttpSpanRecordWithChildren | ExtendedLlmSpanRecord | ExtendedRetrieverSpanRecordWithChildren | ExtendedToolSpanRecordWithChildren | ExtendedWorkflowSpanRecordWithChildren | HTTPValidationError + HTTPValidationError """ return ( diff --git a/src/splunk_ao/resources/api/trace/get_trace_projects_project_id_traces_trace_id_get.py b/src/splunk_ao/resources/api/trace/get_trace_projects_project_id_traces_trace_id_get.py index a05988bb..b81a0ecf 100644 --- a/src/splunk_ao/resources/api/trace/get_trace_projects_project_id_traces_trace_id_get.py +++ b/src/splunk_ao/resources/api/trace/get_trace_projects_project_id_traces_trace_id_get.py @@ -29,6 +29,7 @@ def _get_kwargs( *, include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, + run_id: None | str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -43,6 +44,13 @@ def _get_kwargs( json_access_view_id = access_view_id params["access_view_id"] = json_access_view_id + json_run_id: None | str | Unset + if isinstance(run_id, Unset): + json_run_id = UNSET + else: + json_run_id = run_id + params["run_id"] = json_run_id + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -185,6 +193,7 @@ def sync_detailed( client: ApiClient, include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, + run_id: None | str | Unset = UNSET, ) -> Response[ExtendedTraceRecordWithChildren | StubTraceRecord | HTTPValidationError]: """Get Trace @@ -193,6 +202,7 @@ def sync_detailed( trace_id (str): include_presigned_urls (bool | Unset): Default: False. access_view_id (None | str | Unset): + run_id (None | str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -207,6 +217,7 @@ def sync_detailed( trace_id=trace_id, include_presigned_urls=include_presigned_urls, access_view_id=access_view_id, + run_id=run_id, ) response = client.request(**kwargs) @@ -221,6 +232,7 @@ def sync( client: ApiClient, include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, + run_id: None | str | Unset = UNSET, ) -> Optional[ExtendedTraceRecordWithChildren | StubTraceRecord | HTTPValidationError]: """Get Trace @@ -229,6 +241,7 @@ def sync( trace_id (str): include_presigned_urls (bool | Unset): Default: False. access_view_id (None | str | Unset): + run_id (None | str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -244,6 +257,7 @@ def sync( client=client, include_presigned_urls=include_presigned_urls, access_view_id=access_view_id, + run_id=run_id, ).parsed @@ -254,6 +268,7 @@ async def asyncio_detailed( client: ApiClient, include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, + run_id: None | str | Unset = UNSET, ) -> Response[ExtendedTraceRecordWithChildren | StubTraceRecord | HTTPValidationError]: """Get Trace @@ -262,6 +277,7 @@ async def asyncio_detailed( trace_id (str): include_presigned_urls (bool | Unset): Default: False. access_view_id (None | str | Unset): + run_id (None | str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -276,6 +292,7 @@ async def asyncio_detailed( trace_id=trace_id, include_presigned_urls=include_presigned_urls, access_view_id=access_view_id, + run_id=run_id, ) response = await client.arequest(**kwargs) @@ -290,6 +307,7 @@ async def asyncio( client: ApiClient, include_presigned_urls: bool | Unset = False, access_view_id: None | str | Unset = UNSET, + run_id: None | str | Unset = UNSET, ) -> Optional[ExtendedTraceRecordWithChildren | StubTraceRecord | HTTPValidationError]: """Get Trace @@ -298,6 +316,7 @@ async def asyncio( trace_id (str): include_presigned_urls (bool | Unset): Default: False. access_view_id (None | str | Unset): + run_id (None | str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -314,5 +333,6 @@ async def asyncio( client=client, include_presigned_urls=include_presigned_urls, access_view_id=access_view_id, + run_id=run_id, ) ).parsed diff --git a/src/splunk_ao/resources/api/trace/query_partial_sessions_projects_project_id_sessions_partial_search_post.py b/src/splunk_ao/resources/api/trace/query_partial_sessions_projects_project_id_sessions_partial_search_post.py index a342aa84..5a710194 100644 --- a/src/splunk_ao/resources/api/trace/query_partial_sessions_projects_project_id_sessions_partial_search_post.py +++ b/src/splunk_ao/resources/api/trace/query_partial_sessions_projects_project_id_sessions_partial_search_post.py @@ -19,7 +19,6 @@ from ... import errors from ...models.http_validation_error import HTTPValidationError from ...models.log_records_partial_query_request import LogRecordsPartialQueryRequest -from ...models.log_records_partial_query_response import LogRecordsPartialQueryResponse from ...types import Response @@ -42,14 +41,7 @@ def _get_kwargs(project_id: str, *, body: LogRecordsPartialQueryRequest) -> dict return _kwargs -def _parse_response( - *, client: ApiClient, response: httpx.Response -) -> HTTPValidationError | LogRecordsPartialQueryResponse: - if response.status_code == 200: - response_200 = LogRecordsPartialQueryResponse.from_dict(response.json()) - - return response_200 - +def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError: if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -73,9 +65,7 @@ def _parse_response( raise errors.UnexpectedStatus(response.status_code, response.content) -def _build_response( - *, client: ApiClient, response: httpx.Response -) -> Response[HTTPValidationError | LogRecordsPartialQueryResponse]: +def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[HTTPValidationError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +76,7 @@ def _build_response( def sync_detailed( project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest -) -> Response[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Response[HTTPValidationError]: """Query Partial Sessions Args: @@ -99,7 +89,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsPartialQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, body=body) @@ -109,9 +99,7 @@ def sync_detailed( return _build_response(client=client, response=response) -def sync( - project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest -) -> Optional[HTTPValidationError | LogRecordsPartialQueryResponse]: +def sync(project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest) -> Optional[HTTPValidationError]: """Query Partial Sessions Args: @@ -124,7 +112,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsPartialQueryResponse + HTTPValidationError """ return sync_detailed(project_id=project_id, client=client, body=body).parsed @@ -132,7 +120,7 @@ def sync( async def asyncio_detailed( project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest -) -> Response[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Response[HTTPValidationError]: """Query Partial Sessions Args: @@ -145,7 +133,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsPartialQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, body=body) @@ -157,7 +145,7 @@ async def asyncio_detailed( async def asyncio( project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest -) -> Optional[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Optional[HTTPValidationError]: """Query Partial Sessions Args: @@ -170,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsPartialQueryResponse + HTTPValidationError """ return (await asyncio_detailed(project_id=project_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/trace/query_partial_spans_projects_project_id_spans_partial_search_post.py b/src/splunk_ao/resources/api/trace/query_partial_spans_projects_project_id_spans_partial_search_post.py index c2d7eeb5..f6a3e107 100644 --- a/src/splunk_ao/resources/api/trace/query_partial_spans_projects_project_id_spans_partial_search_post.py +++ b/src/splunk_ao/resources/api/trace/query_partial_spans_projects_project_id_spans_partial_search_post.py @@ -19,7 +19,6 @@ from ... import errors from ...models.http_validation_error import HTTPValidationError from ...models.log_records_partial_query_request import LogRecordsPartialQueryRequest -from ...models.log_records_partial_query_response import LogRecordsPartialQueryResponse from ...types import Response @@ -42,14 +41,7 @@ def _get_kwargs(project_id: str, *, body: LogRecordsPartialQueryRequest) -> dict return _kwargs -def _parse_response( - *, client: ApiClient, response: httpx.Response -) -> HTTPValidationError | LogRecordsPartialQueryResponse: - if response.status_code == 200: - response_200 = LogRecordsPartialQueryResponse.from_dict(response.json()) - - return response_200 - +def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError: if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -73,9 +65,7 @@ def _parse_response( raise errors.UnexpectedStatus(response.status_code, response.content) -def _build_response( - *, client: ApiClient, response: httpx.Response -) -> Response[HTTPValidationError | LogRecordsPartialQueryResponse]: +def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[HTTPValidationError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +76,7 @@ def _build_response( def sync_detailed( project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest -) -> Response[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Response[HTTPValidationError]: """Query Partial Spans Args: @@ -99,7 +89,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsPartialQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, body=body) @@ -109,9 +99,7 @@ def sync_detailed( return _build_response(client=client, response=response) -def sync( - project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest -) -> Optional[HTTPValidationError | LogRecordsPartialQueryResponse]: +def sync(project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest) -> Optional[HTTPValidationError]: """Query Partial Spans Args: @@ -124,7 +112,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsPartialQueryResponse + HTTPValidationError """ return sync_detailed(project_id=project_id, client=client, body=body).parsed @@ -132,7 +120,7 @@ def sync( async def asyncio_detailed( project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest -) -> Response[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Response[HTTPValidationError]: """Query Partial Spans Args: @@ -145,7 +133,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsPartialQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, body=body) @@ -157,7 +145,7 @@ async def asyncio_detailed( async def asyncio( project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest -) -> Optional[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Optional[HTTPValidationError]: """Query Partial Spans Args: @@ -170,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsPartialQueryResponse + HTTPValidationError """ return (await asyncio_detailed(project_id=project_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/trace/query_partial_traces_projects_project_id_traces_partial_search_post.py b/src/splunk_ao/resources/api/trace/query_partial_traces_projects_project_id_traces_partial_search_post.py index 0ad6ac3a..874fd5f6 100644 --- a/src/splunk_ao/resources/api/trace/query_partial_traces_projects_project_id_traces_partial_search_post.py +++ b/src/splunk_ao/resources/api/trace/query_partial_traces_projects_project_id_traces_partial_search_post.py @@ -19,7 +19,6 @@ from ... import errors from ...models.http_validation_error import HTTPValidationError from ...models.log_records_partial_query_request import LogRecordsPartialQueryRequest -from ...models.log_records_partial_query_response import LogRecordsPartialQueryResponse from ...types import Response @@ -42,14 +41,7 @@ def _get_kwargs(project_id: str, *, body: LogRecordsPartialQueryRequest) -> dict return _kwargs -def _parse_response( - *, client: ApiClient, response: httpx.Response -) -> HTTPValidationError | LogRecordsPartialQueryResponse: - if response.status_code == 200: - response_200 = LogRecordsPartialQueryResponse.from_dict(response.json()) - - return response_200 - +def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError: if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -73,9 +65,7 @@ def _parse_response( raise errors.UnexpectedStatus(response.status_code, response.content) -def _build_response( - *, client: ApiClient, response: httpx.Response -) -> Response[HTTPValidationError | LogRecordsPartialQueryResponse]: +def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[HTTPValidationError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +76,7 @@ def _build_response( def sync_detailed( project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest -) -> Response[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Response[HTTPValidationError]: """Query Partial Traces Args: @@ -99,7 +89,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsPartialQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, body=body) @@ -109,9 +99,7 @@ def sync_detailed( return _build_response(client=client, response=response) -def sync( - project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest -) -> Optional[HTTPValidationError | LogRecordsPartialQueryResponse]: +def sync(project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest) -> Optional[HTTPValidationError]: """Query Partial Traces Args: @@ -124,7 +112,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsPartialQueryResponse + HTTPValidationError """ return sync_detailed(project_id=project_id, client=client, body=body).parsed @@ -132,7 +120,7 @@ def sync( async def asyncio_detailed( project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest -) -> Response[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Response[HTTPValidationError]: """Query Partial Traces Args: @@ -145,7 +133,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsPartialQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, body=body) @@ -157,7 +145,7 @@ async def asyncio_detailed( async def asyncio( project_id: str, *, client: ApiClient, body: LogRecordsPartialQueryRequest -) -> Optional[HTTPValidationError | LogRecordsPartialQueryResponse]: +) -> Optional[HTTPValidationError]: """Query Partial Traces Args: @@ -170,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsPartialQueryResponse + HTTPValidationError """ return (await asyncio_detailed(project_id=project_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/trace/query_sessions_projects_project_id_sessions_search_post.py b/src/splunk_ao/resources/api/trace/query_sessions_projects_project_id_sessions_search_post.py index c4cb8d42..507bf3c4 100644 --- a/src/splunk_ao/resources/api/trace/query_sessions_projects_project_id_sessions_search_post.py +++ b/src/splunk_ao/resources/api/trace/query_sessions_projects_project_id_sessions_search_post.py @@ -19,7 +19,6 @@ from ... import errors from ...models.http_validation_error import HTTPValidationError from ...models.log_records_query_request import LogRecordsQueryRequest -from ...models.log_records_query_response import LogRecordsQueryResponse from ...types import Response @@ -42,12 +41,7 @@ def _get_kwargs(project_id: str, *, body: LogRecordsQueryRequest) -> dict[str, A return _kwargs -def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | LogRecordsQueryResponse: - if response.status_code == 200: - response_200 = LogRecordsQueryResponse.from_dict(response.json()) - - return response_200 - +def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError: if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -71,9 +65,7 @@ def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValid raise errors.UnexpectedStatus(response.status_code, response.content) -def _build_response( - *, client: ApiClient, response: httpx.Response -) -> Response[HTTPValidationError | LogRecordsQueryResponse]: +def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[HTTPValidationError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,9 +74,7 @@ def _build_response( ) -def sync_detailed( - project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest -) -> Response[HTTPValidationError | LogRecordsQueryResponse]: +def sync_detailed(project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest) -> Response[HTTPValidationError]: """Query Sessions Args: @@ -96,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, body=body) @@ -106,9 +96,7 @@ def sync_detailed( return _build_response(client=client, response=response) -def sync( - project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest -) -> Optional[HTTPValidationError | LogRecordsQueryResponse]: +def sync(project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest) -> Optional[HTTPValidationError]: """Query Sessions Args: @@ -120,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsQueryResponse + HTTPValidationError """ return sync_detailed(project_id=project_id, client=client, body=body).parsed @@ -128,7 +116,7 @@ def sync( async def asyncio_detailed( project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest -) -> Response[HTTPValidationError | LogRecordsQueryResponse]: +) -> Response[HTTPValidationError]: """Query Sessions Args: @@ -140,7 +128,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, body=body) @@ -150,9 +138,7 @@ async def asyncio_detailed( return _build_response(client=client, response=response) -async def asyncio( - project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest -) -> Optional[HTTPValidationError | LogRecordsQueryResponse]: +async def asyncio(project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest) -> Optional[HTTPValidationError]: """Query Sessions Args: @@ -164,7 +150,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsQueryResponse + HTTPValidationError """ return (await asyncio_detailed(project_id=project_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/trace/query_spans_projects_project_id_spans_search_post.py b/src/splunk_ao/resources/api/trace/query_spans_projects_project_id_spans_search_post.py index 7ed9bab6..a4952fab 100644 --- a/src/splunk_ao/resources/api/trace/query_spans_projects_project_id_spans_search_post.py +++ b/src/splunk_ao/resources/api/trace/query_spans_projects_project_id_spans_search_post.py @@ -19,7 +19,6 @@ from ... import errors from ...models.http_validation_error import HTTPValidationError from ...models.log_records_query_request import LogRecordsQueryRequest -from ...models.log_records_query_response import LogRecordsQueryResponse from ...types import Response @@ -42,12 +41,7 @@ def _get_kwargs(project_id: str, *, body: LogRecordsQueryRequest) -> dict[str, A return _kwargs -def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | LogRecordsQueryResponse: - if response.status_code == 200: - response_200 = LogRecordsQueryResponse.from_dict(response.json()) - - return response_200 - +def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError: if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -71,9 +65,7 @@ def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValid raise errors.UnexpectedStatus(response.status_code, response.content) -def _build_response( - *, client: ApiClient, response: httpx.Response -) -> Response[HTTPValidationError | LogRecordsQueryResponse]: +def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[HTTPValidationError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,9 +74,7 @@ def _build_response( ) -def sync_detailed( - project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest -) -> Response[HTTPValidationError | LogRecordsQueryResponse]: +def sync_detailed(project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest) -> Response[HTTPValidationError]: """Query Spans Args: @@ -96,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, body=body) @@ -106,9 +96,7 @@ def sync_detailed( return _build_response(client=client, response=response) -def sync( - project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest -) -> Optional[HTTPValidationError | LogRecordsQueryResponse]: +def sync(project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest) -> Optional[HTTPValidationError]: """Query Spans Args: @@ -120,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsQueryResponse + HTTPValidationError """ return sync_detailed(project_id=project_id, client=client, body=body).parsed @@ -128,7 +116,7 @@ def sync( async def asyncio_detailed( project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest -) -> Response[HTTPValidationError | LogRecordsQueryResponse]: +) -> Response[HTTPValidationError]: """Query Spans Args: @@ -140,7 +128,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, body=body) @@ -150,9 +138,7 @@ async def asyncio_detailed( return _build_response(client=client, response=response) -async def asyncio( - project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest -) -> Optional[HTTPValidationError | LogRecordsQueryResponse]: +async def asyncio(project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest) -> Optional[HTTPValidationError]: """Query Spans Args: @@ -164,7 +150,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsQueryResponse + HTTPValidationError """ return (await asyncio_detailed(project_id=project_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/api/trace/query_traces_projects_project_id_traces_search_post.py b/src/splunk_ao/resources/api/trace/query_traces_projects_project_id_traces_search_post.py index 29f02f95..ed92774f 100644 --- a/src/splunk_ao/resources/api/trace/query_traces_projects_project_id_traces_search_post.py +++ b/src/splunk_ao/resources/api/trace/query_traces_projects_project_id_traces_search_post.py @@ -19,7 +19,6 @@ from ... import errors from ...models.http_validation_error import HTTPValidationError from ...models.log_records_query_request import LogRecordsQueryRequest -from ...models.log_records_query_response import LogRecordsQueryResponse from ...types import Response @@ -42,12 +41,7 @@ def _get_kwargs(project_id: str, *, body: LogRecordsQueryRequest) -> dict[str, A return _kwargs -def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError | LogRecordsQueryResponse: - if response.status_code == 200: - response_200 = LogRecordsQueryResponse.from_dict(response.json()) - - return response_200 - +def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValidationError: if response.status_code == 422: response_422 = HTTPValidationError.from_dict(response.json()) @@ -71,9 +65,7 @@ def _parse_response(*, client: ApiClient, response: httpx.Response) -> HTTPValid raise errors.UnexpectedStatus(response.status_code, response.content) -def _build_response( - *, client: ApiClient, response: httpx.Response -) -> Response[HTTPValidationError | LogRecordsQueryResponse]: +def _build_response(*, client: ApiClient, response: httpx.Response) -> Response[HTTPValidationError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,9 +74,7 @@ def _build_response( ) -def sync_detailed( - project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest -) -> Response[HTTPValidationError | LogRecordsQueryResponse]: +def sync_detailed(project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest) -> Response[HTTPValidationError]: """Query Traces Args: @@ -96,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, body=body) @@ -106,9 +96,7 @@ def sync_detailed( return _build_response(client=client, response=response) -def sync( - project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest -) -> Optional[HTTPValidationError | LogRecordsQueryResponse]: +def sync(project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest) -> Optional[HTTPValidationError]: """Query Traces Args: @@ -120,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsQueryResponse + HTTPValidationError """ return sync_detailed(project_id=project_id, client=client, body=body).parsed @@ -128,7 +116,7 @@ def sync( async def asyncio_detailed( project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest -) -> Response[HTTPValidationError | LogRecordsQueryResponse]: +) -> Response[HTTPValidationError]: """Query Traces Args: @@ -140,7 +128,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[HTTPValidationError | LogRecordsQueryResponse] + Response[HTTPValidationError] """ kwargs = _get_kwargs(project_id=project_id, body=body) @@ -150,9 +138,7 @@ async def asyncio_detailed( return _build_response(client=client, response=response) -async def asyncio( - project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest -) -> Optional[HTTPValidationError | LogRecordsQueryResponse]: +async def asyncio(project_id: str, *, client: ApiClient, body: LogRecordsQueryRequest) -> Optional[HTTPValidationError]: """Query Traces Args: @@ -164,7 +150,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - HTTPValidationError | LogRecordsQueryResponse + HTTPValidationError """ return (await asyncio_detailed(project_id=project_id, client=client, body=body)).parsed diff --git a/src/splunk_ao/resources/models/__init__.py b/src/splunk_ao/resources/models/__init__.py index 8ce16109..590563ef 100644 --- a/src/splunk_ao/resources/models/__init__.py +++ b/src/splunk_ao/resources/models/__init__.py @@ -4,9 +4,6 @@ from .action_type import ActionType from .add_records_to_queue_request import AddRecordsToQueueRequest from .add_records_to_queue_response import AddRecordsToQueueResponse -from .agent_span import AgentSpan -from .agent_span_dataset_metadata import AgentSpanDatasetMetadata -from .agent_span_user_metadata import AgentSpanUserMetadata from .agent_type import AgentType from .agentic_session_success_scorer import AgenticSessionSuccessScorer from .agentic_session_success_scorer_type import AgenticSessionSuccessScorerType @@ -70,13 +67,13 @@ from .annotation_queue_response import AnnotationQueueResponse from .annotation_queue_response_num_logs_annotated_type_0 import AnnotationQueueResponseNumLogsAnnotatedType0 from .annotation_queue_response_progress_type_0 import AnnotationQueueResponseProgressType0 +from .annotation_queue_settings import AnnotationQueueSettings +from .annotation_queue_settings_response import AnnotationQueueSettingsResponse from .annotation_queue_updated_at_filter import AnnotationQueueUpdatedAtFilter from .annotation_queue_updated_at_filter_operator import AnnotationQueueUpdatedAtFilterOperator from .annotation_queue_updated_at_sort import AnnotationQueueUpdatedAtSort from .annotation_queue_user_collaborator_create import AnnotationQueueUserCollaboratorCreate from .annotation_queue_user_collaborator_update import AnnotationQueueUserCollaboratorUpdate -from .annotation_rating_create import AnnotationRatingCreate -from .annotation_rating_db import AnnotationRatingDB from .annotation_rating_info import AnnotationRatingInfo from .annotation_score_aggregate import AnnotationScoreAggregate from .annotation_star_aggregate import AnnotationStarAggregate @@ -92,6 +89,7 @@ from .annotation_tree_choice_aggregate import AnnotationTreeChoiceAggregate from .annotation_tree_choice_aggregate_counts import AnnotationTreeChoiceAggregateCounts from .annotation_type import AnnotationType +from .annotator_view_span_type import AnnotatorViewSpanType from .anthropic_authentication_type import AnthropicAuthenticationType from .anthropic_integration import AnthropicIntegration from .anthropic_integration_create import AnthropicIntegrationCreate @@ -150,7 +148,6 @@ ) from .billing_usage_data_point import BillingUsageDataPoint from .billing_usage_metric import BillingUsageMetric -from .billing_usage_response import BillingUsageResponse from .body_create_code_scorer_version_scorers_scorer_id_version_code_post import ( BodyCreateCodeScorerVersionScorersScorerIdVersionCodePost, ) @@ -194,6 +191,11 @@ from .choice_rating import ChoiceRating from .code_metric_generation_status import CodeMetricGenerationStatus from .code_metric_generation_status_response import CodeMetricGenerationStatusResponse +from .code_metric_policy_notices_response import CodeMetricPolicyNoticesResponse +from .code_metric_policy_state import CodeMetricPolicyState +from .code_metric_policy_status import CodeMetricPolicyStatus +from .code_metric_policy_status_request import CodeMetricPolicyStatusRequest +from .code_metric_policy_status_response import CodeMetricPolicyStatusResponse from .collaborator_role import CollaboratorRole from .collaborator_role_info import CollaboratorRoleInfo from .collaborator_update import CollaboratorUpdate @@ -215,9 +217,6 @@ from .control_check_stage import ControlCheckStage from .control_resource_action import ControlResourceAction from .control_result import ControlResult -from .control_span import ControlSpan -from .control_span_dataset_metadata import ControlSpanDatasetMetadata -from .control_span_user_metadata import ControlSpanUserMetadata from .correctness_scorer import CorrectnessScorer from .cost_interval import CostInterval from .create_annotation_queue_request import CreateAnnotationQueueRequest @@ -240,7 +239,9 @@ from .create_scorer_request import CreateScorerRequest from .create_scorer_version_request import CreateScorerVersionRequest from .create_update_registered_scorer_response import CreateUpdateRegisteredScorerResponse +from .credit_balance import CreditBalance from .custom_authentication_type import CustomAuthenticationType +from .custom_dashboard_action import CustomDashboardAction from .custom_llm_config import CustomLLMConfig from .custom_llm_config_init_kwargs_type_0 import CustomLLMConfigInitKwargsType0 from .data_type import DataType @@ -297,6 +298,7 @@ from .decision_boolean_criteria import DecisionBooleanCriteria from .decision_choice import DecisionChoice from .decision_level import DecisionLevel +from .decision_model_properties import DecisionModelProperties from .decision_scorer_db import DecisionScorerDB from .decision_scorer_test_configuration import DecisionScorerTestConfiguration from .delete_prompt_response import DeletePromptResponse @@ -333,117 +335,6 @@ from .experiment_update_request import ExperimentUpdateRequest from .experiments_available_columns_response import ExperimentsAvailableColumnsResponse from .export_presigned_url_response import ExportPresignedUrlResponse -from .extended_agent_span_record import ExtendedAgentSpanRecord -from .extended_agent_span_record_annotation_aggregates import ExtendedAgentSpanRecordAnnotationAggregates -from .extended_agent_span_record_annotation_agreement import ExtendedAgentSpanRecordAnnotationAgreement -from .extended_agent_span_record_annotations import ExtendedAgentSpanRecordAnnotations -from .extended_agent_span_record_annotations_additional_property import ( - ExtendedAgentSpanRecordAnnotationsAdditionalProperty, -) -from .extended_agent_span_record_dataset_metadata import ExtendedAgentSpanRecordDatasetMetadata -from .extended_agent_span_record_feedback_rating_info import ExtendedAgentSpanRecordFeedbackRatingInfo -from .extended_agent_span_record_files_type_0 import ExtendedAgentSpanRecordFilesType0 -from .extended_agent_span_record_metric_info_type_0 import ExtendedAgentSpanRecordMetricInfoType0 -from .extended_agent_span_record_user_metadata import ExtendedAgentSpanRecordUserMetadata -from .extended_agent_span_record_with_children import ExtendedAgentSpanRecordWithChildren -from .extended_agent_span_record_with_children_annotation_aggregates import ( - ExtendedAgentSpanRecordWithChildrenAnnotationAggregates, -) -from .extended_agent_span_record_with_children_annotation_agreement import ( - ExtendedAgentSpanRecordWithChildrenAnnotationAgreement, -) -from .extended_agent_span_record_with_children_annotations import ExtendedAgentSpanRecordWithChildrenAnnotations -from .extended_agent_span_record_with_children_annotations_additional_property import ( - ExtendedAgentSpanRecordWithChildrenAnnotationsAdditionalProperty, -) -from .extended_agent_span_record_with_children_dataset_metadata import ( - ExtendedAgentSpanRecordWithChildrenDatasetMetadata, -) -from .extended_agent_span_record_with_children_feedback_rating_info import ( - ExtendedAgentSpanRecordWithChildrenFeedbackRatingInfo, -) -from .extended_agent_span_record_with_children_files_type_0 import ExtendedAgentSpanRecordWithChildrenFilesType0 -from .extended_agent_span_record_with_children_metric_info_type_0 import ( - ExtendedAgentSpanRecordWithChildrenMetricInfoType0, -) -from .extended_agent_span_record_with_children_user_metadata import ExtendedAgentSpanRecordWithChildrenUserMetadata -from .extended_control_span_record import ExtendedControlSpanRecord -from .extended_control_span_record_annotation_aggregates import ExtendedControlSpanRecordAnnotationAggregates -from .extended_control_span_record_annotation_agreement import ExtendedControlSpanRecordAnnotationAgreement -from .extended_control_span_record_annotations import ExtendedControlSpanRecordAnnotations -from .extended_control_span_record_annotations_additional_property import ( - ExtendedControlSpanRecordAnnotationsAdditionalProperty, -) -from .extended_control_span_record_dataset_metadata import ExtendedControlSpanRecordDatasetMetadata -from .extended_control_span_record_feedback_rating_info import ExtendedControlSpanRecordFeedbackRatingInfo -from .extended_control_span_record_files_type_0 import ExtendedControlSpanRecordFilesType0 -from .extended_control_span_record_metric_info_type_0 import ExtendedControlSpanRecordMetricInfoType0 -from .extended_control_span_record_user_metadata import ExtendedControlSpanRecordUserMetadata -from .extended_http_span_record import ExtendedHttpSpanRecord -from .extended_http_span_record_annotation_aggregates import ExtendedHttpSpanRecordAnnotationAggregates -from .extended_http_span_record_annotation_agreement import ExtendedHttpSpanRecordAnnotationAgreement -from .extended_http_span_record_annotations import ExtendedHttpSpanRecordAnnotations -from .extended_http_span_record_annotations_additional_property import ( - ExtendedHttpSpanRecordAnnotationsAdditionalProperty, -) -from .extended_http_span_record_dataset_metadata import ExtendedHttpSpanRecordDatasetMetadata -from .extended_http_span_record_feedback_rating_info import ExtendedHttpSpanRecordFeedbackRatingInfo -from .extended_http_span_record_files_type_0 import ExtendedHttpSpanRecordFilesType0 -from .extended_http_span_record_metric_info_type_0 import ExtendedHttpSpanRecordMetricInfoType0 -from .extended_http_span_record_user_metadata import ExtendedHttpSpanRecordUserMetadata -from .extended_http_span_record_with_children import ExtendedHttpSpanRecordWithChildren -from .extended_http_span_record_with_children_annotation_aggregates import ( - ExtendedHttpSpanRecordWithChildrenAnnotationAggregates, -) -from .extended_http_span_record_with_children_annotation_agreement import ( - ExtendedHttpSpanRecordWithChildrenAnnotationAgreement, -) -from .extended_http_span_record_with_children_annotations import ExtendedHttpSpanRecordWithChildrenAnnotations -from .extended_http_span_record_with_children_annotations_additional_property import ( - ExtendedHttpSpanRecordWithChildrenAnnotationsAdditionalProperty, -) -from .extended_http_span_record_with_children_dataset_metadata import ExtendedHttpSpanRecordWithChildrenDatasetMetadata -from .extended_http_span_record_with_children_feedback_rating_info import ( - ExtendedHttpSpanRecordWithChildrenFeedbackRatingInfo, -) -from .extended_http_span_record_with_children_files_type_0 import ExtendedHttpSpanRecordWithChildrenFilesType0 -from .extended_http_span_record_with_children_metric_info_type_0 import ( - ExtendedHttpSpanRecordWithChildrenMetricInfoType0, -) -from .extended_http_span_record_with_children_user_metadata import ExtendedHttpSpanRecordWithChildrenUserMetadata -from .extended_llm_span_record import ExtendedLlmSpanRecord -from .extended_llm_span_record_annotation_aggregates import ExtendedLlmSpanRecordAnnotationAggregates -from .extended_llm_span_record_annotation_agreement import ExtendedLlmSpanRecordAnnotationAgreement -from .extended_llm_span_record_annotations import ExtendedLlmSpanRecordAnnotations -from .extended_llm_span_record_annotations_additional_property import ExtendedLlmSpanRecordAnnotationsAdditionalProperty -from .extended_llm_span_record_dataset_metadata import ExtendedLlmSpanRecordDatasetMetadata -from .extended_llm_span_record_feedback_rating_info import ExtendedLlmSpanRecordFeedbackRatingInfo -from .extended_llm_span_record_files_type_0 import ExtendedLlmSpanRecordFilesType0 -from .extended_llm_span_record_metric_info_type_0 import ExtendedLlmSpanRecordMetricInfoType0 -from .extended_llm_span_record_tools_type_0_item import ExtendedLlmSpanRecordToolsType0Item -from .extended_llm_span_record_user_metadata import ExtendedLlmSpanRecordUserMetadata -from .extended_read_session_record_with_children import ExtendedReadSessionRecordWithChildren -from .extended_read_session_record_with_children_annotation_aggregates import ( - ExtendedReadSessionRecordWithChildrenAnnotationAggregates, -) -from .extended_read_session_record_with_children_annotation_agreement import ( - ExtendedReadSessionRecordWithChildrenAnnotationAgreement, -) -from .extended_read_session_record_with_children_annotations import ExtendedReadSessionRecordWithChildrenAnnotations -from .extended_read_session_record_with_children_annotations_additional_property import ( - ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty, -) -from .extended_read_session_record_with_children_dataset_metadata import ( - ExtendedReadSessionRecordWithChildrenDatasetMetadata, -) -from .extended_read_session_record_with_children_feedback_rating_info import ( - ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo, -) -from .extended_read_session_record_with_children_files_type_0 import ExtendedReadSessionRecordWithChildrenFilesType0 -from .extended_read_session_record_with_children_metric_info_type_0 import ( - ExtendedReadSessionRecordWithChildrenMetricInfoType0, -) -from .extended_read_session_record_with_children_user_metadata import ExtendedReadSessionRecordWithChildrenUserMetadata from .extended_retriever_span_record import ExtendedRetrieverSpanRecord from .extended_retriever_span_record_annotation_aggregates import ExtendedRetrieverSpanRecordAnnotationAggregates from .extended_retriever_span_record_annotation_agreement import ExtendedRetrieverSpanRecordAnnotationAgreement @@ -480,16 +371,6 @@ from .extended_retriever_span_record_with_children_user_metadata import ( ExtendedRetrieverSpanRecordWithChildrenUserMetadata, ) -from .extended_session_record import ExtendedSessionRecord -from .extended_session_record_annotation_aggregates import ExtendedSessionRecordAnnotationAggregates -from .extended_session_record_annotation_agreement import ExtendedSessionRecordAnnotationAgreement -from .extended_session_record_annotations import ExtendedSessionRecordAnnotations -from .extended_session_record_annotations_additional_property import ExtendedSessionRecordAnnotationsAdditionalProperty -from .extended_session_record_dataset_metadata import ExtendedSessionRecordDatasetMetadata -from .extended_session_record_feedback_rating_info import ExtendedSessionRecordFeedbackRatingInfo -from .extended_session_record_files_type_0 import ExtendedSessionRecordFilesType0 -from .extended_session_record_metric_info_type_0 import ExtendedSessionRecordMetricInfoType0 -from .extended_session_record_user_metadata import ExtendedSessionRecordUserMetadata from .extended_tool_span_record import ExtendedToolSpanRecord from .extended_tool_span_record_annotation_aggregates import ExtendedToolSpanRecordAnnotationAggregates from .extended_tool_span_record_annotation_agreement import ExtendedToolSpanRecordAnnotationAgreement @@ -546,42 +427,6 @@ from .extended_trace_record_with_children_files_type_0 import ExtendedTraceRecordWithChildrenFilesType0 from .extended_trace_record_with_children_metric_info_type_0 import ExtendedTraceRecordWithChildrenMetricInfoType0 from .extended_trace_record_with_children_user_metadata import ExtendedTraceRecordWithChildrenUserMetadata -from .extended_workflow_span_record import ExtendedWorkflowSpanRecord -from .extended_workflow_span_record_annotation_aggregates import ExtendedWorkflowSpanRecordAnnotationAggregates -from .extended_workflow_span_record_annotation_agreement import ExtendedWorkflowSpanRecordAnnotationAgreement -from .extended_workflow_span_record_annotations import ExtendedWorkflowSpanRecordAnnotations -from .extended_workflow_span_record_annotations_additional_property import ( - ExtendedWorkflowSpanRecordAnnotationsAdditionalProperty, -) -from .extended_workflow_span_record_dataset_metadata import ExtendedWorkflowSpanRecordDatasetMetadata -from .extended_workflow_span_record_feedback_rating_info import ExtendedWorkflowSpanRecordFeedbackRatingInfo -from .extended_workflow_span_record_files_type_0 import ExtendedWorkflowSpanRecordFilesType0 -from .extended_workflow_span_record_metric_info_type_0 import ExtendedWorkflowSpanRecordMetricInfoType0 -from .extended_workflow_span_record_user_metadata import ExtendedWorkflowSpanRecordUserMetadata -from .extended_workflow_span_record_with_children import ExtendedWorkflowSpanRecordWithChildren -from .extended_workflow_span_record_with_children_annotation_aggregates import ( - ExtendedWorkflowSpanRecordWithChildrenAnnotationAggregates, -) -from .extended_workflow_span_record_with_children_annotation_agreement import ( - ExtendedWorkflowSpanRecordWithChildrenAnnotationAgreement, -) -from .extended_workflow_span_record_with_children_annotations import ExtendedWorkflowSpanRecordWithChildrenAnnotations -from .extended_workflow_span_record_with_children_annotations_additional_property import ( - ExtendedWorkflowSpanRecordWithChildrenAnnotationsAdditionalProperty, -) -from .extended_workflow_span_record_with_children_dataset_metadata import ( - ExtendedWorkflowSpanRecordWithChildrenDatasetMetadata, -) -from .extended_workflow_span_record_with_children_feedback_rating_info import ( - ExtendedWorkflowSpanRecordWithChildrenFeedbackRatingInfo, -) -from .extended_workflow_span_record_with_children_files_type_0 import ExtendedWorkflowSpanRecordWithChildrenFilesType0 -from .extended_workflow_span_record_with_children_metric_info_type_0 import ( - ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0, -) -from .extended_workflow_span_record_with_children_user_metadata import ( - ExtendedWorkflowSpanRecordWithChildrenUserMetadata, -) from .feature_integration_costs import FeatureIntegrationCosts from .feedback_aggregate import FeedbackAggregate from .feedback_rating_info import FeedbackRatingInfo @@ -628,9 +473,6 @@ from .histogram import Histogram from .histogram_bucket import HistogramBucket from .histogram_strategy import HistogramStrategy -from .http_span import HttpSpan -from .http_span_dataset_metadata import HttpSpanDatasetMetadata -from .http_span_user_metadata import HttpSpanUserMetadata from .http_validation_error import HTTPValidationError from .image_generation_event import ImageGenerationEvent from .image_generation_event_images_type_0_item import ImageGenerationEventImagesType0Item @@ -667,6 +509,7 @@ from .invoke_response_metadata_type_0 import InvokeResponseMetadataType0 from .invoke_response_metric_results import InvokeResponseMetricResults from .job_progress import JobProgress +from .left_out_reason import LeftOutReason from .like_dislike_aggregate import LikeDislikeAggregate from .like_dislike_constraints import LikeDislikeConstraints from .like_dislike_rating import LikeDislikeRating @@ -695,10 +538,7 @@ from .llm_export_format import LLMExportFormat from .llm_integration import LLMIntegration from .llm_metrics import LlmMetrics -from .llm_span import LlmSpan -from .llm_span_dataset_metadata import LlmSpanDatasetMetadata -from .llm_span_tools_type_0_item import LlmSpanToolsType0Item -from .llm_span_user_metadata import LlmSpanUserMetadata +from .llm_scorer_log_record_configuration import LLMScorerLogRecordConfiguration from .log_records_available_columns_request import LogRecordsAvailableColumnsRequest from .log_records_available_columns_response import LogRecordsAvailableColumnsResponse from .log_records_boolean_filter import LogRecordsBooleanFilter @@ -728,15 +568,12 @@ from .log_records_number_filter import LogRecordsNumberFilter from .log_records_number_filter_operator import LogRecordsNumberFilterOperator from .log_records_partial_query_request import LogRecordsPartialQueryRequest -from .log_records_partial_query_response import LogRecordsPartialQueryResponse from .log_records_query_count_request import LogRecordsQueryCountRequest from .log_records_query_count_response import LogRecordsQueryCountResponse from .log_records_query_request import LogRecordsQueryRequest -from .log_records_query_response import LogRecordsQueryResponse from .log_records_sort_clause import LogRecordsSortClause from .log_records_text_filter import LogRecordsTextFilter from .log_records_text_filter_operator import LogRecordsTextFilterOperator -from .log_span_update_request import LogSpanUpdateRequest from .log_span_update_response import LogSpanUpdateResponse from .log_spans_ingest_request import LogSpansIngestRequest from .log_spans_ingest_response import LogSpansIngestResponse @@ -751,6 +588,7 @@ from .logging_method import LoggingMethod from .luna_3_scorer_response import Luna3ScorerResponse from .luna_3_scorer_response_class_name_to_vocab_ix import Luna3ScorerResponseClassNameToVocabIx +from .luna_billing_usage_response import LunaBillingUsageResponse from .luna_dataset_mappings import LunaDatasetMappings from .luna_dataset_mappings_mgt import LunaDatasetMappingsMgt from .luna_dataset_preview import LunaDatasetPreview @@ -811,6 +649,7 @@ from .metric_roll_up_metadata_type_0 import MetricRollUpMetadataType0 from .metric_roll_up_roll_up_metrics import MetricRollUpRollUpMetrics from .metric_roll_up_roll_up_metrics_additional_property_type_1 import MetricRollUpRollUpMetricsAdditionalPropertyType1 +from .metric_settings_conflict_response import MetricSettingsConflictResponse from .metric_settings_request import MetricSettingsRequest from .metric_settings_response import MetricSettingsResponse from .metric_success import MetricSuccess @@ -834,6 +673,8 @@ from .node_name_filter import NodeNameFilter from .node_name_filter_operator import NodeNameFilterOperator from .node_type import NodeType +from .non_luna_billing_usage_response import NonLunaBillingUsageResponse +from .non_luna_billing_usage_response_metric import NonLunaBillingUsageResponseMetric from .not_node_log_records_filter import NotNodeLogRecordsFilter from .numeric_color_constraint import NumericColorConstraint from .numeric_color_constraint_operator import NumericColorConstraintOperator @@ -857,61 +698,6 @@ from .output_toxicity_scorer_type import OutputToxicityScorerType from .output_type_enum import OutputTypeEnum from .override_action import OverrideAction -from .partial_extended_agent_span_record import PartialExtendedAgentSpanRecord -from .partial_extended_agent_span_record_annotation_aggregates import PartialExtendedAgentSpanRecordAnnotationAggregates -from .partial_extended_agent_span_record_annotation_agreement import PartialExtendedAgentSpanRecordAnnotationAgreement -from .partial_extended_agent_span_record_annotations import PartialExtendedAgentSpanRecordAnnotations -from .partial_extended_agent_span_record_annotations_additional_property import ( - PartialExtendedAgentSpanRecordAnnotationsAdditionalProperty, -) -from .partial_extended_agent_span_record_dataset_metadata import PartialExtendedAgentSpanRecordDatasetMetadata -from .partial_extended_agent_span_record_feedback_rating_info import PartialExtendedAgentSpanRecordFeedbackRatingInfo -from .partial_extended_agent_span_record_files_type_0 import PartialExtendedAgentSpanRecordFilesType0 -from .partial_extended_agent_span_record_metric_info_type_0 import PartialExtendedAgentSpanRecordMetricInfoType0 -from .partial_extended_agent_span_record_user_metadata import PartialExtendedAgentSpanRecordUserMetadata -from .partial_extended_control_span_record import PartialExtendedControlSpanRecord -from .partial_extended_control_span_record_annotation_aggregates import ( - PartialExtendedControlSpanRecordAnnotationAggregates, -) -from .partial_extended_control_span_record_annotation_agreement import ( - PartialExtendedControlSpanRecordAnnotationAgreement, -) -from .partial_extended_control_span_record_annotations import PartialExtendedControlSpanRecordAnnotations -from .partial_extended_control_span_record_annotations_additional_property import ( - PartialExtendedControlSpanRecordAnnotationsAdditionalProperty, -) -from .partial_extended_control_span_record_dataset_metadata import PartialExtendedControlSpanRecordDatasetMetadata -from .partial_extended_control_span_record_feedback_rating_info import ( - PartialExtendedControlSpanRecordFeedbackRatingInfo, -) -from .partial_extended_control_span_record_files_type_0 import PartialExtendedControlSpanRecordFilesType0 -from .partial_extended_control_span_record_metric_info_type_0 import PartialExtendedControlSpanRecordMetricInfoType0 -from .partial_extended_control_span_record_user_metadata import PartialExtendedControlSpanRecordUserMetadata -from .partial_extended_http_span_record import PartialExtendedHttpSpanRecord -from .partial_extended_http_span_record_annotation_aggregates import PartialExtendedHttpSpanRecordAnnotationAggregates -from .partial_extended_http_span_record_annotation_agreement import PartialExtendedHttpSpanRecordAnnotationAgreement -from .partial_extended_http_span_record_annotations import PartialExtendedHttpSpanRecordAnnotations -from .partial_extended_http_span_record_annotations_additional_property import ( - PartialExtendedHttpSpanRecordAnnotationsAdditionalProperty, -) -from .partial_extended_http_span_record_dataset_metadata import PartialExtendedHttpSpanRecordDatasetMetadata -from .partial_extended_http_span_record_feedback_rating_info import PartialExtendedHttpSpanRecordFeedbackRatingInfo -from .partial_extended_http_span_record_files_type_0 import PartialExtendedHttpSpanRecordFilesType0 -from .partial_extended_http_span_record_metric_info_type_0 import PartialExtendedHttpSpanRecordMetricInfoType0 -from .partial_extended_http_span_record_user_metadata import PartialExtendedHttpSpanRecordUserMetadata -from .partial_extended_llm_span_record import PartialExtendedLlmSpanRecord -from .partial_extended_llm_span_record_annotation_aggregates import PartialExtendedLlmSpanRecordAnnotationAggregates -from .partial_extended_llm_span_record_annotation_agreement import PartialExtendedLlmSpanRecordAnnotationAgreement -from .partial_extended_llm_span_record_annotations import PartialExtendedLlmSpanRecordAnnotations -from .partial_extended_llm_span_record_annotations_additional_property import ( - PartialExtendedLlmSpanRecordAnnotationsAdditionalProperty, -) -from .partial_extended_llm_span_record_dataset_metadata import PartialExtendedLlmSpanRecordDatasetMetadata -from .partial_extended_llm_span_record_feedback_rating_info import PartialExtendedLlmSpanRecordFeedbackRatingInfo -from .partial_extended_llm_span_record_files_type_0 import PartialExtendedLlmSpanRecordFilesType0 -from .partial_extended_llm_span_record_metric_info_type_0 import PartialExtendedLlmSpanRecordMetricInfoType0 -from .partial_extended_llm_span_record_tools_type_0_item import PartialExtendedLlmSpanRecordToolsType0Item -from .partial_extended_llm_span_record_user_metadata import PartialExtendedLlmSpanRecordUserMetadata from .partial_extended_retriever_span_record import PartialExtendedRetrieverSpanRecord from .partial_extended_retriever_span_record_annotation_aggregates import ( PartialExtendedRetrieverSpanRecordAnnotationAggregates, @@ -930,18 +716,6 @@ from .partial_extended_retriever_span_record_files_type_0 import PartialExtendedRetrieverSpanRecordFilesType0 from .partial_extended_retriever_span_record_metric_info_type_0 import PartialExtendedRetrieverSpanRecordMetricInfoType0 from .partial_extended_retriever_span_record_user_metadata import PartialExtendedRetrieverSpanRecordUserMetadata -from .partial_extended_session_record import PartialExtendedSessionRecord -from .partial_extended_session_record_annotation_aggregates import PartialExtendedSessionRecordAnnotationAggregates -from .partial_extended_session_record_annotation_agreement import PartialExtendedSessionRecordAnnotationAgreement -from .partial_extended_session_record_annotations import PartialExtendedSessionRecordAnnotations -from .partial_extended_session_record_annotations_additional_property import ( - PartialExtendedSessionRecordAnnotationsAdditionalProperty, -) -from .partial_extended_session_record_dataset_metadata import PartialExtendedSessionRecordDatasetMetadata -from .partial_extended_session_record_feedback_rating_info import PartialExtendedSessionRecordFeedbackRatingInfo -from .partial_extended_session_record_files_type_0 import PartialExtendedSessionRecordFilesType0 -from .partial_extended_session_record_metric_info_type_0 import PartialExtendedSessionRecordMetricInfoType0 -from .partial_extended_session_record_user_metadata import PartialExtendedSessionRecordUserMetadata from .partial_extended_tool_span_record import PartialExtendedToolSpanRecord from .partial_extended_tool_span_record_annotation_aggregates import PartialExtendedToolSpanRecordAnnotationAggregates from .partial_extended_tool_span_record_annotation_agreement import PartialExtendedToolSpanRecordAnnotationAgreement @@ -966,27 +740,10 @@ from .partial_extended_trace_record_files_type_0 import PartialExtendedTraceRecordFilesType0 from .partial_extended_trace_record_metric_info_type_0 import PartialExtendedTraceRecordMetricInfoType0 from .partial_extended_trace_record_user_metadata import PartialExtendedTraceRecordUserMetadata -from .partial_extended_workflow_span_record import PartialExtendedWorkflowSpanRecord -from .partial_extended_workflow_span_record_annotation_aggregates import ( - PartialExtendedWorkflowSpanRecordAnnotationAggregates, -) -from .partial_extended_workflow_span_record_annotation_agreement import ( - PartialExtendedWorkflowSpanRecordAnnotationAgreement, -) -from .partial_extended_workflow_span_record_annotations import PartialExtendedWorkflowSpanRecordAnnotations -from .partial_extended_workflow_span_record_annotations_additional_property import ( - PartialExtendedWorkflowSpanRecordAnnotationsAdditionalProperty, -) -from .partial_extended_workflow_span_record_dataset_metadata import PartialExtendedWorkflowSpanRecordDatasetMetadata -from .partial_extended_workflow_span_record_feedback_rating_info import ( - PartialExtendedWorkflowSpanRecordFeedbackRatingInfo, -) -from .partial_extended_workflow_span_record_files_type_0 import PartialExtendedWorkflowSpanRecordFilesType0 -from .partial_extended_workflow_span_record_metric_info_type_0 import PartialExtendedWorkflowSpanRecordMetricInfoType0 -from .partial_extended_workflow_span_record_user_metadata import PartialExtendedWorkflowSpanRecordUserMetadata from .passthrough_action import PassthroughAction from .payload import Payload from .permission import Permission +from .policy_package_notice import PolicyPackageNotice from .preview_dataset_request import PreviewDatasetRequest from .project_action import ProjectAction from .project_billing_usage import ProjectBillingUsage @@ -1068,6 +825,7 @@ from .recompute_log_records_metrics_request import RecomputeLogRecordsMetricsRequest from .registered_scorer_action import RegisteredScorerAction from .registered_scorer_task_result_response import RegisteredScorerTaskResultResponse +from .registered_scorer_validation_stage import RegisteredScorerValidationStage from .remove_records_from_queue_request import RemoveRecordsFromQueueRequest from .remove_records_from_queue_response import RemoveRecordsFromQueueResponse from .render_template_request import RenderTemplateRequest @@ -1093,6 +851,11 @@ from .run_created_by_filter_operator import RunCreatedByFilterOperator from .run_db import RunDB from .run_db_thin import RunDBThin +from .run_enabled_evaluator import RunEnabledEvaluator +from .run_evaluator_binding import RunEvaluatorBinding +from .run_evaluators_enabled import RunEvaluatorsEnabled +from .run_evaluators_inspection import RunEvaluatorsInspection +from .run_evaluators_request import RunEvaluatorsRequest from .run_id_filter import RunIDFilter from .run_id_filter_operator import RunIDFilterOperator from .run_name_filter import RunNameFilter @@ -1109,16 +872,22 @@ from .runtime_scorer_config import RuntimeScorerConfig from .runtime_scorer_config_class_name_to_vocab_ix_type_0 import RuntimeScorerConfigClassNameToVocabIxType0 from .runtime_scorer_config_class_name_to_vocab_ix_type_1 import RuntimeScorerConfigClassNameToVocabIxType1 +from .saved_evaluator_reference import SavedEvaluatorReference from .score_aggregate import ScoreAggregate from .score_bucket import ScoreBucket from .score_constraints import ScoreConstraints from .score_rating import ScoreRating from .scorer_action import ScorerAction +from .scorer_catalog_version_response import ScorerCatalogVersionResponse +from .scorer_catalog_version_response_luna_validation_contract_type_0 import ( + ScorerCatalogVersionResponseLunaValidationContractType0, +) from .scorer_created_at_filter import ScorerCreatedAtFilter from .scorer_created_at_filter_operator import ScorerCreatedAtFilterOperator from .scorer_creator_filter import ScorerCreatorFilter from .scorer_creator_filter_operator import ScorerCreatorFilterOperator from .scorer_defaults import ScorerDefaults +from .scorer_defaults_request import ScorerDefaultsRequest from .scorer_enabled_in_playground_sort import ScorerEnabledInPlaygroundSort from .scorer_enabled_in_run_sort import ScorerEnabledInRunSort from .scorer_environment import ScorerEnvironment @@ -1135,6 +904,7 @@ from .scorer_is_global_filter_operator import ScorerIsGlobalFilterOperator from .scorer_label_filter import ScorerLabelFilter from .scorer_label_filter_operator import ScorerLabelFilterOperator +from .scorer_metadata_selection import ScorerMetadataSelection from .scorer_model_type_filter import ScorerModelTypeFilter from .scorer_model_type_filter_operator import ScorerModelTypeFilterOperator from .scorer_multimodal_capabilities_filter import ScorerMultimodalCapabilitiesFilter @@ -1143,6 +913,12 @@ from .scorer_name_filter import ScorerNameFilter from .scorer_name_filter_operator import ScorerNameFilterOperator from .scorer_name_sort import ScorerNameSort +from .scorer_prompt_message import ScorerPromptMessage +from .scorer_prompt_message_content_type_1_item import ScorerPromptMessageContentType1Item +from .scorer_prompt_preview_response import ScorerPromptPreviewResponse +from .scorer_prompt_preview_response_normalized_input_item import ScorerPromptPreviewResponseNormalizedInputItem +from .scorer_prompt_preview_unavailable_reason import ScorerPromptPreviewUnavailableReason +from .scorer_prompt_preview_unavailable_response import ScorerPromptPreviewUnavailableResponse from .scorer_response import ScorerResponse from .scorer_scope_project_ref import ScorerScopeProjectRef from .scorer_scope_projects_filter import ScorerScopeProjectsFilter @@ -1165,6 +941,10 @@ from .session_create_request import SessionCreateRequest from .session_create_request_user_metadata_type_0 import SessionCreateRequestUserMetadataType0 from .session_create_response import SessionCreateResponse +from .span_input_selection import SpanInputSelection +from .span_input_selection_fields_item import SpanInputSelectionFieldsItem +from .span_input_selection_request import SpanInputSelectionRequest +from .span_input_selection_request_fields_item import SpanInputSelectionRequestFieldsItem from .stage_db import StageDB from .stage_metadata import StageMetadata from .stage_rulesets_response import StageRulesetsResponse @@ -1199,6 +979,7 @@ from .text_content_part import TextContentPart from .text_rating import TextRating from .token import Token +from .tokenomics_delegation_action import TokenomicsDelegationAction from .tool_call import ToolCall from .tool_call_function import ToolCallFunction from .tool_error_rate_scorer import ToolErrorRateScorer @@ -1222,6 +1003,7 @@ from .type_safe_integration_create import TypeSafeIntegrationCreate from .type_safe_integration_extra_type_0 import TypeSafeIntegrationExtraType0 from .update_annotation_queue_request import UpdateAnnotationQueueRequest +from .update_annotation_queue_settings_request import UpdateAnnotationQueueSettingsRequest from .update_dataset_content_request import UpdateDatasetContentRequest from .update_dataset_request import UpdateDatasetRequest from .update_dataset_version_request import UpdateDatasetVersionRequest @@ -1235,6 +1017,7 @@ from .user_collaborator_create import UserCollaboratorCreate from .user_db import UserDB from .user_info import UserInfo +from .user_lifecycle_state import UserLifecycleState from .user_role import UserRole from .valid_result import ValidResult from .valid_result_score_type import ValidResultScoreType @@ -1257,12 +1040,10 @@ from .vertex_ai_integration_extra_type_0 import VertexAIIntegrationExtraType0 from .vertex_aigcs_config import VertexAIGCSConfig from .vertex_aigcs_config_response import VertexAIGCSConfigResponse +from .violation_reason import ViolationReason from .web_search_action import WebSearchAction from .web_search_call_event import WebSearchCallEvent from .web_search_call_event_metadata_type_0 import WebSearchCallEventMetadataType0 -from .workflow_span import WorkflowSpan -from .workflow_span_dataset_metadata import WorkflowSpanDatasetMetadata -from .workflow_span_user_metadata import WorkflowSpanUserMetadata from .write_health_score_request import WriteHealthScoreRequest from .write_health_score_request_secondary_type_0 import WriteHealthScoreRequestSecondaryType0 from .writer_integration import WriterIntegration @@ -1278,9 +1059,6 @@ "AgenticSessionSuccessScorerType", "AgenticWorkflowSuccessScorer", "AgenticWorkflowSuccessScorerType", - "AgentSpan", - "AgentSpanDatasetMetadata", - "AgentSpanUserMetadata", "AgentType", "AggregatedTraceViewEdge", "AggregatedTraceViewGraph", @@ -1334,13 +1112,13 @@ "AnnotationQueueResponse", "AnnotationQueueResponseNumLogsAnnotatedType0", "AnnotationQueueResponseProgressType0", + "AnnotationQueueSettings", + "AnnotationQueueSettingsResponse", "AnnotationQueueUpdatedAtFilter", "AnnotationQueueUpdatedAtFilterOperator", "AnnotationQueueUpdatedAtSort", "AnnotationQueueUserCollaboratorCreate", "AnnotationQueueUserCollaboratorUpdate", - "AnnotationRatingCreate", - "AnnotationRatingDB", "AnnotationRatingInfo", "AnnotationScoreAggregate", "AnnotationStarAggregate", @@ -1356,6 +1134,7 @@ "AnnotationTreeChoiceAggregate", "AnnotationTreeChoiceAggregateCounts", "AnnotationType", + "AnnotatorViewSpanType", "AnthropicAuthenticationType", "AnthropicIntegration", "AnthropicIntegrationCreate", @@ -1410,7 +1189,6 @@ "BaseScorerVersionResponseLunaValidationContractType0", "BillingUsageDataPoint", "BillingUsageMetric", - "BillingUsageResponse", "BodyCreateCodeScorerVersionScorersScorerIdVersionCodePost", "BodyCreateDatasetDatasetsPost", "BodyLoginEmailLoginPost", @@ -1442,6 +1220,11 @@ "ChoiceRating", "CodeMetricGenerationStatus", "CodeMetricGenerationStatusResponse", + "CodeMetricPolicyNoticesResponse", + "CodeMetricPolicyState", + "CodeMetricPolicyStatus", + "CodeMetricPolicyStatusRequest", + "CodeMetricPolicyStatusResponse", "CollaboratorRole", "CollaboratorRoleInfo", "CollaboratorUpdate", @@ -1463,9 +1246,6 @@ "ControlCheckStage", "ControlResourceAction", "ControlResult", - "ControlSpan", - "ControlSpanDatasetMetadata", - "ControlSpanUserMetadata", "CorrectnessScorer", "CostInterval", "CreateAnnotationQueueRequest", @@ -1486,7 +1266,9 @@ "CreateScorerRequest", "CreateScorerVersionRequest", "CreateUpdateRegisteredScorerResponse", + "CreditBalance", "CustomAuthenticationType", + "CustomDashboardAction", "CustomLLMConfig", "CustomLLMConfigInitKwargsType0", "DatabricksIntegration", @@ -1543,6 +1325,7 @@ "DecisionBooleanCriteria", "DecisionChoice", "DecisionLevel", + "DecisionModelProperties", "DecisionScorerDB", "DecisionScorerTestConfiguration", "DeletePromptResponse", @@ -1577,77 +1360,6 @@ "ExperimentStatus", "ExperimentUpdateRequest", "ExportPresignedUrlResponse", - "ExtendedAgentSpanRecord", - "ExtendedAgentSpanRecordAnnotationAggregates", - "ExtendedAgentSpanRecordAnnotationAgreement", - "ExtendedAgentSpanRecordAnnotations", - "ExtendedAgentSpanRecordAnnotationsAdditionalProperty", - "ExtendedAgentSpanRecordDatasetMetadata", - "ExtendedAgentSpanRecordFeedbackRatingInfo", - "ExtendedAgentSpanRecordFilesType0", - "ExtendedAgentSpanRecordMetricInfoType0", - "ExtendedAgentSpanRecordUserMetadata", - "ExtendedAgentSpanRecordWithChildren", - "ExtendedAgentSpanRecordWithChildrenAnnotationAggregates", - "ExtendedAgentSpanRecordWithChildrenAnnotationAgreement", - "ExtendedAgentSpanRecordWithChildrenAnnotations", - "ExtendedAgentSpanRecordWithChildrenAnnotationsAdditionalProperty", - "ExtendedAgentSpanRecordWithChildrenDatasetMetadata", - "ExtendedAgentSpanRecordWithChildrenFeedbackRatingInfo", - "ExtendedAgentSpanRecordWithChildrenFilesType0", - "ExtendedAgentSpanRecordWithChildrenMetricInfoType0", - "ExtendedAgentSpanRecordWithChildrenUserMetadata", - "ExtendedControlSpanRecord", - "ExtendedControlSpanRecordAnnotationAggregates", - "ExtendedControlSpanRecordAnnotationAgreement", - "ExtendedControlSpanRecordAnnotations", - "ExtendedControlSpanRecordAnnotationsAdditionalProperty", - "ExtendedControlSpanRecordDatasetMetadata", - "ExtendedControlSpanRecordFeedbackRatingInfo", - "ExtendedControlSpanRecordFilesType0", - "ExtendedControlSpanRecordMetricInfoType0", - "ExtendedControlSpanRecordUserMetadata", - "ExtendedHttpSpanRecord", - "ExtendedHttpSpanRecordAnnotationAggregates", - "ExtendedHttpSpanRecordAnnotationAgreement", - "ExtendedHttpSpanRecordAnnotations", - "ExtendedHttpSpanRecordAnnotationsAdditionalProperty", - "ExtendedHttpSpanRecordDatasetMetadata", - "ExtendedHttpSpanRecordFeedbackRatingInfo", - "ExtendedHttpSpanRecordFilesType0", - "ExtendedHttpSpanRecordMetricInfoType0", - "ExtendedHttpSpanRecordUserMetadata", - "ExtendedHttpSpanRecordWithChildren", - "ExtendedHttpSpanRecordWithChildrenAnnotationAggregates", - "ExtendedHttpSpanRecordWithChildrenAnnotationAgreement", - "ExtendedHttpSpanRecordWithChildrenAnnotations", - "ExtendedHttpSpanRecordWithChildrenAnnotationsAdditionalProperty", - "ExtendedHttpSpanRecordWithChildrenDatasetMetadata", - "ExtendedHttpSpanRecordWithChildrenFeedbackRatingInfo", - "ExtendedHttpSpanRecordWithChildrenFilesType0", - "ExtendedHttpSpanRecordWithChildrenMetricInfoType0", - "ExtendedHttpSpanRecordWithChildrenUserMetadata", - "ExtendedLlmSpanRecord", - "ExtendedLlmSpanRecordAnnotationAggregates", - "ExtendedLlmSpanRecordAnnotationAgreement", - "ExtendedLlmSpanRecordAnnotations", - "ExtendedLlmSpanRecordAnnotationsAdditionalProperty", - "ExtendedLlmSpanRecordDatasetMetadata", - "ExtendedLlmSpanRecordFeedbackRatingInfo", - "ExtendedLlmSpanRecordFilesType0", - "ExtendedLlmSpanRecordMetricInfoType0", - "ExtendedLlmSpanRecordToolsType0Item", - "ExtendedLlmSpanRecordUserMetadata", - "ExtendedReadSessionRecordWithChildren", - "ExtendedReadSessionRecordWithChildrenAnnotationAggregates", - "ExtendedReadSessionRecordWithChildrenAnnotationAgreement", - "ExtendedReadSessionRecordWithChildrenAnnotations", - "ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty", - "ExtendedReadSessionRecordWithChildrenDatasetMetadata", - "ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo", - "ExtendedReadSessionRecordWithChildrenFilesType0", - "ExtendedReadSessionRecordWithChildrenMetricInfoType0", - "ExtendedReadSessionRecordWithChildrenUserMetadata", "ExtendedRetrieverSpanRecord", "ExtendedRetrieverSpanRecordAnnotationAggregates", "ExtendedRetrieverSpanRecordAnnotationAgreement", @@ -1668,16 +1380,6 @@ "ExtendedRetrieverSpanRecordWithChildrenFilesType0", "ExtendedRetrieverSpanRecordWithChildrenMetricInfoType0", "ExtendedRetrieverSpanRecordWithChildrenUserMetadata", - "ExtendedSessionRecord", - "ExtendedSessionRecordAnnotationAggregates", - "ExtendedSessionRecordAnnotationAgreement", - "ExtendedSessionRecordAnnotations", - "ExtendedSessionRecordAnnotationsAdditionalProperty", - "ExtendedSessionRecordDatasetMetadata", - "ExtendedSessionRecordFeedbackRatingInfo", - "ExtendedSessionRecordFilesType0", - "ExtendedSessionRecordMetricInfoType0", - "ExtendedSessionRecordUserMetadata", "ExtendedToolSpanRecord", "ExtendedToolSpanRecordAnnotationAggregates", "ExtendedToolSpanRecordAnnotationAgreement", @@ -1718,26 +1420,6 @@ "ExtendedTraceRecordWithChildrenFilesType0", "ExtendedTraceRecordWithChildrenMetricInfoType0", "ExtendedTraceRecordWithChildrenUserMetadata", - "ExtendedWorkflowSpanRecord", - "ExtendedWorkflowSpanRecordAnnotationAggregates", - "ExtendedWorkflowSpanRecordAnnotationAgreement", - "ExtendedWorkflowSpanRecordAnnotations", - "ExtendedWorkflowSpanRecordAnnotationsAdditionalProperty", - "ExtendedWorkflowSpanRecordDatasetMetadata", - "ExtendedWorkflowSpanRecordFeedbackRatingInfo", - "ExtendedWorkflowSpanRecordFilesType0", - "ExtendedWorkflowSpanRecordMetricInfoType0", - "ExtendedWorkflowSpanRecordUserMetadata", - "ExtendedWorkflowSpanRecordWithChildren", - "ExtendedWorkflowSpanRecordWithChildrenAnnotationAggregates", - "ExtendedWorkflowSpanRecordWithChildrenAnnotationAgreement", - "ExtendedWorkflowSpanRecordWithChildrenAnnotations", - "ExtendedWorkflowSpanRecordWithChildrenAnnotationsAdditionalProperty", - "ExtendedWorkflowSpanRecordWithChildrenDatasetMetadata", - "ExtendedWorkflowSpanRecordWithChildrenFeedbackRatingInfo", - "ExtendedWorkflowSpanRecordWithChildrenFilesType0", - "ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0", - "ExtendedWorkflowSpanRecordWithChildrenUserMetadata", "FeatureIntegrationCosts", "FeedbackAggregate", "FeedbackRatingInfo", @@ -1776,9 +1458,6 @@ "Histogram", "HistogramBucket", "HistogramStrategy", - "HttpSpan", - "HttpSpanDatasetMetadata", - "HttpSpanUserMetadata", "HTTPValidationError", "ImageGenerationEvent", "ImageGenerationEventImagesType0Item", @@ -1815,6 +1494,7 @@ "InvokeResponseMetadataType0", "InvokeResponseMetricResults", "JobProgress", + "LeftOutReason", "LikeDislikeAggregate", "LikeDislikeConstraints", "LikeDislikeRating", @@ -1843,10 +1523,7 @@ "LLMExportFormat", "LLMIntegration", "LlmMetrics", - "LlmSpan", - "LlmSpanDatasetMetadata", - "LlmSpanToolsType0Item", - "LlmSpanUserMetadata", + "LLMScorerLogRecordConfiguration", "LoggingMethod", "LogRecordsAvailableColumnsRequest", "LogRecordsAvailableColumnsResponse", @@ -1875,17 +1552,14 @@ "LogRecordsNumberFilter", "LogRecordsNumberFilterOperator", "LogRecordsPartialQueryRequest", - "LogRecordsPartialQueryResponse", "LogRecordsQueryCountRequest", "LogRecordsQueryCountResponse", "LogRecordsQueryRequest", - "LogRecordsQueryResponse", "LogRecordsSortClause", "LogRecordsTextFilter", "LogRecordsTextFilterOperator", "LogSpansIngestRequest", "LogSpansIngestResponse", - "LogSpanUpdateRequest", "LogSpanUpdateResponse", "LogStreamCreateRequest", "LogStreamInfo", @@ -1897,6 +1571,7 @@ "LogTraceUpdateResponse", "Luna3ScorerResponse", "Luna3ScorerResponseClassNameToVocabIx", + "LunaBillingUsageResponse", "LunaDatasetMappings", "LunaDatasetMappingsMgt", "LunaDatasetPreview", @@ -1958,6 +1633,7 @@ "MetricRollUpRollUpMetrics", "MetricRollUpRollUpMetricsAdditionalPropertyType1", "Metrics", + "MetricSettingsConflictResponse", "MetricSettingsRequest", "MetricSettingsResponse", "MetricsTestingAvailableColumnsRequest", @@ -1980,6 +1656,8 @@ "NodeNameFilter", "NodeNameFilterOperator", "NodeType", + "NonLunaBillingUsageResponse", + "NonLunaBillingUsageResponseMetric", "NotNodeLogRecordsFilter", "NumericColorConstraint", "NumericColorConstraintOperator", @@ -2003,47 +1681,6 @@ "OutputToxicityScorerType", "OutputTypeEnum", "OverrideAction", - "PartialExtendedAgentSpanRecord", - "PartialExtendedAgentSpanRecordAnnotationAggregates", - "PartialExtendedAgentSpanRecordAnnotationAgreement", - "PartialExtendedAgentSpanRecordAnnotations", - "PartialExtendedAgentSpanRecordAnnotationsAdditionalProperty", - "PartialExtendedAgentSpanRecordDatasetMetadata", - "PartialExtendedAgentSpanRecordFeedbackRatingInfo", - "PartialExtendedAgentSpanRecordFilesType0", - "PartialExtendedAgentSpanRecordMetricInfoType0", - "PartialExtendedAgentSpanRecordUserMetadata", - "PartialExtendedControlSpanRecord", - "PartialExtendedControlSpanRecordAnnotationAggregates", - "PartialExtendedControlSpanRecordAnnotationAgreement", - "PartialExtendedControlSpanRecordAnnotations", - "PartialExtendedControlSpanRecordAnnotationsAdditionalProperty", - "PartialExtendedControlSpanRecordDatasetMetadata", - "PartialExtendedControlSpanRecordFeedbackRatingInfo", - "PartialExtendedControlSpanRecordFilesType0", - "PartialExtendedControlSpanRecordMetricInfoType0", - "PartialExtendedControlSpanRecordUserMetadata", - "PartialExtendedHttpSpanRecord", - "PartialExtendedHttpSpanRecordAnnotationAggregates", - "PartialExtendedHttpSpanRecordAnnotationAgreement", - "PartialExtendedHttpSpanRecordAnnotations", - "PartialExtendedHttpSpanRecordAnnotationsAdditionalProperty", - "PartialExtendedHttpSpanRecordDatasetMetadata", - "PartialExtendedHttpSpanRecordFeedbackRatingInfo", - "PartialExtendedHttpSpanRecordFilesType0", - "PartialExtendedHttpSpanRecordMetricInfoType0", - "PartialExtendedHttpSpanRecordUserMetadata", - "PartialExtendedLlmSpanRecord", - "PartialExtendedLlmSpanRecordAnnotationAggregates", - "PartialExtendedLlmSpanRecordAnnotationAgreement", - "PartialExtendedLlmSpanRecordAnnotations", - "PartialExtendedLlmSpanRecordAnnotationsAdditionalProperty", - "PartialExtendedLlmSpanRecordDatasetMetadata", - "PartialExtendedLlmSpanRecordFeedbackRatingInfo", - "PartialExtendedLlmSpanRecordFilesType0", - "PartialExtendedLlmSpanRecordMetricInfoType0", - "PartialExtendedLlmSpanRecordToolsType0Item", - "PartialExtendedLlmSpanRecordUserMetadata", "PartialExtendedRetrieverSpanRecord", "PartialExtendedRetrieverSpanRecordAnnotationAggregates", "PartialExtendedRetrieverSpanRecordAnnotationAgreement", @@ -2054,16 +1691,6 @@ "PartialExtendedRetrieverSpanRecordFilesType0", "PartialExtendedRetrieverSpanRecordMetricInfoType0", "PartialExtendedRetrieverSpanRecordUserMetadata", - "PartialExtendedSessionRecord", - "PartialExtendedSessionRecordAnnotationAggregates", - "PartialExtendedSessionRecordAnnotationAgreement", - "PartialExtendedSessionRecordAnnotations", - "PartialExtendedSessionRecordAnnotationsAdditionalProperty", - "PartialExtendedSessionRecordDatasetMetadata", - "PartialExtendedSessionRecordFeedbackRatingInfo", - "PartialExtendedSessionRecordFilesType0", - "PartialExtendedSessionRecordMetricInfoType0", - "PartialExtendedSessionRecordUserMetadata", "PartialExtendedToolSpanRecord", "PartialExtendedToolSpanRecordAnnotationAggregates", "PartialExtendedToolSpanRecordAnnotationAgreement", @@ -2084,19 +1711,10 @@ "PartialExtendedTraceRecordFilesType0", "PartialExtendedTraceRecordMetricInfoType0", "PartialExtendedTraceRecordUserMetadata", - "PartialExtendedWorkflowSpanRecord", - "PartialExtendedWorkflowSpanRecordAnnotationAggregates", - "PartialExtendedWorkflowSpanRecordAnnotationAgreement", - "PartialExtendedWorkflowSpanRecordAnnotations", - "PartialExtendedWorkflowSpanRecordAnnotationsAdditionalProperty", - "PartialExtendedWorkflowSpanRecordDatasetMetadata", - "PartialExtendedWorkflowSpanRecordFeedbackRatingInfo", - "PartialExtendedWorkflowSpanRecordFilesType0", - "PartialExtendedWorkflowSpanRecordMetricInfoType0", - "PartialExtendedWorkflowSpanRecordUserMetadata", "PassthroughAction", "Payload", "Permission", + "PolicyPackageNotice", "PreviewDatasetRequest", "ProjectAction", "ProjectBillingUsage", @@ -2174,6 +1792,7 @@ "RecomputeLogRecordsMetricsRequest", "RegisteredScorerAction", "RegisteredScorerTaskResultResponse", + "RegisteredScorerValidationStage", "RemoveRecordsFromQueueRequest", "RemoveRecordsFromQueueResponse", "RenderedTemplate", @@ -2199,6 +1818,11 @@ "RunCreatedByFilterOperator", "RunDB", "RunDBThin", + "RunEnabledEvaluator", + "RunEvaluatorBinding", + "RunEvaluatorsEnabled", + "RunEvaluatorsInspection", + "RunEvaluatorsRequest", "RunIDFilter", "RunIDFilterOperator", "RunNameFilter", @@ -2215,16 +1839,20 @@ "RunUpdatedAtFilter", "RunUpdatedAtFilterOperator", "RunUpdatedAtSort", + "SavedEvaluatorReference", "ScoreAggregate", "ScoreBucket", "ScoreConstraints", "ScorerAction", "ScoreRating", + "ScorerCatalogVersionResponse", + "ScorerCatalogVersionResponseLunaValidationContractType0", "ScorerCreatedAtFilter", "ScorerCreatedAtFilterOperator", "ScorerCreatorFilter", "ScorerCreatorFilterOperator", "ScorerDefaults", + "ScorerDefaultsRequest", "ScorerEnabledInPlaygroundSort", "ScorerEnabledInRunSort", "ScorerEnvironment", @@ -2241,6 +1869,7 @@ "ScorerIsGlobalFilterOperator", "ScorerLabelFilter", "ScorerLabelFilterOperator", + "ScorerMetadataSelection", "ScorerModelTypeFilter", "ScorerModelTypeFilterOperator", "ScorerMultimodalCapabilitiesFilter", @@ -2249,6 +1878,12 @@ "ScorerNameFilter", "ScorerNameFilterOperator", "ScorerNameSort", + "ScorerPromptMessage", + "ScorerPromptMessageContentType1Item", + "ScorerPromptPreviewResponse", + "ScorerPromptPreviewResponseNormalizedInputItem", + "ScorerPromptPreviewUnavailableReason", + "ScorerPromptPreviewUnavailableResponse", "ScorerResponse", "ScorerScopeProjectRef", "ScorerScopeProjectsFilter", @@ -2271,6 +1906,10 @@ "SessionCreateRequest", "SessionCreateRequestUserMetadataType0", "SessionCreateResponse", + "SpanInputSelection", + "SpanInputSelectionFieldsItem", + "SpanInputSelectionRequest", + "SpanInputSelectionRequestFieldsItem", "StageDB", "StageMetadata", "StageRulesetsResponse", @@ -2305,6 +1944,7 @@ "TextContentPart", "TextRating", "Token", + "TokenomicsDelegationAction", "ToolCall", "ToolCallFunction", "ToolErrorRateScorer", @@ -2328,6 +1968,7 @@ "TypeSafeIntegrationCreate", "TypeSafeIntegrationExtraType0", "UpdateAnnotationQueueRequest", + "UpdateAnnotationQueueSettingsRequest", "UpdateDatasetContentRequest", "UpdateDatasetRequest", "UpdateDatasetVersionRequest", @@ -2341,6 +1982,7 @@ "UserCollaboratorCreate", "UserDB", "UserInfo", + "UserLifecycleState", "UserRole", "ValidateCodeScorerDatasetResponse", "ValidateCodeScorerResponse", @@ -2363,12 +2005,10 @@ "VertexAIIntegration", "VertexAIIntegrationCreate", "VertexAIIntegrationExtraType0", + "ViolationReason", "WebSearchAction", "WebSearchCallEvent", "WebSearchCallEventMetadataType0", - "WorkflowSpan", - "WorkflowSpanDatasetMetadata", - "WorkflowSpanUserMetadata", "WriteHealthScoreRequest", "WriteHealthScoreRequestSecondaryType0", "WriterIntegration", diff --git a/src/splunk_ao/resources/models/agent_span.py b/src/splunk_ao/resources/models/agent_span.py deleted file mode 100644 index 394a0307..00000000 --- a/src/splunk_ao/resources/models/agent_span.py +++ /dev/null @@ -1,877 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.agent_type import AgentType -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.agent_span_dataset_metadata import AgentSpanDatasetMetadata - from ..models.agent_span_user_metadata import AgentSpanUserMetadata - from ..models.control_result import ControlResult - from ..models.control_span import ControlSpan - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.http_span import HttpSpan - from ..models.llm_span import LlmSpan - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.retriever_span import RetrieverSpan - from ..models.text_content_part import TextContentPart - from ..models.tool_span import ToolSpan - from ..models.workflow_span import WorkflowSpan - - -T = TypeVar("T", bound="AgentSpan") - - -@_attrs_define -class AgentSpan: - """ - Attributes: - type_ (Literal['agent'] | Unset): Type of the trace, span or session. Default: 'agent'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (AgentSpanUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (AgentSpanDatasetMetadata | Unset): Metadata from the dataset associated with this trace - id (None | str | Unset): Galileo ID of the session, trace or span - session_id (None | str | Unset): Galileo ID of the session containing the trace or span or session - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - step_number (int | None | Unset): Topological step number of the span. - parent_id (None | str | Unset): Galileo ID of the parent of this span - spans (list[AgentSpan | ControlSpan | HttpSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan] | Unset): - Child spans. - agent_type (AgentType | Unset): - agent_name (None | str | Unset): Name of the agent. - """ - - type_: Literal["agent"] | Unset = "agent" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: AgentSpanUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: AgentSpanDatasetMetadata | Unset = UNSET - id: None | str | Unset = UNSET - session_id: None | str | Unset = UNSET - trace_id: None | str | Unset = UNSET - step_number: int | None | Unset = UNSET - parent_id: None | str | Unset = UNSET - spans: list[AgentSpan | ControlSpan | HttpSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan] | Unset = UNSET - agent_type: AgentType | Unset = UNSET - agent_name: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.control_span import ControlSpan - from ..models.llm_span import LlmSpan - from ..models.message import Message - from ..models.retriever_span import RetrieverSpan - from ..models.text_content_part import TextContentPart - from ..models.tool_span import ToolSpan - from ..models.workflow_span import WorkflowSpan - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - id: None | str | Unset - if isinstance(self.id, Unset): - id = UNSET - else: - id = self.id - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - parent_id: None | str | Unset - if isinstance(self.parent_id, Unset): - parent_id = UNSET - else: - parent_id = self.parent_id - - spans: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.spans, Unset): - spans = [] - for spans_item_data in self.spans: - spans_item: dict[str, Any] - if isinstance(spans_item_data, AgentSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, WorkflowSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, LlmSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, RetrieverSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ToolSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ControlSpan): - spans_item = spans_item_data.to_dict() - else: - spans_item = spans_item_data.to_dict() - - spans.append(spans_item) - - agent_type: str | Unset = UNSET - if not isinstance(self.agent_type, Unset): - agent_type = self.agent_type.value - - agent_name: None | str | Unset - if isinstance(self.agent_name, Unset): - agent_name = UNSET - else: - agent_name = self.agent_name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if id is not UNSET: - field_dict["id"] = id - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if step_number is not UNSET: - field_dict["step_number"] = step_number - if parent_id is not UNSET: - field_dict["parent_id"] = parent_id - if spans is not UNSET: - field_dict["spans"] = spans - if agent_type is not UNSET: - field_dict["agent_type"] = agent_type - if agent_name is not UNSET: - field_dict["agent_name"] = agent_name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_span_dataset_metadata import AgentSpanDatasetMetadata - from ..models.agent_span_user_metadata import AgentSpanUserMetadata - from ..models.control_result import ControlResult - from ..models.control_span import ControlSpan - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.http_span import HttpSpan - from ..models.llm_span import LlmSpan - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.retriever_span import RetrieverSpan - from ..models.text_content_part import TextContentPart - from ..models.tool_span import ToolSpan - from ..models.workflow_span import WorkflowSpan - - d = dict(src_dict) - type_ = cast(Literal["agent"] | Unset, d.pop("type", UNSET)) - if type_ != "agent" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'agent', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: AgentSpanUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = AgentSpanUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: AgentSpanDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = AgentSpanDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - id = _parse_id(d.pop("id", UNSET)) - - def _parse_session_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - def _parse_parent_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - parent_id = _parse_parent_id(d.pop("parent_id", UNSET)) - - _spans = d.pop("spans", UNSET) - spans: list[AgentSpan | ControlSpan | HttpSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan] | Unset = ( - UNSET - ) - if _spans is not UNSET: - spans = [] - for spans_item_data in _spans: - - def _parse_spans_item( - data: object, - ) -> AgentSpan | ControlSpan | HttpSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan: - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_0 = AgentSpan.from_dict(data) - - return spans_item_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_1 = WorkflowSpan.from_dict(data) - - return spans_item_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_2 = LlmSpan.from_dict(data) - - return spans_item_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_3 = RetrieverSpan.from_dict(data) - - return spans_item_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_4 = ToolSpan.from_dict(data) - - return spans_item_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_5 = ControlSpan.from_dict(data) - - return spans_item_type_5 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - spans_item_type_6 = HttpSpan.from_dict(data) - - return spans_item_type_6 - - spans_item = _parse_spans_item(spans_item_data) - - spans.append(spans_item) - - _agent_type = d.pop("agent_type", UNSET) - agent_type: AgentType | Unset - if isinstance(_agent_type, Unset): - agent_type = UNSET - else: - agent_type = AgentType(_agent_type) - - def _parse_agent_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_name = _parse_agent_name(d.pop("agent_name", UNSET)) - - agent_span = cls( - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - id=id, - session_id=session_id, - trace_id=trace_id, - step_number=step_number, - parent_id=parent_id, - spans=spans, - agent_type=agent_type, - agent_name=agent_name, - ) - - agent_span.additional_properties = d - return agent_span - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/agent_span_dataset_metadata.py b/src/splunk_ao/resources/models/agent_span_dataset_metadata.py deleted file mode 100644 index 9f95816f..00000000 --- a/src/splunk_ao/resources/models/agent_span_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="AgentSpanDatasetMetadata") - - -@_attrs_define -class AgentSpanDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_span_dataset_metadata = cls() - - agent_span_dataset_metadata.additional_properties = d - return agent_span_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/agent_span_user_metadata.py b/src/splunk_ao/resources/models/agent_span_user_metadata.py deleted file mode 100644 index 33a2323f..00000000 --- a/src/splunk_ao/resources/models/agent_span_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="AgentSpanUserMetadata") - - -@_attrs_define -class AgentSpanUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_span_user_metadata = cls() - - agent_span_user_metadata.additional_properties = d - return agent_span_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/annotation_queue_name_filter_operator.py b/src/splunk_ao/resources/models/annotation_queue_name_filter_operator.py index 4abe0854..844eb3cd 100644 --- a/src/splunk_ao/resources/models/annotation_queue_name_filter_operator.py +++ b/src/splunk_ao/resources/models/annotation_queue_name_filter_operator.py @@ -7,6 +7,7 @@ class AnnotationQueueNameFilterOperator(str, Enum): NE = "ne" NOT_IN = "not_in" ONE_OF = "one_of" + REGEX = "regex" def __str__(self) -> str: return str(self.value) diff --git a/src/splunk_ao/resources/models/annotation_queue_settings.py b/src/splunk_ao/resources/models/annotation_queue_settings.py new file mode 100644 index 00000000..805981fe --- /dev/null +++ b/src/splunk_ao/resources/models/annotation_queue_settings.py @@ -0,0 +1,129 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.annotator_view_span_type import AnnotatorViewSpanType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AnnotationQueueSettings") + + +@_attrs_define +class AnnotationQueueSettings: + """What annotators see in the annotator view. Stored as JSON; defaults apply to missing keys. + + Attributes: + show_full_session (bool | Unset): Default: True. + show_conversation_history (bool | Unset): Default: True. + show_span_types (bool | Unset): Default: True. + span_types (list[AnnotatorViewSpanType] | Unset): + show_parameters (bool | Unset): Default: True. + show_span_metadata (bool | Unset): Default: True. + show_evaluators (bool | Unset): Default: True. + """ + + show_full_session: bool | Unset = True + show_conversation_history: bool | Unset = True + show_span_types: bool | Unset = True + span_types: list[AnnotatorViewSpanType] | Unset = UNSET + show_parameters: bool | Unset = True + show_span_metadata: bool | Unset = True + show_evaluators: bool | Unset = True + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + show_full_session = self.show_full_session + + show_conversation_history = self.show_conversation_history + + show_span_types = self.show_span_types + + span_types: list[str] | Unset = UNSET + if not isinstance(self.span_types, Unset): + span_types = [] + for span_types_item_data in self.span_types: + span_types_item = span_types_item_data.value + span_types.append(span_types_item) + + show_parameters = self.show_parameters + + show_span_metadata = self.show_span_metadata + + show_evaluators = self.show_evaluators + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if show_full_session is not UNSET: + field_dict["show_full_session"] = show_full_session + if show_conversation_history is not UNSET: + field_dict["show_conversation_history"] = show_conversation_history + if show_span_types is not UNSET: + field_dict["show_span_types"] = show_span_types + if span_types is not UNSET: + field_dict["span_types"] = span_types + if show_parameters is not UNSET: + field_dict["show_parameters"] = show_parameters + if show_span_metadata is not UNSET: + field_dict["show_span_metadata"] = show_span_metadata + if show_evaluators is not UNSET: + field_dict["show_evaluators"] = show_evaluators + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + show_full_session = d.pop("show_full_session", UNSET) + + show_conversation_history = d.pop("show_conversation_history", UNSET) + + show_span_types = d.pop("show_span_types", UNSET) + + _span_types = d.pop("span_types", UNSET) + span_types: list[AnnotatorViewSpanType] | Unset = UNSET + if _span_types is not UNSET: + span_types = [] + for span_types_item_data in _span_types: + span_types_item = AnnotatorViewSpanType(span_types_item_data) + + span_types.append(span_types_item) + + show_parameters = d.pop("show_parameters", UNSET) + + show_span_metadata = d.pop("show_span_metadata", UNSET) + + show_evaluators = d.pop("show_evaluators", UNSET) + + annotation_queue_settings = cls( + show_full_session=show_full_session, + show_conversation_history=show_conversation_history, + show_span_types=show_span_types, + span_types=span_types, + show_parameters=show_parameters, + show_span_metadata=show_span_metadata, + show_evaluators=show_evaluators, + ) + + annotation_queue_settings.additional_properties = d + return annotation_queue_settings + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/annotation_queue_settings_response.py b/src/splunk_ao/resources/models/annotation_queue_settings_response.py new file mode 100644 index 00000000..7c74a784 --- /dev/null +++ b/src/splunk_ao/resources/models/annotation_queue_settings_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.annotation_queue_settings import AnnotationQueueSettings + + +T = TypeVar("T", bound="AnnotationQueueSettingsResponse") + + +@_attrs_define +class AnnotationQueueSettingsResponse: + """ + Attributes: + annotation_queue_id (str): + settings (AnnotationQueueSettings): What annotators see in the annotator view. Stored as JSON; defaults apply to + missing keys. + """ + + annotation_queue_id: str + settings: AnnotationQueueSettings + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + annotation_queue_id = self.annotation_queue_id + + settings = self.settings.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({"annotation_queue_id": annotation_queue_id, "settings": settings}) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.annotation_queue_settings import AnnotationQueueSettings + + d = dict(src_dict) + annotation_queue_id = d.pop("annotation_queue_id") + + settings = AnnotationQueueSettings.from_dict(d.pop("settings")) + + annotation_queue_settings_response = cls(annotation_queue_id=annotation_queue_id, settings=settings) + + annotation_queue_settings_response.additional_properties = d + return annotation_queue_settings_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/annotation_rating_create.py b/src/splunk_ao/resources/models/annotation_rating_create.py deleted file mode 100644 index f48877fd..00000000 --- a/src/splunk_ao/resources/models/annotation_rating_create.py +++ /dev/null @@ -1,174 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.choice_rating import ChoiceRating - from ..models.like_dislike_rating import LikeDislikeRating - from ..models.score_rating import ScoreRating - from ..models.star_rating import StarRating - from ..models.tags_rating import TagsRating - from ..models.text_rating import TextRating - from ..models.tree_choice_rating import TreeChoiceRating - - -T = TypeVar("T", bound="AnnotationRatingCreate") - - -@_attrs_define -class AnnotationRatingCreate: - """ - Attributes: - rating (ChoiceRating | LikeDislikeRating | ScoreRating | StarRating | TagsRating | TextRating | - TreeChoiceRating): - explanation (None | str | Unset): - """ - - rating: ChoiceRating | LikeDislikeRating | ScoreRating | StarRating | TagsRating | TextRating | TreeChoiceRating - explanation: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.choice_rating import ChoiceRating - from ..models.like_dislike_rating import LikeDislikeRating - from ..models.score_rating import ScoreRating - from ..models.star_rating import StarRating - from ..models.tags_rating import TagsRating - from ..models.text_rating import TextRating - - rating: dict[str, Any] - if isinstance(self.rating, LikeDislikeRating): - rating = self.rating.to_dict() - elif isinstance(self.rating, StarRating): - rating = self.rating.to_dict() - elif isinstance(self.rating, ScoreRating): - rating = self.rating.to_dict() - elif isinstance(self.rating, TagsRating): - rating = self.rating.to_dict() - elif isinstance(self.rating, TextRating): - rating = self.rating.to_dict() - elif isinstance(self.rating, ChoiceRating): - rating = self.rating.to_dict() - else: - rating = self.rating.to_dict() - - explanation: None | str | Unset - if isinstance(self.explanation, Unset): - explanation = UNSET - else: - explanation = self.explanation - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({"rating": rating}) - if explanation is not UNSET: - field_dict["explanation"] = explanation - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.choice_rating import ChoiceRating - from ..models.like_dislike_rating import LikeDislikeRating - from ..models.score_rating import ScoreRating - from ..models.star_rating import StarRating - from ..models.tags_rating import TagsRating - from ..models.text_rating import TextRating - from ..models.tree_choice_rating import TreeChoiceRating - - d = dict(src_dict) - - def _parse_rating( - data: object, - ) -> ChoiceRating | LikeDislikeRating | ScoreRating | StarRating | TagsRating | TextRating | TreeChoiceRating: - try: - if not isinstance(data, dict): - raise TypeError() - rating_type_0 = LikeDislikeRating.from_dict(data) - - return rating_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - rating_type_1 = StarRating.from_dict(data) - - return rating_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - rating_type_2 = ScoreRating.from_dict(data) - - return rating_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - rating_type_3 = TagsRating.from_dict(data) - - return rating_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - rating_type_4 = TextRating.from_dict(data) - - return rating_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - rating_type_5 = ChoiceRating.from_dict(data) - - return rating_type_5 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - rating_type_6 = TreeChoiceRating.from_dict(data) - - return rating_type_6 - - rating = _parse_rating(d.pop("rating")) - - def _parse_explanation(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - explanation = _parse_explanation(d.pop("explanation", UNSET)) - - annotation_rating_create = cls(rating=rating, explanation=explanation) - - annotation_rating_create.additional_properties = d - return annotation_rating_create - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/annotation_rating_db.py b/src/splunk_ao/resources/models/annotation_rating_db.py deleted file mode 100644 index 974772d3..00000000 --- a/src/splunk_ao/resources/models/annotation_rating_db.py +++ /dev/null @@ -1,193 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.choice_rating import ChoiceRating - from ..models.like_dislike_rating import LikeDislikeRating - from ..models.score_rating import ScoreRating - from ..models.star_rating import StarRating - from ..models.tags_rating import TagsRating - from ..models.text_rating import TextRating - from ..models.tree_choice_rating import TreeChoiceRating - - -T = TypeVar("T", bound="AnnotationRatingDB") - - -@_attrs_define -class AnnotationRatingDB: - """ - Attributes: - rating (ChoiceRating | LikeDislikeRating | ScoreRating | StarRating | TagsRating | TextRating | - TreeChoiceRating): - created_at (datetime.datetime): - created_by (None | str): - explanation (None | str | Unset): - """ - - rating: ChoiceRating | LikeDislikeRating | ScoreRating | StarRating | TagsRating | TextRating | TreeChoiceRating - created_at: datetime.datetime - created_by: None | str - explanation: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.choice_rating import ChoiceRating - from ..models.like_dislike_rating import LikeDislikeRating - from ..models.score_rating import ScoreRating - from ..models.star_rating import StarRating - from ..models.tags_rating import TagsRating - from ..models.text_rating import TextRating - - rating: dict[str, Any] - if isinstance(self.rating, LikeDislikeRating): - rating = self.rating.to_dict() - elif isinstance(self.rating, StarRating): - rating = self.rating.to_dict() - elif isinstance(self.rating, ScoreRating): - rating = self.rating.to_dict() - elif isinstance(self.rating, TagsRating): - rating = self.rating.to_dict() - elif isinstance(self.rating, TextRating): - rating = self.rating.to_dict() - elif isinstance(self.rating, ChoiceRating): - rating = self.rating.to_dict() - else: - rating = self.rating.to_dict() - - created_at = self.created_at.isoformat() - - created_by: None | str - created_by = self.created_by - - explanation: None | str | Unset - if isinstance(self.explanation, Unset): - explanation = UNSET - else: - explanation = self.explanation - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({"rating": rating, "created_at": created_at, "created_by": created_by}) - if explanation is not UNSET: - field_dict["explanation"] = explanation - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.choice_rating import ChoiceRating - from ..models.like_dislike_rating import LikeDislikeRating - from ..models.score_rating import ScoreRating - from ..models.star_rating import StarRating - from ..models.tags_rating import TagsRating - from ..models.text_rating import TextRating - from ..models.tree_choice_rating import TreeChoiceRating - - d = dict(src_dict) - - def _parse_rating( - data: object, - ) -> ChoiceRating | LikeDislikeRating | ScoreRating | StarRating | TagsRating | TextRating | TreeChoiceRating: - try: - if not isinstance(data, dict): - raise TypeError() - rating_type_0 = LikeDislikeRating.from_dict(data) - - return rating_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - rating_type_1 = StarRating.from_dict(data) - - return rating_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - rating_type_2 = ScoreRating.from_dict(data) - - return rating_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - rating_type_3 = TagsRating.from_dict(data) - - return rating_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - rating_type_4 = TextRating.from_dict(data) - - return rating_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - rating_type_5 = ChoiceRating.from_dict(data) - - return rating_type_5 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - rating_type_6 = TreeChoiceRating.from_dict(data) - - return rating_type_6 - - rating = _parse_rating(d.pop("rating")) - - created_at = datetime.datetime.fromisoformat(d.pop("created_at")) - - def _parse_created_by(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - created_by = _parse_created_by(d.pop("created_by")) - - def _parse_explanation(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - explanation = _parse_explanation(d.pop("explanation", UNSET)) - - annotation_rating_db = cls(rating=rating, created_at=created_at, created_by=created_by, explanation=explanation) - - annotation_rating_db.additional_properties = d - return annotation_rating_db - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/annotation_template_create.py b/src/splunk_ao/resources/models/annotation_template_create.py index 7c408dcc..0c2eff0e 100644 --- a/src/splunk_ao/resources/models/annotation_template_create.py +++ b/src/splunk_ao/resources/models/annotation_template_create.py @@ -29,6 +29,7 @@ class AnnotationTemplateCreate: constraints (ChoiceConstraints | LikeDislikeConstraints | ScoreConstraints | StarConstraints | TagsConstraints | TextConstraints | TreeChoiceConstraints): include_explanation (bool | Unset): Default: False. + required (bool | Unset): Default: True. criteria (None | str | Unset): """ @@ -43,6 +44,7 @@ class AnnotationTemplateCreate: | TreeChoiceConstraints ) include_explanation: bool | Unset = False + required: bool | Unset = True criteria: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -74,6 +76,8 @@ def to_dict(self) -> dict[str, Any]: include_explanation = self.include_explanation + required = self.required + criteria: None | str | Unset if isinstance(self.criteria, Unset): criteria = UNSET @@ -85,6 +89,8 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({"name": name, "constraints": constraints}) if include_explanation is not UNSET: field_dict["include_explanation"] = include_explanation + if required is not UNSET: + field_dict["required"] = required if criteria is not UNSET: field_dict["criteria"] = criteria @@ -172,6 +178,8 @@ def _parse_constraints( include_explanation = d.pop("include_explanation", UNSET) + required = d.pop("required", UNSET) + def _parse_criteria(data: object) -> None | str | Unset: if data is None: return data @@ -182,7 +190,11 @@ def _parse_criteria(data: object) -> None | str | Unset: criteria = _parse_criteria(d.pop("criteria", UNSET)) annotation_template_create = cls( - name=name, constraints=constraints, include_explanation=include_explanation, criteria=criteria + name=name, + constraints=constraints, + include_explanation=include_explanation, + required=required, + criteria=criteria, ) annotation_template_create.additional_properties = d diff --git a/src/splunk_ao/resources/models/annotation_template_db.py b/src/splunk_ao/resources/models/annotation_template_db.py index dec7f94f..78d5d972 100644 --- a/src/splunk_ao/resources/models/annotation_template_db.py +++ b/src/splunk_ao/resources/models/annotation_template_db.py @@ -28,6 +28,7 @@ class AnnotationTemplateDB: Attributes: name (str): include_explanation (bool): + required (bool): constraints (ChoiceConstraints | LikeDislikeConstraints | ScoreConstraints | StarConstraints | TagsConstraints | TextConstraints | TreeChoiceDBConstraints): id (str): @@ -40,6 +41,7 @@ class AnnotationTemplateDB: name: str include_explanation: bool + required: bool constraints: ( ChoiceConstraints | LikeDislikeConstraints @@ -69,6 +71,8 @@ def to_dict(self) -> dict[str, Any]: include_explanation = self.include_explanation + required = self.required + constraints: dict[str, Any] if isinstance(self.constraints, LikeDislikeConstraints): constraints = self.constraints.to_dict() @@ -108,6 +112,7 @@ def to_dict(self) -> dict[str, Any]: { "name": name, "include_explanation": include_explanation, + "required": required, "constraints": constraints, "id": id, "created_at": created_at, @@ -136,6 +141,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: include_explanation = d.pop("include_explanation") + required = d.pop("required") + def _parse_constraints( data: object, ) -> ( @@ -230,6 +237,7 @@ def _parse_criteria(data: object) -> None | str | Unset: annotation_template_db = cls( name=name, include_explanation=include_explanation, + required=required, constraints=constraints, id=id, created_at=created_at, diff --git a/src/splunk_ao/resources/models/annotation_template_update.py b/src/splunk_ao/resources/models/annotation_template_update.py index ae2e1fb5..266861a5 100644 --- a/src/splunk_ao/resources/models/annotation_template_update.py +++ b/src/splunk_ao/resources/models/annotation_template_update.py @@ -6,6 +6,8 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..types import UNSET, Unset + T = TypeVar("T", bound="AnnotationTemplateUpdate") @@ -15,10 +17,12 @@ class AnnotationTemplateUpdate: Attributes: name (str): criteria (None | str): + required (bool | None | Unset): """ name: str criteria: None | str + required: bool | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -27,9 +31,17 @@ def to_dict(self) -> dict[str, Any]: criteria: None | str criteria = self.criteria + required: bool | None | Unset + if isinstance(self.required, Unset): + required = UNSET + else: + required = self.required + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"name": name, "criteria": criteria}) + if required is not UNSET: + field_dict["required"] = required return field_dict @@ -45,7 +57,16 @@ def _parse_criteria(data: object) -> None | str: criteria = _parse_criteria(d.pop("criteria")) - annotation_template_update = cls(name=name, criteria=criteria) + def _parse_required(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + required = _parse_required(d.pop("required", UNSET)) + + annotation_template_update = cls(name=name, criteria=criteria, required=required) annotation_template_update.additional_properties = d return annotation_template_update diff --git a/src/splunk_ao/resources/models/annotator_view_span_type.py b/src/splunk_ao/resources/models/annotator_view_span_type.py new file mode 100644 index 00000000..b4d815ca --- /dev/null +++ b/src/splunk_ao/resources/models/annotator_view_span_type.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class AnnotatorViewSpanType(str, Enum): + AGENT = "agent" + CONTROL = "control" + HTTP = "http" + LLM = "llm" + RETRIEVER = "retriever" + TOOL = "tool" + WORKFLOW = "workflow" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/base_scorer.py b/src/splunk_ao/resources/models/base_scorer.py index 3466c7b0..f43e1899 100644 --- a/src/splunk_ao/resources/models/base_scorer.py +++ b/src/splunk_ao/resources/models/base_scorer.py @@ -26,6 +26,8 @@ from ..models.metadata_filter import MetadataFilter from ..models.modality_filter import ModalityFilter from ..models.node_name_filter import NodeNameFilter + from ..models.scorer_metadata_selection import ScorerMetadataSelection + from ..models.span_input_selection import SpanInputSelection T = TypeVar("T", bound="BaseScorer") @@ -50,6 +52,9 @@ class BaseScorer: num_judges (int | None | Unset): default_model_alias (None | str | Unset): ground_truth (bool | None | Unset): + metadata_selection (None | ScorerMetadataSelection | Unset): + span_input_selections (list[SpanInputSelection] | None | Unset): + require_matching_span (bool | Unset): Default: False. regex_field (str | Unset): Default: ''. registered_scorer_id (None | str | Unset): generated_scorer_id (None | str | Unset): @@ -90,6 +95,9 @@ class BaseScorer: num_judges: int | None | Unset = UNSET default_model_alias: None | str | Unset = UNSET ground_truth: bool | None | Unset = UNSET + metadata_selection: None | ScorerMetadataSelection | Unset = UNSET + span_input_selections: list[SpanInputSelection] | None | Unset = UNSET + require_matching_span: bool | Unset = False regex_field: str | Unset = "" registered_scorer_id: None | str | Unset = UNSET generated_scorer_id: None | str | Unset = UNSET @@ -123,6 +131,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.chain_poll_template import ChainPollTemplate from ..models.metadata_filter import MetadataFilter from ..models.node_name_filter import NodeNameFilter + from ..models.scorer_metadata_selection import ScorerMetadataSelection scorer_name = self.scorer_name @@ -234,6 +243,28 @@ def to_dict(self) -> dict[str, Any]: else: ground_truth = self.ground_truth + metadata_selection: dict[str, Any] | None | Unset + if isinstance(self.metadata_selection, Unset): + metadata_selection = UNSET + elif isinstance(self.metadata_selection, ScorerMetadataSelection): + metadata_selection = self.metadata_selection.to_dict() + else: + metadata_selection = self.metadata_selection + + span_input_selections: list[dict[str, Any]] | None | Unset + if isinstance(self.span_input_selections, Unset): + span_input_selections = UNSET + elif isinstance(self.span_input_selections, list): + span_input_selections = [] + for span_input_selections_type_0_item_data in self.span_input_selections: + span_input_selections_type_0_item = span_input_selections_type_0_item_data.to_dict() + span_input_selections.append(span_input_selections_type_0_item) + + else: + span_input_selections = self.span_input_selections + + require_matching_span = self.require_matching_span + regex_field = self.regex_field registered_scorer_id: None | str | Unset @@ -441,6 +472,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["default_model_alias"] = default_model_alias if ground_truth is not UNSET: field_dict["ground_truth"] = ground_truth + if metadata_selection is not UNSET: + field_dict["metadata_selection"] = metadata_selection + if span_input_selections is not UNSET: + field_dict["span_input_selections"] = span_input_selections + if require_matching_span is not UNSET: + field_dict["require_matching_span"] = require_matching_span if regex_field is not UNSET: field_dict["regex_field"] = regex_field if registered_scorer_id is not UNSET: @@ -500,6 +537,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.metadata_filter import MetadataFilter from ..models.modality_filter import ModalityFilter from ..models.node_name_filter import NodeNameFilter + from ..models.scorer_metadata_selection import ScorerMetadataSelection + from ..models.span_input_selection import SpanInputSelection d = dict(src_dict) scorer_name = d.pop("scorer_name", UNSET) @@ -708,6 +747,49 @@ def _parse_ground_truth(data: object) -> bool | None | Unset: ground_truth = _parse_ground_truth(d.pop("ground_truth", UNSET)) + def _parse_metadata_selection(data: object) -> None | ScorerMetadataSelection | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + metadata_selection_type_0 = ScorerMetadataSelection.from_dict(data) + + return metadata_selection_type_0 + except: # noqa: E722 + pass + return cast(None | ScorerMetadataSelection | Unset, data) + + metadata_selection = _parse_metadata_selection(d.pop("metadata_selection", UNSET)) + + def _parse_span_input_selections(data: object) -> list[SpanInputSelection] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + span_input_selections_type_0 = [] + _span_input_selections_type_0 = data + for span_input_selections_type_0_item_data in _span_input_selections_type_0: + span_input_selections_type_0_item = SpanInputSelection.from_dict( + span_input_selections_type_0_item_data + ) + + span_input_selections_type_0.append(span_input_selections_type_0_item) + + return span_input_selections_type_0 + except: # noqa: E722 + pass + return cast(list[SpanInputSelection] | None | Unset, data) + + span_input_selections = _parse_span_input_selections(d.pop("span_input_selections", UNSET)) + + require_matching_span = d.pop("require_matching_span", UNSET) + regex_field = d.pop("regex_field", UNSET) def _parse_registered_scorer_id(data: object) -> None | str | Unset: @@ -1045,6 +1127,9 @@ def _parse_scorer_path_name(data: object) -> None | str | Unset: num_judges=num_judges, default_model_alias=default_model_alias, ground_truth=ground_truth, + metadata_selection=metadata_selection, + span_input_selections=span_input_selections, + require_matching_span=require_matching_span, regex_field=regex_field, registered_scorer_id=registered_scorer_id, generated_scorer_id=generated_scorer_id, diff --git a/src/splunk_ao/resources/models/billing_usage_metric.py b/src/splunk_ao/resources/models/billing_usage_metric.py index 6491f30c..3414b811 100644 --- a/src/splunk_ao/resources/models/billing_usage_metric.py +++ b/src/splunk_ao/resources/models/billing_usage_metric.py @@ -2,6 +2,7 @@ class BillingUsageMetric(str, Enum): + LUNA_DECISION_INPUT_TOKENS = "luna_decision_input_tokens" LUNA_FINE_TUNING_RUNS = "luna_fine_tuning_runs" LUNA_TOKENS = "luna_tokens" MONTHLY_ACTIVE_USERS = "monthly_active_users" diff --git a/src/splunk_ao/resources/models/choice_rating.py b/src/splunk_ao/resources/models/choice_rating.py index 744238a6..6853e9cd 100644 --- a/src/splunk_ao/resources/models/choice_rating.py +++ b/src/splunk_ao/resources/models/choice_rating.py @@ -16,23 +16,23 @@ class ChoiceRating: """ Attributes: value (str): - annotation_type (Literal['choice'] | Unset): Default: 'choice'. + feedback_type (Literal['choice'] | Unset): Default: 'choice'. """ value: str - annotation_type: Literal["choice"] | Unset = "choice" + feedback_type: Literal["choice"] | Unset = "choice" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: value = self.value - annotation_type = self.annotation_type + feedback_type = self.feedback_type field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"value": value}) - if annotation_type is not UNSET: - field_dict["annotation_type"] = annotation_type + if feedback_type is not UNSET: + field_dict["feedback_type"] = feedback_type return field_dict @@ -41,11 +41,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) value = d.pop("value") - annotation_type = cast(Literal["choice"] | Unset, d.pop("annotation_type", UNSET)) - if annotation_type != "choice" and not isinstance(annotation_type, Unset): - raise ValueError(f"annotation_type must match const 'choice', got '{annotation_type}'") + feedback_type = cast(Literal["choice"] | Unset, d.pop("feedback_type", UNSET)) + if feedback_type != "choice" and not isinstance(feedback_type, Unset): + raise ValueError(f"feedback_type must match const 'choice', got '{feedback_type}'") - choice_rating = cls(value=value, annotation_type=annotation_type) + choice_rating = cls(value=value, feedback_type=feedback_type) choice_rating.additional_properties = d return choice_rating diff --git a/src/splunk_ao/resources/models/code_metric_policy_notices_response.py b/src/splunk_ao/resources/models/code_metric_policy_notices_response.py new file mode 100644 index 00000000..9b992841 --- /dev/null +++ b/src/splunk_ao/resources/models/code_metric_policy_notices_response.py @@ -0,0 +1,75 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.code_metric_policy_status import CodeMetricPolicyStatus + + +T = TypeVar("T", bound="CodeMetricPolicyNoticesResponse") + + +@_attrs_define +class CodeMetricPolicyNoticesResponse: + """ + Attributes: + notices (list[CodeMetricPolicyStatus]): + total (int): + """ + + notices: list[CodeMetricPolicyStatus] + total: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + notices = [] + for notices_item_data in self.notices: + notices_item = notices_item_data.to_dict() + notices.append(notices_item) + + total = self.total + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({"notices": notices, "total": total}) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.code_metric_policy_status import CodeMetricPolicyStatus + + d = dict(src_dict) + notices = [] + _notices = d.pop("notices") + for notices_item_data in _notices: + notices_item = CodeMetricPolicyStatus.from_dict(notices_item_data) + + notices.append(notices_item) + + total = d.pop("total") + + code_metric_policy_notices_response = cls(notices=notices, total=total) + + code_metric_policy_notices_response.additional_properties = d + return code_metric_policy_notices_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/code_metric_policy_state.py b/src/splunk_ao/resources/models/code_metric_policy_state.py new file mode 100644 index 00000000..d2e8c7de --- /dev/null +++ b/src/splunk_ao/resources/models/code_metric_policy_state.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class CodeMetricPolicyState(str, Enum): + BLOCKED = "blocked" + END_OF_LIFE_SOON = "end_of_life_soon" + SAVE_AGAIN = "save_again" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/code_metric_policy_status.py b/src/splunk_ao/resources/models/code_metric_policy_status.py new file mode 100644 index 00000000..97a1cefc --- /dev/null +++ b/src/splunk_ao/resources/models/code_metric_policy_status.py @@ -0,0 +1,124 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.code_metric_policy_state import CodeMetricPolicyState + +if TYPE_CHECKING: + from ..models.policy_package_notice import PolicyPackageNotice + + +T = TypeVar("T", bound="CodeMetricPolicyStatus") + + +@_attrs_define +class CodeMetricPolicyStatus: + """The package-policy state of one code metric's default version. + + Attributes: + scorer_id (str): + scorer_name (str): + scorer_version_id (None | str): + state (CodeMetricPolicyState): + message (str): + packages (list[PolicyPackageNotice]): + """ + + scorer_id: str + scorer_name: str + scorer_version_id: None | str + state: CodeMetricPolicyState + message: str + packages: list[PolicyPackageNotice] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + scorer_id = self.scorer_id + + scorer_name = self.scorer_name + + scorer_version_id: None | str + scorer_version_id = self.scorer_version_id + + state = self.state.value + + message = self.message + + packages = [] + for packages_item_data in self.packages: + packages_item = packages_item_data.to_dict() + packages.append(packages_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "scorer_id": scorer_id, + "scorer_name": scorer_name, + "scorer_version_id": scorer_version_id, + "state": state, + "message": message, + "packages": packages, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.policy_package_notice import PolicyPackageNotice + + d = dict(src_dict) + scorer_id = d.pop("scorer_id") + + scorer_name = d.pop("scorer_name") + + def _parse_scorer_version_id(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + scorer_version_id = _parse_scorer_version_id(d.pop("scorer_version_id")) + + state = CodeMetricPolicyState(d.pop("state")) + + message = d.pop("message") + + packages = [] + _packages = d.pop("packages") + for packages_item_data in _packages: + packages_item = PolicyPackageNotice.from_dict(packages_item_data) + + packages.append(packages_item) + + code_metric_policy_status = cls( + scorer_id=scorer_id, + scorer_name=scorer_name, + scorer_version_id=scorer_version_id, + state=state, + message=message, + packages=packages, + ) + + code_metric_policy_status.additional_properties = d + return code_metric_policy_status + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/code_metric_policy_status_request.py b/src/splunk_ao/resources/models/code_metric_policy_status_request.py new file mode 100644 index 00000000..f1d24b5f --- /dev/null +++ b/src/splunk_ao/resources/models/code_metric_policy_status_request.py @@ -0,0 +1,36 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="CodeMetricPolicyStatusRequest") + + +@_attrs_define +class CodeMetricPolicyStatusRequest: + """ + Attributes: + scorer_ids (list[str]): + """ + + scorer_ids: list[str] + + def to_dict(self) -> dict[str, Any]: + scorer_ids = self.scorer_ids + + field_dict: dict[str, Any] = {} + + field_dict.update({"scorer_ids": scorer_ids}) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + scorer_ids = cast(list[str], d.pop("scorer_ids")) + + code_metric_policy_status_request = cls(scorer_ids=scorer_ids) + + return code_metric_policy_status_request diff --git a/src/splunk_ao/resources/models/code_metric_policy_status_response.py b/src/splunk_ao/resources/models/code_metric_policy_status_response.py new file mode 100644 index 00000000..1c062e2a --- /dev/null +++ b/src/splunk_ao/resources/models/code_metric_policy_status_response.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.code_metric_policy_status import CodeMetricPolicyStatus + + +T = TypeVar("T", bound="CodeMetricPolicyStatusResponse") + + +@_attrs_define +class CodeMetricPolicyStatusResponse: + """ + Attributes: + scorers (list[CodeMetricPolicyStatus]): + """ + + scorers: list[CodeMetricPolicyStatus] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + scorers = [] + for scorers_item_data in self.scorers: + scorers_item = scorers_item_data.to_dict() + scorers.append(scorers_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({"scorers": scorers}) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.code_metric_policy_status import CodeMetricPolicyStatus + + d = dict(src_dict) + scorers = [] + _scorers = d.pop("scorers") + for scorers_item_data in _scorers: + scorers_item = CodeMetricPolicyStatus.from_dict(scorers_item_data) + + scorers.append(scorers_item) + + code_metric_policy_status_response = cls(scorers=scorers) + + code_metric_policy_status_response.additional_properties = d + return code_metric_policy_status_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/control_span.py b/src/splunk_ao/resources/models/control_span.py deleted file mode 100644 index 1100fe98..00000000 --- a/src/splunk_ao/resources/models/control_span.py +++ /dev/null @@ -1,715 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.control_applies_to import ControlAppliesTo -from ..models.control_check_stage import ControlCheckStage -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.control_span_dataset_metadata import ControlSpanDatasetMetadata - from ..models.control_span_user_metadata import ControlSpanUserMetadata - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="ControlSpan") - - -@_attrs_define -class ControlSpan: - """ - Attributes: - type_ (Literal['control'] | Unset): Type of the trace, span or session. Default: 'control'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | None | Unset): Output of the trace or span. - redacted_output (ControlResult | None | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (ControlSpanUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (ControlSpanDatasetMetadata | Unset): Metadata from the dataset associated with this trace - id (None | str | Unset): Galileo ID of the session, trace or span - session_id (None | str | Unset): Galileo ID of the session containing the trace or span or session - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - step_number (int | None | Unset): Topological step number of the span. - parent_id (None | str | Unset): Galileo ID of the parent of this span - control_id (int | None | Unset): Identifier of the control definition that produced this span. - agent_name (None | str | Unset): Normalized agent name associated with this control execution. - check_stage (ControlCheckStage | None | Unset): Execution stage where the control ran, typically 'pre' or - 'post'. - applies_to (ControlAppliesTo | None | Unset): Parent execution type the control applied to, for example - 'llm_call' or 'tool_call'. - evaluator_name (None | str | Unset): Representative evaluator name for this control span. For composite - controls, this is the primary evaluator chosen for observability identity. - selector_path (None | str | Unset): Representative selector path for this control span. For composite controls, - this is the primary selector path chosen for observability identity. - """ - - type_: Literal["control"] | Unset = "control" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | None | Unset = UNSET - redacted_output: ControlResult | None | Unset = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: ControlSpanUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: ControlSpanDatasetMetadata | Unset = UNSET - id: None | str | Unset = UNSET - session_id: None | str | Unset = UNSET - trace_id: None | str | Unset = UNSET - step_number: int | None | Unset = UNSET - parent_id: None | str | Unset = UNSET - control_id: int | None | Unset = UNSET - agent_name: None | str | Unset = UNSET - check_stage: ControlCheckStage | None | Unset = UNSET - applies_to: ControlAppliesTo | None | Unset = UNSET - evaluator_name: None | str | Unset = UNSET - selector_path: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.text_content_part import TextContentPart - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | None | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | None | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - id: None | str | Unset - if isinstance(self.id, Unset): - id = UNSET - else: - id = self.id - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - parent_id: None | str | Unset - if isinstance(self.parent_id, Unset): - parent_id = UNSET - else: - parent_id = self.parent_id - - control_id: int | None | Unset - if isinstance(self.control_id, Unset): - control_id = UNSET - else: - control_id = self.control_id - - agent_name: None | str | Unset - if isinstance(self.agent_name, Unset): - agent_name = UNSET - else: - agent_name = self.agent_name - - check_stage: None | str | Unset - if isinstance(self.check_stage, Unset): - check_stage = UNSET - elif isinstance(self.check_stage, ControlCheckStage): - check_stage = self.check_stage.value - else: - check_stage = self.check_stage - - applies_to: None | str | Unset - if isinstance(self.applies_to, Unset): - applies_to = UNSET - elif isinstance(self.applies_to, ControlAppliesTo): - applies_to = self.applies_to.value - else: - applies_to = self.applies_to - - evaluator_name: None | str | Unset - if isinstance(self.evaluator_name, Unset): - evaluator_name = UNSET - else: - evaluator_name = self.evaluator_name - - selector_path: None | str | Unset - if isinstance(self.selector_path, Unset): - selector_path = UNSET - else: - selector_path = self.selector_path - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if id is not UNSET: - field_dict["id"] = id - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if step_number is not UNSET: - field_dict["step_number"] = step_number - if parent_id is not UNSET: - field_dict["parent_id"] = parent_id - if control_id is not UNSET: - field_dict["control_id"] = control_id - if agent_name is not UNSET: - field_dict["agent_name"] = agent_name - if check_stage is not UNSET: - field_dict["check_stage"] = check_stage - if applies_to is not UNSET: - field_dict["applies_to"] = applies_to - if evaluator_name is not UNSET: - field_dict["evaluator_name"] = evaluator_name - if selector_path is not UNSET: - field_dict["selector_path"] = selector_path - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.control_span_dataset_metadata import ControlSpanDatasetMetadata - from ..models.control_span_user_metadata import ControlSpanUserMetadata - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - type_ = cast(Literal["control"] | Unset, d.pop("type", UNSET)) - if type_ != "control" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'control', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output(data: object) -> ControlResult | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_0 = ControlResult.from_dict(data) - - return output_type_0 - except: # noqa: E722 - pass - return cast(ControlResult | None | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output(data: object) -> ControlResult | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_0 = ControlResult.from_dict(data) - - return redacted_output_type_0 - except: # noqa: E722 - pass - return cast(ControlResult | None | Unset, data) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: ControlSpanUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = ControlSpanUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: ControlSpanDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = ControlSpanDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - id = _parse_id(d.pop("id", UNSET)) - - def _parse_session_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - def _parse_parent_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - parent_id = _parse_parent_id(d.pop("parent_id", UNSET)) - - def _parse_control_id(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - control_id = _parse_control_id(d.pop("control_id", UNSET)) - - def _parse_agent_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_name = _parse_agent_name(d.pop("agent_name", UNSET)) - - def _parse_check_stage(data: object) -> ControlCheckStage | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - check_stage_type_0 = ControlCheckStage(data) - - return check_stage_type_0 - except: # noqa: E722 - pass - return cast(ControlCheckStage | None | Unset, data) - - check_stage = _parse_check_stage(d.pop("check_stage", UNSET)) - - def _parse_applies_to(data: object) -> ControlAppliesTo | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - applies_to_type_0 = ControlAppliesTo(data) - - return applies_to_type_0 - except: # noqa: E722 - pass - return cast(ControlAppliesTo | None | Unset, data) - - applies_to = _parse_applies_to(d.pop("applies_to", UNSET)) - - def _parse_evaluator_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - evaluator_name = _parse_evaluator_name(d.pop("evaluator_name", UNSET)) - - def _parse_selector_path(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - selector_path = _parse_selector_path(d.pop("selector_path", UNSET)) - - control_span = cls( - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - id=id, - session_id=session_id, - trace_id=trace_id, - step_number=step_number, - parent_id=parent_id, - control_id=control_id, - agent_name=agent_name, - check_stage=check_stage, - applies_to=applies_to, - evaluator_name=evaluator_name, - selector_path=selector_path, - ) - - control_span.additional_properties = d - return control_span - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/control_span_dataset_metadata.py b/src/splunk_ao/resources/models/control_span_dataset_metadata.py deleted file mode 100644 index 0f1e7df1..00000000 --- a/src/splunk_ao/resources/models/control_span_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ControlSpanDatasetMetadata") - - -@_attrs_define -class ControlSpanDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - control_span_dataset_metadata = cls() - - control_span_dataset_metadata.additional_properties = d - return control_span_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/control_span_user_metadata.py b/src/splunk_ao/resources/models/control_span_user_metadata.py deleted file mode 100644 index 0a00533d..00000000 --- a/src/splunk_ao/resources/models/control_span_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ControlSpanUserMetadata") - - -@_attrs_define -class ControlSpanUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - control_span_user_metadata = cls() - - control_span_user_metadata.additional_properties = d - return control_span_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/create_scorer_request.py b/src/splunk_ao/resources/models/create_scorer_request.py index f4993d14..700de03c 100644 --- a/src/splunk_ao/resources/models/create_scorer_request.py +++ b/src/splunk_ao/resources/models/create_scorer_request.py @@ -19,7 +19,7 @@ from ..models.metric_color_picker_categorical import MetricColorPickerCategorical from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric - from ..models.scorer_defaults import ScorerDefaults + from ..models.scorer_defaults_request import ScorerDefaultsRequest from ..models.scorer_invocation_config import ScorerInvocationConfig @@ -36,7 +36,7 @@ class CreateScorerRequest: label (None | str | Unset): description (None | str | Unset): Default: ''. tags (list[str] | Unset): - defaults (None | ScorerDefaults | Unset): + defaults (None | ScorerDefaultsRequest | Unset): invocation (None | ScorerInvocationConfig | Unset): deprecated (bool | None | Unset): model_type (ModelType | None | Unset): @@ -62,7 +62,7 @@ class CreateScorerRequest: label: None | str | Unset = UNSET description: None | str | Unset = "" tags: list[str] | Unset = UNSET - defaults: None | ScorerDefaults | Unset = UNSET + defaults: None | ScorerDefaultsRequest | Unset = UNSET invocation: None | ScorerInvocationConfig | Unset = UNSET deprecated: bool | None | Unset = UNSET model_type: ModelType | None | Unset = UNSET @@ -93,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.metric_color_picker_categorical import MetricColorPickerCategorical from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric - from ..models.scorer_defaults import ScorerDefaults + from ..models.scorer_defaults_request import ScorerDefaultsRequest from ..models.scorer_invocation_config import ScorerInvocationConfig name = self.name @@ -125,7 +125,7 @@ def to_dict(self) -> dict[str, Any]: defaults: dict[str, Any] | None | Unset if isinstance(self.defaults, Unset): defaults = UNSET - elif isinstance(self.defaults, ScorerDefaults): + elif isinstance(self.defaults, ScorerDefaultsRequest): defaults = self.defaults.to_dict() else: defaults = self.defaults @@ -311,7 +311,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.metric_color_picker_categorical import MetricColorPickerCategorical from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric - from ..models.scorer_defaults import ScorerDefaults + from ..models.scorer_defaults_request import ScorerDefaultsRequest from ..models.scorer_invocation_config import ScorerInvocationConfig d = dict(src_dict) @@ -348,7 +348,7 @@ def _parse_description(data: object) -> None | str | Unset: tags = cast(list[str], d.pop("tags", UNSET)) - def _parse_defaults(data: object) -> None | ScorerDefaults | Unset: + def _parse_defaults(data: object) -> None | ScorerDefaultsRequest | Unset: if data is None: return data if isinstance(data, Unset): @@ -356,12 +356,12 @@ def _parse_defaults(data: object) -> None | ScorerDefaults | Unset: try: if not isinstance(data, dict): raise TypeError() - defaults_type_0 = ScorerDefaults.from_dict(data) + defaults_type_0 = ScorerDefaultsRequest.from_dict(data) return defaults_type_0 except: # noqa: E722 pass - return cast(None | ScorerDefaults | Unset, data) + return cast(None | ScorerDefaultsRequest | Unset, data) defaults = _parse_defaults(d.pop("defaults", UNSET)) diff --git a/src/splunk_ao/resources/models/credit_balance.py b/src/splunk_ao/resources/models/credit_balance.py new file mode 100644 index 00000000..79f0cf51 --- /dev/null +++ b/src/splunk_ao/resources/models/credit_balance.py @@ -0,0 +1,124 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreditBalance") + + +@_attrs_define +class CreditBalance: + """ + Attributes: + organization_id (UUID): + granted_tokens (int): + consumed_tokens (int): + reserved_tokens (int): + available_tokens (int): + exhausted (bool): + unit (Literal['input_tokens'] | Unset): Default: 'input_tokens'. + eligible (bool | Unset): Default: True. + """ + + organization_id: UUID + granted_tokens: int + consumed_tokens: int + reserved_tokens: int + available_tokens: int + exhausted: bool + unit: Literal["input_tokens"] | Unset = "input_tokens" + eligible: bool | Unset = True + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + organization_id = str(self.organization_id) + + granted_tokens = self.granted_tokens + + consumed_tokens = self.consumed_tokens + + reserved_tokens = self.reserved_tokens + + available_tokens = self.available_tokens + + exhausted = self.exhausted + + unit = self.unit + + eligible = self.eligible + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "organization_id": organization_id, + "granted_tokens": granted_tokens, + "consumed_tokens": consumed_tokens, + "reserved_tokens": reserved_tokens, + "available_tokens": available_tokens, + "exhausted": exhausted, + } + ) + if unit is not UNSET: + field_dict["unit"] = unit + if eligible is not UNSET: + field_dict["eligible"] = eligible + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + organization_id = UUID(d.pop("organization_id")) + + granted_tokens = d.pop("granted_tokens") + + consumed_tokens = d.pop("consumed_tokens") + + reserved_tokens = d.pop("reserved_tokens") + + available_tokens = d.pop("available_tokens") + + exhausted = d.pop("exhausted") + + unit = cast(Literal["input_tokens"] | Unset, d.pop("unit", UNSET)) + if unit != "input_tokens" and not isinstance(unit, Unset): + raise ValueError(f"unit must match const 'input_tokens', got '{unit}'") + + eligible = d.pop("eligible", UNSET) + + credit_balance = cls( + organization_id=organization_id, + granted_tokens=granted_tokens, + consumed_tokens=consumed_tokens, + reserved_tokens=reserved_tokens, + available_tokens=available_tokens, + exhausted=exhausted, + unit=unit, + eligible=eligible, + ) + + credit_balance.additional_properties = d + return credit_balance + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/custom_dashboard_action.py b/src/splunk_ao/resources/models/custom_dashboard_action.py new file mode 100644 index 00000000..d128c218 --- /dev/null +++ b/src/splunk_ao/resources/models/custom_dashboard_action.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class CustomDashboardAction(str, Enum): + DELETE = "delete" + SHARE = "share" + TRANSFER = "transfer" + UPDATE = "update" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/dataset_name_filter_operator.py b/src/splunk_ao/resources/models/dataset_name_filter_operator.py index 4a82f836..a06f70ea 100644 --- a/src/splunk_ao/resources/models/dataset_name_filter_operator.py +++ b/src/splunk_ao/resources/models/dataset_name_filter_operator.py @@ -7,6 +7,7 @@ class DatasetNameFilterOperator(str, Enum): NE = "ne" NOT_IN = "not_in" ONE_OF = "one_of" + REGEX = "regex" def __str__(self) -> str: return str(self.value) diff --git a/src/splunk_ao/resources/models/decision_boolean_criteria.py b/src/splunk_ao/resources/models/decision_boolean_criteria.py index d8ceb107..af6c41ab 100644 --- a/src/splunk_ao/resources/models/decision_boolean_criteria.py +++ b/src/splunk_ao/resources/models/decision_boolean_criteria.py @@ -10,8 +10,7 @@ @_attrs_define class DecisionBooleanCriteria: - """What a true answer and a false answer mean, for a yes/no question. The two are set together. - + """ Attributes: true_ (str): false_ (str): diff --git a/src/splunk_ao/resources/models/decision_choice.py b/src/splunk_ao/resources/models/decision_choice.py index bf7952ec..10eba470 100644 --- a/src/splunk_ao/resources/models/decision_choice.py +++ b/src/splunk_ao/resources/models/decision_choice.py @@ -12,13 +12,11 @@ @_attrs_define class DecisionChoice: - """One option of a choice question, with an optional description of when it applies. + """Extra fields are forbidden so a score level never validates as a choice. - Extra fields are forbidden, so a level, which has a ``level`` field, never validates as a choice. - - Attributes: - label (str): - description (None | str | Unset): + Attributes: + label (str): + description (None | str | Unset): """ label: str diff --git a/src/splunk_ao/resources/models/decision_model_properties.py b/src/splunk_ao/resources/models/decision_model_properties.py new file mode 100644 index 00000000..a772b08a --- /dev/null +++ b/src/splunk_ao/resources/models/decision_model_properties.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="DecisionModelProperties") + + +@_attrs_define +class DecisionModelProperties: + """One decision model that a custom integration serves. The registry entry of the same name supplies the rest. + + Attributes: + name (str): Name of a decision model that a custom integration can serve, such as 'kairos-jev'. + """ + + name: str + + def to_dict(self) -> dict[str, Any]: + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update({"name": name}) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + decision_model_properties = cls(name=name) + + return decision_model_properties diff --git a/src/splunk_ao/resources/models/decision_scorer_test_configuration.py b/src/splunk_ao/resources/models/decision_scorer_test_configuration.py index 6bf2e0fd..bfcaa316 100644 --- a/src/splunk_ao/resources/models/decision_scorer_test_configuration.py +++ b/src/splunk_ao/resources/models/decision_scorer_test_configuration.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -11,6 +11,10 @@ from ..models.step_type import StepType from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.scorer_metadata_selection import ScorerMetadataSelection + + T = TypeVar("T", bound="DecisionScorerTestConfiguration") @@ -26,15 +30,19 @@ class DecisionScorerTestConfiguration: scoreable_node_types (list[StepType]): input_type (InputTypeEnum | None | Unset): ground_truth (bool | Unset): Default: False. + metadata_selection (None | ScorerMetadataSelection | Unset): """ output_type: OutputTypeEnum scoreable_node_types: list[StepType] input_type: InputTypeEnum | None | Unset = UNSET ground_truth: bool | Unset = False + metadata_selection: None | ScorerMetadataSelection | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.scorer_metadata_selection import ScorerMetadataSelection + output_type = self.output_type.value scoreable_node_types = [] @@ -52,6 +60,14 @@ def to_dict(self) -> dict[str, Any]: ground_truth = self.ground_truth + metadata_selection: dict[str, Any] | None | Unset + if isinstance(self.metadata_selection, Unset): + metadata_selection = UNSET + elif isinstance(self.metadata_selection, ScorerMetadataSelection): + metadata_selection = self.metadata_selection.to_dict() + else: + metadata_selection = self.metadata_selection + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"output_type": output_type, "scoreable_node_types": scoreable_node_types}) @@ -59,11 +75,15 @@ def to_dict(self) -> dict[str, Any]: field_dict["input_type"] = input_type if ground_truth is not UNSET: field_dict["ground_truth"] = ground_truth + if metadata_selection is not UNSET: + field_dict["metadata_selection"] = metadata_selection return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.scorer_metadata_selection import ScorerMetadataSelection + d = dict(src_dict) output_type = OutputTypeEnum(d.pop("output_type")) @@ -93,11 +113,29 @@ def _parse_input_type(data: object) -> InputTypeEnum | None | Unset: ground_truth = d.pop("ground_truth", UNSET) + def _parse_metadata_selection(data: object) -> None | ScorerMetadataSelection | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + metadata_selection_type_0 = ScorerMetadataSelection.from_dict(data) + + return metadata_selection_type_0 + except: # noqa: E722 + pass + return cast(None | ScorerMetadataSelection | Unset, data) + + metadata_selection = _parse_metadata_selection(d.pop("metadata_selection", UNSET)) + decision_scorer_test_configuration = cls( output_type=output_type, scoreable_node_types=scoreable_node_types, input_type=input_type, ground_truth=ground_truth, + metadata_selection=metadata_selection, ) decision_scorer_test_configuration.additional_properties = d diff --git a/src/splunk_ao/resources/models/document.py b/src/splunk_ao/resources/models/document.py index a1e8523c..c57d86ca 100644 --- a/src/splunk_ao/resources/models/document.py +++ b/src/splunk_ao/resources/models/document.py @@ -18,15 +18,15 @@ class Document: """ Attributes: - content (str): Content of the document. + page_content (str): Content of the document. metadata (DocumentMetadata | Unset): """ - content: str + page_content: str metadata: DocumentMetadata | Unset = UNSET def to_dict(self) -> dict[str, Any]: - content = self.content + page_content = self.page_content metadata: dict[str, Any] | Unset = UNSET if not isinstance(self.metadata, Unset): @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - field_dict.update({"content": content}) + field_dict.update({"page_content": page_content}) if metadata is not UNSET: field_dict["metadata"] = metadata @@ -45,7 +45,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.document_metadata import DocumentMetadata d = dict(src_dict) - content = d.pop("content") + page_content = d.pop("page_content") _metadata = d.pop("metadata", UNSET) metadata: DocumentMetadata | Unset @@ -54,6 +54,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: metadata = DocumentMetadata.from_dict(_metadata) - document = cls(content=content, metadata=metadata) + document = cls(page_content=page_content, metadata=metadata) return document diff --git a/src/splunk_ao/resources/models/experiment_group_name_filter_operator.py b/src/splunk_ao/resources/models/experiment_group_name_filter_operator.py index d77911e2..1cd05f32 100644 --- a/src/splunk_ao/resources/models/experiment_group_name_filter_operator.py +++ b/src/splunk_ao/resources/models/experiment_group_name_filter_operator.py @@ -7,6 +7,7 @@ class ExperimentGroupNameFilterOperator(str, Enum): NE = "ne" NOT_IN = "not_in" ONE_OF = "one_of" + REGEX = "regex" def __str__(self) -> str: return str(self.value) diff --git a/src/splunk_ao/resources/models/extended_agent_span_record.py b/src/splunk_ao/resources/models/extended_agent_span_record.py deleted file mode 100644 index 8e85e8e5..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record.py +++ /dev/null @@ -1,1262 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.agent_type import AgentType -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_agent_span_record_annotation_aggregates import ExtendedAgentSpanRecordAnnotationAggregates - from ..models.extended_agent_span_record_annotation_agreement import ExtendedAgentSpanRecordAnnotationAgreement - from ..models.extended_agent_span_record_annotations import ExtendedAgentSpanRecordAnnotations - from ..models.extended_agent_span_record_dataset_metadata import ExtendedAgentSpanRecordDatasetMetadata - from ..models.extended_agent_span_record_feedback_rating_info import ExtendedAgentSpanRecordFeedbackRatingInfo - from ..models.extended_agent_span_record_files_type_0 import ExtendedAgentSpanRecordFilesType0 - from ..models.extended_agent_span_record_metric_info_type_0 import ExtendedAgentSpanRecordMetricInfoType0 - from ..models.extended_agent_span_record_user_metadata import ExtendedAgentSpanRecordUserMetadata - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="ExtendedAgentSpanRecord") - - -@_attrs_define -class ExtendedAgentSpanRecord: - """ - Attributes: - id (str): Galileo ID of the session, trace or span - session_id (str): Galileo ID of the session containing the trace (or the same value as id for a trace) - project_id (str): Galileo ID of the project associated with this trace or span - run_id (str): Galileo ID of the run (log stream or experiment) associated with this trace or span - parent_id (str): Galileo ID of the parent of this span - type_ (Literal['agent'] | Unset): Type of the trace, span or session. Default: 'agent'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (ExtendedAgentSpanRecordUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (ExtendedAgentSpanRecordDatasetMetadata | Unset): Metadata from the dataset associated with - this trace - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (ExtendedAgentSpanRecordFeedbackRatingInfo | Unset): Feedback information related to the - record - annotations (ExtendedAgentSpanRecordAnnotations | Unset): Annotations keyed by template ID and annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (ExtendedAgentSpanRecordAnnotationAggregates | Unset): Annotation aggregate information - keyed by template ID - annotation_agreement (ExtendedAgentSpanRecordAnnotationAgreement | Unset): Annotation agreement scores keyed by - template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (ExtendedAgentSpanRecordMetricInfoType0 | None | Unset): Detailed information about the metrics - associated with this trace or span - files (ExtendedAgentSpanRecordFilesType0 | None | Unset): File metadata keyed by file ID for files associated - with this record - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - agent_type (AgentType | Unset): - agent_name (None | str | Unset): Name of the agent. - """ - - id: str - session_id: str - project_id: str - run_id: str - parent_id: str - type_: Literal["agent"] | Unset = "agent" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: ExtendedAgentSpanRecordUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: ExtendedAgentSpanRecordDatasetMetadata | Unset = UNSET - trace_id: None | str | Unset = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: ExtendedAgentSpanRecordFeedbackRatingInfo | Unset = UNSET - annotations: ExtendedAgentSpanRecordAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: ExtendedAgentSpanRecordAnnotationAggregates | Unset = UNSET - annotation_agreement: ExtendedAgentSpanRecordAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: ExtendedAgentSpanRecordMetricInfoType0 | None | Unset = UNSET - files: ExtendedAgentSpanRecordFilesType0 | None | Unset = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - agent_type: AgentType | Unset = UNSET - agent_name: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.extended_agent_span_record_files_type_0 import ExtendedAgentSpanRecordFilesType0 - from ..models.extended_agent_span_record_metric_info_type_0 import ExtendedAgentSpanRecordMetricInfoType0 - from ..models.message import Message - from ..models.text_content_part import TextContentPart - - id = self.id - - session_id = self.session_id - - project_id = self.project_id - - run_id = self.run_id - - parent_id = self.parent_id - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, ExtendedAgentSpanRecordMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, ExtendedAgentSpanRecordFilesType0): - files = self.files.to_dict() - else: - files = self.files - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - agent_type: str | Unset = UNSET - if not isinstance(self.agent_type, Unset): - agent_type = self.agent_type.value - - agent_name: None | str | Unset - if isinstance(self.agent_name, Unset): - agent_name = UNSET - else: - agent_name = self.agent_name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - {"id": id, "session_id": session_id, "project_id": project_id, "run_id": run_id, "parent_id": parent_id} - ) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - if agent_type is not UNSET: - field_dict["agent_type"] = agent_type - if agent_name is not UNSET: - field_dict["agent_name"] = agent_name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_agent_span_record_annotation_aggregates import ( - ExtendedAgentSpanRecordAnnotationAggregates, - ) - from ..models.extended_agent_span_record_annotation_agreement import ExtendedAgentSpanRecordAnnotationAgreement - from ..models.extended_agent_span_record_annotations import ExtendedAgentSpanRecordAnnotations - from ..models.extended_agent_span_record_dataset_metadata import ExtendedAgentSpanRecordDatasetMetadata - from ..models.extended_agent_span_record_feedback_rating_info import ExtendedAgentSpanRecordFeedbackRatingInfo - from ..models.extended_agent_span_record_files_type_0 import ExtendedAgentSpanRecordFilesType0 - from ..models.extended_agent_span_record_metric_info_type_0 import ExtendedAgentSpanRecordMetricInfoType0 - from ..models.extended_agent_span_record_user_metadata import ExtendedAgentSpanRecordUserMetadata - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - id = d.pop("id") - - session_id = d.pop("session_id") - - project_id = d.pop("project_id") - - run_id = d.pop("run_id") - - parent_id = d.pop("parent_id") - - type_ = cast(Literal["agent"] | Unset, d.pop("type", UNSET)) - if type_ != "agent" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'agent', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: ExtendedAgentSpanRecordUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = ExtendedAgentSpanRecordUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: ExtendedAgentSpanRecordDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = ExtendedAgentSpanRecordDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: ExtendedAgentSpanRecordFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = ExtendedAgentSpanRecordFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: ExtendedAgentSpanRecordAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = ExtendedAgentSpanRecordAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: ExtendedAgentSpanRecordAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = ExtendedAgentSpanRecordAnnotationAggregates.from_dict(_annotation_aggregates) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: ExtendedAgentSpanRecordAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = ExtendedAgentSpanRecordAnnotationAgreement.from_dict(_annotation_agreement) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> ExtendedAgentSpanRecordMetricInfoType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = ExtendedAgentSpanRecordMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(ExtendedAgentSpanRecordMetricInfoType0 | None | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> ExtendedAgentSpanRecordFilesType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = ExtendedAgentSpanRecordFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(ExtendedAgentSpanRecordFilesType0 | None | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - _agent_type = d.pop("agent_type", UNSET) - agent_type: AgentType | Unset - if isinstance(_agent_type, Unset): - agent_type = UNSET - else: - agent_type = AgentType(_agent_type) - - def _parse_agent_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_name = _parse_agent_name(d.pop("agent_name", UNSET)) - - extended_agent_span_record = cls( - id=id, - session_id=session_id, - project_id=project_id, - run_id=run_id, - parent_id=parent_id, - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - trace_id=trace_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - is_complete=is_complete, - step_number=step_number, - agent_type=agent_type, - agent_name=agent_name, - ) - - extended_agent_span_record.additional_properties = d - return extended_agent_span_record - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_annotation_aggregates.py b/src/splunk_ao/resources/models/extended_agent_span_record_annotation_aggregates.py deleted file mode 100644 index f14aea6f..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordAnnotationAggregates") - - -@_attrs_define -class ExtendedAgentSpanRecordAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - extended_agent_span_record_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_agent_span_record_annotation_aggregates.additional_properties = additional_properties - return extended_agent_span_record_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_annotation_agreement.py b/src/splunk_ao/resources/models/extended_agent_span_record_annotation_agreement.py deleted file mode 100644 index a8097a8f..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedAgentSpanRecordAnnotationAgreement") - - -@_attrs_define -class ExtendedAgentSpanRecordAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_agent_span_record_annotation_agreement = cls() - - extended_agent_span_record_annotation_agreement.additional_properties = d - return extended_agent_span_record_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_annotations.py b/src/splunk_ao/resources/models/extended_agent_span_record_annotations.py deleted file mode 100644 index 467141df..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.extended_agent_span_record_annotations_additional_property import ( - ExtendedAgentSpanRecordAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordAnnotations") - - -@_attrs_define -class ExtendedAgentSpanRecordAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, ExtendedAgentSpanRecordAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_agent_span_record_annotations_additional_property import ( - ExtendedAgentSpanRecordAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - extended_agent_span_record_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = ExtendedAgentSpanRecordAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_agent_span_record_annotations.additional_properties = additional_properties - return extended_agent_span_record_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> ExtendedAgentSpanRecordAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: ExtendedAgentSpanRecordAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_annotations_additional_property.py b/src/splunk_ao/resources/models/extended_agent_span_record_annotations_additional_property.py deleted file mode 100644 index 85a8b3f0..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_annotations_additional_property.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordAnnotationsAdditionalProperty") - - -@_attrs_define -class ExtendedAgentSpanRecordAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - extended_agent_span_record_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_agent_span_record_annotations_additional_property.additional_properties = additional_properties - return extended_agent_span_record_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_dataset_metadata.py b/src/splunk_ao/resources/models/extended_agent_span_record_dataset_metadata.py deleted file mode 100644 index 0b01fd90..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedAgentSpanRecordDatasetMetadata") - - -@_attrs_define -class ExtendedAgentSpanRecordDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_agent_span_record_dataset_metadata = cls() - - extended_agent_span_record_dataset_metadata.additional_properties = d - return extended_agent_span_record_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_feedback_rating_info.py b/src/splunk_ao/resources/models/extended_agent_span_record_feedback_rating_info.py deleted file mode 100644 index 34eec7ce..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordFeedbackRatingInfo") - - -@_attrs_define -class ExtendedAgentSpanRecordFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - extended_agent_span_record_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_agent_span_record_feedback_rating_info.additional_properties = additional_properties - return extended_agent_span_record_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_files_type_0.py b/src/splunk_ao/resources/models/extended_agent_span_record_files_type_0.py deleted file mode 100644 index 7a7a4316..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordFilesType0") - - -@_attrs_define -class ExtendedAgentSpanRecordFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - extended_agent_span_record_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_agent_span_record_files_type_0.additional_properties = additional_properties - return extended_agent_span_record_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_metric_info_type_0.py b/src/splunk_ao/resources/models/extended_agent_span_record_metric_info_type_0.py deleted file mode 100644 index 0dfcd83c..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordMetricInfoType0") - - -@_attrs_define -class ExtendedAgentSpanRecordMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - extended_agent_span_record_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_agent_span_record_metric_info_type_0.additional_properties = additional_properties - return extended_agent_span_record_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_user_metadata.py b/src/splunk_ao/resources/models/extended_agent_span_record_user_metadata.py deleted file mode 100644 index 66bd5ea9..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedAgentSpanRecordUserMetadata") - - -@_attrs_define -class ExtendedAgentSpanRecordUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_agent_span_record_user_metadata = cls() - - extended_agent_span_record_user_metadata.additional_properties = d - return extended_agent_span_record_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_with_children.py b/src/splunk_ao/resources/models/extended_agent_span_record_with_children.py deleted file mode 100644 index 675df0d9..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_with_children.py +++ /dev/null @@ -1,1510 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.agent_type import AgentType -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_agent_span_record_with_children_annotation_aggregates import ( - ExtendedAgentSpanRecordWithChildrenAnnotationAggregates, - ) - from ..models.extended_agent_span_record_with_children_annotation_agreement import ( - ExtendedAgentSpanRecordWithChildrenAnnotationAgreement, - ) - from ..models.extended_agent_span_record_with_children_annotations import ( - ExtendedAgentSpanRecordWithChildrenAnnotations, - ) - from ..models.extended_agent_span_record_with_children_dataset_metadata import ( - ExtendedAgentSpanRecordWithChildrenDatasetMetadata, - ) - from ..models.extended_agent_span_record_with_children_feedback_rating_info import ( - ExtendedAgentSpanRecordWithChildrenFeedbackRatingInfo, - ) - from ..models.extended_agent_span_record_with_children_files_type_0 import ( - ExtendedAgentSpanRecordWithChildrenFilesType0, - ) - from ..models.extended_agent_span_record_with_children_metric_info_type_0 import ( - ExtendedAgentSpanRecordWithChildrenMetricInfoType0, - ) - from ..models.extended_agent_span_record_with_children_user_metadata import ( - ExtendedAgentSpanRecordWithChildrenUserMetadata, - ) - from ..models.extended_control_span_record import ExtendedControlSpanRecord - from ..models.extended_http_span_record_with_children import ExtendedHttpSpanRecordWithChildren - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - from ..models.extended_retriever_span_record_with_children import ExtendedRetrieverSpanRecordWithChildren - from ..models.extended_tool_span_record_with_children import ExtendedToolSpanRecordWithChildren - from ..models.extended_workflow_span_record_with_children import ExtendedWorkflowSpanRecordWithChildren - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordWithChildren") - - -@_attrs_define -class ExtendedAgentSpanRecordWithChildren: - """ - Attributes: - id (str): Galileo ID of the session, trace or span - session_id (str): Galileo ID of the session containing the trace (or the same value as id for a trace) - project_id (str): Galileo ID of the project associated with this trace or span - run_id (str): Galileo ID of the run (log stream or experiment) associated with this trace or span - parent_id (str): Galileo ID of the parent of this span - spans (list[ExtendedAgentSpanRecordWithChildren | ExtendedControlSpanRecord | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord | ExtendedRetrieverSpanRecordWithChildren | ExtendedToolSpanRecordWithChildren | - ExtendedWorkflowSpanRecordWithChildren] | Unset): - type_ (Literal['agent'] | Unset): Type of the trace, span or session. Default: 'agent'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (ExtendedAgentSpanRecordWithChildrenUserMetadata | Unset): Metadata associated with this trace or - span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (ExtendedAgentSpanRecordWithChildrenDatasetMetadata | Unset): Metadata from the dataset - associated with this trace - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (ExtendedAgentSpanRecordWithChildrenFeedbackRatingInfo | Unset): Feedback information - related to the record - annotations (ExtendedAgentSpanRecordWithChildrenAnnotations | Unset): Annotations keyed by template ID and - annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (ExtendedAgentSpanRecordWithChildrenAnnotationAggregates | Unset): Annotation aggregate - information keyed by template ID - annotation_agreement (ExtendedAgentSpanRecordWithChildrenAnnotationAgreement | Unset): Annotation agreement - scores keyed by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (ExtendedAgentSpanRecordWithChildrenMetricInfoType0 | None | Unset): Detailed information about the - metrics associated with this trace or span - files (ExtendedAgentSpanRecordWithChildrenFilesType0 | None | Unset): File metadata keyed by file ID for files - associated with this record - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - agent_type (AgentType | Unset): - agent_name (None | str | Unset): Name of the agent. - """ - - id: str - session_id: str - project_id: str - run_id: str - parent_id: str - spans: ( - list[ - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - ] - | Unset - ) = UNSET - type_: Literal["agent"] | Unset = "agent" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: ExtendedAgentSpanRecordWithChildrenUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: ExtendedAgentSpanRecordWithChildrenDatasetMetadata | Unset = UNSET - trace_id: None | str | Unset = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: ExtendedAgentSpanRecordWithChildrenFeedbackRatingInfo | Unset = UNSET - annotations: ExtendedAgentSpanRecordWithChildrenAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: ExtendedAgentSpanRecordWithChildrenAnnotationAggregates | Unset = UNSET - annotation_agreement: ExtendedAgentSpanRecordWithChildrenAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: ExtendedAgentSpanRecordWithChildrenMetricInfoType0 | None | Unset = UNSET - files: ExtendedAgentSpanRecordWithChildrenFilesType0 | None | Unset = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - agent_type: AgentType | Unset = UNSET - agent_name: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.extended_agent_span_record_with_children_files_type_0 import ( - ExtendedAgentSpanRecordWithChildrenFilesType0, - ) - from ..models.extended_agent_span_record_with_children_metric_info_type_0 import ( - ExtendedAgentSpanRecordWithChildrenMetricInfoType0, - ) - from ..models.extended_control_span_record import ExtendedControlSpanRecord - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - from ..models.extended_retriever_span_record_with_children import ExtendedRetrieverSpanRecordWithChildren - from ..models.extended_tool_span_record_with_children import ExtendedToolSpanRecordWithChildren - from ..models.extended_workflow_span_record_with_children import ExtendedWorkflowSpanRecordWithChildren - from ..models.message import Message - from ..models.text_content_part import TextContentPart - - id = self.id - - session_id = self.session_id - - project_id = self.project_id - - run_id = self.run_id - - parent_id = self.parent_id - - spans: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.spans, Unset): - spans = [] - for spans_item_data in self.spans: - spans_item: dict[str, Any] - if isinstance(spans_item_data, ExtendedAgentSpanRecordWithChildren): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedWorkflowSpanRecordWithChildren): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedLlmSpanRecord): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedToolSpanRecordWithChildren): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedRetrieverSpanRecordWithChildren): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedControlSpanRecord): - spans_item = spans_item_data.to_dict() - else: - spans_item = spans_item_data.to_dict() - - spans.append(spans_item) - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, ExtendedAgentSpanRecordWithChildrenMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, ExtendedAgentSpanRecordWithChildrenFilesType0): - files = self.files.to_dict() - else: - files = self.files - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - agent_type: str | Unset = UNSET - if not isinstance(self.agent_type, Unset): - agent_type = self.agent_type.value - - agent_name: None | str | Unset - if isinstance(self.agent_name, Unset): - agent_name = UNSET - else: - agent_name = self.agent_name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - {"id": id, "session_id": session_id, "project_id": project_id, "run_id": run_id, "parent_id": parent_id} - ) - if spans is not UNSET: - field_dict["spans"] = spans - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - if agent_type is not UNSET: - field_dict["agent_type"] = agent_type - if agent_name is not UNSET: - field_dict["agent_name"] = agent_name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_agent_span_record_with_children_annotation_aggregates import ( - ExtendedAgentSpanRecordWithChildrenAnnotationAggregates, - ) - from ..models.extended_agent_span_record_with_children_annotation_agreement import ( - ExtendedAgentSpanRecordWithChildrenAnnotationAgreement, - ) - from ..models.extended_agent_span_record_with_children_annotations import ( - ExtendedAgentSpanRecordWithChildrenAnnotations, - ) - from ..models.extended_agent_span_record_with_children_dataset_metadata import ( - ExtendedAgentSpanRecordWithChildrenDatasetMetadata, - ) - from ..models.extended_agent_span_record_with_children_feedback_rating_info import ( - ExtendedAgentSpanRecordWithChildrenFeedbackRatingInfo, - ) - from ..models.extended_agent_span_record_with_children_files_type_0 import ( - ExtendedAgentSpanRecordWithChildrenFilesType0, - ) - from ..models.extended_agent_span_record_with_children_metric_info_type_0 import ( - ExtendedAgentSpanRecordWithChildrenMetricInfoType0, - ) - from ..models.extended_agent_span_record_with_children_user_metadata import ( - ExtendedAgentSpanRecordWithChildrenUserMetadata, - ) - from ..models.extended_control_span_record import ExtendedControlSpanRecord - from ..models.extended_http_span_record_with_children import ExtendedHttpSpanRecordWithChildren - from ..models.extended_retriever_span_record_with_children import ExtendedRetrieverSpanRecordWithChildren - from ..models.extended_tool_span_record_with_children import ExtendedToolSpanRecordWithChildren - from ..models.extended_workflow_span_record_with_children import ExtendedWorkflowSpanRecordWithChildren - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - id = d.pop("id") - - session_id = d.pop("session_id") - - project_id = d.pop("project_id") - - run_id = d.pop("run_id") - - parent_id = d.pop("parent_id") - - _spans = d.pop("spans", UNSET) - spans: ( - list[ - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - ] - | Unset - ) = UNSET - if _spans is not UNSET: - spans = [] - for spans_item_data in _spans: - - def _parse_spans_item( - data: object, - ) -> ( - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - ): - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_0 = ExtendedAgentSpanRecordWithChildren.from_dict(data) - - return spans_item_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_1 = ExtendedWorkflowSpanRecordWithChildren.from_dict(data) - - return spans_item_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_2 = ExtendedLlmSpanRecord.from_dict(data) - - return spans_item_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_3 = ExtendedToolSpanRecordWithChildren.from_dict(data) - - return spans_item_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_4 = ExtendedRetrieverSpanRecordWithChildren.from_dict(data) - - return spans_item_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_5 = ExtendedControlSpanRecord.from_dict(data) - - return spans_item_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_6 = ExtendedHttpSpanRecordWithChildren.from_dict(data) - - return spans_item_type_6 - except: # noqa: E722 - pass - # If we reach here, none of the parsers succeeded - discriminator_info = ( - f" (type={data.get('type')})" if isinstance(data, dict) and "type" in data else "" - ) - raise ValueError(f"Could not parse union type for spans_item{discriminator_info}") - - spans_item = _parse_spans_item(spans_item_data) - - spans.append(spans_item) - - type_ = cast(Literal["agent"] | Unset, d.pop("type", UNSET)) - if type_ != "agent" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'agent', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: ExtendedAgentSpanRecordWithChildrenUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = ExtendedAgentSpanRecordWithChildrenUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: ExtendedAgentSpanRecordWithChildrenDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = ExtendedAgentSpanRecordWithChildrenDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: ExtendedAgentSpanRecordWithChildrenFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = ExtendedAgentSpanRecordWithChildrenFeedbackRatingInfo.from_dict( - _feedback_rating_info - ) - - _annotations = d.pop("annotations", UNSET) - annotations: ExtendedAgentSpanRecordWithChildrenAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = ExtendedAgentSpanRecordWithChildrenAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: ExtendedAgentSpanRecordWithChildrenAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = ExtendedAgentSpanRecordWithChildrenAnnotationAggregates.from_dict( - _annotation_aggregates - ) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: ExtendedAgentSpanRecordWithChildrenAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = ExtendedAgentSpanRecordWithChildrenAnnotationAgreement.from_dict( - _annotation_agreement - ) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> ExtendedAgentSpanRecordWithChildrenMetricInfoType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = ExtendedAgentSpanRecordWithChildrenMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(ExtendedAgentSpanRecordWithChildrenMetricInfoType0 | None | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> ExtendedAgentSpanRecordWithChildrenFilesType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = ExtendedAgentSpanRecordWithChildrenFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(ExtendedAgentSpanRecordWithChildrenFilesType0 | None | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - _agent_type = d.pop("agent_type", UNSET) - agent_type: AgentType | Unset - if isinstance(_agent_type, Unset): - agent_type = UNSET - else: - agent_type = AgentType(_agent_type) - - def _parse_agent_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_name = _parse_agent_name(d.pop("agent_name", UNSET)) - - extended_agent_span_record_with_children = cls( - id=id, - session_id=session_id, - project_id=project_id, - run_id=run_id, - parent_id=parent_id, - spans=spans, - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - trace_id=trace_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - is_complete=is_complete, - step_number=step_number, - agent_type=agent_type, - agent_name=agent_name, - ) - - extended_agent_span_record_with_children.additional_properties = d - return extended_agent_span_record_with_children - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotation_aggregates.py b/src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotation_aggregates.py deleted file mode 100644 index 7bd49b15..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordWithChildrenAnnotationAggregates") - - -@_attrs_define -class ExtendedAgentSpanRecordWithChildrenAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - extended_agent_span_record_with_children_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_agent_span_record_with_children_annotation_aggregates.additional_properties = additional_properties - return extended_agent_span_record_with_children_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotation_agreement.py b/src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotation_agreement.py deleted file mode 100644 index 3b69ff60..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedAgentSpanRecordWithChildrenAnnotationAgreement") - - -@_attrs_define -class ExtendedAgentSpanRecordWithChildrenAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_agent_span_record_with_children_annotation_agreement = cls() - - extended_agent_span_record_with_children_annotation_agreement.additional_properties = d - return extended_agent_span_record_with_children_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotations.py b/src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotations.py deleted file mode 100644 index d158d5bf..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.extended_agent_span_record_with_children_annotations_additional_property import ( - ExtendedAgentSpanRecordWithChildrenAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordWithChildrenAnnotations") - - -@_attrs_define -class ExtendedAgentSpanRecordWithChildrenAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, ExtendedAgentSpanRecordWithChildrenAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_agent_span_record_with_children_annotations_additional_property import ( - ExtendedAgentSpanRecordWithChildrenAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - extended_agent_span_record_with_children_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = ExtendedAgentSpanRecordWithChildrenAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_agent_span_record_with_children_annotations.additional_properties = additional_properties - return extended_agent_span_record_with_children_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> ExtendedAgentSpanRecordWithChildrenAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: ExtendedAgentSpanRecordWithChildrenAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotations_additional_property.py b/src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotations_additional_property.py deleted file mode 100644 index 6aa23cda..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_annotations_additional_property.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordWithChildrenAnnotationsAdditionalProperty") - - -@_attrs_define -class ExtendedAgentSpanRecordWithChildrenAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - extended_agent_span_record_with_children_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_agent_span_record_with_children_annotations_additional_property.additional_properties = ( - additional_properties - ) - return extended_agent_span_record_with_children_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_dataset_metadata.py b/src/splunk_ao/resources/models/extended_agent_span_record_with_children_dataset_metadata.py deleted file mode 100644 index 62f5a361..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedAgentSpanRecordWithChildrenDatasetMetadata") - - -@_attrs_define -class ExtendedAgentSpanRecordWithChildrenDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_agent_span_record_with_children_dataset_metadata = cls() - - extended_agent_span_record_with_children_dataset_metadata.additional_properties = d - return extended_agent_span_record_with_children_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_feedback_rating_info.py b/src/splunk_ao/resources/models/extended_agent_span_record_with_children_feedback_rating_info.py deleted file mode 100644 index 39be3e32..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordWithChildrenFeedbackRatingInfo") - - -@_attrs_define -class ExtendedAgentSpanRecordWithChildrenFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - extended_agent_span_record_with_children_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_agent_span_record_with_children_feedback_rating_info.additional_properties = additional_properties - return extended_agent_span_record_with_children_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_files_type_0.py b/src/splunk_ao/resources/models/extended_agent_span_record_with_children_files_type_0.py deleted file mode 100644 index cbb2908d..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordWithChildrenFilesType0") - - -@_attrs_define -class ExtendedAgentSpanRecordWithChildrenFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - extended_agent_span_record_with_children_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_agent_span_record_with_children_files_type_0.additional_properties = additional_properties - return extended_agent_span_record_with_children_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_metric_info_type_0.py b/src/splunk_ao/resources/models/extended_agent_span_record_with_children_metric_info_type_0.py deleted file mode 100644 index 352ef262..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="ExtendedAgentSpanRecordWithChildrenMetricInfoType0") - - -@_attrs_define -class ExtendedAgentSpanRecordWithChildrenMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - extended_agent_span_record_with_children_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_agent_span_record_with_children_metric_info_type_0.additional_properties = additional_properties - return extended_agent_span_record_with_children_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_user_metadata.py b/src/splunk_ao/resources/models/extended_agent_span_record_with_children_user_metadata.py deleted file mode 100644 index 82bbede0..00000000 --- a/src/splunk_ao/resources/models/extended_agent_span_record_with_children_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedAgentSpanRecordWithChildrenUserMetadata") - - -@_attrs_define -class ExtendedAgentSpanRecordWithChildrenUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_agent_span_record_with_children_user_metadata = cls() - - extended_agent_span_record_with_children_user_metadata.additional_properties = d - return extended_agent_span_record_with_children_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_control_span_record.py b/src/splunk_ao/resources/models/extended_control_span_record.py deleted file mode 100644 index a24a3270..00000000 --- a/src/splunk_ao/resources/models/extended_control_span_record.py +++ /dev/null @@ -1,1108 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..models.control_applies_to import ControlAppliesTo -from ..models.control_check_stage import ControlCheckStage -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.extended_control_span_record_annotation_aggregates import ( - ExtendedControlSpanRecordAnnotationAggregates, - ) - from ..models.extended_control_span_record_annotation_agreement import ExtendedControlSpanRecordAnnotationAgreement - from ..models.extended_control_span_record_annotations import ExtendedControlSpanRecordAnnotations - from ..models.extended_control_span_record_dataset_metadata import ExtendedControlSpanRecordDatasetMetadata - from ..models.extended_control_span_record_feedback_rating_info import ExtendedControlSpanRecordFeedbackRatingInfo - from ..models.extended_control_span_record_files_type_0 import ExtendedControlSpanRecordFilesType0 - from ..models.extended_control_span_record_metric_info_type_0 import ExtendedControlSpanRecordMetricInfoType0 - from ..models.extended_control_span_record_user_metadata import ExtendedControlSpanRecordUserMetadata - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="ExtendedControlSpanRecord") - - -@_attrs_define -class ExtendedControlSpanRecord: - """ - Attributes: - id (str): Galileo ID of the session, trace or span - session_id (str): Galileo ID of the session containing the trace (or the same value as id for a trace) - project_id (str): Galileo ID of the project associated with this trace or span - run_id (str): Galileo ID of the run (log stream or experiment) associated with this trace or span - parent_id (str): Galileo ID of the parent of this span - type_ (Literal['control'] | Unset): Type of the trace, span or session. Default: 'control'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | None | Unset): Output of the trace or span. - redacted_output (ControlResult | None | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (ExtendedControlSpanRecordUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (ExtendedControlSpanRecordDatasetMetadata | Unset): Metadata from the dataset associated with - this trace - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (ExtendedControlSpanRecordFeedbackRatingInfo | Unset): Feedback information related to the - record - annotations (ExtendedControlSpanRecordAnnotations | Unset): Annotations keyed by template ID and annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (ExtendedControlSpanRecordAnnotationAggregates | Unset): Annotation aggregate information - keyed by template ID - annotation_agreement (ExtendedControlSpanRecordAnnotationAgreement | Unset): Annotation agreement scores keyed - by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (ExtendedControlSpanRecordMetricInfoType0 | None | Unset): Detailed information about the metrics - associated with this trace or span - files (ExtendedControlSpanRecordFilesType0 | None | Unset): File metadata keyed by file ID for files associated - with this record - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - control_id (int | None | Unset): Identifier of the control definition that produced this span. - agent_name (None | str | Unset): Normalized agent name associated with this control execution. - check_stage (ControlCheckStage | None | Unset): Execution stage where the control ran, typically 'pre' or - 'post'. - applies_to (ControlAppliesTo | None | Unset): Parent execution type the control applied to, for example - 'llm_call' or 'tool_call'. - evaluator_name (None | str | Unset): Representative evaluator name for this control span. For composite - controls, this is the primary evaluator chosen for observability identity. - selector_path (None | str | Unset): Representative selector path for this control span. For composite controls, - this is the primary selector path chosen for observability identity. - """ - - id: str - session_id: str - project_id: str - run_id: str - parent_id: str - type_: Literal["control"] | Unset = "control" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | None | Unset = UNSET - redacted_output: ControlResult | None | Unset = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: ExtendedControlSpanRecordUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: ExtendedControlSpanRecordDatasetMetadata | Unset = UNSET - trace_id: None | str | Unset = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: ExtendedControlSpanRecordFeedbackRatingInfo | Unset = UNSET - annotations: ExtendedControlSpanRecordAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: ExtendedControlSpanRecordAnnotationAggregates | Unset = UNSET - annotation_agreement: ExtendedControlSpanRecordAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: ExtendedControlSpanRecordMetricInfoType0 | None | Unset = UNSET - files: ExtendedControlSpanRecordFilesType0 | None | Unset = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - control_id: int | None | Unset = UNSET - agent_name: None | str | Unset = UNSET - check_stage: ControlCheckStage | None | Unset = UNSET - applies_to: ControlAppliesTo | None | Unset = UNSET - evaluator_name: None | str | Unset = UNSET - selector_path: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.extended_control_span_record_files_type_0 import ExtendedControlSpanRecordFilesType0 - from ..models.extended_control_span_record_metric_info_type_0 import ExtendedControlSpanRecordMetricInfoType0 - from ..models.text_content_part import TextContentPart - - id = self.id - - session_id = self.session_id - - project_id = self.project_id - - run_id = self.run_id - - parent_id = self.parent_id - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | None | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | None | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, ExtendedControlSpanRecordMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, ExtendedControlSpanRecordFilesType0): - files = self.files.to_dict() - else: - files = self.files - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - control_id: int | None | Unset - if isinstance(self.control_id, Unset): - control_id = UNSET - else: - control_id = self.control_id - - agent_name: None | str | Unset - if isinstance(self.agent_name, Unset): - agent_name = UNSET - else: - agent_name = self.agent_name - - check_stage: None | str | Unset - if isinstance(self.check_stage, Unset): - check_stage = UNSET - elif isinstance(self.check_stage, ControlCheckStage): - check_stage = self.check_stage.value - else: - check_stage = self.check_stage - - applies_to: None | str | Unset - if isinstance(self.applies_to, Unset): - applies_to = UNSET - elif isinstance(self.applies_to, ControlAppliesTo): - applies_to = self.applies_to.value - else: - applies_to = self.applies_to - - evaluator_name: None | str | Unset - if isinstance(self.evaluator_name, Unset): - evaluator_name = UNSET - else: - evaluator_name = self.evaluator_name - - selector_path: None | str | Unset - if isinstance(self.selector_path, Unset): - selector_path = UNSET - else: - selector_path = self.selector_path - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - {"id": id, "session_id": session_id, "project_id": project_id, "run_id": run_id, "parent_id": parent_id} - ) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - if control_id is not UNSET: - field_dict["control_id"] = control_id - if agent_name is not UNSET: - field_dict["agent_name"] = agent_name - if check_stage is not UNSET: - field_dict["check_stage"] = check_stage - if applies_to is not UNSET: - field_dict["applies_to"] = applies_to - if evaluator_name is not UNSET: - field_dict["evaluator_name"] = evaluator_name - if selector_path is not UNSET: - field_dict["selector_path"] = selector_path - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.extended_control_span_record_annotation_aggregates import ( - ExtendedControlSpanRecordAnnotationAggregates, - ) - from ..models.extended_control_span_record_annotation_agreement import ( - ExtendedControlSpanRecordAnnotationAgreement, - ) - from ..models.extended_control_span_record_annotations import ExtendedControlSpanRecordAnnotations - from ..models.extended_control_span_record_dataset_metadata import ExtendedControlSpanRecordDatasetMetadata - from ..models.extended_control_span_record_feedback_rating_info import ( - ExtendedControlSpanRecordFeedbackRatingInfo, - ) - from ..models.extended_control_span_record_files_type_0 import ExtendedControlSpanRecordFilesType0 - from ..models.extended_control_span_record_metric_info_type_0 import ExtendedControlSpanRecordMetricInfoType0 - from ..models.extended_control_span_record_user_metadata import ExtendedControlSpanRecordUserMetadata - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - id = d.pop("id") - - session_id = d.pop("session_id") - - project_id = d.pop("project_id") - - run_id = d.pop("run_id") - - parent_id = d.pop("parent_id") - - type_ = cast(Literal["control"] | Unset, d.pop("type", UNSET)) - if type_ != "control" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'control', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output(data: object) -> ControlResult | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_0 = ControlResult.from_dict(data) - - return output_type_0 - except: # noqa: E722 - pass - return cast(ControlResult | None | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output(data: object) -> ControlResult | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_0 = ControlResult.from_dict(data) - - return redacted_output_type_0 - except: # noqa: E722 - pass - return cast(ControlResult | None | Unset, data) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: ExtendedControlSpanRecordUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = ExtendedControlSpanRecordUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: ExtendedControlSpanRecordDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = ExtendedControlSpanRecordDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: ExtendedControlSpanRecordFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = ExtendedControlSpanRecordFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: ExtendedControlSpanRecordAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = ExtendedControlSpanRecordAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: ExtendedControlSpanRecordAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = ExtendedControlSpanRecordAnnotationAggregates.from_dict(_annotation_aggregates) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: ExtendedControlSpanRecordAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = ExtendedControlSpanRecordAnnotationAgreement.from_dict(_annotation_agreement) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> ExtendedControlSpanRecordMetricInfoType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = ExtendedControlSpanRecordMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(ExtendedControlSpanRecordMetricInfoType0 | None | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> ExtendedControlSpanRecordFilesType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = ExtendedControlSpanRecordFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(ExtendedControlSpanRecordFilesType0 | None | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - def _parse_control_id(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - control_id = _parse_control_id(d.pop("control_id", UNSET)) - - def _parse_agent_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_name = _parse_agent_name(d.pop("agent_name", UNSET)) - - def _parse_check_stage(data: object) -> ControlCheckStage | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - check_stage_type_0 = ControlCheckStage(data) - - return check_stage_type_0 - except: # noqa: E722 - pass - return cast(ControlCheckStage | None | Unset, data) - - check_stage = _parse_check_stage(d.pop("check_stage", UNSET)) - - def _parse_applies_to(data: object) -> ControlAppliesTo | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - applies_to_type_0 = ControlAppliesTo(data) - - return applies_to_type_0 - except: # noqa: E722 - pass - return cast(ControlAppliesTo | None | Unset, data) - - applies_to = _parse_applies_to(d.pop("applies_to", UNSET)) - - def _parse_evaluator_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - evaluator_name = _parse_evaluator_name(d.pop("evaluator_name", UNSET)) - - def _parse_selector_path(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - selector_path = _parse_selector_path(d.pop("selector_path", UNSET)) - - extended_control_span_record = cls( - id=id, - session_id=session_id, - project_id=project_id, - run_id=run_id, - parent_id=parent_id, - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - trace_id=trace_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - is_complete=is_complete, - step_number=step_number, - control_id=control_id, - agent_name=agent_name, - check_stage=check_stage, - applies_to=applies_to, - evaluator_name=evaluator_name, - selector_path=selector_path, - ) - - extended_control_span_record.additional_properties = d - return extended_control_span_record - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_control_span_record_annotation_aggregates.py b/src/splunk_ao/resources/models/extended_control_span_record_annotation_aggregates.py deleted file mode 100644 index f9b75c05..00000000 --- a/src/splunk_ao/resources/models/extended_control_span_record_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="ExtendedControlSpanRecordAnnotationAggregates") - - -@_attrs_define -class ExtendedControlSpanRecordAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - extended_control_span_record_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_control_span_record_annotation_aggregates.additional_properties = additional_properties - return extended_control_span_record_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_control_span_record_annotation_agreement.py b/src/splunk_ao/resources/models/extended_control_span_record_annotation_agreement.py deleted file mode 100644 index 4597ac98..00000000 --- a/src/splunk_ao/resources/models/extended_control_span_record_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedControlSpanRecordAnnotationAgreement") - - -@_attrs_define -class ExtendedControlSpanRecordAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_control_span_record_annotation_agreement = cls() - - extended_control_span_record_annotation_agreement.additional_properties = d - return extended_control_span_record_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_control_span_record_annotations.py b/src/splunk_ao/resources/models/extended_control_span_record_annotations.py deleted file mode 100644 index e9defb9f..00000000 --- a/src/splunk_ao/resources/models/extended_control_span_record_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.extended_control_span_record_annotations_additional_property import ( - ExtendedControlSpanRecordAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="ExtendedControlSpanRecordAnnotations") - - -@_attrs_define -class ExtendedControlSpanRecordAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, ExtendedControlSpanRecordAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_control_span_record_annotations_additional_property import ( - ExtendedControlSpanRecordAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - extended_control_span_record_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = ExtendedControlSpanRecordAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_control_span_record_annotations.additional_properties = additional_properties - return extended_control_span_record_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> ExtendedControlSpanRecordAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: ExtendedControlSpanRecordAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_control_span_record_annotations_additional_property.py b/src/splunk_ao/resources/models/extended_control_span_record_annotations_additional_property.py deleted file mode 100644 index 4809137c..00000000 --- a/src/splunk_ao/resources/models/extended_control_span_record_annotations_additional_property.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="ExtendedControlSpanRecordAnnotationsAdditionalProperty") - - -@_attrs_define -class ExtendedControlSpanRecordAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - extended_control_span_record_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_control_span_record_annotations_additional_property.additional_properties = additional_properties - return extended_control_span_record_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_control_span_record_dataset_metadata.py b/src/splunk_ao/resources/models/extended_control_span_record_dataset_metadata.py deleted file mode 100644 index 241d7d1d..00000000 --- a/src/splunk_ao/resources/models/extended_control_span_record_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedControlSpanRecordDatasetMetadata") - - -@_attrs_define -class ExtendedControlSpanRecordDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_control_span_record_dataset_metadata = cls() - - extended_control_span_record_dataset_metadata.additional_properties = d - return extended_control_span_record_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_control_span_record_feedback_rating_info.py b/src/splunk_ao/resources/models/extended_control_span_record_feedback_rating_info.py deleted file mode 100644 index 1542ae4a..00000000 --- a/src/splunk_ao/resources/models/extended_control_span_record_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="ExtendedControlSpanRecordFeedbackRatingInfo") - - -@_attrs_define -class ExtendedControlSpanRecordFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - extended_control_span_record_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_control_span_record_feedback_rating_info.additional_properties = additional_properties - return extended_control_span_record_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_control_span_record_files_type_0.py b/src/splunk_ao/resources/models/extended_control_span_record_files_type_0.py deleted file mode 100644 index 2649a6d3..00000000 --- a/src/splunk_ao/resources/models/extended_control_span_record_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="ExtendedControlSpanRecordFilesType0") - - -@_attrs_define -class ExtendedControlSpanRecordFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - extended_control_span_record_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_control_span_record_files_type_0.additional_properties = additional_properties - return extended_control_span_record_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_control_span_record_metric_info_type_0.py b/src/splunk_ao/resources/models/extended_control_span_record_metric_info_type_0.py deleted file mode 100644 index e9900c26..00000000 --- a/src/splunk_ao/resources/models/extended_control_span_record_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="ExtendedControlSpanRecordMetricInfoType0") - - -@_attrs_define -class ExtendedControlSpanRecordMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - extended_control_span_record_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_control_span_record_metric_info_type_0.additional_properties = additional_properties - return extended_control_span_record_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_control_span_record_user_metadata.py b/src/splunk_ao/resources/models/extended_control_span_record_user_metadata.py deleted file mode 100644 index d1d0958d..00000000 --- a/src/splunk_ao/resources/models/extended_control_span_record_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedControlSpanRecordUserMetadata") - - -@_attrs_define -class ExtendedControlSpanRecordUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_control_span_record_user_metadata = cls() - - extended_control_span_record_user_metadata.additional_properties = d - return extended_control_span_record_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record.py b/src/splunk_ao/resources/models/extended_http_span_record.py deleted file mode 100644 index 886b9f16..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record.py +++ /dev/null @@ -1,1111 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_http_span_record_annotation_aggregates import ExtendedHttpSpanRecordAnnotationAggregates - from ..models.extended_http_span_record_annotation_agreement import ExtendedHttpSpanRecordAnnotationAgreement - from ..models.extended_http_span_record_annotations import ExtendedHttpSpanRecordAnnotations - from ..models.extended_http_span_record_dataset_metadata import ExtendedHttpSpanRecordDatasetMetadata - from ..models.extended_http_span_record_feedback_rating_info import ExtendedHttpSpanRecordFeedbackRatingInfo - from ..models.extended_http_span_record_files_type_0 import ExtendedHttpSpanRecordFilesType0 - from ..models.extended_http_span_record_metric_info_type_0 import ExtendedHttpSpanRecordMetricInfoType0 - from ..models.extended_http_span_record_user_metadata import ExtendedHttpSpanRecordUserMetadata - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="ExtendedHttpSpanRecord") - - -@_attrs_define -class ExtendedHttpSpanRecord: - """ - Attributes: - id (str): Galileo ID of the session, trace or span - session_id (str): Galileo ID of the session containing the trace (or the same value as id for a trace) - project_id (str): Galileo ID of the project associated with this trace or span - run_id (str): Galileo ID of the run (log stream or experiment) associated with this trace or span - parent_id (str): Galileo ID of the parent of this span - type_ (Literal['http'] | Unset): Type of the trace, span or session. Default: 'http'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (ExtendedHttpSpanRecordUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (ExtendedHttpSpanRecordDatasetMetadata | Unset): Metadata from the dataset associated with this - trace - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (ExtendedHttpSpanRecordFeedbackRatingInfo | Unset): Feedback information related to the - record - annotations (ExtendedHttpSpanRecordAnnotations | Unset): Annotations keyed by template ID and annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (ExtendedHttpSpanRecordAnnotationAggregates | Unset): Annotation aggregate information - keyed by template ID - annotation_agreement (ExtendedHttpSpanRecordAnnotationAgreement | Unset): Annotation agreement scores keyed by - template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (ExtendedHttpSpanRecordMetricInfoType0 | None | Unset): Detailed information about the metrics - associated with this trace or span - files (ExtendedHttpSpanRecordFilesType0 | None | Unset): File metadata keyed by file ID for files associated - with this record - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - """ - - id: str - session_id: str - project_id: str - run_id: str - parent_id: str - type_: Literal["http"] | Unset = "http" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: ExtendedHttpSpanRecordUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: ExtendedHttpSpanRecordDatasetMetadata | Unset = UNSET - trace_id: None | str | Unset = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: ExtendedHttpSpanRecordFeedbackRatingInfo | Unset = UNSET - annotations: ExtendedHttpSpanRecordAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: ExtendedHttpSpanRecordAnnotationAggregates | Unset = UNSET - annotation_agreement: ExtendedHttpSpanRecordAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: ExtendedHttpSpanRecordMetricInfoType0 | None | Unset = UNSET - files: ExtendedHttpSpanRecordFilesType0 | None | Unset = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.extended_http_span_record_files_type_0 import ExtendedHttpSpanRecordFilesType0 - from ..models.extended_http_span_record_metric_info_type_0 import ExtendedHttpSpanRecordMetricInfoType0 - from ..models.message import Message - from ..models.text_content_part import TextContentPart - - id = self.id - - session_id = self.session_id - - project_id = self.project_id - - run_id = self.run_id - - parent_id = self.parent_id - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, ExtendedHttpSpanRecordMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, ExtendedHttpSpanRecordFilesType0): - files = self.files.to_dict() - else: - files = self.files - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - {"id": id, "session_id": session_id, "project_id": project_id, "run_id": run_id, "parent_id": parent_id} - ) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_http_span_record_annotation_aggregates import ExtendedHttpSpanRecordAnnotationAggregates - from ..models.extended_http_span_record_annotation_agreement import ExtendedHttpSpanRecordAnnotationAgreement - from ..models.extended_http_span_record_annotations import ExtendedHttpSpanRecordAnnotations - from ..models.extended_http_span_record_dataset_metadata import ExtendedHttpSpanRecordDatasetMetadata - from ..models.extended_http_span_record_feedback_rating_info import ExtendedHttpSpanRecordFeedbackRatingInfo - from ..models.extended_http_span_record_files_type_0 import ExtendedHttpSpanRecordFilesType0 - from ..models.extended_http_span_record_metric_info_type_0 import ExtendedHttpSpanRecordMetricInfoType0 - from ..models.extended_http_span_record_user_metadata import ExtendedHttpSpanRecordUserMetadata - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - id = d.pop("id") - - session_id = d.pop("session_id") - - project_id = d.pop("project_id") - - run_id = d.pop("run_id") - - parent_id = d.pop("parent_id") - - type_ = cast(Literal["http"] | Unset, d.pop("type", UNSET)) - if type_ != "http" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'http', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: ExtendedHttpSpanRecordUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = ExtendedHttpSpanRecordUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: ExtendedHttpSpanRecordDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = ExtendedHttpSpanRecordDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: ExtendedHttpSpanRecordFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = ExtendedHttpSpanRecordFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: ExtendedHttpSpanRecordAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = ExtendedHttpSpanRecordAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: ExtendedHttpSpanRecordAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = ExtendedHttpSpanRecordAnnotationAggregates.from_dict(_annotation_aggregates) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: ExtendedHttpSpanRecordAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = ExtendedHttpSpanRecordAnnotationAgreement.from_dict(_annotation_agreement) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> ExtendedHttpSpanRecordMetricInfoType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = ExtendedHttpSpanRecordMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(ExtendedHttpSpanRecordMetricInfoType0 | None | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> ExtendedHttpSpanRecordFilesType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = ExtendedHttpSpanRecordFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(ExtendedHttpSpanRecordFilesType0 | None | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - extended_http_span_record = cls( - id=id, - session_id=session_id, - project_id=project_id, - run_id=run_id, - parent_id=parent_id, - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - trace_id=trace_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - is_complete=is_complete, - step_number=step_number, - ) - - extended_http_span_record.additional_properties = d - return extended_http_span_record - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_annotation_aggregates.py b/src/splunk_ao/resources/models/extended_http_span_record_annotation_aggregates.py deleted file mode 100644 index e8a3c987..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordAnnotationAggregates") - - -@_attrs_define -class ExtendedHttpSpanRecordAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - extended_http_span_record_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_http_span_record_annotation_aggregates.additional_properties = additional_properties - return extended_http_span_record_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_annotation_agreement.py b/src/splunk_ao/resources/models/extended_http_span_record_annotation_agreement.py deleted file mode 100644 index 5260df2e..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedHttpSpanRecordAnnotationAgreement") - - -@_attrs_define -class ExtendedHttpSpanRecordAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_http_span_record_annotation_agreement = cls() - - extended_http_span_record_annotation_agreement.additional_properties = d - return extended_http_span_record_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_annotations.py b/src/splunk_ao/resources/models/extended_http_span_record_annotations.py deleted file mode 100644 index 4b66d475..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.extended_http_span_record_annotations_additional_property import ( - ExtendedHttpSpanRecordAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordAnnotations") - - -@_attrs_define -class ExtendedHttpSpanRecordAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, ExtendedHttpSpanRecordAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_http_span_record_annotations_additional_property import ( - ExtendedHttpSpanRecordAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - extended_http_span_record_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = ExtendedHttpSpanRecordAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_http_span_record_annotations.additional_properties = additional_properties - return extended_http_span_record_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> ExtendedHttpSpanRecordAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: ExtendedHttpSpanRecordAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_annotations_additional_property.py b/src/splunk_ao/resources/models/extended_http_span_record_annotations_additional_property.py deleted file mode 100644 index 1c5d9815..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_annotations_additional_property.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordAnnotationsAdditionalProperty") - - -@_attrs_define -class ExtendedHttpSpanRecordAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - extended_http_span_record_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_http_span_record_annotations_additional_property.additional_properties = additional_properties - return extended_http_span_record_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_dataset_metadata.py b/src/splunk_ao/resources/models/extended_http_span_record_dataset_metadata.py deleted file mode 100644 index e1a4a8b6..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedHttpSpanRecordDatasetMetadata") - - -@_attrs_define -class ExtendedHttpSpanRecordDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_http_span_record_dataset_metadata = cls() - - extended_http_span_record_dataset_metadata.additional_properties = d - return extended_http_span_record_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_feedback_rating_info.py b/src/splunk_ao/resources/models/extended_http_span_record_feedback_rating_info.py deleted file mode 100644 index 05fc9822..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordFeedbackRatingInfo") - - -@_attrs_define -class ExtendedHttpSpanRecordFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - extended_http_span_record_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_http_span_record_feedback_rating_info.additional_properties = additional_properties - return extended_http_span_record_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_files_type_0.py b/src/splunk_ao/resources/models/extended_http_span_record_files_type_0.py deleted file mode 100644 index b87db891..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordFilesType0") - - -@_attrs_define -class ExtendedHttpSpanRecordFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - extended_http_span_record_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_http_span_record_files_type_0.additional_properties = additional_properties - return extended_http_span_record_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_metric_info_type_0.py b/src/splunk_ao/resources/models/extended_http_span_record_metric_info_type_0.py deleted file mode 100644 index 8ea32766..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordMetricInfoType0") - - -@_attrs_define -class ExtendedHttpSpanRecordMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - extended_http_span_record_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_http_span_record_metric_info_type_0.additional_properties = additional_properties - return extended_http_span_record_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_user_metadata.py b/src/splunk_ao/resources/models/extended_http_span_record_user_metadata.py deleted file mode 100644 index 586727ab..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedHttpSpanRecordUserMetadata") - - -@_attrs_define -class ExtendedHttpSpanRecordUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_http_span_record_user_metadata = cls() - - extended_http_span_record_user_metadata.additional_properties = d - return extended_http_span_record_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_with_children.py b/src/splunk_ao/resources/models/extended_http_span_record_with_children.py deleted file mode 100644 index 9cd3da16..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_with_children.py +++ /dev/null @@ -1,1360 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_agent_span_record_with_children import ExtendedAgentSpanRecordWithChildren - from ..models.extended_control_span_record import ExtendedControlSpanRecord - from ..models.extended_http_span_record_with_children_annotation_aggregates import ( - ExtendedHttpSpanRecordWithChildrenAnnotationAggregates, - ) - from ..models.extended_http_span_record_with_children_annotation_agreement import ( - ExtendedHttpSpanRecordWithChildrenAnnotationAgreement, - ) - from ..models.extended_http_span_record_with_children_annotations import ( - ExtendedHttpSpanRecordWithChildrenAnnotations, - ) - from ..models.extended_http_span_record_with_children_dataset_metadata import ( - ExtendedHttpSpanRecordWithChildrenDatasetMetadata, - ) - from ..models.extended_http_span_record_with_children_feedback_rating_info import ( - ExtendedHttpSpanRecordWithChildrenFeedbackRatingInfo, - ) - from ..models.extended_http_span_record_with_children_files_type_0 import ( - ExtendedHttpSpanRecordWithChildrenFilesType0, - ) - from ..models.extended_http_span_record_with_children_metric_info_type_0 import ( - ExtendedHttpSpanRecordWithChildrenMetricInfoType0, - ) - from ..models.extended_http_span_record_with_children_user_metadata import ( - ExtendedHttpSpanRecordWithChildrenUserMetadata, - ) - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - from ..models.extended_retriever_span_record_with_children import ExtendedRetrieverSpanRecordWithChildren - from ..models.extended_tool_span_record_with_children import ExtendedToolSpanRecordWithChildren - from ..models.extended_workflow_span_record_with_children import ExtendedWorkflowSpanRecordWithChildren - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordWithChildren") - - -@_attrs_define -class ExtendedHttpSpanRecordWithChildren: - """ - Attributes: - id (str): Galileo ID of the session, trace or span - session_id (str): Galileo ID of the session containing the trace (or the same value as id for a trace) - project_id (str): Galileo ID of the project associated with this trace or span - run_id (str): Galileo ID of the run (log stream or experiment) associated with this trace or span - parent_id (str): Galileo ID of the parent of this span - spans (list[ExtendedAgentSpanRecordWithChildren | ExtendedControlSpanRecord | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord | ExtendedRetrieverSpanRecordWithChildren | ExtendedToolSpanRecordWithChildren | - ExtendedWorkflowSpanRecordWithChildren] | Unset): - type_ (Literal['http'] | Unset): Type of the trace, span or session. Default: 'http'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (ExtendedHttpSpanRecordWithChildrenUserMetadata | Unset): Metadata associated with this trace or - span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (ExtendedHttpSpanRecordWithChildrenDatasetMetadata | Unset): Metadata from the dataset - associated with this trace - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (ExtendedHttpSpanRecordWithChildrenFeedbackRatingInfo | Unset): Feedback information - related to the record - annotations (ExtendedHttpSpanRecordWithChildrenAnnotations | Unset): Annotations keyed by template ID and - annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (ExtendedHttpSpanRecordWithChildrenAnnotationAggregates | Unset): Annotation aggregate - information keyed by template ID - annotation_agreement (ExtendedHttpSpanRecordWithChildrenAnnotationAgreement | Unset): Annotation agreement - scores keyed by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (ExtendedHttpSpanRecordWithChildrenMetricInfoType0 | None | Unset): Detailed information about the - metrics associated with this trace or span - files (ExtendedHttpSpanRecordWithChildrenFilesType0 | None | Unset): File metadata keyed by file ID for files - associated with this record - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - """ - - id: str - session_id: str - project_id: str - run_id: str - parent_id: str - spans: ( - list[ - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - ] - | Unset - ) = UNSET - type_: Literal["http"] | Unset = "http" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: ExtendedHttpSpanRecordWithChildrenUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: ExtendedHttpSpanRecordWithChildrenDatasetMetadata | Unset = UNSET - trace_id: None | str | Unset = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: ExtendedHttpSpanRecordWithChildrenFeedbackRatingInfo | Unset = UNSET - annotations: ExtendedHttpSpanRecordWithChildrenAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: ExtendedHttpSpanRecordWithChildrenAnnotationAggregates | Unset = UNSET - annotation_agreement: ExtendedHttpSpanRecordWithChildrenAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: ExtendedHttpSpanRecordWithChildrenMetricInfoType0 | None | Unset = UNSET - files: ExtendedHttpSpanRecordWithChildrenFilesType0 | None | Unset = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.extended_agent_span_record_with_children import ExtendedAgentSpanRecordWithChildren - from ..models.extended_control_span_record import ExtendedControlSpanRecord - from ..models.extended_http_span_record_with_children_files_type_0 import ( - ExtendedHttpSpanRecordWithChildrenFilesType0, - ) - from ..models.extended_http_span_record_with_children_metric_info_type_0 import ( - ExtendedHttpSpanRecordWithChildrenMetricInfoType0, - ) - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - from ..models.extended_retriever_span_record_with_children import ExtendedRetrieverSpanRecordWithChildren - from ..models.extended_tool_span_record_with_children import ExtendedToolSpanRecordWithChildren - from ..models.extended_workflow_span_record_with_children import ExtendedWorkflowSpanRecordWithChildren - from ..models.message import Message - from ..models.text_content_part import TextContentPart - - id = self.id - - session_id = self.session_id - - project_id = self.project_id - - run_id = self.run_id - - parent_id = self.parent_id - - spans: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.spans, Unset): - spans = [] - for spans_item_data in self.spans: - spans_item: dict[str, Any] - if isinstance(spans_item_data, ExtendedAgentSpanRecordWithChildren): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedWorkflowSpanRecordWithChildren): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedLlmSpanRecord): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedToolSpanRecordWithChildren): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedRetrieverSpanRecordWithChildren): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedControlSpanRecord): - spans_item = spans_item_data.to_dict() - else: - spans_item = spans_item_data.to_dict() - - spans.append(spans_item) - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, ExtendedHttpSpanRecordWithChildrenMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, ExtendedHttpSpanRecordWithChildrenFilesType0): - files = self.files.to_dict() - else: - files = self.files - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - {"id": id, "session_id": session_id, "project_id": project_id, "run_id": run_id, "parent_id": parent_id} - ) - if spans is not UNSET: - field_dict["spans"] = spans - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_agent_span_record_with_children import ExtendedAgentSpanRecordWithChildren - from ..models.extended_control_span_record import ExtendedControlSpanRecord - from ..models.extended_http_span_record_with_children_annotation_aggregates import ( - ExtendedHttpSpanRecordWithChildrenAnnotationAggregates, - ) - from ..models.extended_http_span_record_with_children_annotation_agreement import ( - ExtendedHttpSpanRecordWithChildrenAnnotationAgreement, - ) - from ..models.extended_http_span_record_with_children_annotations import ( - ExtendedHttpSpanRecordWithChildrenAnnotations, - ) - from ..models.extended_http_span_record_with_children_dataset_metadata import ( - ExtendedHttpSpanRecordWithChildrenDatasetMetadata, - ) - from ..models.extended_http_span_record_with_children_feedback_rating_info import ( - ExtendedHttpSpanRecordWithChildrenFeedbackRatingInfo, - ) - from ..models.extended_http_span_record_with_children_files_type_0 import ( - ExtendedHttpSpanRecordWithChildrenFilesType0, - ) - from ..models.extended_http_span_record_with_children_metric_info_type_0 import ( - ExtendedHttpSpanRecordWithChildrenMetricInfoType0, - ) - from ..models.extended_http_span_record_with_children_user_metadata import ( - ExtendedHttpSpanRecordWithChildrenUserMetadata, - ) - from ..models.extended_retriever_span_record_with_children import ExtendedRetrieverSpanRecordWithChildren - from ..models.extended_tool_span_record_with_children import ExtendedToolSpanRecordWithChildren - from ..models.extended_workflow_span_record_with_children import ExtendedWorkflowSpanRecordWithChildren - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - id = d.pop("id") - - session_id = d.pop("session_id") - - project_id = d.pop("project_id") - - run_id = d.pop("run_id") - - parent_id = d.pop("parent_id") - - _spans = d.pop("spans", UNSET) - spans: ( - list[ - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - ] - | Unset - ) = UNSET - if _spans is not UNSET: - spans = [] - for spans_item_data in _spans: - - def _parse_spans_item( - data: object, - ) -> ( - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - ): - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_0 = ExtendedAgentSpanRecordWithChildren.from_dict(data) - - return spans_item_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_1 = ExtendedWorkflowSpanRecordWithChildren.from_dict(data) - - return spans_item_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_2 = ExtendedLlmSpanRecord.from_dict(data) - - return spans_item_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_3 = ExtendedToolSpanRecordWithChildren.from_dict(data) - - return spans_item_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_4 = ExtendedRetrieverSpanRecordWithChildren.from_dict(data) - - return spans_item_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_5 = ExtendedControlSpanRecord.from_dict(data) - - return spans_item_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_6 = ExtendedHttpSpanRecordWithChildren.from_dict(data) - - return spans_item_type_6 - except: # noqa: E722 - pass - # If we reach here, none of the parsers succeeded - discriminator_info = ( - f" (type={data.get('type')})" if isinstance(data, dict) and "type" in data else "" - ) - raise ValueError(f"Could not parse union type for spans_item{discriminator_info}") - - spans_item = _parse_spans_item(spans_item_data) - - spans.append(spans_item) - - type_ = cast(Literal["http"] | Unset, d.pop("type", UNSET)) - if type_ != "http" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'http', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: ExtendedHttpSpanRecordWithChildrenUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = ExtendedHttpSpanRecordWithChildrenUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: ExtendedHttpSpanRecordWithChildrenDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = ExtendedHttpSpanRecordWithChildrenDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: ExtendedHttpSpanRecordWithChildrenFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = ExtendedHttpSpanRecordWithChildrenFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: ExtendedHttpSpanRecordWithChildrenAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = ExtendedHttpSpanRecordWithChildrenAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: ExtendedHttpSpanRecordWithChildrenAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = ExtendedHttpSpanRecordWithChildrenAnnotationAggregates.from_dict( - _annotation_aggregates - ) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: ExtendedHttpSpanRecordWithChildrenAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = ExtendedHttpSpanRecordWithChildrenAnnotationAgreement.from_dict( - _annotation_agreement - ) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> ExtendedHttpSpanRecordWithChildrenMetricInfoType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = ExtendedHttpSpanRecordWithChildrenMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(ExtendedHttpSpanRecordWithChildrenMetricInfoType0 | None | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> ExtendedHttpSpanRecordWithChildrenFilesType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = ExtendedHttpSpanRecordWithChildrenFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(ExtendedHttpSpanRecordWithChildrenFilesType0 | None | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - extended_http_span_record_with_children = cls( - id=id, - session_id=session_id, - project_id=project_id, - run_id=run_id, - parent_id=parent_id, - spans=spans, - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - trace_id=trace_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - is_complete=is_complete, - step_number=step_number, - ) - - extended_http_span_record_with_children.additional_properties = d - return extended_http_span_record_with_children - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_with_children_annotation_aggregates.py b/src/splunk_ao/resources/models/extended_http_span_record_with_children_annotation_aggregates.py deleted file mode 100644 index d44b39f8..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_with_children_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordWithChildrenAnnotationAggregates") - - -@_attrs_define -class ExtendedHttpSpanRecordWithChildrenAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - extended_http_span_record_with_children_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_http_span_record_with_children_annotation_aggregates.additional_properties = additional_properties - return extended_http_span_record_with_children_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_with_children_annotation_agreement.py b/src/splunk_ao/resources/models/extended_http_span_record_with_children_annotation_agreement.py deleted file mode 100644 index 904957fd..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_with_children_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedHttpSpanRecordWithChildrenAnnotationAgreement") - - -@_attrs_define -class ExtendedHttpSpanRecordWithChildrenAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_http_span_record_with_children_annotation_agreement = cls() - - extended_http_span_record_with_children_annotation_agreement.additional_properties = d - return extended_http_span_record_with_children_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_with_children_annotations.py b/src/splunk_ao/resources/models/extended_http_span_record_with_children_annotations.py deleted file mode 100644 index 87af6885..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_with_children_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.extended_http_span_record_with_children_annotations_additional_property import ( - ExtendedHttpSpanRecordWithChildrenAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordWithChildrenAnnotations") - - -@_attrs_define -class ExtendedHttpSpanRecordWithChildrenAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, ExtendedHttpSpanRecordWithChildrenAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_http_span_record_with_children_annotations_additional_property import ( - ExtendedHttpSpanRecordWithChildrenAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - extended_http_span_record_with_children_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = ExtendedHttpSpanRecordWithChildrenAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_http_span_record_with_children_annotations.additional_properties = additional_properties - return extended_http_span_record_with_children_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> ExtendedHttpSpanRecordWithChildrenAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: ExtendedHttpSpanRecordWithChildrenAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_with_children_annotations_additional_property.py b/src/splunk_ao/resources/models/extended_http_span_record_with_children_annotations_additional_property.py deleted file mode 100644 index 2f367bb5..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_with_children_annotations_additional_property.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordWithChildrenAnnotationsAdditionalProperty") - - -@_attrs_define -class ExtendedHttpSpanRecordWithChildrenAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - extended_http_span_record_with_children_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_http_span_record_with_children_annotations_additional_property.additional_properties = ( - additional_properties - ) - return extended_http_span_record_with_children_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_with_children_dataset_metadata.py b/src/splunk_ao/resources/models/extended_http_span_record_with_children_dataset_metadata.py deleted file mode 100644 index 7d32d354..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_with_children_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedHttpSpanRecordWithChildrenDatasetMetadata") - - -@_attrs_define -class ExtendedHttpSpanRecordWithChildrenDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_http_span_record_with_children_dataset_metadata = cls() - - extended_http_span_record_with_children_dataset_metadata.additional_properties = d - return extended_http_span_record_with_children_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_with_children_feedback_rating_info.py b/src/splunk_ao/resources/models/extended_http_span_record_with_children_feedback_rating_info.py deleted file mode 100644 index 4356ae86..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_with_children_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordWithChildrenFeedbackRatingInfo") - - -@_attrs_define -class ExtendedHttpSpanRecordWithChildrenFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - extended_http_span_record_with_children_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_http_span_record_with_children_feedback_rating_info.additional_properties = additional_properties - return extended_http_span_record_with_children_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_with_children_files_type_0.py b/src/splunk_ao/resources/models/extended_http_span_record_with_children_files_type_0.py deleted file mode 100644 index a60ce95b..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_with_children_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordWithChildrenFilesType0") - - -@_attrs_define -class ExtendedHttpSpanRecordWithChildrenFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - extended_http_span_record_with_children_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_http_span_record_with_children_files_type_0.additional_properties = additional_properties - return extended_http_span_record_with_children_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_with_children_metric_info_type_0.py b/src/splunk_ao/resources/models/extended_http_span_record_with_children_metric_info_type_0.py deleted file mode 100644 index 0e7ab0ee..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_with_children_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="ExtendedHttpSpanRecordWithChildrenMetricInfoType0") - - -@_attrs_define -class ExtendedHttpSpanRecordWithChildrenMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - extended_http_span_record_with_children_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_http_span_record_with_children_metric_info_type_0.additional_properties = additional_properties - return extended_http_span_record_with_children_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_http_span_record_with_children_user_metadata.py b/src/splunk_ao/resources/models/extended_http_span_record_with_children_user_metadata.py deleted file mode 100644 index 220fbcfe..00000000 --- a/src/splunk_ao/resources/models/extended_http_span_record_with_children_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedHttpSpanRecordWithChildrenUserMetadata") - - -@_attrs_define -class ExtendedHttpSpanRecordWithChildrenUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_http_span_record_with_children_user_metadata = cls() - - extended_http_span_record_with_children_user_metadata.additional_properties = d - return extended_http_span_record_with_children_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_llm_span_record.py b/src/splunk_ao/resources/models/extended_llm_span_record.py deleted file mode 100644 index a230e16b..00000000 --- a/src/splunk_ao/resources/models/extended_llm_span_record.py +++ /dev/null @@ -1,1153 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.extended_llm_span_record_annotation_aggregates import ExtendedLlmSpanRecordAnnotationAggregates - from ..models.extended_llm_span_record_annotation_agreement import ExtendedLlmSpanRecordAnnotationAgreement - from ..models.extended_llm_span_record_annotations import ExtendedLlmSpanRecordAnnotations - from ..models.extended_llm_span_record_dataset_metadata import ExtendedLlmSpanRecordDatasetMetadata - from ..models.extended_llm_span_record_feedback_rating_info import ExtendedLlmSpanRecordFeedbackRatingInfo - from ..models.extended_llm_span_record_files_type_0 import ExtendedLlmSpanRecordFilesType0 - from ..models.extended_llm_span_record_metric_info_type_0 import ExtendedLlmSpanRecordMetricInfoType0 - from ..models.extended_llm_span_record_tools_type_0_item import ExtendedLlmSpanRecordToolsType0Item - from ..models.extended_llm_span_record_user_metadata import ExtendedLlmSpanRecordUserMetadata - from ..models.image_generation_event import ImageGenerationEvent - from ..models.internal_tool_call import InternalToolCall - from ..models.llm_metrics import LlmMetrics - from ..models.mcp_approval_request_event import MCPApprovalRequestEvent - from ..models.mcp_call_event import MCPCallEvent - from ..models.mcp_list_tools_event import MCPListToolsEvent - from ..models.message import Message - from ..models.message_event import MessageEvent - from ..models.reasoning_event import ReasoningEvent - from ..models.web_search_call_event import WebSearchCallEvent - - -T = TypeVar("T", bound="ExtendedLlmSpanRecord") - - -@_attrs_define -class ExtendedLlmSpanRecord: - """ - Attributes: - id (str): Galileo ID of the session, trace or span - session_id (str): Galileo ID of the session containing the trace (or the same value as id for a trace) - project_id (str): Galileo ID of the project associated with this trace or span - run_id (str): Galileo ID of the run (log stream or experiment) associated with this trace or span - parent_id (str): Galileo ID of the parent of this span - type_ (Literal['llm'] | Unset): Type of the trace, span or session. Default: 'llm'. - input_ (list[Message] | Unset): Input to the trace or span. - redacted_input (list[Message] | None | Unset): Redacted input of the trace or span. - output (Message | Unset): - redacted_output (Message | None | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (ExtendedLlmSpanRecordUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (LlmMetrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (ExtendedLlmSpanRecordDatasetMetadata | Unset): Metadata from the dataset associated with this - trace - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (ExtendedLlmSpanRecordFeedbackRatingInfo | Unset): Feedback information related to the - record - annotations (ExtendedLlmSpanRecordAnnotations | Unset): Annotations keyed by template ID and annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (ExtendedLlmSpanRecordAnnotationAggregates | Unset): Annotation aggregate information - keyed by template ID - annotation_agreement (ExtendedLlmSpanRecordAnnotationAgreement | Unset): Annotation agreement scores keyed by - template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (ExtendedLlmSpanRecordMetricInfoType0 | None | Unset): Detailed information about the metrics - associated with this trace or span - files (ExtendedLlmSpanRecordFilesType0 | None | Unset): File metadata keyed by file ID for files associated with - this record - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - tools (list[ExtendedLlmSpanRecordToolsType0Item] | None | Unset): List of available tools passed to the LLM on - invocation. - events (list[ImageGenerationEvent | InternalToolCall | MCPApprovalRequestEvent | MCPCallEvent | - MCPListToolsEvent | MessageEvent | ReasoningEvent | WebSearchCallEvent] | None | Unset): List of reasoning, - internal tool call, or MCP events that occurred during the LLM span. - model (None | str | Unset): Model used for this span. - provider (None | str | Unset): Provider used for this span. - temperature (float | None | Unset): Temperature used for generation. - finish_reason (None | str | Unset): Reason for finishing. - """ - - id: str - session_id: str - project_id: str - run_id: str - parent_id: str - type_: Literal["llm"] | Unset = "llm" - input_: list[Message] | Unset = UNSET - redacted_input: list[Message] | None | Unset = UNSET - output: Message | Unset = UNSET - redacted_output: Message | None | Unset = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: ExtendedLlmSpanRecordUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: LlmMetrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: ExtendedLlmSpanRecordDatasetMetadata | Unset = UNSET - trace_id: None | str | Unset = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: ExtendedLlmSpanRecordFeedbackRatingInfo | Unset = UNSET - annotations: ExtendedLlmSpanRecordAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: ExtendedLlmSpanRecordAnnotationAggregates | Unset = UNSET - annotation_agreement: ExtendedLlmSpanRecordAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: ExtendedLlmSpanRecordMetricInfoType0 | None | Unset = UNSET - files: ExtendedLlmSpanRecordFilesType0 | None | Unset = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - tools: list[ExtendedLlmSpanRecordToolsType0Item] | None | Unset = UNSET - events: ( - list[ - ImageGenerationEvent - | InternalToolCall - | MCPApprovalRequestEvent - | MCPCallEvent - | MCPListToolsEvent - | MessageEvent - | ReasoningEvent - | WebSearchCallEvent - ] - | None - | Unset - ) = UNSET - model: None | str | Unset = UNSET - provider: None | str | Unset = UNSET - temperature: float | None | Unset = UNSET - finish_reason: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.extended_llm_span_record_files_type_0 import ExtendedLlmSpanRecordFilesType0 - from ..models.extended_llm_span_record_metric_info_type_0 import ExtendedLlmSpanRecordMetricInfoType0 - from ..models.image_generation_event import ImageGenerationEvent - from ..models.internal_tool_call import InternalToolCall - from ..models.mcp_call_event import MCPCallEvent - from ..models.mcp_list_tools_event import MCPListToolsEvent - from ..models.message import Message - from ..models.message_event import MessageEvent - from ..models.reasoning_event import ReasoningEvent - from ..models.web_search_call_event import WebSearchCallEvent - - id = self.id - - session_id = self.session_id - - project_id = self.project_id - - run_id = self.run_id - - parent_id = self.parent_id - - type_ = self.type_ - - input_: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.input_, Unset): - input_ = [] - for input_item_data in self.input_: - input_item = input_item_data.to_dict() - input_.append(input_item) - - redacted_input: list[dict[str, Any]] | None | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_0_item_data in self.redacted_input: - redacted_input_type_0_item = redacted_input_type_0_item_data.to_dict() - redacted_input.append(redacted_input_type_0_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | Unset = UNSET - if not isinstance(self.output, Unset): - output = self.output.to_dict() - - redacted_output: dict[str, Any] | None | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, ExtendedLlmSpanRecordMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, ExtendedLlmSpanRecordFilesType0): - files = self.files.to_dict() - else: - files = self.files - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - tools: list[dict[str, Any]] | None | Unset - if isinstance(self.tools, Unset): - tools = UNSET - elif isinstance(self.tools, list): - tools = [] - for tools_type_0_item_data in self.tools: - tools_type_0_item = tools_type_0_item_data.to_dict() - tools.append(tools_type_0_item) - - else: - tools = self.tools - - events: list[dict[str, Any]] | None | Unset - if isinstance(self.events, Unset): - events = UNSET - elif isinstance(self.events, list): - events = [] - for events_type_0_item_data in self.events: - events_type_0_item: dict[str, Any] - if isinstance(events_type_0_item_data, MessageEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, ReasoningEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, InternalToolCall): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, WebSearchCallEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, ImageGenerationEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, MCPCallEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, MCPListToolsEvent): - events_type_0_item = events_type_0_item_data.to_dict() - else: - events_type_0_item = events_type_0_item_data.to_dict() - - events.append(events_type_0_item) - - else: - events = self.events - - model: None | str | Unset - if isinstance(self.model, Unset): - model = UNSET - else: - model = self.model - - provider: None | str | Unset - if isinstance(self.provider, Unset): - provider = UNSET - else: - provider = self.provider - - temperature: float | None | Unset - if isinstance(self.temperature, Unset): - temperature = UNSET - else: - temperature = self.temperature - - finish_reason: None | str | Unset - if isinstance(self.finish_reason, Unset): - finish_reason = UNSET - else: - finish_reason = self.finish_reason - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - {"id": id, "session_id": session_id, "project_id": project_id, "run_id": run_id, "parent_id": parent_id} - ) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - if tools is not UNSET: - field_dict["tools"] = tools - if events is not UNSET: - field_dict["events"] = events - if model is not UNSET: - field_dict["model"] = model - if provider is not UNSET: - field_dict["provider"] = provider - if temperature is not UNSET: - field_dict["temperature"] = temperature - if finish_reason is not UNSET: - field_dict["finish_reason"] = finish_reason - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_llm_span_record_annotation_aggregates import ExtendedLlmSpanRecordAnnotationAggregates - from ..models.extended_llm_span_record_annotation_agreement import ExtendedLlmSpanRecordAnnotationAgreement - from ..models.extended_llm_span_record_annotations import ExtendedLlmSpanRecordAnnotations - from ..models.extended_llm_span_record_dataset_metadata import ExtendedLlmSpanRecordDatasetMetadata - from ..models.extended_llm_span_record_feedback_rating_info import ExtendedLlmSpanRecordFeedbackRatingInfo - from ..models.extended_llm_span_record_files_type_0 import ExtendedLlmSpanRecordFilesType0 - from ..models.extended_llm_span_record_metric_info_type_0 import ExtendedLlmSpanRecordMetricInfoType0 - from ..models.extended_llm_span_record_tools_type_0_item import ExtendedLlmSpanRecordToolsType0Item - from ..models.extended_llm_span_record_user_metadata import ExtendedLlmSpanRecordUserMetadata - from ..models.image_generation_event import ImageGenerationEvent - from ..models.internal_tool_call import InternalToolCall - from ..models.llm_metrics import LlmMetrics - from ..models.mcp_approval_request_event import MCPApprovalRequestEvent - from ..models.mcp_call_event import MCPCallEvent - from ..models.mcp_list_tools_event import MCPListToolsEvent - from ..models.message import Message - from ..models.message_event import MessageEvent - from ..models.reasoning_event import ReasoningEvent - from ..models.web_search_call_event import WebSearchCallEvent - - d = dict(src_dict) - id = d.pop("id") - - session_id = d.pop("session_id") - - project_id = d.pop("project_id") - - run_id = d.pop("run_id") - - parent_id = d.pop("parent_id") - - type_ = cast(Literal["llm"] | Unset, d.pop("type", UNSET)) - if type_ != "llm" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'llm', got '{type_}'") - - _input_ = d.pop("input", UNSET) - input_: list[Message] | Unset = UNSET - if _input_ is not UNSET: - input_ = [] - for input_item_data in _input_: - input_item = Message.from_dict(input_item_data) - - input_.append(input_item) - - def _parse_redacted_input(data: object) -> list[Message] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_0 = [] - _redacted_input_type_0 = data - for redacted_input_type_0_item_data in _redacted_input_type_0: - redacted_input_type_0_item = Message.from_dict(redacted_input_type_0_item_data) - - redacted_input_type_0.append(redacted_input_type_0_item) - - return redacted_input_type_0 - except: # noqa: E722 - pass - return cast(list[Message] | None | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - _output = d.pop("output", UNSET) - output: Message | Unset - if isinstance(_output, Unset): - output = UNSET - else: - output = Message.from_dict(_output) - - def _parse_redacted_output(data: object) -> Message | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_0 = Message.from_dict(data) - - return redacted_output_type_0 - except: # noqa: E722 - pass - return cast(Message | None | Unset, data) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: ExtendedLlmSpanRecordUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = ExtendedLlmSpanRecordUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: LlmMetrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = LlmMetrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: ExtendedLlmSpanRecordDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = ExtendedLlmSpanRecordDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: ExtendedLlmSpanRecordFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = ExtendedLlmSpanRecordFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: ExtendedLlmSpanRecordAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = ExtendedLlmSpanRecordAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: ExtendedLlmSpanRecordAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = ExtendedLlmSpanRecordAnnotationAggregates.from_dict(_annotation_aggregates) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: ExtendedLlmSpanRecordAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = ExtendedLlmSpanRecordAnnotationAgreement.from_dict(_annotation_agreement) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> ExtendedLlmSpanRecordMetricInfoType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = ExtendedLlmSpanRecordMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(ExtendedLlmSpanRecordMetricInfoType0 | None | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> ExtendedLlmSpanRecordFilesType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = ExtendedLlmSpanRecordFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(ExtendedLlmSpanRecordFilesType0 | None | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - def _parse_tools(data: object) -> list[ExtendedLlmSpanRecordToolsType0Item] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - tools_type_0 = [] - _tools_type_0 = data - for tools_type_0_item_data in _tools_type_0: - tools_type_0_item = ExtendedLlmSpanRecordToolsType0Item.from_dict(tools_type_0_item_data) - - tools_type_0.append(tools_type_0_item) - - return tools_type_0 - except: # noqa: E722 - pass - return cast(list[ExtendedLlmSpanRecordToolsType0Item] | None | Unset, data) - - tools = _parse_tools(d.pop("tools", UNSET)) - - def _parse_events( - data: object, - ) -> ( - list[ - ImageGenerationEvent - | InternalToolCall - | MCPApprovalRequestEvent - | MCPCallEvent - | MCPListToolsEvent - | MessageEvent - | ReasoningEvent - | WebSearchCallEvent - ] - | None - | Unset - ): - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - events_type_0 = [] - _events_type_0 = data - for events_type_0_item_data in _events_type_0: - - def _parse_events_type_0_item( - data: object, - ) -> ( - ImageGenerationEvent - | InternalToolCall - | MCPApprovalRequestEvent - | MCPCallEvent - | MCPListToolsEvent - | MessageEvent - | ReasoningEvent - | WebSearchCallEvent - ): - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_0 = MessageEvent.from_dict(data) - - return events_type_0_item_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_1 = ReasoningEvent.from_dict(data) - - return events_type_0_item_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_2 = InternalToolCall.from_dict(data) - - return events_type_0_item_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_3 = WebSearchCallEvent.from_dict(data) - - return events_type_0_item_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_4 = ImageGenerationEvent.from_dict(data) - - return events_type_0_item_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_5 = MCPCallEvent.from_dict(data) - - return events_type_0_item_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_6 = MCPListToolsEvent.from_dict(data) - - return events_type_0_item_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_7 = MCPApprovalRequestEvent.from_dict(data) - - return events_type_0_item_type_7 - - events_type_0_item = _parse_events_type_0_item(events_type_0_item_data) - - events_type_0.append(events_type_0_item) - - return events_type_0 - except: # noqa: E722 - pass - return cast( - list[ - ImageGenerationEvent - | InternalToolCall - | MCPApprovalRequestEvent - | MCPCallEvent - | MCPListToolsEvent - | MessageEvent - | ReasoningEvent - | WebSearchCallEvent - ] - | None - | Unset, - data, - ) - - events = _parse_events(d.pop("events", UNSET)) - - def _parse_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - model = _parse_model(d.pop("model", UNSET)) - - def _parse_provider(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - provider = _parse_provider(d.pop("provider", UNSET)) - - def _parse_temperature(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - temperature = _parse_temperature(d.pop("temperature", UNSET)) - - def _parse_finish_reason(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - finish_reason = _parse_finish_reason(d.pop("finish_reason", UNSET)) - - extended_llm_span_record = cls( - id=id, - session_id=session_id, - project_id=project_id, - run_id=run_id, - parent_id=parent_id, - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - trace_id=trace_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - is_complete=is_complete, - step_number=step_number, - tools=tools, - events=events, - model=model, - provider=provider, - temperature=temperature, - finish_reason=finish_reason, - ) - - extended_llm_span_record.additional_properties = d - return extended_llm_span_record - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_llm_span_record_annotation_aggregates.py b/src/splunk_ao/resources/models/extended_llm_span_record_annotation_aggregates.py deleted file mode 100644 index 2bed97a4..00000000 --- a/src/splunk_ao/resources/models/extended_llm_span_record_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="ExtendedLlmSpanRecordAnnotationAggregates") - - -@_attrs_define -class ExtendedLlmSpanRecordAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - extended_llm_span_record_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_llm_span_record_annotation_aggregates.additional_properties = additional_properties - return extended_llm_span_record_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_llm_span_record_annotation_agreement.py b/src/splunk_ao/resources/models/extended_llm_span_record_annotation_agreement.py deleted file mode 100644 index 2ca2a9c5..00000000 --- a/src/splunk_ao/resources/models/extended_llm_span_record_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedLlmSpanRecordAnnotationAgreement") - - -@_attrs_define -class ExtendedLlmSpanRecordAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_llm_span_record_annotation_agreement = cls() - - extended_llm_span_record_annotation_agreement.additional_properties = d - return extended_llm_span_record_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_llm_span_record_annotations.py b/src/splunk_ao/resources/models/extended_llm_span_record_annotations.py deleted file mode 100644 index 275c00cc..00000000 --- a/src/splunk_ao/resources/models/extended_llm_span_record_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.extended_llm_span_record_annotations_additional_property import ( - ExtendedLlmSpanRecordAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="ExtendedLlmSpanRecordAnnotations") - - -@_attrs_define -class ExtendedLlmSpanRecordAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, ExtendedLlmSpanRecordAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_llm_span_record_annotations_additional_property import ( - ExtendedLlmSpanRecordAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - extended_llm_span_record_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = ExtendedLlmSpanRecordAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_llm_span_record_annotations.additional_properties = additional_properties - return extended_llm_span_record_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> ExtendedLlmSpanRecordAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: ExtendedLlmSpanRecordAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_llm_span_record_annotations_additional_property.py b/src/splunk_ao/resources/models/extended_llm_span_record_annotations_additional_property.py deleted file mode 100644 index 70065534..00000000 --- a/src/splunk_ao/resources/models/extended_llm_span_record_annotations_additional_property.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="ExtendedLlmSpanRecordAnnotationsAdditionalProperty") - - -@_attrs_define -class ExtendedLlmSpanRecordAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - extended_llm_span_record_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_llm_span_record_annotations_additional_property.additional_properties = additional_properties - return extended_llm_span_record_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_llm_span_record_dataset_metadata.py b/src/splunk_ao/resources/models/extended_llm_span_record_dataset_metadata.py deleted file mode 100644 index 583f55d9..00000000 --- a/src/splunk_ao/resources/models/extended_llm_span_record_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedLlmSpanRecordDatasetMetadata") - - -@_attrs_define -class ExtendedLlmSpanRecordDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_llm_span_record_dataset_metadata = cls() - - extended_llm_span_record_dataset_metadata.additional_properties = d - return extended_llm_span_record_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_llm_span_record_feedback_rating_info.py b/src/splunk_ao/resources/models/extended_llm_span_record_feedback_rating_info.py deleted file mode 100644 index ee93f01e..00000000 --- a/src/splunk_ao/resources/models/extended_llm_span_record_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="ExtendedLlmSpanRecordFeedbackRatingInfo") - - -@_attrs_define -class ExtendedLlmSpanRecordFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - extended_llm_span_record_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_llm_span_record_feedback_rating_info.additional_properties = additional_properties - return extended_llm_span_record_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_llm_span_record_files_type_0.py b/src/splunk_ao/resources/models/extended_llm_span_record_files_type_0.py deleted file mode 100644 index aa4582f0..00000000 --- a/src/splunk_ao/resources/models/extended_llm_span_record_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="ExtendedLlmSpanRecordFilesType0") - - -@_attrs_define -class ExtendedLlmSpanRecordFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - extended_llm_span_record_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_llm_span_record_files_type_0.additional_properties = additional_properties - return extended_llm_span_record_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_llm_span_record_metric_info_type_0.py b/src/splunk_ao/resources/models/extended_llm_span_record_metric_info_type_0.py deleted file mode 100644 index 53f54e96..00000000 --- a/src/splunk_ao/resources/models/extended_llm_span_record_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="ExtendedLlmSpanRecordMetricInfoType0") - - -@_attrs_define -class ExtendedLlmSpanRecordMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - extended_llm_span_record_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_llm_span_record_metric_info_type_0.additional_properties = additional_properties - return extended_llm_span_record_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_llm_span_record_user_metadata.py b/src/splunk_ao/resources/models/extended_llm_span_record_user_metadata.py deleted file mode 100644 index 0d13e1c7..00000000 --- a/src/splunk_ao/resources/models/extended_llm_span_record_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedLlmSpanRecordUserMetadata") - - -@_attrs_define -class ExtendedLlmSpanRecordUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_llm_span_record_user_metadata = cls() - - extended_llm_span_record_user_metadata.additional_properties = d - return extended_llm_span_record_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_read_session_record_with_children.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children.py deleted file mode 100644 index d26dc563..00000000 --- a/src/splunk_ao/resources/models/extended_read_session_record_with_children.py +++ /dev/null @@ -1,1289 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_read_session_record_with_children_annotation_aggregates import ( - ExtendedReadSessionRecordWithChildrenAnnotationAggregates, - ) - from ..models.extended_read_session_record_with_children_annotation_agreement import ( - ExtendedReadSessionRecordWithChildrenAnnotationAgreement, - ) - from ..models.extended_read_session_record_with_children_annotations import ( - ExtendedReadSessionRecordWithChildrenAnnotations, - ) - from ..models.extended_read_session_record_with_children_dataset_metadata import ( - ExtendedReadSessionRecordWithChildrenDatasetMetadata, - ) - from ..models.extended_read_session_record_with_children_feedback_rating_info import ( - ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo, - ) - from ..models.extended_read_session_record_with_children_files_type_0 import ( - ExtendedReadSessionRecordWithChildrenFilesType0, - ) - from ..models.extended_read_session_record_with_children_metric_info_type_0 import ( - ExtendedReadSessionRecordWithChildrenMetricInfoType0, - ) - from ..models.extended_read_session_record_with_children_user_metadata import ( - ExtendedReadSessionRecordWithChildrenUserMetadata, - ) - from ..models.extended_trace_record_with_children import ExtendedTraceRecordWithChildren - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.stub_trace_record import StubTraceRecord - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildren") - - -@_attrs_define -class ExtendedReadSessionRecordWithChildren: - """Read-side session response that also accepts synthesized stub_trace roots. - - Same shape as ExtendedSessionRecordWithChildren, except `traces` allows the - StubTraceRecord placeholder produced by create_tree_for_extended_read_session - for spans whose TraceRecord hasn't arrived yet. Defined independently of - ExtendedSessionRecordWithChildren/RecordWithChildTraces rather than - subclassing them, since widening their Sequence[ExtendedTraceRecordWithChildren] - field to also allow StubTraceRecord in a subclass is an LSP violation mypy - correctly rejects. - - Attributes: - id (str): Galileo ID of the session - project_id (str): Galileo ID of the project associated with this trace or span - run_id (str): Galileo ID of the run (log stream or experiment) associated with this trace or span - type_ (Literal['session'] | Unset): Type of the trace, span or session. Default: 'session'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (ExtendedReadSessionRecordWithChildrenUserMetadata | Unset): Metadata associated with this trace - or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (ExtendedReadSessionRecordWithChildrenDatasetMetadata | Unset): Metadata from the dataset - associated with this trace - session_id (None | str | Unset): Galileo ID of the session containing the trace or span or session - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo | Unset): Feedback information - related to the record - annotations (ExtendedReadSessionRecordWithChildrenAnnotations | Unset): Annotations keyed by template ID and - annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (ExtendedReadSessionRecordWithChildrenAnnotationAggregates | Unset): Annotation aggregate - information keyed by template ID - annotation_agreement (ExtendedReadSessionRecordWithChildrenAnnotationAgreement | Unset): Annotation agreement - scores keyed by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (ExtendedReadSessionRecordWithChildrenMetricInfoType0 | None | Unset): Detailed information about - the metrics associated with this trace or span - files (ExtendedReadSessionRecordWithChildrenFilesType0 | None | Unset): File metadata keyed by file ID for files - associated with this record - previous_session_id (None | str | Unset): - num_traces (int | None | Unset): - traces (list[ExtendedTraceRecordWithChildren | StubTraceRecord] | Unset): - """ - - id: str - project_id: str - run_id: str - type_: Literal["session"] | Unset = "session" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: ExtendedReadSessionRecordWithChildrenUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: ExtendedReadSessionRecordWithChildrenDatasetMetadata | Unset = UNSET - session_id: None | str | Unset = UNSET - trace_id: None | str | Unset = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo | Unset = UNSET - annotations: ExtendedReadSessionRecordWithChildrenAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: ExtendedReadSessionRecordWithChildrenAnnotationAggregates | Unset = UNSET - annotation_agreement: ExtendedReadSessionRecordWithChildrenAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: ExtendedReadSessionRecordWithChildrenMetricInfoType0 | None | Unset = UNSET - files: ExtendedReadSessionRecordWithChildrenFilesType0 | None | Unset = UNSET - previous_session_id: None | str | Unset = UNSET - num_traces: int | None | Unset = UNSET - traces: list[ExtendedTraceRecordWithChildren | StubTraceRecord] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.extended_read_session_record_with_children_files_type_0 import ( - ExtendedReadSessionRecordWithChildrenFilesType0, - ) - from ..models.extended_read_session_record_with_children_metric_info_type_0 import ( - ExtendedReadSessionRecordWithChildrenMetricInfoType0, - ) - from ..models.extended_trace_record_with_children import ExtendedTraceRecordWithChildren - from ..models.message import Message - from ..models.text_content_part import TextContentPart - - id = self.id - - project_id = self.project_id - - run_id = self.run_id - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, ExtendedReadSessionRecordWithChildrenMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, ExtendedReadSessionRecordWithChildrenFilesType0): - files = self.files.to_dict() - else: - files = self.files - - previous_session_id: None | str | Unset - if isinstance(self.previous_session_id, Unset): - previous_session_id = UNSET - else: - previous_session_id = self.previous_session_id - - num_traces: int | None | Unset - if isinstance(self.num_traces, Unset): - num_traces = UNSET - else: - num_traces = self.num_traces - - traces: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.traces, Unset): - traces = [] - for traces_item_data in self.traces: - traces_item: dict[str, Any] - if isinstance(traces_item_data, ExtendedTraceRecordWithChildren): - traces_item = traces_item_data.to_dict() - else: - traces_item = traces_item_data.to_dict() - - traces.append(traces_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({"id": id, "project_id": project_id, "run_id": run_id}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if previous_session_id is not UNSET: - field_dict["previous_session_id"] = previous_session_id - if num_traces is not UNSET: - field_dict["num_traces"] = num_traces - if traces is not UNSET: - field_dict["traces"] = traces - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_read_session_record_with_children_annotation_aggregates import ( - ExtendedReadSessionRecordWithChildrenAnnotationAggregates, - ) - from ..models.extended_read_session_record_with_children_annotation_agreement import ( - ExtendedReadSessionRecordWithChildrenAnnotationAgreement, - ) - from ..models.extended_read_session_record_with_children_annotations import ( - ExtendedReadSessionRecordWithChildrenAnnotations, - ) - from ..models.extended_read_session_record_with_children_dataset_metadata import ( - ExtendedReadSessionRecordWithChildrenDatasetMetadata, - ) - from ..models.extended_read_session_record_with_children_feedback_rating_info import ( - ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo, - ) - from ..models.extended_read_session_record_with_children_files_type_0 import ( - ExtendedReadSessionRecordWithChildrenFilesType0, - ) - from ..models.extended_read_session_record_with_children_metric_info_type_0 import ( - ExtendedReadSessionRecordWithChildrenMetricInfoType0, - ) - from ..models.extended_read_session_record_with_children_user_metadata import ( - ExtendedReadSessionRecordWithChildrenUserMetadata, - ) - from ..models.extended_trace_record_with_children import ExtendedTraceRecordWithChildren - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.stub_trace_record import StubTraceRecord - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - id = d.pop("id") - - project_id = d.pop("project_id") - - run_id = d.pop("run_id") - - type_ = cast(Literal["session"] | Unset, d.pop("type", UNSET)) - if type_ != "session" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'session', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: ExtendedReadSessionRecordWithChildrenUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = ExtendedReadSessionRecordWithChildrenUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: ExtendedReadSessionRecordWithChildrenDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = ExtendedReadSessionRecordWithChildrenDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_session_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo.from_dict( - _feedback_rating_info - ) - - _annotations = d.pop("annotations", UNSET) - annotations: ExtendedReadSessionRecordWithChildrenAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = ExtendedReadSessionRecordWithChildrenAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: ExtendedReadSessionRecordWithChildrenAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = ExtendedReadSessionRecordWithChildrenAnnotationAggregates.from_dict( - _annotation_aggregates - ) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: ExtendedReadSessionRecordWithChildrenAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = ExtendedReadSessionRecordWithChildrenAnnotationAgreement.from_dict( - _annotation_agreement - ) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> ExtendedReadSessionRecordWithChildrenMetricInfoType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = ExtendedReadSessionRecordWithChildrenMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(ExtendedReadSessionRecordWithChildrenMetricInfoType0 | None | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> ExtendedReadSessionRecordWithChildrenFilesType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = ExtendedReadSessionRecordWithChildrenFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(ExtendedReadSessionRecordWithChildrenFilesType0 | None | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - def _parse_previous_session_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - previous_session_id = _parse_previous_session_id(d.pop("previous_session_id", UNSET)) - - def _parse_num_traces(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - num_traces = _parse_num_traces(d.pop("num_traces", UNSET)) - - _traces = d.pop("traces", UNSET) - traces: list[ExtendedTraceRecordWithChildren | StubTraceRecord] | Unset = UNSET - if _traces is not UNSET: - traces = [] - for traces_item_data in _traces: - - def _parse_traces_item(data: object) -> ExtendedTraceRecordWithChildren | StubTraceRecord: - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - traces_item_type_0 = ExtendedTraceRecordWithChildren.from_dict(data) - - return traces_item_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - traces_item_type_1 = StubTraceRecord.from_dict(data) - - return traces_item_type_1 - except: # noqa: E722 - pass - # If we reach here, none of the parsers succeeded - discriminator_info = ( - f" (type={data.get('type')})" if isinstance(data, dict) and "type" in data else "" - ) - raise ValueError(f"Could not parse union type for traces_item{discriminator_info}") - - traces_item = _parse_traces_item(traces_item_data) - - traces.append(traces_item) - - extended_read_session_record_with_children = cls( - id=id, - project_id=project_id, - run_id=run_id, - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - session_id=session_id, - trace_id=trace_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - previous_session_id=previous_session_id, - num_traces=num_traces, - traces=traces, - ) - - extended_read_session_record_with_children.additional_properties = d - return extended_read_session_record_with_children - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_aggregates.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_aggregates.py deleted file mode 100644 index 6af26898..00000000 --- a/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenAnnotationAggregates") - - -@_attrs_define -class ExtendedReadSessionRecordWithChildrenAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - extended_read_session_record_with_children_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_read_session_record_with_children_annotation_aggregates.additional_properties = additional_properties - return extended_read_session_record_with_children_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_agreement.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_agreement.py deleted file mode 100644 index 4ed59025..00000000 --- a/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenAnnotationAgreement") - - -@_attrs_define -class ExtendedReadSessionRecordWithChildrenAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_read_session_record_with_children_annotation_agreement = cls() - - extended_read_session_record_with_children_annotation_agreement.additional_properties = d - return extended_read_session_record_with_children_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations.py deleted file mode 100644 index 9c525559..00000000 --- a/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.extended_read_session_record_with_children_annotations_additional_property import ( - ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenAnnotations") - - -@_attrs_define -class ExtendedReadSessionRecordWithChildrenAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_read_session_record_with_children_annotations_additional_property import ( - ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - extended_read_session_record_with_children_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty.from_dict( - prop_dict - ) - - additional_properties[prop_name] = additional_property - - extended_read_session_record_with_children_annotations.additional_properties = additional_properties - return extended_read_session_record_with_children_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations_additional_property.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations_additional_property.py deleted file mode 100644 index f0e63581..00000000 --- a/src/splunk_ao/resources/models/extended_read_session_record_with_children_annotations_additional_property.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty") - - -@_attrs_define -class ExtendedReadSessionRecordWithChildrenAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - extended_read_session_record_with_children_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_read_session_record_with_children_annotations_additional_property.additional_properties = ( - additional_properties - ) - return extended_read_session_record_with_children_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_read_session_record_with_children_dataset_metadata.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_dataset_metadata.py deleted file mode 100644 index 8998fd1e..00000000 --- a/src/splunk_ao/resources/models/extended_read_session_record_with_children_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenDatasetMetadata") - - -@_attrs_define -class ExtendedReadSessionRecordWithChildrenDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_read_session_record_with_children_dataset_metadata = cls() - - extended_read_session_record_with_children_dataset_metadata.additional_properties = d - return extended_read_session_record_with_children_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_read_session_record_with_children_feedback_rating_info.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_feedback_rating_info.py deleted file mode 100644 index bd469b72..00000000 --- a/src/splunk_ao/resources/models/extended_read_session_record_with_children_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo") - - -@_attrs_define -class ExtendedReadSessionRecordWithChildrenFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - extended_read_session_record_with_children_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_read_session_record_with_children_feedback_rating_info.additional_properties = additional_properties - return extended_read_session_record_with_children_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_read_session_record_with_children_files_type_0.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_files_type_0.py deleted file mode 100644 index 2dca0a64..00000000 --- a/src/splunk_ao/resources/models/extended_read_session_record_with_children_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenFilesType0") - - -@_attrs_define -class ExtendedReadSessionRecordWithChildrenFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - extended_read_session_record_with_children_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_read_session_record_with_children_files_type_0.additional_properties = additional_properties - return extended_read_session_record_with_children_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_read_session_record_with_children_metric_info_type_0.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_metric_info_type_0.py deleted file mode 100644 index b4e5bdd7..00000000 --- a/src/splunk_ao/resources/models/extended_read_session_record_with_children_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenMetricInfoType0") - - -@_attrs_define -class ExtendedReadSessionRecordWithChildrenMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - extended_read_session_record_with_children_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_read_session_record_with_children_metric_info_type_0.additional_properties = additional_properties - return extended_read_session_record_with_children_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_read_session_record_with_children_user_metadata.py b/src/splunk_ao/resources/models/extended_read_session_record_with_children_user_metadata.py deleted file mode 100644 index 4413ae65..00000000 --- a/src/splunk_ao/resources/models/extended_read_session_record_with_children_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedReadSessionRecordWithChildrenUserMetadata") - - -@_attrs_define -class ExtendedReadSessionRecordWithChildrenUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_read_session_record_with_children_user_metadata = cls() - - extended_read_session_record_with_children_user_metadata.additional_properties = d - return extended_read_session_record_with_children_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_retriever_span_record.py b/src/splunk_ao/resources/models/extended_retriever_span_record.py index 30376dc5..7ea50273 100644 --- a/src/splunk_ao/resources/models/extended_retriever_span_record.py +++ b/src/splunk_ao/resources/models/extended_retriever_span_record.py @@ -9,6 +9,7 @@ from ..models.annotation_status import AnnotationStatus from ..models.content_modality import ContentModality +from ..models.left_out_reason import LeftOutReason from ..types import UNSET, Unset if TYPE_CHECKING: @@ -84,6 +85,12 @@ class ExtendedRetrieverSpanRecord: associated with this trace or span files (ExtendedRetrieverSpanRecordFilesType0 | None | Unset): File metadata keyed by file ID for files associated with this record + is_placeholder (bool | Unset): Whether this span is not stored but stands in for a parent span missing from its + trace Default: False. + left_out_reason (LeftOutReason | None | Unset): Set when the tree cannot place this span under its parent, so it + sits at the trace root instead. child_of_leaf_span: an ancestor is an llm or control span. unreachable: its + chain of parents never reaches the trace. Detail trees never set no_trace_row: a stub_trace root shows that + case. is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. step_number (int | None | Unset): Topological step number of the span. """ @@ -128,6 +135,8 @@ class ExtendedRetrieverSpanRecord: error_message: str | Unset = "" metric_info: ExtendedRetrieverSpanRecordMetricInfoType0 | None | Unset = UNSET files: ExtendedRetrieverSpanRecordFilesType0 | None | Unset = UNSET + is_placeholder: bool | Unset = False + left_out_reason: LeftOutReason | None | Unset = UNSET is_complete: bool | Unset = True step_number: int | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -335,6 +344,16 @@ def to_dict(self) -> dict[str, Any]: else: files = self.files + is_placeholder = self.is_placeholder + + left_out_reason: None | str | Unset + if isinstance(self.left_out_reason, Unset): + left_out_reason = UNSET + elif isinstance(self.left_out_reason, LeftOutReason): + left_out_reason = self.left_out_reason.value + else: + left_out_reason = self.left_out_reason + is_complete = self.is_complete step_number: int | None | Unset @@ -418,6 +437,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["metric_info"] = metric_info if files is not UNSET: field_dict["files"] = files + if is_placeholder is not UNSET: + field_dict["is_placeholder"] = is_placeholder + if left_out_reason is not UNSET: + field_dict["left_out_reason"] = left_out_reason if is_complete is not UNSET: field_dict["is_complete"] = is_complete if step_number is not UNSET: @@ -867,6 +890,25 @@ def _parse_files(data: object) -> ExtendedRetrieverSpanRecordFilesType0 | None | files = _parse_files(d.pop("files", UNSET)) + is_placeholder = d.pop("is_placeholder", UNSET) + + def _parse_left_out_reason(data: object) -> LeftOutReason | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + left_out_reason_type_0 = LeftOutReason(data) + + return left_out_reason_type_0 + except: # noqa: E722 + pass + return cast(LeftOutReason | None | Unset, data) + + left_out_reason = _parse_left_out_reason(d.pop("left_out_reason", UNSET)) + is_complete = d.pop("is_complete", UNSET) def _parse_step_number(data: object) -> int | None | Unset: @@ -919,6 +961,8 @@ def _parse_step_number(data: object) -> int | None | Unset: error_message=error_message, metric_info=metric_info, files=files, + is_placeholder=is_placeholder, + left_out_reason=left_out_reason, is_complete=is_complete, step_number=step_number, ) diff --git a/src/splunk_ao/resources/models/extended_retriever_span_record_with_children.py b/src/splunk_ao/resources/models/extended_retriever_span_record_with_children.py index 1ce2c992..419c23a9 100644 --- a/src/splunk_ao/resources/models/extended_retriever_span_record_with_children.py +++ b/src/splunk_ao/resources/models/extended_retriever_span_record_with_children.py @@ -9,6 +9,7 @@ from ..models.annotation_status import AnnotationStatus from ..models.content_modality import ContentModality +from ..models.left_out_reason import LeftOutReason from ..types import UNSET, Unset if TYPE_CHECKING: @@ -105,6 +106,12 @@ class ExtendedRetrieverSpanRecordWithChildren: the metrics associated with this trace or span files (ExtendedRetrieverSpanRecordWithChildrenFilesType0 | None | Unset): File metadata keyed by file ID for files associated with this record + is_placeholder (bool | Unset): Whether this span is not stored but stands in for a parent span missing from its + trace Default: False. + left_out_reason (LeftOutReason | None | Unset): Set when the tree cannot place this span under its parent, so it + sits at the trace root instead. child_of_leaf_span: an ancestor is an llm or control span. unreachable: its + chain of parents never reaches the trace. Detail trees never set no_trace_row: a stub_trace root shows that + case. is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. step_number (int | None | Unset): Topological step number of the span. """ @@ -161,6 +168,8 @@ class ExtendedRetrieverSpanRecordWithChildren: error_message: str | Unset = "" metric_info: ExtendedRetrieverSpanRecordWithChildrenMetricInfoType0 | None | Unset = UNSET files: ExtendedRetrieverSpanRecordWithChildrenFilesType0 | None | Unset = UNSET + is_placeholder: bool | Unset = False + left_out_reason: LeftOutReason | None | Unset = UNSET is_complete: bool | Unset = True step_number: int | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -397,6 +406,16 @@ def to_dict(self) -> dict[str, Any]: else: files = self.files + is_placeholder = self.is_placeholder + + left_out_reason: None | str | Unset + if isinstance(self.left_out_reason, Unset): + left_out_reason = UNSET + elif isinstance(self.left_out_reason, LeftOutReason): + left_out_reason = self.left_out_reason.value + else: + left_out_reason = self.left_out_reason + is_complete = self.is_complete step_number: int | None | Unset @@ -482,6 +501,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["metric_info"] = metric_info if files is not UNSET: field_dict["files"] = files + if is_placeholder is not UNSET: + field_dict["is_placeholder"] = is_placeholder + if left_out_reason is not UNSET: + field_dict["left_out_reason"] = left_out_reason if is_complete is not UNSET: field_dict["is_complete"] = is_complete if step_number is not UNSET: @@ -1100,6 +1123,25 @@ def _parse_files(data: object) -> ExtendedRetrieverSpanRecordWithChildrenFilesTy files = _parse_files(d.pop("files", UNSET)) + is_placeholder = d.pop("is_placeholder", UNSET) + + def _parse_left_out_reason(data: object) -> LeftOutReason | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + left_out_reason_type_0 = LeftOutReason(data) + + return left_out_reason_type_0 + except: # noqa: E722 + pass + return cast(LeftOutReason | None | Unset, data) + + left_out_reason = _parse_left_out_reason(d.pop("left_out_reason", UNSET)) + is_complete = d.pop("is_complete", UNSET) def _parse_step_number(data: object) -> int | None | Unset: @@ -1153,6 +1195,8 @@ def _parse_step_number(data: object) -> int | None | Unset: error_message=error_message, metric_info=metric_info, files=files, + is_placeholder=is_placeholder, + left_out_reason=left_out_reason, is_complete=is_complete, step_number=step_number, ) diff --git a/src/splunk_ao/resources/models/extended_session_record.py b/src/splunk_ao/resources/models/extended_session_record.py deleted file mode 100644 index fae5adba..00000000 --- a/src/splunk_ao/resources/models/extended_session_record.py +++ /dev/null @@ -1,1125 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_session_record_annotation_aggregates import ExtendedSessionRecordAnnotationAggregates - from ..models.extended_session_record_annotation_agreement import ExtendedSessionRecordAnnotationAgreement - from ..models.extended_session_record_annotations import ExtendedSessionRecordAnnotations - from ..models.extended_session_record_dataset_metadata import ExtendedSessionRecordDatasetMetadata - from ..models.extended_session_record_feedback_rating_info import ExtendedSessionRecordFeedbackRatingInfo - from ..models.extended_session_record_files_type_0 import ExtendedSessionRecordFilesType0 - from ..models.extended_session_record_metric_info_type_0 import ExtendedSessionRecordMetricInfoType0 - from ..models.extended_session_record_user_metadata import ExtendedSessionRecordUserMetadata - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="ExtendedSessionRecord") - - -@_attrs_define -class ExtendedSessionRecord: - """ - Attributes: - id (str): Galileo ID of the session - project_id (str): Galileo ID of the project associated with this trace or span - run_id (str): Galileo ID of the run (log stream or experiment) associated with this trace or span - type_ (Literal['session'] | Unset): Type of the trace, span or session. Default: 'session'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (ExtendedSessionRecordUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (ExtendedSessionRecordDatasetMetadata | Unset): Metadata from the dataset associated with this - trace - session_id (None | str | Unset): Galileo ID of the session containing the trace or span or session - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (ExtendedSessionRecordFeedbackRatingInfo | Unset): Feedback information related to the - record - annotations (ExtendedSessionRecordAnnotations | Unset): Annotations keyed by template ID and annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (ExtendedSessionRecordAnnotationAggregates | Unset): Annotation aggregate information - keyed by template ID - annotation_agreement (ExtendedSessionRecordAnnotationAgreement | Unset): Annotation agreement scores keyed by - template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (ExtendedSessionRecordMetricInfoType0 | None | Unset): Detailed information about the metrics - associated with this trace or span - files (ExtendedSessionRecordFilesType0 | None | Unset): File metadata keyed by file ID for files associated with - this record - previous_session_id (None | str | Unset): - num_traces (int | None | Unset): - """ - - id: str - project_id: str - run_id: str - type_: Literal["session"] | Unset = "session" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: ExtendedSessionRecordUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: ExtendedSessionRecordDatasetMetadata | Unset = UNSET - session_id: None | str | Unset = UNSET - trace_id: None | str | Unset = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: ExtendedSessionRecordFeedbackRatingInfo | Unset = UNSET - annotations: ExtendedSessionRecordAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: ExtendedSessionRecordAnnotationAggregates | Unset = UNSET - annotation_agreement: ExtendedSessionRecordAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: ExtendedSessionRecordMetricInfoType0 | None | Unset = UNSET - files: ExtendedSessionRecordFilesType0 | None | Unset = UNSET - previous_session_id: None | str | Unset = UNSET - num_traces: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.extended_session_record_files_type_0 import ExtendedSessionRecordFilesType0 - from ..models.extended_session_record_metric_info_type_0 import ExtendedSessionRecordMetricInfoType0 - from ..models.message import Message - from ..models.text_content_part import TextContentPart - - id = self.id - - project_id = self.project_id - - run_id = self.run_id - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, ExtendedSessionRecordMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, ExtendedSessionRecordFilesType0): - files = self.files.to_dict() - else: - files = self.files - - previous_session_id: None | str | Unset - if isinstance(self.previous_session_id, Unset): - previous_session_id = UNSET - else: - previous_session_id = self.previous_session_id - - num_traces: int | None | Unset - if isinstance(self.num_traces, Unset): - num_traces = UNSET - else: - num_traces = self.num_traces - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({"id": id, "project_id": project_id, "run_id": run_id}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if previous_session_id is not UNSET: - field_dict["previous_session_id"] = previous_session_id - if num_traces is not UNSET: - field_dict["num_traces"] = num_traces - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_session_record_annotation_aggregates import ExtendedSessionRecordAnnotationAggregates - from ..models.extended_session_record_annotation_agreement import ExtendedSessionRecordAnnotationAgreement - from ..models.extended_session_record_annotations import ExtendedSessionRecordAnnotations - from ..models.extended_session_record_dataset_metadata import ExtendedSessionRecordDatasetMetadata - from ..models.extended_session_record_feedback_rating_info import ExtendedSessionRecordFeedbackRatingInfo - from ..models.extended_session_record_files_type_0 import ExtendedSessionRecordFilesType0 - from ..models.extended_session_record_metric_info_type_0 import ExtendedSessionRecordMetricInfoType0 - from ..models.extended_session_record_user_metadata import ExtendedSessionRecordUserMetadata - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - id = d.pop("id") - - project_id = d.pop("project_id") - - run_id = d.pop("run_id") - - type_ = cast(Literal["session"] | Unset, d.pop("type", UNSET)) - if type_ != "session" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'session', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: ExtendedSessionRecordUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = ExtendedSessionRecordUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: ExtendedSessionRecordDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = ExtendedSessionRecordDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_session_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: ExtendedSessionRecordFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = ExtendedSessionRecordFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: ExtendedSessionRecordAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = ExtendedSessionRecordAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: ExtendedSessionRecordAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = ExtendedSessionRecordAnnotationAggregates.from_dict(_annotation_aggregates) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: ExtendedSessionRecordAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = ExtendedSessionRecordAnnotationAgreement.from_dict(_annotation_agreement) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> ExtendedSessionRecordMetricInfoType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = ExtendedSessionRecordMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(ExtendedSessionRecordMetricInfoType0 | None | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> ExtendedSessionRecordFilesType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = ExtendedSessionRecordFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(ExtendedSessionRecordFilesType0 | None | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - def _parse_previous_session_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - previous_session_id = _parse_previous_session_id(d.pop("previous_session_id", UNSET)) - - def _parse_num_traces(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - num_traces = _parse_num_traces(d.pop("num_traces", UNSET)) - - extended_session_record = cls( - id=id, - project_id=project_id, - run_id=run_id, - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - session_id=session_id, - trace_id=trace_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - previous_session_id=previous_session_id, - num_traces=num_traces, - ) - - extended_session_record.additional_properties = d - return extended_session_record - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_session_record_annotation_aggregates.py b/src/splunk_ao/resources/models/extended_session_record_annotation_aggregates.py deleted file mode 100644 index ed5cf6ef..00000000 --- a/src/splunk_ao/resources/models/extended_session_record_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="ExtendedSessionRecordAnnotationAggregates") - - -@_attrs_define -class ExtendedSessionRecordAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - extended_session_record_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_session_record_annotation_aggregates.additional_properties = additional_properties - return extended_session_record_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_session_record_annotation_agreement.py b/src/splunk_ao/resources/models/extended_session_record_annotation_agreement.py deleted file mode 100644 index 85c53545..00000000 --- a/src/splunk_ao/resources/models/extended_session_record_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedSessionRecordAnnotationAgreement") - - -@_attrs_define -class ExtendedSessionRecordAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_session_record_annotation_agreement = cls() - - extended_session_record_annotation_agreement.additional_properties = d - return extended_session_record_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_session_record_annotations.py b/src/splunk_ao/resources/models/extended_session_record_annotations.py deleted file mode 100644 index a8f2281d..00000000 --- a/src/splunk_ao/resources/models/extended_session_record_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.extended_session_record_annotations_additional_property import ( - ExtendedSessionRecordAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="ExtendedSessionRecordAnnotations") - - -@_attrs_define -class ExtendedSessionRecordAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, ExtendedSessionRecordAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_session_record_annotations_additional_property import ( - ExtendedSessionRecordAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - extended_session_record_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = ExtendedSessionRecordAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_session_record_annotations.additional_properties = additional_properties - return extended_session_record_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> ExtendedSessionRecordAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: ExtendedSessionRecordAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_session_record_annotations_additional_property.py b/src/splunk_ao/resources/models/extended_session_record_annotations_additional_property.py deleted file mode 100644 index b6997586..00000000 --- a/src/splunk_ao/resources/models/extended_session_record_annotations_additional_property.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="ExtendedSessionRecordAnnotationsAdditionalProperty") - - -@_attrs_define -class ExtendedSessionRecordAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - extended_session_record_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_session_record_annotations_additional_property.additional_properties = additional_properties - return extended_session_record_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_session_record_dataset_metadata.py b/src/splunk_ao/resources/models/extended_session_record_dataset_metadata.py deleted file mode 100644 index ff249322..00000000 --- a/src/splunk_ao/resources/models/extended_session_record_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedSessionRecordDatasetMetadata") - - -@_attrs_define -class ExtendedSessionRecordDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_session_record_dataset_metadata = cls() - - extended_session_record_dataset_metadata.additional_properties = d - return extended_session_record_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_session_record_feedback_rating_info.py b/src/splunk_ao/resources/models/extended_session_record_feedback_rating_info.py deleted file mode 100644 index 1cdba1fb..00000000 --- a/src/splunk_ao/resources/models/extended_session_record_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="ExtendedSessionRecordFeedbackRatingInfo") - - -@_attrs_define -class ExtendedSessionRecordFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - extended_session_record_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_session_record_feedback_rating_info.additional_properties = additional_properties - return extended_session_record_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_session_record_files_type_0.py b/src/splunk_ao/resources/models/extended_session_record_files_type_0.py deleted file mode 100644 index 7e8945aa..00000000 --- a/src/splunk_ao/resources/models/extended_session_record_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="ExtendedSessionRecordFilesType0") - - -@_attrs_define -class ExtendedSessionRecordFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - extended_session_record_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_session_record_files_type_0.additional_properties = additional_properties - return extended_session_record_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_session_record_metric_info_type_0.py b/src/splunk_ao/resources/models/extended_session_record_metric_info_type_0.py deleted file mode 100644 index e1bea712..00000000 --- a/src/splunk_ao/resources/models/extended_session_record_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="ExtendedSessionRecordMetricInfoType0") - - -@_attrs_define -class ExtendedSessionRecordMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - extended_session_record_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_session_record_metric_info_type_0.additional_properties = additional_properties - return extended_session_record_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_session_record_user_metadata.py b/src/splunk_ao/resources/models/extended_session_record_user_metadata.py deleted file mode 100644 index 93c6b5f5..00000000 --- a/src/splunk_ao/resources/models/extended_session_record_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedSessionRecordUserMetadata") - - -@_attrs_define -class ExtendedSessionRecordUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_session_record_user_metadata = cls() - - extended_session_record_user_metadata.additional_properties = d - return extended_session_record_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_tool_span_record.py b/src/splunk_ao/resources/models/extended_tool_span_record.py index 8ec0ce2c..844b425f 100644 --- a/src/splunk_ao/resources/models/extended_tool_span_record.py +++ b/src/splunk_ao/resources/models/extended_tool_span_record.py @@ -9,6 +9,7 @@ from ..models.annotation_status import AnnotationStatus from ..models.content_modality import ContentModality +from ..models.left_out_reason import LeftOutReason from ..types import UNSET, Unset if TYPE_CHECKING: @@ -77,6 +78,12 @@ class ExtendedToolSpanRecord: associated with this trace or span files (ExtendedToolSpanRecordFilesType0 | None | Unset): File metadata keyed by file ID for files associated with this record + is_placeholder (bool | Unset): Whether this span is not stored but stands in for a parent span missing from its + trace Default: False. + left_out_reason (LeftOutReason | None | Unset): Set when the tree cannot place this span under its parent, so it + sits at the trace root instead. child_of_leaf_span: an ancestor is an llm or control span. unreachable: its + chain of parents never reaches the trace. Detail trees never set no_trace_row: a stub_trace root shows that + case. is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. step_number (int | None | Unset): Topological step number of the span. tool_call_id (None | str | Unset): ID of the tool call. @@ -122,6 +129,8 @@ class ExtendedToolSpanRecord: error_message: str | Unset = "" metric_info: ExtendedToolSpanRecordMetricInfoType0 | None | Unset = UNSET files: ExtendedToolSpanRecordFilesType0 | None | Unset = UNSET + is_placeholder: bool | Unset = False + left_out_reason: LeftOutReason | None | Unset = UNSET is_complete: bool | Unset = True step_number: int | None | Unset = UNSET tool_call_id: None | str | Unset = UNSET @@ -321,6 +330,16 @@ def to_dict(self) -> dict[str, Any]: else: files = self.files + is_placeholder = self.is_placeholder + + left_out_reason: None | str | Unset + if isinstance(self.left_out_reason, Unset): + left_out_reason = UNSET + elif isinstance(self.left_out_reason, LeftOutReason): + left_out_reason = self.left_out_reason.value + else: + left_out_reason = self.left_out_reason + is_complete = self.is_complete step_number: int | None | Unset @@ -410,6 +429,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["metric_info"] = metric_info if files is not UNSET: field_dict["files"] = files + if is_placeholder is not UNSET: + field_dict["is_placeholder"] = is_placeholder + if left_out_reason is not UNSET: + field_dict["left_out_reason"] = left_out_reason if is_complete is not UNSET: field_dict["is_complete"] = is_complete if step_number is not UNSET: @@ -727,6 +750,25 @@ def _parse_files(data: object) -> ExtendedToolSpanRecordFilesType0 | None | Unse files = _parse_files(d.pop("files", UNSET)) + is_placeholder = d.pop("is_placeholder", UNSET) + + def _parse_left_out_reason(data: object) -> LeftOutReason | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + left_out_reason_type_0 = LeftOutReason(data) + + return left_out_reason_type_0 + except: # noqa: E722 + pass + return cast(LeftOutReason | None | Unset, data) + + left_out_reason = _parse_left_out_reason(d.pop("left_out_reason", UNSET)) + is_complete = d.pop("is_complete", UNSET) def _parse_step_number(data: object) -> int | None | Unset: @@ -788,6 +830,8 @@ def _parse_tool_call_id(data: object) -> None | str | Unset: error_message=error_message, metric_info=metric_info, files=files, + is_placeholder=is_placeholder, + left_out_reason=left_out_reason, is_complete=is_complete, step_number=step_number, tool_call_id=tool_call_id, diff --git a/src/splunk_ao/resources/models/extended_tool_span_record_with_children.py b/src/splunk_ao/resources/models/extended_tool_span_record_with_children.py index 2b421281..02e2dcd9 100644 --- a/src/splunk_ao/resources/models/extended_tool_span_record_with_children.py +++ b/src/splunk_ao/resources/models/extended_tool_span_record_with_children.py @@ -9,6 +9,7 @@ from ..models.annotation_status import AnnotationStatus from ..models.content_modality import ContentModality +from ..models.left_out_reason import LeftOutReason from ..types import UNSET, Unset if TYPE_CHECKING: @@ -104,6 +105,12 @@ class ExtendedToolSpanRecordWithChildren: metrics associated with this trace or span files (ExtendedToolSpanRecordWithChildrenFilesType0 | None | Unset): File metadata keyed by file ID for files associated with this record + is_placeholder (bool | Unset): Whether this span is not stored but stands in for a parent span missing from its + trace Default: False. + left_out_reason (LeftOutReason | None | Unset): Set when the tree cannot place this span under its parent, so it + sits at the trace root instead. child_of_leaf_span: an ancestor is an llm or control span. unreachable: its + chain of parents never reaches the trace. Detail trees never set no_trace_row: a stub_trace root shows that + case. is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. step_number (int | None | Unset): Topological step number of the span. tool_call_id (None | str | Unset): ID of the tool call. @@ -161,6 +168,8 @@ class ExtendedToolSpanRecordWithChildren: error_message: str | Unset = "" metric_info: ExtendedToolSpanRecordWithChildrenMetricInfoType0 | None | Unset = UNSET files: ExtendedToolSpanRecordWithChildrenFilesType0 | None | Unset = UNSET + is_placeholder: bool | Unset = False + left_out_reason: LeftOutReason | None | Unset = UNSET is_complete: bool | Unset = True step_number: int | None | Unset = UNSET tool_call_id: None | str | Unset = UNSET @@ -391,6 +400,16 @@ def to_dict(self) -> dict[str, Any]: else: files = self.files + is_placeholder = self.is_placeholder + + left_out_reason: None | str | Unset + if isinstance(self.left_out_reason, Unset): + left_out_reason = UNSET + elif isinstance(self.left_out_reason, LeftOutReason): + left_out_reason = self.left_out_reason.value + else: + left_out_reason = self.left_out_reason + is_complete = self.is_complete step_number: int | None | Unset @@ -482,6 +501,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["metric_info"] = metric_info if files is not UNSET: field_dict["files"] = files + if is_placeholder is not UNSET: + field_dict["is_placeholder"] = is_placeholder + if left_out_reason is not UNSET: + field_dict["left_out_reason"] = left_out_reason if is_complete is not UNSET: field_dict["is_complete"] = is_complete if step_number is not UNSET: @@ -974,6 +997,25 @@ def _parse_files(data: object) -> ExtendedToolSpanRecordWithChildrenFilesType0 | files = _parse_files(d.pop("files", UNSET)) + is_placeholder = d.pop("is_placeholder", UNSET) + + def _parse_left_out_reason(data: object) -> LeftOutReason | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + left_out_reason_type_0 = LeftOutReason(data) + + return left_out_reason_type_0 + except: # noqa: E722 + pass + return cast(LeftOutReason | None | Unset, data) + + left_out_reason = _parse_left_out_reason(d.pop("left_out_reason", UNSET)) + is_complete = d.pop("is_complete", UNSET) def _parse_step_number(data: object) -> int | None | Unset: @@ -1036,6 +1078,8 @@ def _parse_tool_call_id(data: object) -> None | str | Unset: error_message=error_message, metric_info=metric_info, files=files, + is_placeholder=is_placeholder, + left_out_reason=left_out_reason, is_complete=is_complete, step_number=step_number, tool_call_id=tool_call_id, diff --git a/src/splunk_ao/resources/models/extended_trace_record.py b/src/splunk_ao/resources/models/extended_trace_record.py index ead5a3b2..f490bd3d 100644 --- a/src/splunk_ao/resources/models/extended_trace_record.py +++ b/src/splunk_ao/resources/models/extended_trace_record.py @@ -82,6 +82,8 @@ class ExtendedTraceRecord: dataset_generated_output (None | str | Unset): Generated output from the dataset associated with this trace is_complete (bool | Unset): Whether the trace is complete or not Default: True. num_spans (int | None | Unset): + is_synthetic (bool | Unset): Whether ingest created this trace row because the trace's root span was missing + Default: False. """ id: str @@ -126,6 +128,7 @@ class ExtendedTraceRecord: dataset_generated_output: None | str | Unset = UNSET is_complete: bool | Unset = True num_spans: int | None | Unset = UNSET + is_synthetic: bool | Unset = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -379,6 +382,8 @@ def to_dict(self) -> dict[str, Any]: else: num_spans = self.num_spans + is_synthetic = self.is_synthetic + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -458,6 +463,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["is_complete"] = is_complete if num_spans is not UNSET: field_dict["num_spans"] = num_spans + if is_synthetic is not UNSET: + field_dict["is_synthetic"] = is_synthetic return field_dict @@ -1015,6 +1022,8 @@ def _parse_num_spans(data: object) -> int | None | Unset: num_spans = _parse_num_spans(d.pop("num_spans", UNSET)) + is_synthetic = d.pop("is_synthetic", UNSET) + extended_trace_record = cls( id=id, session_id=session_id, @@ -1058,6 +1067,7 @@ def _parse_num_spans(data: object) -> int | None | Unset: dataset_generated_output=dataset_generated_output, is_complete=is_complete, num_spans=num_spans, + is_synthetic=is_synthetic, ) extended_trace_record.additional_properties = d diff --git a/src/splunk_ao/resources/models/extended_trace_record_with_children.py b/src/splunk_ao/resources/models/extended_trace_record_with_children.py index 043ecb7a..62e125a6 100644 --- a/src/splunk_ao/resources/models/extended_trace_record_with_children.py +++ b/src/splunk_ao/resources/models/extended_trace_record_with_children.py @@ -105,6 +105,8 @@ class ExtendedTraceRecordWithChildren: dataset_generated_output (None | str | Unset): Generated output from the dataset associated with this trace is_complete (bool | Unset): Whether the trace is complete or not Default: True. num_spans (int | None | Unset): + is_synthetic (bool | Unset): Whether ingest created this trace row because the trace's root span was missing + Default: False. """ id: str @@ -161,6 +163,7 @@ class ExtendedTraceRecordWithChildren: dataset_generated_output: None | str | Unset = UNSET is_complete: bool | Unset = True num_spans: int | None | Unset = UNSET + is_synthetic: bool | Unset = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -444,6 +447,8 @@ def to_dict(self) -> dict[str, Any]: else: num_spans = self.num_spans + is_synthetic = self.is_synthetic + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -525,6 +530,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["is_complete"] = is_complete if num_spans is not UNSET: field_dict["num_spans"] = num_spans + if is_synthetic is not UNSET: + field_dict["is_synthetic"] = is_synthetic return field_dict @@ -1252,6 +1259,8 @@ def _parse_num_spans(data: object) -> int | None | Unset: num_spans = _parse_num_spans(d.pop("num_spans", UNSET)) + is_synthetic = d.pop("is_synthetic", UNSET) + extended_trace_record_with_children = cls( id=id, session_id=session_id, @@ -1296,6 +1305,7 @@ def _parse_num_spans(data: object) -> int | None | Unset: dataset_generated_output=dataset_generated_output, is_complete=is_complete, num_spans=num_spans, + is_synthetic=is_synthetic, ) extended_trace_record_with_children.additional_properties = d diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record.py b/src/splunk_ao/resources/models/extended_workflow_span_record.py deleted file mode 100644 index 2e1aa9d1..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record.py +++ /dev/null @@ -1,1121 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_workflow_span_record_annotation_aggregates import ( - ExtendedWorkflowSpanRecordAnnotationAggregates, - ) - from ..models.extended_workflow_span_record_annotation_agreement import ( - ExtendedWorkflowSpanRecordAnnotationAgreement, - ) - from ..models.extended_workflow_span_record_annotations import ExtendedWorkflowSpanRecordAnnotations - from ..models.extended_workflow_span_record_dataset_metadata import ExtendedWorkflowSpanRecordDatasetMetadata - from ..models.extended_workflow_span_record_feedback_rating_info import ExtendedWorkflowSpanRecordFeedbackRatingInfo - from ..models.extended_workflow_span_record_files_type_0 import ExtendedWorkflowSpanRecordFilesType0 - from ..models.extended_workflow_span_record_metric_info_type_0 import ExtendedWorkflowSpanRecordMetricInfoType0 - from ..models.extended_workflow_span_record_user_metadata import ExtendedWorkflowSpanRecordUserMetadata - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecord") - - -@_attrs_define -class ExtendedWorkflowSpanRecord: - """ - Attributes: - id (str): Galileo ID of the session, trace or span - session_id (str): Galileo ID of the session containing the trace (or the same value as id for a trace) - project_id (str): Galileo ID of the project associated with this trace or span - run_id (str): Galileo ID of the run (log stream or experiment) associated with this trace or span - parent_id (str): Galileo ID of the parent of this span - type_ (Literal['workflow'] | Unset): Type of the trace, span or session. Default: 'workflow'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (ExtendedWorkflowSpanRecordUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (ExtendedWorkflowSpanRecordDatasetMetadata | Unset): Metadata from the dataset associated with - this trace - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (ExtendedWorkflowSpanRecordFeedbackRatingInfo | Unset): Feedback information related to the - record - annotations (ExtendedWorkflowSpanRecordAnnotations | Unset): Annotations keyed by template ID and annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (ExtendedWorkflowSpanRecordAnnotationAggregates | Unset): Annotation aggregate information - keyed by template ID - annotation_agreement (ExtendedWorkflowSpanRecordAnnotationAgreement | Unset): Annotation agreement scores keyed - by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (ExtendedWorkflowSpanRecordMetricInfoType0 | None | Unset): Detailed information about the metrics - associated with this trace or span - files (ExtendedWorkflowSpanRecordFilesType0 | None | Unset): File metadata keyed by file ID for files associated - with this record - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - """ - - id: str - session_id: str - project_id: str - run_id: str - parent_id: str - type_: Literal["workflow"] | Unset = "workflow" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: ExtendedWorkflowSpanRecordUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: ExtendedWorkflowSpanRecordDatasetMetadata | Unset = UNSET - trace_id: None | str | Unset = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: ExtendedWorkflowSpanRecordFeedbackRatingInfo | Unset = UNSET - annotations: ExtendedWorkflowSpanRecordAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: ExtendedWorkflowSpanRecordAnnotationAggregates | Unset = UNSET - annotation_agreement: ExtendedWorkflowSpanRecordAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: ExtendedWorkflowSpanRecordMetricInfoType0 | None | Unset = UNSET - files: ExtendedWorkflowSpanRecordFilesType0 | None | Unset = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.extended_workflow_span_record_files_type_0 import ExtendedWorkflowSpanRecordFilesType0 - from ..models.extended_workflow_span_record_metric_info_type_0 import ExtendedWorkflowSpanRecordMetricInfoType0 - from ..models.message import Message - from ..models.text_content_part import TextContentPart - - id = self.id - - session_id = self.session_id - - project_id = self.project_id - - run_id = self.run_id - - parent_id = self.parent_id - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, ExtendedWorkflowSpanRecordMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, ExtendedWorkflowSpanRecordFilesType0): - files = self.files.to_dict() - else: - files = self.files - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - {"id": id, "session_id": session_id, "project_id": project_id, "run_id": run_id, "parent_id": parent_id} - ) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_workflow_span_record_annotation_aggregates import ( - ExtendedWorkflowSpanRecordAnnotationAggregates, - ) - from ..models.extended_workflow_span_record_annotation_agreement import ( - ExtendedWorkflowSpanRecordAnnotationAgreement, - ) - from ..models.extended_workflow_span_record_annotations import ExtendedWorkflowSpanRecordAnnotations - from ..models.extended_workflow_span_record_dataset_metadata import ExtendedWorkflowSpanRecordDatasetMetadata - from ..models.extended_workflow_span_record_feedback_rating_info import ( - ExtendedWorkflowSpanRecordFeedbackRatingInfo, - ) - from ..models.extended_workflow_span_record_files_type_0 import ExtendedWorkflowSpanRecordFilesType0 - from ..models.extended_workflow_span_record_metric_info_type_0 import ExtendedWorkflowSpanRecordMetricInfoType0 - from ..models.extended_workflow_span_record_user_metadata import ExtendedWorkflowSpanRecordUserMetadata - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - id = d.pop("id") - - session_id = d.pop("session_id") - - project_id = d.pop("project_id") - - run_id = d.pop("run_id") - - parent_id = d.pop("parent_id") - - type_ = cast(Literal["workflow"] | Unset, d.pop("type", UNSET)) - if type_ != "workflow" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'workflow', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: ExtendedWorkflowSpanRecordUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = ExtendedWorkflowSpanRecordUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: ExtendedWorkflowSpanRecordDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = ExtendedWorkflowSpanRecordDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: ExtendedWorkflowSpanRecordFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = ExtendedWorkflowSpanRecordFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: ExtendedWorkflowSpanRecordAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = ExtendedWorkflowSpanRecordAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: ExtendedWorkflowSpanRecordAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = ExtendedWorkflowSpanRecordAnnotationAggregates.from_dict(_annotation_aggregates) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: ExtendedWorkflowSpanRecordAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = ExtendedWorkflowSpanRecordAnnotationAgreement.from_dict(_annotation_agreement) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> ExtendedWorkflowSpanRecordMetricInfoType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = ExtendedWorkflowSpanRecordMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(ExtendedWorkflowSpanRecordMetricInfoType0 | None | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> ExtendedWorkflowSpanRecordFilesType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = ExtendedWorkflowSpanRecordFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(ExtendedWorkflowSpanRecordFilesType0 | None | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - extended_workflow_span_record = cls( - id=id, - session_id=session_id, - project_id=project_id, - run_id=run_id, - parent_id=parent_id, - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - trace_id=trace_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - is_complete=is_complete, - step_number=step_number, - ) - - extended_workflow_span_record.additional_properties = d - return extended_workflow_span_record - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_annotation_aggregates.py b/src/splunk_ao/resources/models/extended_workflow_span_record_annotation_aggregates.py deleted file mode 100644 index aa6590be..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordAnnotationAggregates") - - -@_attrs_define -class ExtendedWorkflowSpanRecordAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - extended_workflow_span_record_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_workflow_span_record_annotation_aggregates.additional_properties = additional_properties - return extended_workflow_span_record_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_annotation_agreement.py b/src/splunk_ao/resources/models/extended_workflow_span_record_annotation_agreement.py deleted file mode 100644 index 88e53d79..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordAnnotationAgreement") - - -@_attrs_define -class ExtendedWorkflowSpanRecordAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_workflow_span_record_annotation_agreement = cls() - - extended_workflow_span_record_annotation_agreement.additional_properties = d - return extended_workflow_span_record_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_annotations.py b/src/splunk_ao/resources/models/extended_workflow_span_record_annotations.py deleted file mode 100644 index 684709ac..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.extended_workflow_span_record_annotations_additional_property import ( - ExtendedWorkflowSpanRecordAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordAnnotations") - - -@_attrs_define -class ExtendedWorkflowSpanRecordAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, ExtendedWorkflowSpanRecordAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_workflow_span_record_annotations_additional_property import ( - ExtendedWorkflowSpanRecordAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - extended_workflow_span_record_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = ExtendedWorkflowSpanRecordAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_workflow_span_record_annotations.additional_properties = additional_properties - return extended_workflow_span_record_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> ExtendedWorkflowSpanRecordAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: ExtendedWorkflowSpanRecordAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_annotations_additional_property.py b/src/splunk_ao/resources/models/extended_workflow_span_record_annotations_additional_property.py deleted file mode 100644 index 6ea5fbfa..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_annotations_additional_property.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordAnnotationsAdditionalProperty") - - -@_attrs_define -class ExtendedWorkflowSpanRecordAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - extended_workflow_span_record_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_workflow_span_record_annotations_additional_property.additional_properties = additional_properties - return extended_workflow_span_record_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_dataset_metadata.py b/src/splunk_ao/resources/models/extended_workflow_span_record_dataset_metadata.py deleted file mode 100644 index dfbba8d8..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordDatasetMetadata") - - -@_attrs_define -class ExtendedWorkflowSpanRecordDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_workflow_span_record_dataset_metadata = cls() - - extended_workflow_span_record_dataset_metadata.additional_properties = d - return extended_workflow_span_record_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_feedback_rating_info.py b/src/splunk_ao/resources/models/extended_workflow_span_record_feedback_rating_info.py deleted file mode 100644 index 95918407..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordFeedbackRatingInfo") - - -@_attrs_define -class ExtendedWorkflowSpanRecordFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - extended_workflow_span_record_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_workflow_span_record_feedback_rating_info.additional_properties = additional_properties - return extended_workflow_span_record_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_files_type_0.py b/src/splunk_ao/resources/models/extended_workflow_span_record_files_type_0.py deleted file mode 100644 index 625b6648..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordFilesType0") - - -@_attrs_define -class ExtendedWorkflowSpanRecordFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - extended_workflow_span_record_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_workflow_span_record_files_type_0.additional_properties = additional_properties - return extended_workflow_span_record_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_metric_info_type_0.py b/src/splunk_ao/resources/models/extended_workflow_span_record_metric_info_type_0.py deleted file mode 100644 index 1ed5cf34..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordMetricInfoType0") - - -@_attrs_define -class ExtendedWorkflowSpanRecordMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - extended_workflow_span_record_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_workflow_span_record_metric_info_type_0.additional_properties = additional_properties - return extended_workflow_span_record_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children.py b/src/splunk_ao/resources/models/extended_workflow_span_record_with_children.py deleted file mode 100644 index 37d1f58b..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children.py +++ /dev/null @@ -1,1361 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_agent_span_record_with_children import ExtendedAgentSpanRecordWithChildren - from ..models.extended_control_span_record import ExtendedControlSpanRecord - from ..models.extended_http_span_record_with_children import ExtendedHttpSpanRecordWithChildren - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - from ..models.extended_retriever_span_record_with_children import ExtendedRetrieverSpanRecordWithChildren - from ..models.extended_tool_span_record_with_children import ExtendedToolSpanRecordWithChildren - from ..models.extended_workflow_span_record_with_children_annotation_aggregates import ( - ExtendedWorkflowSpanRecordWithChildrenAnnotationAggregates, - ) - from ..models.extended_workflow_span_record_with_children_annotation_agreement import ( - ExtendedWorkflowSpanRecordWithChildrenAnnotationAgreement, - ) - from ..models.extended_workflow_span_record_with_children_annotations import ( - ExtendedWorkflowSpanRecordWithChildrenAnnotations, - ) - from ..models.extended_workflow_span_record_with_children_dataset_metadata import ( - ExtendedWorkflowSpanRecordWithChildrenDatasetMetadata, - ) - from ..models.extended_workflow_span_record_with_children_feedback_rating_info import ( - ExtendedWorkflowSpanRecordWithChildrenFeedbackRatingInfo, - ) - from ..models.extended_workflow_span_record_with_children_files_type_0 import ( - ExtendedWorkflowSpanRecordWithChildrenFilesType0, - ) - from ..models.extended_workflow_span_record_with_children_metric_info_type_0 import ( - ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0, - ) - from ..models.extended_workflow_span_record_with_children_user_metadata import ( - ExtendedWorkflowSpanRecordWithChildrenUserMetadata, - ) - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordWithChildren") - - -@_attrs_define -class ExtendedWorkflowSpanRecordWithChildren: - """ - Attributes: - id (str): Galileo ID of the session, trace or span - session_id (str): Galileo ID of the session containing the trace (or the same value as id for a trace) - project_id (str): Galileo ID of the project associated with this trace or span - run_id (str): Galileo ID of the run (log stream or experiment) associated with this trace or span - parent_id (str): Galileo ID of the parent of this span - spans (list[ExtendedAgentSpanRecordWithChildren | ExtendedControlSpanRecord | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord | ExtendedRetrieverSpanRecordWithChildren | ExtendedToolSpanRecordWithChildren | - ExtendedWorkflowSpanRecordWithChildren] | Unset): - type_ (Literal['workflow'] | Unset): Type of the trace, span or session. Default: 'workflow'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (ExtendedWorkflowSpanRecordWithChildrenUserMetadata | Unset): Metadata associated with this trace - or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (ExtendedWorkflowSpanRecordWithChildrenDatasetMetadata | Unset): Metadata from the dataset - associated with this trace - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (ExtendedWorkflowSpanRecordWithChildrenFeedbackRatingInfo | Unset): Feedback information - related to the record - annotations (ExtendedWorkflowSpanRecordWithChildrenAnnotations | Unset): Annotations keyed by template ID and - annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (ExtendedWorkflowSpanRecordWithChildrenAnnotationAggregates | Unset): Annotation aggregate - information keyed by template ID - annotation_agreement (ExtendedWorkflowSpanRecordWithChildrenAnnotationAgreement | Unset): Annotation agreement - scores keyed by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0 | None | Unset): Detailed information about - the metrics associated with this trace or span - files (ExtendedWorkflowSpanRecordWithChildrenFilesType0 | None | Unset): File metadata keyed by file ID for - files associated with this record - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - """ - - id: str - session_id: str - project_id: str - run_id: str - parent_id: str - spans: ( - list[ - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - ] - | Unset - ) = UNSET - type_: Literal["workflow"] | Unset = "workflow" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: ExtendedWorkflowSpanRecordWithChildrenUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: ExtendedWorkflowSpanRecordWithChildrenDatasetMetadata | Unset = UNSET - trace_id: None | str | Unset = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: ExtendedWorkflowSpanRecordWithChildrenFeedbackRatingInfo | Unset = UNSET - annotations: ExtendedWorkflowSpanRecordWithChildrenAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: ExtendedWorkflowSpanRecordWithChildrenAnnotationAggregates | Unset = UNSET - annotation_agreement: ExtendedWorkflowSpanRecordWithChildrenAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0 | None | Unset = UNSET - files: ExtendedWorkflowSpanRecordWithChildrenFilesType0 | None | Unset = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.extended_agent_span_record_with_children import ExtendedAgentSpanRecordWithChildren - from ..models.extended_control_span_record import ExtendedControlSpanRecord - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - from ..models.extended_retriever_span_record_with_children import ExtendedRetrieverSpanRecordWithChildren - from ..models.extended_tool_span_record_with_children import ExtendedToolSpanRecordWithChildren - from ..models.extended_workflow_span_record_with_children_files_type_0 import ( - ExtendedWorkflowSpanRecordWithChildrenFilesType0, - ) - from ..models.extended_workflow_span_record_with_children_metric_info_type_0 import ( - ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0, - ) - from ..models.message import Message - from ..models.text_content_part import TextContentPart - - id = self.id - - session_id = self.session_id - - project_id = self.project_id - - run_id = self.run_id - - parent_id = self.parent_id - - spans: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.spans, Unset): - spans = [] - for spans_item_data in self.spans: - spans_item: dict[str, Any] - if isinstance(spans_item_data, ExtendedAgentSpanRecordWithChildren): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedWorkflowSpanRecordWithChildren): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedLlmSpanRecord): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedToolSpanRecordWithChildren): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedRetrieverSpanRecordWithChildren): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ExtendedControlSpanRecord): - spans_item = spans_item_data.to_dict() - else: - spans_item = spans_item_data.to_dict() - - spans.append(spans_item) - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, ExtendedWorkflowSpanRecordWithChildrenFilesType0): - files = self.files.to_dict() - else: - files = self.files - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - {"id": id, "session_id": session_id, "project_id": project_id, "run_id": run_id, "parent_id": parent_id} - ) - if spans is not UNSET: - field_dict["spans"] = spans - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.extended_agent_span_record_with_children import ExtendedAgentSpanRecordWithChildren - from ..models.extended_control_span_record import ExtendedControlSpanRecord - from ..models.extended_http_span_record_with_children import ExtendedHttpSpanRecordWithChildren - from ..models.extended_retriever_span_record_with_children import ExtendedRetrieverSpanRecordWithChildren - from ..models.extended_tool_span_record_with_children import ExtendedToolSpanRecordWithChildren - from ..models.extended_workflow_span_record_with_children_annotation_aggregates import ( - ExtendedWorkflowSpanRecordWithChildrenAnnotationAggregates, - ) - from ..models.extended_workflow_span_record_with_children_annotation_agreement import ( - ExtendedWorkflowSpanRecordWithChildrenAnnotationAgreement, - ) - from ..models.extended_workflow_span_record_with_children_annotations import ( - ExtendedWorkflowSpanRecordWithChildrenAnnotations, - ) - from ..models.extended_workflow_span_record_with_children_dataset_metadata import ( - ExtendedWorkflowSpanRecordWithChildrenDatasetMetadata, - ) - from ..models.extended_workflow_span_record_with_children_feedback_rating_info import ( - ExtendedWorkflowSpanRecordWithChildrenFeedbackRatingInfo, - ) - from ..models.extended_workflow_span_record_with_children_files_type_0 import ( - ExtendedWorkflowSpanRecordWithChildrenFilesType0, - ) - from ..models.extended_workflow_span_record_with_children_metric_info_type_0 import ( - ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0, - ) - from ..models.extended_workflow_span_record_with_children_user_metadata import ( - ExtendedWorkflowSpanRecordWithChildrenUserMetadata, - ) - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - id = d.pop("id") - - session_id = d.pop("session_id") - - project_id = d.pop("project_id") - - run_id = d.pop("run_id") - - parent_id = d.pop("parent_id") - - _spans = d.pop("spans", UNSET) - spans: ( - list[ - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - ] - | Unset - ) = UNSET - if _spans is not UNSET: - spans = [] - for spans_item_data in _spans: - - def _parse_spans_item( - data: object, - ) -> ( - ExtendedAgentSpanRecordWithChildren - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecordWithChildren - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecordWithChildren - | ExtendedToolSpanRecordWithChildren - | ExtendedWorkflowSpanRecordWithChildren - ): - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_0 = ExtendedAgentSpanRecordWithChildren.from_dict(data) - - return spans_item_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_1 = ExtendedWorkflowSpanRecordWithChildren.from_dict(data) - - return spans_item_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_2 = ExtendedLlmSpanRecord.from_dict(data) - - return spans_item_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_3 = ExtendedToolSpanRecordWithChildren.from_dict(data) - - return spans_item_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_4 = ExtendedRetrieverSpanRecordWithChildren.from_dict(data) - - return spans_item_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_5 = ExtendedControlSpanRecord.from_dict(data) - - return spans_item_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_6 = ExtendedHttpSpanRecordWithChildren.from_dict(data) - - return spans_item_type_6 - except: # noqa: E722 - pass - # If we reach here, none of the parsers succeeded - discriminator_info = ( - f" (type={data.get('type')})" if isinstance(data, dict) and "type" in data else "" - ) - raise ValueError(f"Could not parse union type for spans_item{discriminator_info}") - - spans_item = _parse_spans_item(spans_item_data) - - spans.append(spans_item) - - type_ = cast(Literal["workflow"] | Unset, d.pop("type", UNSET)) - if type_ != "workflow" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'workflow', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: ExtendedWorkflowSpanRecordWithChildrenUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = ExtendedWorkflowSpanRecordWithChildrenUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: ExtendedWorkflowSpanRecordWithChildrenDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = ExtendedWorkflowSpanRecordWithChildrenDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: ExtendedWorkflowSpanRecordWithChildrenFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = ExtendedWorkflowSpanRecordWithChildrenFeedbackRatingInfo.from_dict( - _feedback_rating_info - ) - - _annotations = d.pop("annotations", UNSET) - annotations: ExtendedWorkflowSpanRecordWithChildrenAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = ExtendedWorkflowSpanRecordWithChildrenAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: ExtendedWorkflowSpanRecordWithChildrenAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = ExtendedWorkflowSpanRecordWithChildrenAnnotationAggregates.from_dict( - _annotation_aggregates - ) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: ExtendedWorkflowSpanRecordWithChildrenAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = ExtendedWorkflowSpanRecordWithChildrenAnnotationAgreement.from_dict( - _annotation_agreement - ) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0 | None | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> ExtendedWorkflowSpanRecordWithChildrenFilesType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = ExtendedWorkflowSpanRecordWithChildrenFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(ExtendedWorkflowSpanRecordWithChildrenFilesType0 | None | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - extended_workflow_span_record_with_children = cls( - id=id, - session_id=session_id, - project_id=project_id, - run_id=run_id, - parent_id=parent_id, - spans=spans, - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - trace_id=trace_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - is_complete=is_complete, - step_number=step_number, - ) - - extended_workflow_span_record_with_children.additional_properties = d - return extended_workflow_span_record_with_children - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotation_aggregates.py b/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotation_aggregates.py deleted file mode 100644 index 6dc50ff6..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordWithChildrenAnnotationAggregates") - - -@_attrs_define -class ExtendedWorkflowSpanRecordWithChildrenAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - extended_workflow_span_record_with_children_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_workflow_span_record_with_children_annotation_aggregates.additional_properties = additional_properties - return extended_workflow_span_record_with_children_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotation_agreement.py b/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotation_agreement.py deleted file mode 100644 index 61dbd3da..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordWithChildrenAnnotationAgreement") - - -@_attrs_define -class ExtendedWorkflowSpanRecordWithChildrenAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_workflow_span_record_with_children_annotation_agreement = cls() - - extended_workflow_span_record_with_children_annotation_agreement.additional_properties = d - return extended_workflow_span_record_with_children_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotations.py b/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotations.py deleted file mode 100644 index 29fa41a6..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotations.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.extended_workflow_span_record_with_children_annotations_additional_property import ( - ExtendedWorkflowSpanRecordWithChildrenAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordWithChildrenAnnotations") - - -@_attrs_define -class ExtendedWorkflowSpanRecordWithChildrenAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, ExtendedWorkflowSpanRecordWithChildrenAnnotationsAdditionalProperty] = ( - _attrs_field(init=False, factory=dict) - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_workflow_span_record_with_children_annotations_additional_property import ( - ExtendedWorkflowSpanRecordWithChildrenAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - extended_workflow_span_record_with_children_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = ExtendedWorkflowSpanRecordWithChildrenAnnotationsAdditionalProperty.from_dict( - prop_dict - ) - - additional_properties[prop_name] = additional_property - - extended_workflow_span_record_with_children_annotations.additional_properties = additional_properties - return extended_workflow_span_record_with_children_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> ExtendedWorkflowSpanRecordWithChildrenAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: ExtendedWorkflowSpanRecordWithChildrenAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotations_additional_property.py b/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotations_additional_property.py deleted file mode 100644 index 85fd4372..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_annotations_additional_property.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordWithChildrenAnnotationsAdditionalProperty") - - -@_attrs_define -class ExtendedWorkflowSpanRecordWithChildrenAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - extended_workflow_span_record_with_children_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_workflow_span_record_with_children_annotations_additional_property.additional_properties = ( - additional_properties - ) - return extended_workflow_span_record_with_children_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_dataset_metadata.py b/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_dataset_metadata.py deleted file mode 100644 index 66d37824..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordWithChildrenDatasetMetadata") - - -@_attrs_define -class ExtendedWorkflowSpanRecordWithChildrenDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_workflow_span_record_with_children_dataset_metadata = cls() - - extended_workflow_span_record_with_children_dataset_metadata.additional_properties = d - return extended_workflow_span_record_with_children_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_feedback_rating_info.py b/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_feedback_rating_info.py deleted file mode 100644 index 50422b61..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordWithChildrenFeedbackRatingInfo") - - -@_attrs_define -class ExtendedWorkflowSpanRecordWithChildrenFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - extended_workflow_span_record_with_children_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_workflow_span_record_with_children_feedback_rating_info.additional_properties = additional_properties - return extended_workflow_span_record_with_children_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_files_type_0.py b/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_files_type_0.py deleted file mode 100644 index 9358fb8b..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordWithChildrenFilesType0") - - -@_attrs_define -class ExtendedWorkflowSpanRecordWithChildrenFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - extended_workflow_span_record_with_children_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_workflow_span_record_with_children_files_type_0.additional_properties = additional_properties - return extended_workflow_span_record_with_children_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_metric_info_type_0.py b/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_metric_info_type_0.py deleted file mode 100644 index 8f7049b2..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0") - - -@_attrs_define -class ExtendedWorkflowSpanRecordWithChildrenMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - extended_workflow_span_record_with_children_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - extended_workflow_span_record_with_children_metric_info_type_0.additional_properties = additional_properties - return extended_workflow_span_record_with_children_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_user_metadata.py b/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_user_metadata.py deleted file mode 100644 index 74b2121d..00000000 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_with_children_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordWithChildrenUserMetadata") - - -@_attrs_define -class ExtendedWorkflowSpanRecordWithChildrenUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - extended_workflow_span_record_with_children_user_metadata = cls() - - extended_workflow_span_record_with_children_user_metadata.additional_properties = d - return extended_workflow_span_record_with_children_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/generated_scorer_response.py b/src/splunk_ao/resources/models/generated_scorer_response.py index 7dd95d75..8cb3632a 100644 --- a/src/splunk_ao/resources/models/generated_scorer_response.py +++ b/src/splunk_ao/resources/models/generated_scorer_response.py @@ -26,7 +26,7 @@ class GeneratedScorerResponse: name (str): chain_poll_template (ChainPollTemplate): Template for a chainpoll metric prompt, containing all the info necessary to send a chainpoll prompt. - created_by (str): + created_by (None | str): created_at (datetime.datetime): updated_at (datetime.datetime): scoreable_node_types (list[NodeType] | None): @@ -38,7 +38,7 @@ class GeneratedScorerResponse: id: str name: str chain_poll_template: ChainPollTemplate - created_by: str + created_by: None | str created_at: datetime.datetime updated_at: datetime.datetime scoreable_node_types: list[NodeType] | None @@ -54,6 +54,7 @@ def to_dict(self) -> dict[str, Any]: chain_poll_template = self.chain_poll_template.to_dict() + created_by: None | str created_by = self.created_by created_at = self.created_at.isoformat() @@ -117,7 +118,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: chain_poll_template = ChainPollTemplate.from_dict(d.pop("chain_poll_template")) - created_by = d.pop("created_by") + def _parse_created_by(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + created_by = _parse_created_by(d.pop("created_by")) created_at = datetime.datetime.fromisoformat(d.pop("created_at")) diff --git a/src/splunk_ao/resources/models/http_span.py b/src/splunk_ao/resources/models/http_span.py deleted file mode 100644 index 4925092a..00000000 --- a/src/splunk_ao/resources/models/http_span.py +++ /dev/null @@ -1,841 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.agent_span import AgentSpan - from ..models.control_result import ControlResult - from ..models.control_span import ControlSpan - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.http_span_dataset_metadata import HttpSpanDatasetMetadata - from ..models.http_span_user_metadata import HttpSpanUserMetadata - from ..models.llm_span import LlmSpan - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.retriever_span import RetrieverSpan - from ..models.text_content_part import TextContentPart - from ..models.tool_span import ToolSpan - from ..models.workflow_span import WorkflowSpan - - -T = TypeVar("T", bound="HttpSpan") - - -@_attrs_define -class HttpSpan: - """ - Attributes: - type_ (Literal['http'] | Unset): Type of the trace, span or session. Default: 'http'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (HttpSpanUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (HttpSpanDatasetMetadata | Unset): Metadata from the dataset associated with this trace - id (None | str | Unset): Galileo ID of the session, trace or span - session_id (None | str | Unset): Galileo ID of the session containing the trace or span or session - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - step_number (int | None | Unset): Topological step number of the span. - parent_id (None | str | Unset): Galileo ID of the parent of this span - spans (list[AgentSpan | ControlSpan | HttpSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan] | Unset): - Child spans. - """ - - type_: Literal["http"] | Unset = "http" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: HttpSpanUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: HttpSpanDatasetMetadata | Unset = UNSET - id: None | str | Unset = UNSET - session_id: None | str | Unset = UNSET - trace_id: None | str | Unset = UNSET - step_number: int | None | Unset = UNSET - parent_id: None | str | Unset = UNSET - spans: list[AgentSpan | ControlSpan | HttpSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.agent_span import AgentSpan - from ..models.control_result import ControlResult - from ..models.control_span import ControlSpan - from ..models.llm_span import LlmSpan - from ..models.message import Message - from ..models.retriever_span import RetrieverSpan - from ..models.text_content_part import TextContentPart - from ..models.tool_span import ToolSpan - from ..models.workflow_span import WorkflowSpan - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - id: None | str | Unset - if isinstance(self.id, Unset): - id = UNSET - else: - id = self.id - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - parent_id: None | str | Unset - if isinstance(self.parent_id, Unset): - parent_id = UNSET - else: - parent_id = self.parent_id - - spans: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.spans, Unset): - spans = [] - for spans_item_data in self.spans: - spans_item: dict[str, Any] - if isinstance(spans_item_data, AgentSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, WorkflowSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, LlmSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, RetrieverSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ToolSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ControlSpan): - spans_item = spans_item_data.to_dict() - else: - spans_item = spans_item_data.to_dict() - - spans.append(spans_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if id is not UNSET: - field_dict["id"] = id - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if step_number is not UNSET: - field_dict["step_number"] = step_number - if parent_id is not UNSET: - field_dict["parent_id"] = parent_id - if spans is not UNSET: - field_dict["spans"] = spans - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_span import AgentSpan - from ..models.control_result import ControlResult - from ..models.control_span import ControlSpan - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.http_span_dataset_metadata import HttpSpanDatasetMetadata - from ..models.http_span_user_metadata import HttpSpanUserMetadata - from ..models.llm_span import LlmSpan - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.retriever_span import RetrieverSpan - from ..models.text_content_part import TextContentPart - from ..models.tool_span import ToolSpan - from ..models.workflow_span import WorkflowSpan - - d = dict(src_dict) - type_ = cast(Literal["http"] | Unset, d.pop("type", UNSET)) - if type_ != "http" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'http', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: HttpSpanUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = HttpSpanUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: HttpSpanDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = HttpSpanDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - id = _parse_id(d.pop("id", UNSET)) - - def _parse_session_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - def _parse_parent_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - parent_id = _parse_parent_id(d.pop("parent_id", UNSET)) - - _spans = d.pop("spans", UNSET) - spans: list[AgentSpan | ControlSpan | HttpSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan] | Unset = ( - UNSET - ) - if _spans is not UNSET: - spans = [] - for spans_item_data in _spans: - - def _parse_spans_item( - data: object, - ) -> AgentSpan | ControlSpan | HttpSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan: - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_0 = AgentSpan.from_dict(data) - - return spans_item_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_1 = WorkflowSpan.from_dict(data) - - return spans_item_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_2 = LlmSpan.from_dict(data) - - return spans_item_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_3 = RetrieverSpan.from_dict(data) - - return spans_item_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_4 = ToolSpan.from_dict(data) - - return spans_item_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_5 = ControlSpan.from_dict(data) - - return spans_item_type_5 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - spans_item_type_6 = HttpSpan.from_dict(data) - - return spans_item_type_6 - - spans_item = _parse_spans_item(spans_item_data) - - spans.append(spans_item) - - http_span = cls( - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - id=id, - session_id=session_id, - trace_id=trace_id, - step_number=step_number, - parent_id=parent_id, - spans=spans, - ) - - http_span.additional_properties = d - return http_span - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/http_span_dataset_metadata.py b/src/splunk_ao/resources/models/http_span_dataset_metadata.py deleted file mode 100644 index bbc5b43e..00000000 --- a/src/splunk_ao/resources/models/http_span_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HttpSpanDatasetMetadata") - - -@_attrs_define -class HttpSpanDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - http_span_dataset_metadata = cls() - - http_span_dataset_metadata.additional_properties = d - return http_span_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/http_span_user_metadata.py b/src/splunk_ao/resources/models/http_span_user_metadata.py deleted file mode 100644 index b1a443e9..00000000 --- a/src/splunk_ao/resources/models/http_span_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HttpSpanUserMetadata") - - -@_attrs_define -class HttpSpanUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - http_span_user_metadata = cls() - - http_span_user_metadata.additional_properties = d - return http_span_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/integration_provider.py b/src/splunk_ao/resources/models/integration_provider.py index 1ec6e659..2f21eb0a 100644 --- a/src/splunk_ao/resources/models/integration_provider.py +++ b/src/splunk_ao/resources/models/integration_provider.py @@ -8,6 +8,7 @@ class IntegrationProvider(str, Enum): AZURE = "azure" CUSTOM = "custom" DATABRICKS = "databricks" + LUNA = "luna" MISTRAL = "mistral" NVIDIA = "nvidia" OPENAI = "openai" diff --git a/src/splunk_ao/resources/models/invalid_result.py b/src/splunk_ao/resources/models/invalid_result.py index c977eca8..c63a9ec0 100644 --- a/src/splunk_ao/resources/models/invalid_result.py +++ b/src/splunk_ao/resources/models/invalid_result.py @@ -17,10 +17,12 @@ class InvalidResult: Attributes: error_message (str): result_type (Literal['invalid'] | Unset): Default: 'invalid'. + error_code (Literal['environment_preparing'] | None | Unset): """ error_message: str result_type: Literal["invalid"] | Unset = "invalid" + error_code: Literal["environment_preparing"] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -28,11 +30,19 @@ def to_dict(self) -> dict[str, Any]: result_type = self.result_type + error_code: Literal["environment_preparing"] | None | Unset + if isinstance(self.error_code, Unset): + error_code = UNSET + else: + error_code = self.error_code + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"error_message": error_message}) if result_type is not UNSET: field_dict["result_type"] = result_type + if error_code is not UNSET: + field_dict["error_code"] = error_code return field_dict @@ -45,7 +55,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: if result_type != "invalid" and not isinstance(result_type, Unset): raise ValueError(f"result_type must match const 'invalid', got '{result_type}'") - invalid_result = cls(error_message=error_message, result_type=result_type) + def _parse_error_code(data: object) -> Literal["environment_preparing"] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + error_code_type_0 = cast(Literal["environment_preparing"], data) + if error_code_type_0 != "environment_preparing": + raise ValueError( + f"error_code_type_0 must match const 'environment_preparing', got '{error_code_type_0}'" + ) + return error_code_type_0 + return cast(Literal["environment_preparing"] | None | Unset, data) + + error_code = _parse_error_code(d.pop("error_code", UNSET)) + + invalid_result = cls(error_message=error_message, result_type=result_type, error_code=error_code) invalid_result.additional_properties = d return invalid_result diff --git a/src/splunk_ao/resources/models/left_out_reason.py b/src/splunk_ao/resources/models/left_out_reason.py new file mode 100644 index 00000000..44f2b657 --- /dev/null +++ b/src/splunk_ao/resources/models/left_out_reason.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class LeftOutReason(str, Enum): + CHILD_OF_LEAF_SPAN = "child_of_leaf_span" + NO_TRACE_ROW = "no_trace_row" + UNREACHABLE = "unreachable" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/like_dislike_rating.py b/src/splunk_ao/resources/models/like_dislike_rating.py index af607aa1..9fa0c1a1 100644 --- a/src/splunk_ao/resources/models/like_dislike_rating.py +++ b/src/splunk_ao/resources/models/like_dislike_rating.py @@ -16,23 +16,23 @@ class LikeDislikeRating: """ Attributes: value (bool): - annotation_type (Literal['like_dislike'] | Unset): Default: 'like_dislike'. + feedback_type (Literal['like_dislike'] | Unset): Default: 'like_dislike'. """ value: bool - annotation_type: Literal["like_dislike"] | Unset = "like_dislike" + feedback_type: Literal["like_dislike"] | Unset = "like_dislike" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: value = self.value - annotation_type = self.annotation_type + feedback_type = self.feedback_type field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"value": value}) - if annotation_type is not UNSET: - field_dict["annotation_type"] = annotation_type + if feedback_type is not UNSET: + field_dict["feedback_type"] = feedback_type return field_dict @@ -41,11 +41,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) value = d.pop("value") - annotation_type = cast(Literal["like_dislike"] | Unset, d.pop("annotation_type", UNSET)) - if annotation_type != "like_dislike" and not isinstance(annotation_type, Unset): - raise ValueError(f"annotation_type must match const 'like_dislike', got '{annotation_type}'") + feedback_type = cast(Literal["like_dislike"] | Unset, d.pop("feedback_type", UNSET)) + if feedback_type != "like_dislike" and not isinstance(feedback_type, Unset): + raise ValueError(f"feedback_type must match const 'like_dislike', got '{feedback_type}'") - like_dislike_rating = cls(value=value, annotation_type=annotation_type) + like_dislike_rating = cls(value=value, feedback_type=feedback_type) like_dislike_rating.additional_properties = d return like_dislike_rating diff --git a/src/splunk_ao/resources/models/llm_scorer_log_record_configuration.py b/src/splunk_ao/resources/models/llm_scorer_log_record_configuration.py new file mode 100644 index 00000000..5d453099 --- /dev/null +++ b/src/splunk_ao/resources/models/llm_scorer_log_record_configuration.py @@ -0,0 +1,226 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.input_type_enum import InputTypeEnum +from ..models.multimodal_capability import MultimodalCapability +from ..models.output_type_enum import OutputTypeEnum +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.scorer_metadata_selection import ScorerMetadataSelection + + +T = TypeVar("T", bound="LLMScorerLogRecordConfiguration") + + +@_attrs_define +class LLMScorerLogRecordConfiguration: + """ + Attributes: + model_alias (str | Unset): Default: 'gpt-4.1-mini'. + num_judges (int | Unset): Default: 3. + output_type (OutputTypeEnum | Unset): Enumeration of output types. + scoreable_node_types (list[str] | Unset): Types of nodes that can be scored by this scorer. + cot_enabled (bool | Unset): Whether chain of thought is enabled for this scorer. Default: False. + ground_truth (bool | Unset): Whether ground truth is enabled for this scorer. Default: False. + multimodal_capabilities (list[MultimodalCapability] | None | Unset): Multimodal capabilities required by this + scorer. + input_type (InputTypeEnum | None | Unset): + metadata_selection (None | ScorerMetadataSelection | Unset): + """ + + model_alias: str | Unset = "gpt-4.1-mini" + num_judges: int | Unset = 3 + output_type: OutputTypeEnum | Unset = UNSET + scoreable_node_types: list[str] | Unset = UNSET + cot_enabled: bool | Unset = False + ground_truth: bool | Unset = False + multimodal_capabilities: list[MultimodalCapability] | None | Unset = UNSET + input_type: InputTypeEnum | None | Unset = UNSET + metadata_selection: None | ScorerMetadataSelection | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.scorer_metadata_selection import ScorerMetadataSelection + + model_alias = self.model_alias + + num_judges = self.num_judges + + output_type: str | Unset = UNSET + if not isinstance(self.output_type, Unset): + output_type = self.output_type.value + + scoreable_node_types: list[str] | Unset = UNSET + if not isinstance(self.scoreable_node_types, Unset): + scoreable_node_types = self.scoreable_node_types + + cot_enabled = self.cot_enabled + + ground_truth = self.ground_truth + + multimodal_capabilities: list[str] | None | Unset + if isinstance(self.multimodal_capabilities, Unset): + multimodal_capabilities = UNSET + elif isinstance(self.multimodal_capabilities, list): + multimodal_capabilities = [] + for multimodal_capabilities_type_0_item_data in self.multimodal_capabilities: + multimodal_capabilities_type_0_item = multimodal_capabilities_type_0_item_data.value + multimodal_capabilities.append(multimodal_capabilities_type_0_item) + + else: + multimodal_capabilities = self.multimodal_capabilities + + input_type: None | str | Unset + if isinstance(self.input_type, Unset): + input_type = UNSET + elif isinstance(self.input_type, InputTypeEnum): + input_type = self.input_type.value + else: + input_type = self.input_type + + metadata_selection: dict[str, Any] | None | Unset + if isinstance(self.metadata_selection, Unset): + metadata_selection = UNSET + elif isinstance(self.metadata_selection, ScorerMetadataSelection): + metadata_selection = self.metadata_selection.to_dict() + else: + metadata_selection = self.metadata_selection + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if model_alias is not UNSET: + field_dict["model_alias"] = model_alias + if num_judges is not UNSET: + field_dict["num_judges"] = num_judges + if output_type is not UNSET: + field_dict["output_type"] = output_type + if scoreable_node_types is not UNSET: + field_dict["scoreable_node_types"] = scoreable_node_types + if cot_enabled is not UNSET: + field_dict["cot_enabled"] = cot_enabled + if ground_truth is not UNSET: + field_dict["ground_truth"] = ground_truth + if multimodal_capabilities is not UNSET: + field_dict["multimodal_capabilities"] = multimodal_capabilities + if input_type is not UNSET: + field_dict["input_type"] = input_type + if metadata_selection is not UNSET: + field_dict["metadata_selection"] = metadata_selection + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.scorer_metadata_selection import ScorerMetadataSelection + + d = dict(src_dict) + model_alias = d.pop("model_alias", UNSET) + + num_judges = d.pop("num_judges", UNSET) + + _output_type = d.pop("output_type", UNSET) + output_type: OutputTypeEnum | Unset + if isinstance(_output_type, Unset): + output_type = UNSET + else: + output_type = OutputTypeEnum(_output_type) + + scoreable_node_types = cast(list[str], d.pop("scoreable_node_types", UNSET)) + + cot_enabled = d.pop("cot_enabled", UNSET) + + ground_truth = d.pop("ground_truth", UNSET) + + def _parse_multimodal_capabilities(data: object) -> list[MultimodalCapability] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + multimodal_capabilities_type_0 = [] + _multimodal_capabilities_type_0 = data + for multimodal_capabilities_type_0_item_data in _multimodal_capabilities_type_0: + multimodal_capabilities_type_0_item = MultimodalCapability(multimodal_capabilities_type_0_item_data) + + multimodal_capabilities_type_0.append(multimodal_capabilities_type_0_item) + + return multimodal_capabilities_type_0 + except: # noqa: E722 + pass + return cast(list[MultimodalCapability] | None | Unset, data) + + multimodal_capabilities = _parse_multimodal_capabilities(d.pop("multimodal_capabilities", UNSET)) + + def _parse_input_type(data: object) -> InputTypeEnum | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + input_type_type_0 = InputTypeEnum(data) + + return input_type_type_0 + except: # noqa: E722 + pass + return cast(InputTypeEnum | None | Unset, data) + + input_type = _parse_input_type(d.pop("input_type", UNSET)) + + def _parse_metadata_selection(data: object) -> None | ScorerMetadataSelection | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + metadata_selection_type_0 = ScorerMetadataSelection.from_dict(data) + + return metadata_selection_type_0 + except: # noqa: E722 + pass + return cast(None | ScorerMetadataSelection | Unset, data) + + metadata_selection = _parse_metadata_selection(d.pop("metadata_selection", UNSET)) + + llm_scorer_log_record_configuration = cls( + model_alias=model_alias, + num_judges=num_judges, + output_type=output_type, + scoreable_node_types=scoreable_node_types, + cot_enabled=cot_enabled, + ground_truth=ground_truth, + multimodal_capabilities=multimodal_capabilities, + input_type=input_type, + metadata_selection=metadata_selection, + ) + + llm_scorer_log_record_configuration.additional_properties = d + return llm_scorer_log_record_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/llm_span.py b/src/splunk_ao/resources/models/llm_span.py deleted file mode 100644 index d4c0f320..00000000 --- a/src/splunk_ao/resources/models/llm_span.py +++ /dev/null @@ -1,767 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.image_generation_event import ImageGenerationEvent - from ..models.internal_tool_call import InternalToolCall - from ..models.llm_metrics import LlmMetrics - from ..models.llm_span_dataset_metadata import LlmSpanDatasetMetadata - from ..models.llm_span_tools_type_0_item import LlmSpanToolsType0Item - from ..models.llm_span_user_metadata import LlmSpanUserMetadata - from ..models.mcp_approval_request_event import MCPApprovalRequestEvent - from ..models.mcp_call_event import MCPCallEvent - from ..models.mcp_list_tools_event import MCPListToolsEvent - from ..models.message import Message - from ..models.message_event import MessageEvent - from ..models.reasoning_event import ReasoningEvent - from ..models.web_search_call_event import WebSearchCallEvent - - -T = TypeVar("T", bound="LlmSpan") - - -@_attrs_define -class LlmSpan: - """ - Attributes: - type_ (Literal['llm'] | Unset): Type of the trace, span or session. Default: 'llm'. - input_ (list[Message] | Unset): Input to the trace or span. - redacted_input (list[Message] | None | Unset): Redacted input of the trace or span. - output (Message | Unset): - redacted_output (Message | None | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (LlmSpanUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (LlmMetrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (LlmSpanDatasetMetadata | Unset): Metadata from the dataset associated with this trace - id (None | str | Unset): Galileo ID of the session, trace or span - session_id (None | str | Unset): Galileo ID of the session containing the trace or span or session - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - step_number (int | None | Unset): Topological step number of the span. - parent_id (None | str | Unset): Galileo ID of the parent of this span - tools (list[LlmSpanToolsType0Item] | None | Unset): List of available tools passed to the LLM on invocation. - events (list[ImageGenerationEvent | InternalToolCall | MCPApprovalRequestEvent | MCPCallEvent | - MCPListToolsEvent | MessageEvent | ReasoningEvent | WebSearchCallEvent] | None | Unset): List of reasoning, - internal tool call, or MCP events that occurred during the LLM span. - model (None | str | Unset): Model used for this span. - provider (None | str | Unset): Provider used for this span. - temperature (float | None | Unset): Temperature used for generation. - finish_reason (None | str | Unset): Reason for finishing. - """ - - type_: Literal["llm"] | Unset = "llm" - input_: list[Message] | Unset = UNSET - redacted_input: list[Message] | None | Unset = UNSET - output: Message | Unset = UNSET - redacted_output: Message | None | Unset = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: LlmSpanUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: LlmMetrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: LlmSpanDatasetMetadata | Unset = UNSET - id: None | str | Unset = UNSET - session_id: None | str | Unset = UNSET - trace_id: None | str | Unset = UNSET - step_number: int | None | Unset = UNSET - parent_id: None | str | Unset = UNSET - tools: list[LlmSpanToolsType0Item] | None | Unset = UNSET - events: ( - list[ - ImageGenerationEvent - | InternalToolCall - | MCPApprovalRequestEvent - | MCPCallEvent - | MCPListToolsEvent - | MessageEvent - | ReasoningEvent - | WebSearchCallEvent - ] - | None - | Unset - ) = UNSET - model: None | str | Unset = UNSET - provider: None | str | Unset = UNSET - temperature: float | None | Unset = UNSET - finish_reason: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.image_generation_event import ImageGenerationEvent - from ..models.internal_tool_call import InternalToolCall - from ..models.mcp_call_event import MCPCallEvent - from ..models.mcp_list_tools_event import MCPListToolsEvent - from ..models.message import Message - from ..models.message_event import MessageEvent - from ..models.reasoning_event import ReasoningEvent - from ..models.web_search_call_event import WebSearchCallEvent - - type_ = self.type_ - - input_: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.input_, Unset): - input_ = [] - for input_item_data in self.input_: - input_item = input_item_data.to_dict() - input_.append(input_item) - - redacted_input: list[dict[str, Any]] | None | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_0_item_data in self.redacted_input: - redacted_input_type_0_item = redacted_input_type_0_item_data.to_dict() - redacted_input.append(redacted_input_type_0_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | Unset = UNSET - if not isinstance(self.output, Unset): - output = self.output.to_dict() - - redacted_output: dict[str, Any] | None | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - id: None | str | Unset - if isinstance(self.id, Unset): - id = UNSET - else: - id = self.id - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - parent_id: None | str | Unset - if isinstance(self.parent_id, Unset): - parent_id = UNSET - else: - parent_id = self.parent_id - - tools: list[dict[str, Any]] | None | Unset - if isinstance(self.tools, Unset): - tools = UNSET - elif isinstance(self.tools, list): - tools = [] - for tools_type_0_item_data in self.tools: - tools_type_0_item = tools_type_0_item_data.to_dict() - tools.append(tools_type_0_item) - - else: - tools = self.tools - - events: list[dict[str, Any]] | None | Unset - if isinstance(self.events, Unset): - events = UNSET - elif isinstance(self.events, list): - events = [] - for events_type_0_item_data in self.events: - events_type_0_item: dict[str, Any] - if isinstance(events_type_0_item_data, MessageEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, ReasoningEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, InternalToolCall): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, WebSearchCallEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, ImageGenerationEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, MCPCallEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, MCPListToolsEvent): - events_type_0_item = events_type_0_item_data.to_dict() - else: - events_type_0_item = events_type_0_item_data.to_dict() - - events.append(events_type_0_item) - - else: - events = self.events - - model: None | str | Unset - if isinstance(self.model, Unset): - model = UNSET - else: - model = self.model - - provider: None | str | Unset - if isinstance(self.provider, Unset): - provider = UNSET - else: - provider = self.provider - - temperature: float | None | Unset - if isinstance(self.temperature, Unset): - temperature = UNSET - else: - temperature = self.temperature - - finish_reason: None | str | Unset - if isinstance(self.finish_reason, Unset): - finish_reason = UNSET - else: - finish_reason = self.finish_reason - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if id is not UNSET: - field_dict["id"] = id - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if step_number is not UNSET: - field_dict["step_number"] = step_number - if parent_id is not UNSET: - field_dict["parent_id"] = parent_id - if tools is not UNSET: - field_dict["tools"] = tools - if events is not UNSET: - field_dict["events"] = events - if model is not UNSET: - field_dict["model"] = model - if provider is not UNSET: - field_dict["provider"] = provider - if temperature is not UNSET: - field_dict["temperature"] = temperature - if finish_reason is not UNSET: - field_dict["finish_reason"] = finish_reason - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.image_generation_event import ImageGenerationEvent - from ..models.internal_tool_call import InternalToolCall - from ..models.llm_metrics import LlmMetrics - from ..models.llm_span_dataset_metadata import LlmSpanDatasetMetadata - from ..models.llm_span_tools_type_0_item import LlmSpanToolsType0Item - from ..models.llm_span_user_metadata import LlmSpanUserMetadata - from ..models.mcp_approval_request_event import MCPApprovalRequestEvent - from ..models.mcp_call_event import MCPCallEvent - from ..models.mcp_list_tools_event import MCPListToolsEvent - from ..models.message import Message - from ..models.message_event import MessageEvent - from ..models.reasoning_event import ReasoningEvent - from ..models.web_search_call_event import WebSearchCallEvent - - d = dict(src_dict) - type_ = cast(Literal["llm"] | Unset, d.pop("type", UNSET)) - if type_ != "llm" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'llm', got '{type_}'") - - _input_ = d.pop("input", UNSET) - input_: list[Message] | Unset = UNSET - if _input_ is not UNSET: - input_ = [] - for input_item_data in _input_: - input_item = Message.from_dict(input_item_data) - - input_.append(input_item) - - def _parse_redacted_input(data: object) -> list[Message] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_0 = [] - _redacted_input_type_0 = data - for redacted_input_type_0_item_data in _redacted_input_type_0: - redacted_input_type_0_item = Message.from_dict(redacted_input_type_0_item_data) - - redacted_input_type_0.append(redacted_input_type_0_item) - - return redacted_input_type_0 - except: # noqa: E722 - pass - return cast(list[Message] | None | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - _output = d.pop("output", UNSET) - output: Message | Unset - if isinstance(_output, Unset): - output = UNSET - else: - output = Message.from_dict(_output) - - def _parse_redacted_output(data: object) -> Message | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_0 = Message.from_dict(data) - - return redacted_output_type_0 - except: # noqa: E722 - pass - return cast(Message | None | Unset, data) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: LlmSpanUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = LlmSpanUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: LlmMetrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = LlmMetrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: LlmSpanDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = LlmSpanDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - id = _parse_id(d.pop("id", UNSET)) - - def _parse_session_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - def _parse_parent_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - parent_id = _parse_parent_id(d.pop("parent_id", UNSET)) - - def _parse_tools(data: object) -> list[LlmSpanToolsType0Item] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - tools_type_0 = [] - _tools_type_0 = data - for tools_type_0_item_data in _tools_type_0: - tools_type_0_item = LlmSpanToolsType0Item.from_dict(tools_type_0_item_data) - - tools_type_0.append(tools_type_0_item) - - return tools_type_0 - except: # noqa: E722 - pass - return cast(list[LlmSpanToolsType0Item] | None | Unset, data) - - tools = _parse_tools(d.pop("tools", UNSET)) - - def _parse_events( - data: object, - ) -> ( - list[ - ImageGenerationEvent - | InternalToolCall - | MCPApprovalRequestEvent - | MCPCallEvent - | MCPListToolsEvent - | MessageEvent - | ReasoningEvent - | WebSearchCallEvent - ] - | None - | Unset - ): - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - events_type_0 = [] - _events_type_0 = data - for events_type_0_item_data in _events_type_0: - - def _parse_events_type_0_item( - data: object, - ) -> ( - ImageGenerationEvent - | InternalToolCall - | MCPApprovalRequestEvent - | MCPCallEvent - | MCPListToolsEvent - | MessageEvent - | ReasoningEvent - | WebSearchCallEvent - ): - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_0 = MessageEvent.from_dict(data) - - return events_type_0_item_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_1 = ReasoningEvent.from_dict(data) - - return events_type_0_item_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_2 = InternalToolCall.from_dict(data) - - return events_type_0_item_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_3 = WebSearchCallEvent.from_dict(data) - - return events_type_0_item_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_4 = ImageGenerationEvent.from_dict(data) - - return events_type_0_item_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_5 = MCPCallEvent.from_dict(data) - - return events_type_0_item_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_6 = MCPListToolsEvent.from_dict(data) - - return events_type_0_item_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_7 = MCPApprovalRequestEvent.from_dict(data) - - return events_type_0_item_type_7 - - events_type_0_item = _parse_events_type_0_item(events_type_0_item_data) - - events_type_0.append(events_type_0_item) - - return events_type_0 - except: # noqa: E722 - pass - return cast( - list[ - ImageGenerationEvent - | InternalToolCall - | MCPApprovalRequestEvent - | MCPCallEvent - | MCPListToolsEvent - | MessageEvent - | ReasoningEvent - | WebSearchCallEvent - ] - | None - | Unset, - data, - ) - - events = _parse_events(d.pop("events", UNSET)) - - def _parse_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - model = _parse_model(d.pop("model", UNSET)) - - def _parse_provider(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - provider = _parse_provider(d.pop("provider", UNSET)) - - def _parse_temperature(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - temperature = _parse_temperature(d.pop("temperature", UNSET)) - - def _parse_finish_reason(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - finish_reason = _parse_finish_reason(d.pop("finish_reason", UNSET)) - - llm_span = cls( - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - id=id, - session_id=session_id, - trace_id=trace_id, - step_number=step_number, - parent_id=parent_id, - tools=tools, - events=events, - model=model, - provider=provider, - temperature=temperature, - finish_reason=finish_reason, - ) - - llm_span.additional_properties = d - return llm_span - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/llm_span_dataset_metadata.py b/src/splunk_ao/resources/models/llm_span_dataset_metadata.py deleted file mode 100644 index 87f2f29d..00000000 --- a/src/splunk_ao/resources/models/llm_span_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="LlmSpanDatasetMetadata") - - -@_attrs_define -class LlmSpanDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - llm_span_dataset_metadata = cls() - - llm_span_dataset_metadata.additional_properties = d - return llm_span_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/llm_span_user_metadata.py b/src/splunk_ao/resources/models/llm_span_user_metadata.py deleted file mode 100644 index c1cba8ab..00000000 --- a/src/splunk_ao/resources/models/llm_span_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="LlmSpanUserMetadata") - - -@_attrs_define -class LlmSpanUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - llm_span_user_metadata = cls() - - llm_span_user_metadata.additional_properties = d - return llm_span_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/log_records_partial_query_response.py b/src/splunk_ao/resources/models/log_records_partial_query_response.py deleted file mode 100644 index df4ac97c..00000000 --- a/src/splunk_ao/resources/models/log_records_partial_query_response.py +++ /dev/null @@ -1,367 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.partial_extended_agent_span_record import PartialExtendedAgentSpanRecord - from ..models.partial_extended_control_span_record import PartialExtendedControlSpanRecord - from ..models.partial_extended_http_span_record import PartialExtendedHttpSpanRecord - from ..models.partial_extended_llm_span_record import PartialExtendedLlmSpanRecord - from ..models.partial_extended_retriever_span_record import PartialExtendedRetrieverSpanRecord - from ..models.partial_extended_session_record import PartialExtendedSessionRecord - from ..models.partial_extended_tool_span_record import PartialExtendedToolSpanRecord - from ..models.partial_extended_trace_record import PartialExtendedTraceRecord - from ..models.partial_extended_workflow_span_record import PartialExtendedWorkflowSpanRecord - - -T = TypeVar("T", bound="LogRecordsPartialQueryResponse") - - -@_attrs_define -class LogRecordsPartialQueryResponse: - """ - Attributes: - starting_token (int | Unset): Default: 0. - limit (int | Unset): Default: 100. - paginated (bool | Unset): Default: False. - next_starting_token (int | None | Unset): - last_row_id (None | str | Unset): - records (list[PartialExtendedAgentSpanRecord | PartialExtendedControlSpanRecord | PartialExtendedHttpSpanRecord - | PartialExtendedLlmSpanRecord | PartialExtendedRetrieverSpanRecord | PartialExtendedSessionRecord | - PartialExtendedToolSpanRecord | PartialExtendedTraceRecord | PartialExtendedWorkflowSpanRecord] | Unset): - records matching the query - """ - - starting_token: int | Unset = 0 - limit: int | Unset = 100 - paginated: bool | Unset = False - next_starting_token: int | None | Unset = UNSET - last_row_id: None | str | Unset = UNSET - records: ( - list[ - PartialExtendedAgentSpanRecord - | PartialExtendedControlSpanRecord - | PartialExtendedHttpSpanRecord - | PartialExtendedLlmSpanRecord - | PartialExtendedRetrieverSpanRecord - | PartialExtendedSessionRecord - | PartialExtendedToolSpanRecord - | PartialExtendedTraceRecord - | PartialExtendedWorkflowSpanRecord - ] - | Unset - ) = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.partial_extended_agent_span_record import PartialExtendedAgentSpanRecord - from ..models.partial_extended_control_span_record import PartialExtendedControlSpanRecord - from ..models.partial_extended_http_span_record import PartialExtendedHttpSpanRecord - from ..models.partial_extended_llm_span_record import PartialExtendedLlmSpanRecord - from ..models.partial_extended_retriever_span_record import PartialExtendedRetrieverSpanRecord - from ..models.partial_extended_tool_span_record import PartialExtendedToolSpanRecord - from ..models.partial_extended_trace_record import PartialExtendedTraceRecord - from ..models.partial_extended_workflow_span_record import PartialExtendedWorkflowSpanRecord - - starting_token = self.starting_token - - limit = self.limit - - paginated = self.paginated - - next_starting_token: int | None | Unset - if isinstance(self.next_starting_token, Unset): - next_starting_token = UNSET - else: - next_starting_token = self.next_starting_token - - last_row_id: None | str | Unset - if isinstance(self.last_row_id, Unset): - last_row_id = UNSET - else: - last_row_id = self.last_row_id - - records: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.records, Unset): - records = [] - for records_item_data in self.records: - records_item: dict[str, Any] - if isinstance(records_item_data, PartialExtendedTraceRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, PartialExtendedAgentSpanRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, PartialExtendedWorkflowSpanRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, PartialExtendedLlmSpanRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, PartialExtendedToolSpanRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, PartialExtendedRetrieverSpanRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, PartialExtendedControlSpanRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, PartialExtendedHttpSpanRecord): - records_item = records_item_data.to_dict() - else: - records_item = records_item_data.to_dict() - - records.append(records_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if starting_token is not UNSET: - field_dict["starting_token"] = starting_token - if limit is not UNSET: - field_dict["limit"] = limit - if paginated is not UNSET: - field_dict["paginated"] = paginated - if next_starting_token is not UNSET: - field_dict["next_starting_token"] = next_starting_token - if last_row_id is not UNSET: - field_dict["last_row_id"] = last_row_id - if records is not UNSET: - field_dict["records"] = records - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.partial_extended_agent_span_record import PartialExtendedAgentSpanRecord - from ..models.partial_extended_control_span_record import PartialExtendedControlSpanRecord - from ..models.partial_extended_http_span_record import PartialExtendedHttpSpanRecord - from ..models.partial_extended_llm_span_record import PartialExtendedLlmSpanRecord - from ..models.partial_extended_retriever_span_record import PartialExtendedRetrieverSpanRecord - from ..models.partial_extended_session_record import PartialExtendedSessionRecord - from ..models.partial_extended_tool_span_record import PartialExtendedToolSpanRecord - from ..models.partial_extended_trace_record import PartialExtendedTraceRecord - from ..models.partial_extended_workflow_span_record import PartialExtendedWorkflowSpanRecord - - d = dict(src_dict) - starting_token = d.pop("starting_token", UNSET) - - limit = d.pop("limit", UNSET) - - paginated = d.pop("paginated", UNSET) - - def _parse_next_starting_token(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - next_starting_token = _parse_next_starting_token(d.pop("next_starting_token", UNSET)) - - def _parse_last_row_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - last_row_id = _parse_last_row_id(d.pop("last_row_id", UNSET)) - - _records = d.pop("records", UNSET) - records: ( - list[ - PartialExtendedAgentSpanRecord - | PartialExtendedControlSpanRecord - | PartialExtendedHttpSpanRecord - | PartialExtendedLlmSpanRecord - | PartialExtendedRetrieverSpanRecord - | PartialExtendedSessionRecord - | PartialExtendedToolSpanRecord - | PartialExtendedTraceRecord - | PartialExtendedWorkflowSpanRecord - ] - | Unset - ) = UNSET - if _records is not UNSET: - records = [] - for records_item_data in _records: - - def _parse_records_item( - data: object, - ) -> ( - PartialExtendedAgentSpanRecord - | PartialExtendedControlSpanRecord - | PartialExtendedHttpSpanRecord - | PartialExtendedLlmSpanRecord - | PartialExtendedRetrieverSpanRecord - | PartialExtendedSessionRecord - | PartialExtendedToolSpanRecord - | PartialExtendedTraceRecord - | PartialExtendedWorkflowSpanRecord - ): - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_0 = PartialExtendedTraceRecord.from_dict(data) - - return records_item_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_1 = PartialExtendedAgentSpanRecord.from_dict(data) - - return records_item_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_2 = PartialExtendedWorkflowSpanRecord.from_dict(data) - - return records_item_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_3 = PartialExtendedLlmSpanRecord.from_dict(data) - - return records_item_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_4 = PartialExtendedToolSpanRecord.from_dict(data) - - return records_item_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_5 = PartialExtendedRetrieverSpanRecord.from_dict(data) - - return records_item_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_6 = PartialExtendedControlSpanRecord.from_dict(data) - - return records_item_type_6 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_7 = PartialExtendedHttpSpanRecord.from_dict(data) - - return records_item_type_7 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_8 = PartialExtendedSessionRecord.from_dict(data) - - return records_item_type_8 - except: # noqa: E722 - pass - # If we reach here, none of the parsers succeeded - discriminator_info = ( - f" (type={data.get('type')})" if isinstance(data, dict) and "type" in data else "" - ) - raise ValueError(f"Could not parse union type for records_item{discriminator_info}") - - records_item = _parse_records_item(records_item_data) - - records.append(records_item) - - log_records_partial_query_response = cls( - starting_token=starting_token, - limit=limit, - paginated=paginated, - next_starting_token=next_starting_token, - last_row_id=last_row_id, - records=records, - ) - - log_records_partial_query_response.additional_properties = d - return log_records_partial_query_response - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/log_records_query_response.py b/src/splunk_ao/resources/models/log_records_query_response.py deleted file mode 100644 index 44660cfb..00000000 --- a/src/splunk_ao/resources/models/log_records_query_response.py +++ /dev/null @@ -1,359 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - from ..models.extended_control_span_record import ExtendedControlSpanRecord - from ..models.extended_http_span_record import ExtendedHttpSpanRecord - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - from ..models.extended_session_record import ExtendedSessionRecord - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - from ..models.extended_trace_record import ExtendedTraceRecord - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - -T = TypeVar("T", bound="LogRecordsQueryResponse") - - -@_attrs_define -class LogRecordsQueryResponse: - """ - Attributes: - starting_token (int | Unset): Default: 0. - limit (int | Unset): Default: 100. - paginated (bool | Unset): Default: False. - next_starting_token (int | None | Unset): - last_row_id (None | str | Unset): - records (list[ExtendedAgentSpanRecord | ExtendedControlSpanRecord | ExtendedHttpSpanRecord | - ExtendedLlmSpanRecord | ExtendedRetrieverSpanRecord | ExtendedSessionRecord | ExtendedToolSpanRecord | - ExtendedTraceRecord | ExtendedWorkflowSpanRecord] | Unset): records matching the query - """ - - starting_token: int | Unset = 0 - limit: int | Unset = 100 - paginated: bool | Unset = False - next_starting_token: int | None | Unset = UNSET - last_row_id: None | str | Unset = UNSET - records: ( - list[ - ExtendedAgentSpanRecord - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecord - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecord - | ExtendedSessionRecord - | ExtendedToolSpanRecord - | ExtendedTraceRecord - | ExtendedWorkflowSpanRecord - ] - | Unset - ) = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - from ..models.extended_control_span_record import ExtendedControlSpanRecord - from ..models.extended_http_span_record import ExtendedHttpSpanRecord - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - from ..models.extended_trace_record import ExtendedTraceRecord - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - starting_token = self.starting_token - - limit = self.limit - - paginated = self.paginated - - next_starting_token: int | None | Unset - if isinstance(self.next_starting_token, Unset): - next_starting_token = UNSET - else: - next_starting_token = self.next_starting_token - - last_row_id: None | str | Unset - if isinstance(self.last_row_id, Unset): - last_row_id = UNSET - else: - last_row_id = self.last_row_id - - records: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.records, Unset): - records = [] - for records_item_data in self.records: - records_item: dict[str, Any] - if isinstance(records_item_data, ExtendedTraceRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, ExtendedAgentSpanRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, ExtendedWorkflowSpanRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, ExtendedLlmSpanRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, ExtendedToolSpanRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, ExtendedRetrieverSpanRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, ExtendedControlSpanRecord): - records_item = records_item_data.to_dict() - elif isinstance(records_item_data, ExtendedHttpSpanRecord): - records_item = records_item_data.to_dict() - else: - records_item = records_item_data.to_dict() - - records.append(records_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if starting_token is not UNSET: - field_dict["starting_token"] = starting_token - if limit is not UNSET: - field_dict["limit"] = limit - if paginated is not UNSET: - field_dict["paginated"] = paginated - if next_starting_token is not UNSET: - field_dict["next_starting_token"] = next_starting_token - if last_row_id is not UNSET: - field_dict["last_row_id"] = last_row_id - if records is not UNSET: - field_dict["records"] = records - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.extended_control_span_record import ExtendedControlSpanRecord - from ..models.extended_http_span_record import ExtendedHttpSpanRecord - - d = dict(src_dict) - starting_token = d.pop("starting_token", UNSET) - - limit = d.pop("limit", UNSET) - - paginated = d.pop("paginated", UNSET) - - def _parse_next_starting_token(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - next_starting_token = _parse_next_starting_token(d.pop("next_starting_token", UNSET)) - - def _parse_last_row_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - last_row_id = _parse_last_row_id(d.pop("last_row_id", UNSET)) - - _records = d.pop("records", UNSET) - records: ( - list[ - ExtendedAgentSpanRecord - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecord - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecord - | ExtendedSessionRecord - | ExtendedToolSpanRecord - | ExtendedTraceRecord - | ExtendedWorkflowSpanRecord - ] - | Unset - ) = UNSET - if _records is not UNSET: - records = [] - for records_item_data in _records: - - def _parse_records_item( - data: object, - ) -> ( - ExtendedAgentSpanRecord - | ExtendedControlSpanRecord - | ExtendedHttpSpanRecord - | ExtendedLlmSpanRecord - | ExtendedRetrieverSpanRecord - | ExtendedSessionRecord - | ExtendedToolSpanRecord - | ExtendedTraceRecord - | ExtendedWorkflowSpanRecord - ): - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_0 = ExtendedTraceRecord.from_dict(data) - - return records_item_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_1 = ExtendedAgentSpanRecord.from_dict(data) - - return records_item_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_2 = ExtendedWorkflowSpanRecord.from_dict(data) - - return records_item_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_3 = ExtendedLlmSpanRecord.from_dict(data) - - return records_item_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_4 = ExtendedToolSpanRecord.from_dict(data) - - return records_item_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_5 = ExtendedRetrieverSpanRecord.from_dict(data) - - return records_item_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_6 = ExtendedControlSpanRecord.from_dict(data) - - return records_item_type_6 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_7 = ExtendedHttpSpanRecord.from_dict(data) - - return records_item_type_7 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - records_item_type_8 = ExtendedSessionRecord.from_dict(data) - - return records_item_type_8 - except: # noqa: E722 - pass - # If we reach here, none of the parsers succeeded - discriminator_info = ( - f" (type={data.get('type')})" if isinstance(data, dict) and "type" in data else "" - ) - raise ValueError(f"Could not parse union type for records_item{discriminator_info}") - - records_item = _parse_records_item(records_item_data) - - records.append(records_item) - - log_records_query_response = cls( - starting_token=starting_token, - limit=limit, - paginated=paginated, - next_starting_token=next_starting_token, - last_row_id=last_row_id, - records=records, - ) - - log_records_query_response.additional_properties = d - return log_records_query_response - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/log_records_text_filter_operator.py b/src/splunk_ao/resources/models/log_records_text_filter_operator.py index 38b98d5d..cf53ae7d 100644 --- a/src/splunk_ao/resources/models/log_records_text_filter_operator.py +++ b/src/splunk_ao/resources/models/log_records_text_filter_operator.py @@ -7,6 +7,7 @@ class LogRecordsTextFilterOperator(str, Enum): NE = "ne" NOT_IN = "not_in" ONE_OF = "one_of" + REGEX = "regex" def __str__(self) -> str: return str(self.value) diff --git a/src/splunk_ao/resources/models/log_span_update_request.py b/src/splunk_ao/resources/models/log_span_update_request.py deleted file mode 100644 index 632cae5d..00000000 --- a/src/splunk_ao/resources/models/log_span_update_request.py +++ /dev/null @@ -1,448 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.logging_method import LoggingMethod -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="LogSpanUpdateRequest") - - -@_attrs_define -class LogSpanUpdateRequest: - """Request model for updating a span. - - Attributes: - span_id (str): Span id to update. - log_stream_id (None | str | Unset): Log stream id associated with the traces. - experiment_id (None | str | Unset): Experiment id associated with the traces. - metrics_testing_id (None | str | Unset): Metrics testing id associated with the traces. - logging_method (LoggingMethod | Unset): - client_version (None | str | Unset): - reliable (bool | Unset): Whether or not to use reliable logging. If set to False, the method will respond - immediately before verifying that the traces have been successfully ingested, and no error message will be - returned if ingestion fails. If set to True, the method will wait for the traces to be durably accepted or - return an error message if there is an ingestion failure. On the streaming write path (kafka_metrics_pipeline) - accepted means acknowledged by Kafka; the records become readable after the data-writer flush, about - GALILEO_STREAMING_EXPECTED_LAG_SECONDS (default 2.5 s) later, so a read issued immediately after the response - can miss them. Default: True. - input_ (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Input of the span. - Overwrites previous value if present. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the span. Overwrites previous value if present. - tags (list[str] | None | Unset): Tags to add to the span. - status_code (int | None | Unset): Status code of the span. Overwrites previous value if present. - duration_ns (int | None | Unset): Duration in nanoseconds. Overwrites previous value if present. - """ - - span_id: str - log_stream_id: None | str | Unset = UNSET - experiment_id: None | str | Unset = UNSET - metrics_testing_id: None | str | Unset = UNSET - logging_method: LoggingMethod | Unset = UNSET - client_version: None | str | Unset = UNSET - reliable: bool | Unset = True - input_: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - tags: list[str] | None | Unset = UNSET - status_code: int | None | Unset = UNSET - duration_ns: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.message import Message - from ..models.text_content_part import TextContentPart - - span_id = self.span_id - - log_stream_id: None | str | Unset - if isinstance(self.log_stream_id, Unset): - log_stream_id = UNSET - else: - log_stream_id = self.log_stream_id - - experiment_id: None | str | Unset - if isinstance(self.experiment_id, Unset): - experiment_id = UNSET - else: - experiment_id = self.experiment_id - - metrics_testing_id: None | str | Unset - if isinstance(self.metrics_testing_id, Unset): - metrics_testing_id = UNSET - else: - metrics_testing_id = self.metrics_testing_id - - logging_method: str | Unset = UNSET - if not isinstance(self.logging_method, Unset): - logging_method = self.logging_method.value - - client_version: None | str | Unset - if isinstance(self.client_version, Unset): - client_version = UNSET - else: - client_version = self.client_version - - reliable = self.reliable - - input_: list[dict[str, Any]] | None | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - tags: list[str] | None | Unset - if isinstance(self.tags, Unset): - tags = UNSET - elif isinstance(self.tags, list): - tags = self.tags - - else: - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - duration_ns: int | None | Unset - if isinstance(self.duration_ns, Unset): - duration_ns = UNSET - else: - duration_ns = self.duration_ns - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({"span_id": span_id}) - if log_stream_id is not UNSET: - field_dict["log_stream_id"] = log_stream_id - if experiment_id is not UNSET: - field_dict["experiment_id"] = experiment_id - if metrics_testing_id is not UNSET: - field_dict["metrics_testing_id"] = metrics_testing_id - if logging_method is not UNSET: - field_dict["logging_method"] = logging_method - if client_version is not UNSET: - field_dict["client_version"] = client_version - if reliable is not UNSET: - field_dict["reliable"] = reliable - if input_ is not UNSET: - field_dict["input"] = input_ - if output is not UNSET: - field_dict["output"] = output - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if duration_ns is not UNSET: - field_dict["duration_ns"] = duration_ns - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - span_id = d.pop("span_id") - - def _parse_log_stream_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - log_stream_id = _parse_log_stream_id(d.pop("log_stream_id", UNSET)) - - def _parse_experiment_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - experiment_id = _parse_experiment_id(d.pop("experiment_id", UNSET)) - - def _parse_metrics_testing_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_testing_id = _parse_metrics_testing_id(d.pop("metrics_testing_id", UNSET)) - - _logging_method = d.pop("logging_method", UNSET) - logging_method: LoggingMethod | Unset - if isinstance(_logging_method, Unset): - logging_method = UNSET - else: - logging_method = LoggingMethod(_logging_method) - - def _parse_client_version(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - client_version = _parse_client_version(d.pop("client_version", UNSET)) - - reliable = d.pop("reliable", UNSET) - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_tags(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - tags_type_0 = cast(list[str], data) - - return tags_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - tags = _parse_tags(d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - def _parse_duration_ns(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - duration_ns = _parse_duration_ns(d.pop("duration_ns", UNSET)) - - log_span_update_request = cls( - span_id=span_id, - log_stream_id=log_stream_id, - experiment_id=experiment_id, - metrics_testing_id=metrics_testing_id, - logging_method=logging_method, - client_version=client_version, - reliable=reliable, - input_=input_, - output=output, - tags=tags, - status_code=status_code, - duration_ns=duration_ns, - ) - - log_span_update_request.additional_properties = d - return log_span_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/luna_billing_usage_response.py b/src/splunk_ao/resources/models/luna_billing_usage_response.py new file mode 100644 index 00000000..b0478e84 --- /dev/null +++ b/src/splunk_ao/resources/models/luna_billing_usage_response.py @@ -0,0 +1,176 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.credit_balance import CreditBalance + from ..models.project_billing_usage import ProjectBillingUsage + + +T = TypeVar("T", bound="LunaBillingUsageResponse") + + +@_attrs_define +class LunaBillingUsageResponse: + """ + Attributes: + total (int | None): + credits_ (CreditBalance | None): + credits_unavailable_reason (None | str): + metric (Literal['luna_decision_input_tokens'] | Unset): Default: 'luna_decision_input_tokens'. + projects (list[ProjectBillingUsage] | Unset): + available (bool | Unset): Default: True. + unavailable_reason (None | str | Unset): + """ + + total: int | None + credits_: CreditBalance | None + credits_unavailable_reason: None | str + metric: Literal["luna_decision_input_tokens"] | Unset = "luna_decision_input_tokens" + projects: list[ProjectBillingUsage] | Unset = UNSET + available: bool | Unset = True + unavailable_reason: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.credit_balance import CreditBalance + + total: int | None + total = self.total + + credits_: dict[str, Any] | None + if isinstance(self.credits_, CreditBalance): + credits_ = self.credits_.to_dict() + else: + credits_ = self.credits_ + + credits_unavailable_reason: None | str + credits_unavailable_reason = self.credits_unavailable_reason + + metric = self.metric + + projects: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.projects, Unset): + projects = [] + for projects_item_data in self.projects: + projects_item = projects_item_data.to_dict() + projects.append(projects_item) + + available = self.available + + unavailable_reason: None | str | Unset + if isinstance(self.unavailable_reason, Unset): + unavailable_reason = UNSET + else: + unavailable_reason = self.unavailable_reason + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + {"total": total, "credits": credits_, "credits_unavailable_reason": credits_unavailable_reason} + ) + if metric is not UNSET: + field_dict["metric"] = metric + if projects is not UNSET: + field_dict["projects"] = projects + if available is not UNSET: + field_dict["available"] = available + if unavailable_reason is not UNSET: + field_dict["unavailable_reason"] = unavailable_reason + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.credit_balance import CreditBalance + from ..models.project_billing_usage import ProjectBillingUsage + + d = dict(src_dict) + + def _parse_total(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + total = _parse_total(d.pop("total")) + + def _parse_credits_(data: object) -> CreditBalance | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + credits_type_0 = CreditBalance.from_dict(data) + + return credits_type_0 + except: # noqa: E722 + pass + return cast(CreditBalance | None, data) + + credits_ = _parse_credits_(d.pop("credits")) + + def _parse_credits_unavailable_reason(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + credits_unavailable_reason = _parse_credits_unavailable_reason(d.pop("credits_unavailable_reason")) + + metric = cast(Literal["luna_decision_input_tokens"] | Unset, d.pop("metric", UNSET)) + if metric != "luna_decision_input_tokens" and not isinstance(metric, Unset): + raise ValueError(f"metric must match const 'luna_decision_input_tokens', got '{metric}'") + + _projects = d.pop("projects", UNSET) + projects: list[ProjectBillingUsage] | Unset = UNSET + if _projects is not UNSET: + projects = [] + for projects_item_data in _projects: + projects_item = ProjectBillingUsage.from_dict(projects_item_data) + + projects.append(projects_item) + + available = d.pop("available", UNSET) + + def _parse_unavailable_reason(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + unavailable_reason = _parse_unavailable_reason(d.pop("unavailable_reason", UNSET)) + + luna_billing_usage_response = cls( + total=total, + credits_=credits_, + credits_unavailable_reason=credits_unavailable_reason, + metric=metric, + projects=projects, + available=available, + unavailable_reason=unavailable_reason, + ) + + luna_billing_usage_response.additional_properties = d + return luna_billing_usage_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/metadata_filter.py b/src/splunk_ao/resources/models/metadata_filter.py index da12e60c..7971ec19 100644 --- a/src/splunk_ao/resources/models/metadata_filter.py +++ b/src/splunk_ao/resources/models/metadata_filter.py @@ -21,12 +21,14 @@ class MetadataFilter: key (str): value (list[str] | str): name (Literal['metadata'] | Unset): Default: 'metadata'. + case_sensitive (bool | Unset): Default: True. """ operator: MetadataFilterOperator key: str value: list[str] | str name: Literal["metadata"] | Unset = "metadata" + case_sensitive: bool | Unset = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -43,11 +45,15 @@ def to_dict(self) -> dict[str, Any]: name = self.name + case_sensitive = self.case_sensitive + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"operator": operator, "key": key, "value": value}) if name is not UNSET: field_dict["name"] = name + if case_sensitive is not UNSET: + field_dict["case_sensitive"] = case_sensitive return field_dict @@ -75,7 +81,9 @@ def _parse_value(data: object) -> list[str] | str: if name != "metadata" and not isinstance(name, Unset): raise ValueError(f"name must match const 'metadata', got '{name}'") - metadata_filter = cls(operator=operator, key=key, value=value, name=name) + case_sensitive = d.pop("case_sensitive", UNSET) + + metadata_filter = cls(operator=operator, key=key, value=value, name=name, case_sensitive=case_sensitive) metadata_filter.additional_properties = d return metadata_filter diff --git a/src/splunk_ao/resources/models/metadata_filter_operator.py b/src/splunk_ao/resources/models/metadata_filter_operator.py index 4c9aecc2..0cd7cde6 100644 --- a/src/splunk_ao/resources/models/metadata_filter_operator.py +++ b/src/splunk_ao/resources/models/metadata_filter_operator.py @@ -6,6 +6,7 @@ class MetadataFilterOperator(str, Enum): NE = "ne" NOT_IN = "not_in" ONE_OF = "one_of" + REGEX = "regex" def __str__(self) -> str: return str(self.value) diff --git a/src/splunk_ao/resources/models/extended_workflow_span_record_user_metadata.py b/src/splunk_ao/resources/models/metric_settings_conflict_response.py similarity index 56% rename from src/splunk_ao/resources/models/extended_workflow_span_record_user_metadata.py rename to src/splunk_ao/resources/models/metric_settings_conflict_response.py index c9926ec7..89193966 100644 --- a/src/splunk_ao/resources/models/extended_workflow_span_record_user_metadata.py +++ b/src/splunk_ao/resources/models/metric_settings_conflict_response.py @@ -6,38 +6,47 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="ExtendedWorkflowSpanRecordUserMetadata") +T = TypeVar("T", bound="MetricSettingsConflictResponse") @_attrs_define -class ExtendedWorkflowSpanRecordUserMetadata: - """Metadata associated with this trace or span.""" +class MetricSettingsConflictResponse: + """A replacement save rejected because its settings revision is stale. - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + Attributes: + detail (str): + """ + + detail: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + detail = self.detail field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) + field_dict.update({"detail": detail}) return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - extended_workflow_span_record_user_metadata = cls() + detail = d.pop("detail") + + metric_settings_conflict_response = cls(detail=detail) - extended_workflow_span_record_user_metadata.additional_properties = d - return extended_workflow_span_record_user_metadata + metric_settings_conflict_response.additional_properties = d + return metric_settings_conflict_response @property def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> str: + def __getitem__(self, key: str) -> Any: return self.additional_properties[key] - def __setitem__(self, key: str, value: str) -> None: + def __setitem__(self, key: str, value: Any) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/src/splunk_ao/resources/models/metric_settings_request.py b/src/splunk_ao/resources/models/metric_settings_request.py index dd0b652a..ce8c9f34 100644 --- a/src/splunk_ao/resources/models/metric_settings_request.py +++ b/src/splunk_ao/resources/models/metric_settings_request.py @@ -20,15 +20,24 @@ class MetricSettingsRequest: """ Attributes: + expected_settings_revision (None | str | Unset): Revision read before replacing settings. A stale revision + returns 409. scorers (list[RuntimeScorerConfig] | None | Unset): List of Galileo scorers to enable. segment_filters (list[SegmentFilter] | None | Unset): List of segment filters to apply to the run. """ + expected_settings_revision: None | str | Unset = UNSET scorers: list[RuntimeScorerConfig] | None | Unset = UNSET segment_filters: list[SegmentFilter] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + expected_settings_revision: None | str | Unset + if isinstance(self.expected_settings_revision, Unset): + expected_settings_revision = UNSET + else: + expected_settings_revision = self.expected_settings_revision + scorers: list[dict[str, Any]] | None | Unset if isinstance(self.scorers, Unset): scorers = UNSET @@ -56,6 +65,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if expected_settings_revision is not UNSET: + field_dict["expected_settings_revision"] = expected_settings_revision if scorers is not UNSET: field_dict["scorers"] = scorers if segment_filters is not UNSET: @@ -70,6 +81,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + def _parse_expected_settings_revision(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + expected_settings_revision = _parse_expected_settings_revision(d.pop("expected_settings_revision", UNSET)) + def _parse_scorers(data: object) -> list[RuntimeScorerConfig] | None | Unset: if data is None: return data @@ -114,7 +134,9 @@ def _parse_segment_filters(data: object) -> list[SegmentFilter] | None | Unset: segment_filters = _parse_segment_filters(d.pop("segment_filters", UNSET)) - metric_settings_request = cls(scorers=scorers, segment_filters=segment_filters) + metric_settings_request = cls( + expected_settings_revision=expected_settings_revision, scorers=scorers, segment_filters=segment_filters + ) metric_settings_request.additional_properties = d return metric_settings_request diff --git a/src/splunk_ao/resources/models/metric_settings_response.py b/src/splunk_ao/resources/models/metric_settings_response.py index a2119c84..1ce1f513 100644 --- a/src/splunk_ao/resources/models/metric_settings_response.py +++ b/src/splunk_ao/resources/models/metric_settings_response.py @@ -21,11 +21,16 @@ class MetricSettingsResponse: """ Attributes: scorers (list[RuntimeScorerConfig]): + expected_settings_revision (None | str | Unset): Revision read before replacing settings. A stale revision + returns 409. segment_filters (list[SegmentFilter] | None | Unset): List of segment filters to apply to the run. + settings_revision (None | str | Unset): Revision of the persisted evaluator settings. """ scorers: list[RuntimeScorerConfig] + expected_settings_revision: None | str | Unset = UNSET segment_filters: list[SegmentFilter] | None | Unset = UNSET + settings_revision: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,6 +39,12 @@ def to_dict(self) -> dict[str, Any]: scorers_item = scorers_item_data.to_dict() scorers.append(scorers_item) + expected_settings_revision: None | str | Unset + if isinstance(self.expected_settings_revision, Unset): + expected_settings_revision = UNSET + else: + expected_settings_revision = self.expected_settings_revision + segment_filters: list[dict[str, Any]] | None | Unset if isinstance(self.segment_filters, Unset): segment_filters = UNSET @@ -46,11 +57,21 @@ def to_dict(self) -> dict[str, Any]: else: segment_filters = self.segment_filters + settings_revision: None | str | Unset + if isinstance(self.settings_revision, Unset): + settings_revision = UNSET + else: + settings_revision = self.settings_revision + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"scorers": scorers}) + if expected_settings_revision is not UNSET: + field_dict["expected_settings_revision"] = expected_settings_revision if segment_filters is not UNSET: field_dict["segment_filters"] = segment_filters + if settings_revision is not UNSET: + field_dict["settings_revision"] = settings_revision return field_dict @@ -67,6 +88,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: scorers.append(scorers_item) + def _parse_expected_settings_revision(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + expected_settings_revision = _parse_expected_settings_revision(d.pop("expected_settings_revision", UNSET)) + def _parse_segment_filters(data: object) -> list[SegmentFilter] | None | Unset: if data is None: return data @@ -89,7 +119,21 @@ def _parse_segment_filters(data: object) -> list[SegmentFilter] | None | Unset: segment_filters = _parse_segment_filters(d.pop("segment_filters", UNSET)) - metric_settings_response = cls(scorers=scorers, segment_filters=segment_filters) + def _parse_settings_revision(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + settings_revision = _parse_settings_revision(d.pop("settings_revision", UNSET)) + + metric_settings_response = cls( + scorers=scorers, + expected_settings_revision=expected_settings_revision, + segment_filters=segment_filters, + settings_revision=settings_revision, + ) metric_settings_response.additional_properties = d return metric_settings_response diff --git a/src/splunk_ao/resources/models/node_name_filter_operator.py b/src/splunk_ao/resources/models/node_name_filter_operator.py index a90749e4..17f037b0 100644 --- a/src/splunk_ao/resources/models/node_name_filter_operator.py +++ b/src/splunk_ao/resources/models/node_name_filter_operator.py @@ -7,6 +7,7 @@ class NodeNameFilterOperator(str, Enum): NE = "ne" NOT_IN = "not_in" ONE_OF = "one_of" + REGEX = "regex" def __str__(self) -> str: return str(self.value) diff --git a/src/splunk_ao/resources/models/billing_usage_response.py b/src/splunk_ao/resources/models/non_luna_billing_usage_response.py similarity index 84% rename from src/splunk_ao/resources/models/billing_usage_response.py rename to src/splunk_ao/resources/models/non_luna_billing_usage_response.py index 3296e3cb..bfea3dc1 100644 --- a/src/splunk_ao/resources/models/billing_usage_response.py +++ b/src/splunk_ao/resources/models/non_luna_billing_usage_response.py @@ -6,39 +6,37 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..models.billing_usage_metric import BillingUsageMetric +from ..models.non_luna_billing_usage_response_metric import NonLunaBillingUsageResponseMetric from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.project_billing_usage import ProjectBillingUsage -T = TypeVar("T", bound="BillingUsageResponse") +T = TypeVar("T", bound="NonLunaBillingUsageResponse") @_attrs_define -class BillingUsageResponse: +class NonLunaBillingUsageResponse: """ Attributes: - metric (BillingUsageMetric): - total (int | Unset): Default: 0. + metric (NonLunaBillingUsageResponseMetric): projects (list[ProjectBillingUsage] | Unset): available (bool | Unset): Default: True. unavailable_reason (None | str | Unset): + total (int | Unset): Default: 0. """ - metric: BillingUsageMetric - total: int | Unset = 0 + metric: NonLunaBillingUsageResponseMetric projects: list[ProjectBillingUsage] | Unset = UNSET available: bool | Unset = True unavailable_reason: None | str | Unset = UNSET + total: int | Unset = 0 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: metric = self.metric.value - total = self.total - projects: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.projects, Unset): projects = [] @@ -54,17 +52,19 @@ def to_dict(self) -> dict[str, Any]: else: unavailable_reason = self.unavailable_reason + total = self.total + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"metric": metric}) - if total is not UNSET: - field_dict["total"] = total if projects is not UNSET: field_dict["projects"] = projects if available is not UNSET: field_dict["available"] = available if unavailable_reason is not UNSET: field_dict["unavailable_reason"] = unavailable_reason + if total is not UNSET: + field_dict["total"] = total return field_dict @@ -73,9 +73,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.project_billing_usage import ProjectBillingUsage d = dict(src_dict) - metric = BillingUsageMetric(d.pop("metric")) - - total = d.pop("total", UNSET) + metric = NonLunaBillingUsageResponseMetric(d.pop("metric")) _projects = d.pop("projects", UNSET) projects: list[ProjectBillingUsage] | Unset = UNSET @@ -97,12 +95,14 @@ def _parse_unavailable_reason(data: object) -> None | str | Unset: unavailable_reason = _parse_unavailable_reason(d.pop("unavailable_reason", UNSET)) - billing_usage_response = cls( - metric=metric, total=total, projects=projects, available=available, unavailable_reason=unavailable_reason + total = d.pop("total", UNSET) + + non_luna_billing_usage_response = cls( + metric=metric, projects=projects, available=available, unavailable_reason=unavailable_reason, total=total ) - billing_usage_response.additional_properties = d - return billing_usage_response + non_luna_billing_usage_response.additional_properties = d + return non_luna_billing_usage_response @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/non_luna_billing_usage_response_metric.py b/src/splunk_ao/resources/models/non_luna_billing_usage_response_metric.py new file mode 100644 index 00000000..b5daa473 --- /dev/null +++ b/src/splunk_ao/resources/models/non_luna_billing_usage_response_metric.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class NonLunaBillingUsageResponseMetric(str, Enum): + LUNA_FINE_TUNING_RUNS = "luna_fine_tuning_runs" + LUNA_TOKENS = "luna_tokens" + MONTHLY_ACTIVE_USERS = "monthly_active_users" + SPANS = "spans" + TOTAL_USERS = "total_users" + TRACES = "traces" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/organization_action.py b/src/splunk_ao/resources/models/organization_action.py index 5d65a22b..be4655a7 100644 --- a/src/splunk_ao/resources/models/organization_action.py +++ b/src/splunk_ao/resources/models/organization_action.py @@ -10,6 +10,7 @@ class OrganizationAction(str, Enum): READ_SETTINGS = "read_settings" READ_UNREDACTED_DATA = "read_unredacted_data" RENAME = "rename" + UPDATE_EVALUATOR_COST_CAP = "update_evaluator_cost_cap" UPDATE_SETTINGS = "update_settings" def __str__(self) -> str: diff --git a/src/splunk_ao/resources/models/partial_extended_agent_span_record.py b/src/splunk_ao/resources/models/partial_extended_agent_span_record.py deleted file mode 100644 index b1e1f104..00000000 --- a/src/splunk_ao/resources/models/partial_extended_agent_span_record.py +++ /dev/null @@ -1,1399 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.agent_type import AgentType -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.partial_extended_agent_span_record_annotation_aggregates import ( - PartialExtendedAgentSpanRecordAnnotationAggregates, - ) - from ..models.partial_extended_agent_span_record_annotation_agreement import ( - PartialExtendedAgentSpanRecordAnnotationAgreement, - ) - from ..models.partial_extended_agent_span_record_annotations import PartialExtendedAgentSpanRecordAnnotations - from ..models.partial_extended_agent_span_record_dataset_metadata import ( - PartialExtendedAgentSpanRecordDatasetMetadata, - ) - from ..models.partial_extended_agent_span_record_feedback_rating_info import ( - PartialExtendedAgentSpanRecordFeedbackRatingInfo, - ) - from ..models.partial_extended_agent_span_record_files_type_0 import PartialExtendedAgentSpanRecordFilesType0 - from ..models.partial_extended_agent_span_record_metric_info_type_0 import ( - PartialExtendedAgentSpanRecordMetricInfoType0, - ) - from ..models.partial_extended_agent_span_record_user_metadata import PartialExtendedAgentSpanRecordUserMetadata - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="PartialExtendedAgentSpanRecord") - - -@_attrs_define -class PartialExtendedAgentSpanRecord: - """ - Attributes: - type_ (Literal['agent'] | Unset): Type of the trace, span or session. Default: 'agent'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (PartialExtendedAgentSpanRecordUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (PartialExtendedAgentSpanRecordDatasetMetadata | Unset): Metadata from the dataset associated - with this trace - id (None | Unset | UUID): Galileo ID of the session, trace or span - session_id (None | Unset | UUID): Galileo ID of the session containing the trace (or the same value as id for a - trace) - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - project_id (None | Unset | UUID): Galileo ID of the project associated with this trace or span - run_id (None | Unset | UUID): Galileo ID of the run (log stream or experiment) associated with this trace or - span - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (PartialExtendedAgentSpanRecordFeedbackRatingInfo | Unset): Feedback information related to - the record - annotations (PartialExtendedAgentSpanRecordAnnotations | Unset): Annotations keyed by template ID and annotator - ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (PartialExtendedAgentSpanRecordAnnotationAggregates | Unset): Annotation aggregate - information keyed by template ID - annotation_agreement (PartialExtendedAgentSpanRecordAnnotationAgreement | Unset): Annotation agreement scores - keyed by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (None | PartialExtendedAgentSpanRecordMetricInfoType0 | Unset): Detailed information about the - metrics associated with this trace or span - files (None | PartialExtendedAgentSpanRecordFilesType0 | Unset): File metadata keyed by file ID for files - associated with this record - parent_id (None | Unset | UUID): Galileo ID of the parent of this span - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - agent_type (AgentType | Unset): - agent_name (None | str | Unset): Name of the agent. - """ - - type_: Literal["agent"] | Unset = "agent" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: PartialExtendedAgentSpanRecordUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: PartialExtendedAgentSpanRecordDatasetMetadata | Unset = UNSET - id: None | Unset | UUID = UNSET - session_id: None | Unset | UUID = UNSET - trace_id: None | str | Unset = UNSET - project_id: None | Unset | UUID = UNSET - run_id: None | Unset | UUID = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: PartialExtendedAgentSpanRecordFeedbackRatingInfo | Unset = UNSET - annotations: PartialExtendedAgentSpanRecordAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: PartialExtendedAgentSpanRecordAnnotationAggregates | Unset = UNSET - annotation_agreement: PartialExtendedAgentSpanRecordAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: None | PartialExtendedAgentSpanRecordMetricInfoType0 | Unset = UNSET - files: None | PartialExtendedAgentSpanRecordFilesType0 | Unset = UNSET - parent_id: None | Unset | UUID = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - agent_type: AgentType | Unset = UNSET - agent_name: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.message import Message - from ..models.partial_extended_agent_span_record_files_type_0 import PartialExtendedAgentSpanRecordFilesType0 - from ..models.partial_extended_agent_span_record_metric_info_type_0 import ( - PartialExtendedAgentSpanRecordMetricInfoType0, - ) - from ..models.text_content_part import TextContentPart - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - id: None | str | Unset - if isinstance(self.id, Unset): - id = UNSET - elif isinstance(self.id, UUID): - id = str(self.id) - else: - id = self.id - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - elif isinstance(self.session_id, UUID): - session_id = str(self.session_id) - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - project_id: None | str | Unset - if isinstance(self.project_id, Unset): - project_id = UNSET - elif isinstance(self.project_id, UUID): - project_id = str(self.project_id) - else: - project_id = self.project_id - - run_id: None | str | Unset - if isinstance(self.run_id, Unset): - run_id = UNSET - elif isinstance(self.run_id, UUID): - run_id = str(self.run_id) - else: - run_id = self.run_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, PartialExtendedAgentSpanRecordMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, PartialExtendedAgentSpanRecordFilesType0): - files = self.files.to_dict() - else: - files = self.files - - parent_id: None | str | Unset - if isinstance(self.parent_id, Unset): - parent_id = UNSET - elif isinstance(self.parent_id, UUID): - parent_id = str(self.parent_id) - else: - parent_id = self.parent_id - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - agent_type: str | Unset = UNSET - if not isinstance(self.agent_type, Unset): - agent_type = self.agent_type.value - - agent_name: None | str | Unset - if isinstance(self.agent_name, Unset): - agent_name = UNSET - else: - agent_name = self.agent_name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if id is not UNSET: - field_dict["id"] = id - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if project_id is not UNSET: - field_dict["project_id"] = project_id - if run_id is not UNSET: - field_dict["run_id"] = run_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if parent_id is not UNSET: - field_dict["parent_id"] = parent_id - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - if agent_type is not UNSET: - field_dict["agent_type"] = agent_type - if agent_name is not UNSET: - field_dict["agent_name"] = agent_name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.partial_extended_agent_span_record_annotation_aggregates import ( - PartialExtendedAgentSpanRecordAnnotationAggregates, - ) - from ..models.partial_extended_agent_span_record_annotation_agreement import ( - PartialExtendedAgentSpanRecordAnnotationAgreement, - ) - from ..models.partial_extended_agent_span_record_annotations import PartialExtendedAgentSpanRecordAnnotations - from ..models.partial_extended_agent_span_record_dataset_metadata import ( - PartialExtendedAgentSpanRecordDatasetMetadata, - ) - from ..models.partial_extended_agent_span_record_feedback_rating_info import ( - PartialExtendedAgentSpanRecordFeedbackRatingInfo, - ) - from ..models.partial_extended_agent_span_record_files_type_0 import PartialExtendedAgentSpanRecordFilesType0 - from ..models.partial_extended_agent_span_record_metric_info_type_0 import ( - PartialExtendedAgentSpanRecordMetricInfoType0, - ) - from ..models.partial_extended_agent_span_record_user_metadata import PartialExtendedAgentSpanRecordUserMetadata - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - type_ = cast(Literal["agent"] | Unset, d.pop("type", UNSET)) - if type_ != "agent" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'agent', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: PartialExtendedAgentSpanRecordUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = PartialExtendedAgentSpanRecordUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: PartialExtendedAgentSpanRecordDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = PartialExtendedAgentSpanRecordDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - id_type_0 = UUID(data) - - return id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - id = _parse_id(d.pop("id", UNSET)) - - def _parse_session_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - session_id_type_0 = UUID(data) - - return session_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_project_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - project_id_type_0 = UUID(data) - - return project_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - project_id = _parse_project_id(d.pop("project_id", UNSET)) - - def _parse_run_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - run_id_type_0 = UUID(data) - - return run_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - run_id = _parse_run_id(d.pop("run_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: PartialExtendedAgentSpanRecordFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = PartialExtendedAgentSpanRecordFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: PartialExtendedAgentSpanRecordAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = PartialExtendedAgentSpanRecordAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: PartialExtendedAgentSpanRecordAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = PartialExtendedAgentSpanRecordAnnotationAggregates.from_dict(_annotation_aggregates) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: PartialExtendedAgentSpanRecordAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = PartialExtendedAgentSpanRecordAnnotationAgreement.from_dict(_annotation_agreement) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> None | PartialExtendedAgentSpanRecordMetricInfoType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = PartialExtendedAgentSpanRecordMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(None | PartialExtendedAgentSpanRecordMetricInfoType0 | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> None | PartialExtendedAgentSpanRecordFilesType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - # Discriminator-aware parsing for Extended*Record types - if isinstance(data, dict) and "type" in data: - type_value = data.get("type") - - # Hardcoded discriminator mapping for Extended*Record types - if type_value == "trace": - try: - from ..models.extended_trace_record import ExtendedTraceRecord - - return ExtendedTraceRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "agent": - try: - from ..models.extended_agent_span_record import ExtendedAgentSpanRecord - - return ExtendedAgentSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "workflow": - try: - from ..models.extended_workflow_span_record import ExtendedWorkflowSpanRecord - - return ExtendedWorkflowSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "llm": - try: - from ..models.extended_llm_span_record import ExtendedLlmSpanRecord - - return ExtendedLlmSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "tool": - try: - from ..models.extended_tool_span_record import ExtendedToolSpanRecord - - return ExtendedToolSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "retriever": - try: - from ..models.extended_retriever_span_record import ExtendedRetrieverSpanRecord - - return ExtendedRetrieverSpanRecord.from_dict(data) - except: # noqa: E722 - pass - elif type_value == "session": - try: - from ..models.extended_session_record import ExtendedSessionRecord - - return ExtendedSessionRecord.from_dict(data) - except: # noqa: E722 - pass - - # Fallback to standard union parsing - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = PartialExtendedAgentSpanRecordFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(None | PartialExtendedAgentSpanRecordFilesType0 | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - def _parse_parent_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - parent_id_type_0 = UUID(data) - - return parent_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - parent_id = _parse_parent_id(d.pop("parent_id", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - _agent_type = d.pop("agent_type", UNSET) - agent_type: AgentType | Unset - if isinstance(_agent_type, Unset): - agent_type = UNSET - else: - agent_type = AgentType(_agent_type) - - def _parse_agent_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_name = _parse_agent_name(d.pop("agent_name", UNSET)) - - partial_extended_agent_span_record = cls( - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - id=id, - session_id=session_id, - trace_id=trace_id, - project_id=project_id, - run_id=run_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - parent_id=parent_id, - is_complete=is_complete, - step_number=step_number, - agent_type=agent_type, - agent_name=agent_name, - ) - - partial_extended_agent_span_record.additional_properties = d - return partial_extended_agent_span_record - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_agent_span_record_annotation_aggregates.py b/src/splunk_ao/resources/models/partial_extended_agent_span_record_annotation_aggregates.py deleted file mode 100644 index 27d4d3d0..00000000 --- a/src/splunk_ao/resources/models/partial_extended_agent_span_record_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="PartialExtendedAgentSpanRecordAnnotationAggregates") - - -@_attrs_define -class PartialExtendedAgentSpanRecordAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - partial_extended_agent_span_record_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_agent_span_record_annotation_aggregates.additional_properties = additional_properties - return partial_extended_agent_span_record_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_agent_span_record_annotation_agreement.py b/src/splunk_ao/resources/models/partial_extended_agent_span_record_annotation_agreement.py deleted file mode 100644 index 3e4d3eb9..00000000 --- a/src/splunk_ao/resources/models/partial_extended_agent_span_record_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedAgentSpanRecordAnnotationAgreement") - - -@_attrs_define -class PartialExtendedAgentSpanRecordAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_agent_span_record_annotation_agreement = cls() - - partial_extended_agent_span_record_annotation_agreement.additional_properties = d - return partial_extended_agent_span_record_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_agent_span_record_annotations.py b/src/splunk_ao/resources/models/partial_extended_agent_span_record_annotations.py deleted file mode 100644 index e0d8efd4..00000000 --- a/src/splunk_ao/resources/models/partial_extended_agent_span_record_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.partial_extended_agent_span_record_annotations_additional_property import ( - PartialExtendedAgentSpanRecordAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="PartialExtendedAgentSpanRecordAnnotations") - - -@_attrs_define -class PartialExtendedAgentSpanRecordAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, PartialExtendedAgentSpanRecordAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.partial_extended_agent_span_record_annotations_additional_property import ( - PartialExtendedAgentSpanRecordAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - partial_extended_agent_span_record_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = PartialExtendedAgentSpanRecordAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_agent_span_record_annotations.additional_properties = additional_properties - return partial_extended_agent_span_record_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> PartialExtendedAgentSpanRecordAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: PartialExtendedAgentSpanRecordAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_agent_span_record_annotations_additional_property.py b/src/splunk_ao/resources/models/partial_extended_agent_span_record_annotations_additional_property.py deleted file mode 100644 index 424e1fe2..00000000 --- a/src/splunk_ao/resources/models/partial_extended_agent_span_record_annotations_additional_property.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="PartialExtendedAgentSpanRecordAnnotationsAdditionalProperty") - - -@_attrs_define -class PartialExtendedAgentSpanRecordAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - partial_extended_agent_span_record_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_agent_span_record_annotations_additional_property.additional_properties = additional_properties - return partial_extended_agent_span_record_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_agent_span_record_dataset_metadata.py b/src/splunk_ao/resources/models/partial_extended_agent_span_record_dataset_metadata.py deleted file mode 100644 index 54a8bacb..00000000 --- a/src/splunk_ao/resources/models/partial_extended_agent_span_record_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedAgentSpanRecordDatasetMetadata") - - -@_attrs_define -class PartialExtendedAgentSpanRecordDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_agent_span_record_dataset_metadata = cls() - - partial_extended_agent_span_record_dataset_metadata.additional_properties = d - return partial_extended_agent_span_record_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_agent_span_record_feedback_rating_info.py b/src/splunk_ao/resources/models/partial_extended_agent_span_record_feedback_rating_info.py deleted file mode 100644 index 23fa7e55..00000000 --- a/src/splunk_ao/resources/models/partial_extended_agent_span_record_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="PartialExtendedAgentSpanRecordFeedbackRatingInfo") - - -@_attrs_define -class PartialExtendedAgentSpanRecordFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - partial_extended_agent_span_record_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_agent_span_record_feedback_rating_info.additional_properties = additional_properties - return partial_extended_agent_span_record_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_agent_span_record_files_type_0.py b/src/splunk_ao/resources/models/partial_extended_agent_span_record_files_type_0.py deleted file mode 100644 index 97b2f75b..00000000 --- a/src/splunk_ao/resources/models/partial_extended_agent_span_record_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="PartialExtendedAgentSpanRecordFilesType0") - - -@_attrs_define -class PartialExtendedAgentSpanRecordFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - partial_extended_agent_span_record_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_agent_span_record_files_type_0.additional_properties = additional_properties - return partial_extended_agent_span_record_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_agent_span_record_metric_info_type_0.py b/src/splunk_ao/resources/models/partial_extended_agent_span_record_metric_info_type_0.py deleted file mode 100644 index 148bc2ad..00000000 --- a/src/splunk_ao/resources/models/partial_extended_agent_span_record_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="PartialExtendedAgentSpanRecordMetricInfoType0") - - -@_attrs_define -class PartialExtendedAgentSpanRecordMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - partial_extended_agent_span_record_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_agent_span_record_metric_info_type_0.additional_properties = additional_properties - return partial_extended_agent_span_record_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_agent_span_record_user_metadata.py b/src/splunk_ao/resources/models/partial_extended_agent_span_record_user_metadata.py deleted file mode 100644 index fae74940..00000000 --- a/src/splunk_ao/resources/models/partial_extended_agent_span_record_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedAgentSpanRecordUserMetadata") - - -@_attrs_define -class PartialExtendedAgentSpanRecordUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_agent_span_record_user_metadata = cls() - - partial_extended_agent_span_record_user_metadata.additional_properties = d - return partial_extended_agent_span_record_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_control_span_record.py b/src/splunk_ao/resources/models/partial_extended_control_span_record.py deleted file mode 100644 index 17a1f091..00000000 --- a/src/splunk_ao/resources/models/partial_extended_control_span_record.py +++ /dev/null @@ -1,1250 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..models.control_applies_to import ControlAppliesTo -from ..models.control_check_stage import ControlCheckStage -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.partial_extended_control_span_record_annotation_aggregates import ( - PartialExtendedControlSpanRecordAnnotationAggregates, - ) - from ..models.partial_extended_control_span_record_annotation_agreement import ( - PartialExtendedControlSpanRecordAnnotationAgreement, - ) - from ..models.partial_extended_control_span_record_annotations import PartialExtendedControlSpanRecordAnnotations - from ..models.partial_extended_control_span_record_dataset_metadata import ( - PartialExtendedControlSpanRecordDatasetMetadata, - ) - from ..models.partial_extended_control_span_record_feedback_rating_info import ( - PartialExtendedControlSpanRecordFeedbackRatingInfo, - ) - from ..models.partial_extended_control_span_record_files_type_0 import PartialExtendedControlSpanRecordFilesType0 - from ..models.partial_extended_control_span_record_metric_info_type_0 import ( - PartialExtendedControlSpanRecordMetricInfoType0, - ) - from ..models.partial_extended_control_span_record_user_metadata import PartialExtendedControlSpanRecordUserMetadata - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="PartialExtendedControlSpanRecord") - - -@_attrs_define -class PartialExtendedControlSpanRecord: - """ - Attributes: - type_ (Literal['control'] | Unset): Type of the trace, span or session. Default: 'control'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | None | Unset): Output of the trace or span. - redacted_output (ControlResult | None | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (PartialExtendedControlSpanRecordUserMetadata | Unset): Metadata associated with this trace or - span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (PartialExtendedControlSpanRecordDatasetMetadata | Unset): Metadata from the dataset associated - with this trace - id (None | Unset | UUID): Galileo ID of the session, trace or span - session_id (None | Unset | UUID): Galileo ID of the session containing the trace (or the same value as id for a - trace) - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - project_id (None | Unset | UUID): Galileo ID of the project associated with this trace or span - run_id (None | Unset | UUID): Galileo ID of the run (log stream or experiment) associated with this trace or - span - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (PartialExtendedControlSpanRecordFeedbackRatingInfo | Unset): Feedback information related - to the record - annotations (PartialExtendedControlSpanRecordAnnotations | Unset): Annotations keyed by template ID and - annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (PartialExtendedControlSpanRecordAnnotationAggregates | Unset): Annotation aggregate - information keyed by template ID - annotation_agreement (PartialExtendedControlSpanRecordAnnotationAgreement | Unset): Annotation agreement scores - keyed by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (None | PartialExtendedControlSpanRecordMetricInfoType0 | Unset): Detailed information about the - metrics associated with this trace or span - files (None | PartialExtendedControlSpanRecordFilesType0 | Unset): File metadata keyed by file ID for files - associated with this record - parent_id (None | Unset | UUID): Galileo ID of the parent of this span - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - control_id (int | None | Unset): Identifier of the control definition that produced this span. - agent_name (None | str | Unset): Normalized agent name associated with this control execution. - check_stage (ControlCheckStage | None | Unset): Execution stage where the control ran, typically 'pre' or - 'post'. - applies_to (ControlAppliesTo | None | Unset): Parent execution type the control applied to, for example - 'llm_call' or 'tool_call'. - evaluator_name (None | str | Unset): Representative evaluator name for this control span. For composite - controls, this is the primary evaluator chosen for observability identity. - selector_path (None | str | Unset): Representative selector path for this control span. For composite controls, - this is the primary selector path chosen for observability identity. - """ - - type_: Literal["control"] | Unset = "control" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | None | Unset = UNSET - redacted_output: ControlResult | None | Unset = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: PartialExtendedControlSpanRecordUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: PartialExtendedControlSpanRecordDatasetMetadata | Unset = UNSET - id: None | Unset | UUID = UNSET - session_id: None | Unset | UUID = UNSET - trace_id: None | str | Unset = UNSET - project_id: None | Unset | UUID = UNSET - run_id: None | Unset | UUID = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: PartialExtendedControlSpanRecordFeedbackRatingInfo | Unset = UNSET - annotations: PartialExtendedControlSpanRecordAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: PartialExtendedControlSpanRecordAnnotationAggregates | Unset = UNSET - annotation_agreement: PartialExtendedControlSpanRecordAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: None | PartialExtendedControlSpanRecordMetricInfoType0 | Unset = UNSET - files: None | PartialExtendedControlSpanRecordFilesType0 | Unset = UNSET - parent_id: None | Unset | UUID = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - control_id: int | None | Unset = UNSET - agent_name: None | str | Unset = UNSET - check_stage: ControlCheckStage | None | Unset = UNSET - applies_to: ControlAppliesTo | None | Unset = UNSET - evaluator_name: None | str | Unset = UNSET - selector_path: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.partial_extended_control_span_record_files_type_0 import ( - PartialExtendedControlSpanRecordFilesType0, - ) - from ..models.partial_extended_control_span_record_metric_info_type_0 import ( - PartialExtendedControlSpanRecordMetricInfoType0, - ) - from ..models.text_content_part import TextContentPart - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | None | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | None | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - id: None | str | Unset - if isinstance(self.id, Unset): - id = UNSET - elif isinstance(self.id, UUID): - id = str(self.id) - else: - id = self.id - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - elif isinstance(self.session_id, UUID): - session_id = str(self.session_id) - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - project_id: None | str | Unset - if isinstance(self.project_id, Unset): - project_id = UNSET - elif isinstance(self.project_id, UUID): - project_id = str(self.project_id) - else: - project_id = self.project_id - - run_id: None | str | Unset - if isinstance(self.run_id, Unset): - run_id = UNSET - elif isinstance(self.run_id, UUID): - run_id = str(self.run_id) - else: - run_id = self.run_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, PartialExtendedControlSpanRecordMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, PartialExtendedControlSpanRecordFilesType0): - files = self.files.to_dict() - else: - files = self.files - - parent_id: None | str | Unset - if isinstance(self.parent_id, Unset): - parent_id = UNSET - elif isinstance(self.parent_id, UUID): - parent_id = str(self.parent_id) - else: - parent_id = self.parent_id - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - control_id: int | None | Unset - if isinstance(self.control_id, Unset): - control_id = UNSET - else: - control_id = self.control_id - - agent_name: None | str | Unset - if isinstance(self.agent_name, Unset): - agent_name = UNSET - else: - agent_name = self.agent_name - - check_stage: None | str | Unset - if isinstance(self.check_stage, Unset): - check_stage = UNSET - elif isinstance(self.check_stage, ControlCheckStage): - check_stage = self.check_stage.value - else: - check_stage = self.check_stage - - applies_to: None | str | Unset - if isinstance(self.applies_to, Unset): - applies_to = UNSET - elif isinstance(self.applies_to, ControlAppliesTo): - applies_to = self.applies_to.value - else: - applies_to = self.applies_to - - evaluator_name: None | str | Unset - if isinstance(self.evaluator_name, Unset): - evaluator_name = UNSET - else: - evaluator_name = self.evaluator_name - - selector_path: None | str | Unset - if isinstance(self.selector_path, Unset): - selector_path = UNSET - else: - selector_path = self.selector_path - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if id is not UNSET: - field_dict["id"] = id - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if project_id is not UNSET: - field_dict["project_id"] = project_id - if run_id is not UNSET: - field_dict["run_id"] = run_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if parent_id is not UNSET: - field_dict["parent_id"] = parent_id - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - if control_id is not UNSET: - field_dict["control_id"] = control_id - if agent_name is not UNSET: - field_dict["agent_name"] = agent_name - if check_stage is not UNSET: - field_dict["check_stage"] = check_stage - if applies_to is not UNSET: - field_dict["applies_to"] = applies_to - if evaluator_name is not UNSET: - field_dict["evaluator_name"] = evaluator_name - if selector_path is not UNSET: - field_dict["selector_path"] = selector_path - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.partial_extended_control_span_record_annotation_aggregates import ( - PartialExtendedControlSpanRecordAnnotationAggregates, - ) - from ..models.partial_extended_control_span_record_annotation_agreement import ( - PartialExtendedControlSpanRecordAnnotationAgreement, - ) - from ..models.partial_extended_control_span_record_annotations import ( - PartialExtendedControlSpanRecordAnnotations, - ) - from ..models.partial_extended_control_span_record_dataset_metadata import ( - PartialExtendedControlSpanRecordDatasetMetadata, - ) - from ..models.partial_extended_control_span_record_feedback_rating_info import ( - PartialExtendedControlSpanRecordFeedbackRatingInfo, - ) - from ..models.partial_extended_control_span_record_files_type_0 import ( - PartialExtendedControlSpanRecordFilesType0, - ) - from ..models.partial_extended_control_span_record_metric_info_type_0 import ( - PartialExtendedControlSpanRecordMetricInfoType0, - ) - from ..models.partial_extended_control_span_record_user_metadata import ( - PartialExtendedControlSpanRecordUserMetadata, - ) - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - type_ = cast(Literal["control"] | Unset, d.pop("type", UNSET)) - if type_ != "control" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'control', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output(data: object) -> ControlResult | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_0 = ControlResult.from_dict(data) - - return output_type_0 - except: # noqa: E722 - pass - return cast(ControlResult | None | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output(data: object) -> ControlResult | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_0 = ControlResult.from_dict(data) - - return redacted_output_type_0 - except: # noqa: E722 - pass - return cast(ControlResult | None | Unset, data) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: PartialExtendedControlSpanRecordUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = PartialExtendedControlSpanRecordUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: PartialExtendedControlSpanRecordDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = PartialExtendedControlSpanRecordDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - id_type_0 = UUID(data) - - return id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - id = _parse_id(d.pop("id", UNSET)) - - def _parse_session_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - session_id_type_0 = UUID(data) - - return session_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_project_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - project_id_type_0 = UUID(data) - - return project_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - project_id = _parse_project_id(d.pop("project_id", UNSET)) - - def _parse_run_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - run_id_type_0 = UUID(data) - - return run_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - run_id = _parse_run_id(d.pop("run_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: PartialExtendedControlSpanRecordFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = PartialExtendedControlSpanRecordFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: PartialExtendedControlSpanRecordAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = PartialExtendedControlSpanRecordAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: PartialExtendedControlSpanRecordAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = PartialExtendedControlSpanRecordAnnotationAggregates.from_dict( - _annotation_aggregates - ) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: PartialExtendedControlSpanRecordAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = PartialExtendedControlSpanRecordAnnotationAgreement.from_dict(_annotation_agreement) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> None | PartialExtendedControlSpanRecordMetricInfoType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = PartialExtendedControlSpanRecordMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(None | PartialExtendedControlSpanRecordMetricInfoType0 | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> None | PartialExtendedControlSpanRecordFilesType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = PartialExtendedControlSpanRecordFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(None | PartialExtendedControlSpanRecordFilesType0 | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - def _parse_parent_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - parent_id_type_0 = UUID(data) - - return parent_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - parent_id = _parse_parent_id(d.pop("parent_id", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - def _parse_control_id(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - control_id = _parse_control_id(d.pop("control_id", UNSET)) - - def _parse_agent_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_name = _parse_agent_name(d.pop("agent_name", UNSET)) - - def _parse_check_stage(data: object) -> ControlCheckStage | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - check_stage_type_0 = ControlCheckStage(data) - - return check_stage_type_0 - except: # noqa: E722 - pass - return cast(ControlCheckStage | None | Unset, data) - - check_stage = _parse_check_stage(d.pop("check_stage", UNSET)) - - def _parse_applies_to(data: object) -> ControlAppliesTo | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - applies_to_type_0 = ControlAppliesTo(data) - - return applies_to_type_0 - except: # noqa: E722 - pass - return cast(ControlAppliesTo | None | Unset, data) - - applies_to = _parse_applies_to(d.pop("applies_to", UNSET)) - - def _parse_evaluator_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - evaluator_name = _parse_evaluator_name(d.pop("evaluator_name", UNSET)) - - def _parse_selector_path(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - selector_path = _parse_selector_path(d.pop("selector_path", UNSET)) - - partial_extended_control_span_record = cls( - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - id=id, - session_id=session_id, - trace_id=trace_id, - project_id=project_id, - run_id=run_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - parent_id=parent_id, - is_complete=is_complete, - step_number=step_number, - control_id=control_id, - agent_name=agent_name, - check_stage=check_stage, - applies_to=applies_to, - evaluator_name=evaluator_name, - selector_path=selector_path, - ) - - partial_extended_control_span_record.additional_properties = d - return partial_extended_control_span_record - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_control_span_record_annotation_aggregates.py b/src/splunk_ao/resources/models/partial_extended_control_span_record_annotation_aggregates.py deleted file mode 100644 index d4285853..00000000 --- a/src/splunk_ao/resources/models/partial_extended_control_span_record_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="PartialExtendedControlSpanRecordAnnotationAggregates") - - -@_attrs_define -class PartialExtendedControlSpanRecordAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - partial_extended_control_span_record_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_control_span_record_annotation_aggregates.additional_properties = additional_properties - return partial_extended_control_span_record_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_control_span_record_annotation_agreement.py b/src/splunk_ao/resources/models/partial_extended_control_span_record_annotation_agreement.py deleted file mode 100644 index f591a094..00000000 --- a/src/splunk_ao/resources/models/partial_extended_control_span_record_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedControlSpanRecordAnnotationAgreement") - - -@_attrs_define -class PartialExtendedControlSpanRecordAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_control_span_record_annotation_agreement = cls() - - partial_extended_control_span_record_annotation_agreement.additional_properties = d - return partial_extended_control_span_record_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_control_span_record_annotations.py b/src/splunk_ao/resources/models/partial_extended_control_span_record_annotations.py deleted file mode 100644 index 10624464..00000000 --- a/src/splunk_ao/resources/models/partial_extended_control_span_record_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.partial_extended_control_span_record_annotations_additional_property import ( - PartialExtendedControlSpanRecordAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="PartialExtendedControlSpanRecordAnnotations") - - -@_attrs_define -class PartialExtendedControlSpanRecordAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, PartialExtendedControlSpanRecordAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.partial_extended_control_span_record_annotations_additional_property import ( - PartialExtendedControlSpanRecordAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - partial_extended_control_span_record_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = PartialExtendedControlSpanRecordAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_control_span_record_annotations.additional_properties = additional_properties - return partial_extended_control_span_record_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> PartialExtendedControlSpanRecordAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: PartialExtendedControlSpanRecordAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_control_span_record_annotations_additional_property.py b/src/splunk_ao/resources/models/partial_extended_control_span_record_annotations_additional_property.py deleted file mode 100644 index 9ea922e4..00000000 --- a/src/splunk_ao/resources/models/partial_extended_control_span_record_annotations_additional_property.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="PartialExtendedControlSpanRecordAnnotationsAdditionalProperty") - - -@_attrs_define -class PartialExtendedControlSpanRecordAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - partial_extended_control_span_record_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_control_span_record_annotations_additional_property.additional_properties = ( - additional_properties - ) - return partial_extended_control_span_record_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_control_span_record_dataset_metadata.py b/src/splunk_ao/resources/models/partial_extended_control_span_record_dataset_metadata.py deleted file mode 100644 index cfaf1a1a..00000000 --- a/src/splunk_ao/resources/models/partial_extended_control_span_record_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedControlSpanRecordDatasetMetadata") - - -@_attrs_define -class PartialExtendedControlSpanRecordDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_control_span_record_dataset_metadata = cls() - - partial_extended_control_span_record_dataset_metadata.additional_properties = d - return partial_extended_control_span_record_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_control_span_record_feedback_rating_info.py b/src/splunk_ao/resources/models/partial_extended_control_span_record_feedback_rating_info.py deleted file mode 100644 index dc9a1447..00000000 --- a/src/splunk_ao/resources/models/partial_extended_control_span_record_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="PartialExtendedControlSpanRecordFeedbackRatingInfo") - - -@_attrs_define -class PartialExtendedControlSpanRecordFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - partial_extended_control_span_record_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_control_span_record_feedback_rating_info.additional_properties = additional_properties - return partial_extended_control_span_record_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_control_span_record_files_type_0.py b/src/splunk_ao/resources/models/partial_extended_control_span_record_files_type_0.py deleted file mode 100644 index 9253f17c..00000000 --- a/src/splunk_ao/resources/models/partial_extended_control_span_record_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="PartialExtendedControlSpanRecordFilesType0") - - -@_attrs_define -class PartialExtendedControlSpanRecordFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - partial_extended_control_span_record_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_control_span_record_files_type_0.additional_properties = additional_properties - return partial_extended_control_span_record_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_control_span_record_metric_info_type_0.py b/src/splunk_ao/resources/models/partial_extended_control_span_record_metric_info_type_0.py deleted file mode 100644 index fc7e9075..00000000 --- a/src/splunk_ao/resources/models/partial_extended_control_span_record_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="PartialExtendedControlSpanRecordMetricInfoType0") - - -@_attrs_define -class PartialExtendedControlSpanRecordMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - partial_extended_control_span_record_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_control_span_record_metric_info_type_0.additional_properties = additional_properties - return partial_extended_control_span_record_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_control_span_record_user_metadata.py b/src/splunk_ao/resources/models/partial_extended_control_span_record_user_metadata.py deleted file mode 100644 index ff18ceab..00000000 --- a/src/splunk_ao/resources/models/partial_extended_control_span_record_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedControlSpanRecordUserMetadata") - - -@_attrs_define -class PartialExtendedControlSpanRecordUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_control_span_record_user_metadata = cls() - - partial_extended_control_span_record_user_metadata.additional_properties = d - return partial_extended_control_span_record_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_http_span_record.py b/src/splunk_ao/resources/models/partial_extended_http_span_record.py deleted file mode 100644 index ab0e2e30..00000000 --- a/src/splunk_ao/resources/models/partial_extended_http_span_record.py +++ /dev/null @@ -1,1248 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.partial_extended_http_span_record_annotation_aggregates import ( - PartialExtendedHttpSpanRecordAnnotationAggregates, - ) - from ..models.partial_extended_http_span_record_annotation_agreement import ( - PartialExtendedHttpSpanRecordAnnotationAgreement, - ) - from ..models.partial_extended_http_span_record_annotations import PartialExtendedHttpSpanRecordAnnotations - from ..models.partial_extended_http_span_record_dataset_metadata import PartialExtendedHttpSpanRecordDatasetMetadata - from ..models.partial_extended_http_span_record_feedback_rating_info import ( - PartialExtendedHttpSpanRecordFeedbackRatingInfo, - ) - from ..models.partial_extended_http_span_record_files_type_0 import PartialExtendedHttpSpanRecordFilesType0 - from ..models.partial_extended_http_span_record_metric_info_type_0 import ( - PartialExtendedHttpSpanRecordMetricInfoType0, - ) - from ..models.partial_extended_http_span_record_user_metadata import PartialExtendedHttpSpanRecordUserMetadata - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="PartialExtendedHttpSpanRecord") - - -@_attrs_define -class PartialExtendedHttpSpanRecord: - """ - Attributes: - type_ (Literal['http'] | Unset): Type of the trace, span or session. Default: 'http'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (PartialExtendedHttpSpanRecordUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (PartialExtendedHttpSpanRecordDatasetMetadata | Unset): Metadata from the dataset associated - with this trace - id (None | Unset | UUID): Galileo ID of the session, trace or span - session_id (None | Unset | UUID): Galileo ID of the session containing the trace (or the same value as id for a - trace) - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - project_id (None | Unset | UUID): Galileo ID of the project associated with this trace or span - run_id (None | Unset | UUID): Galileo ID of the run (log stream or experiment) associated with this trace or - span - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (PartialExtendedHttpSpanRecordFeedbackRatingInfo | Unset): Feedback information related to - the record - annotations (PartialExtendedHttpSpanRecordAnnotations | Unset): Annotations keyed by template ID and annotator - ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (PartialExtendedHttpSpanRecordAnnotationAggregates | Unset): Annotation aggregate - information keyed by template ID - annotation_agreement (PartialExtendedHttpSpanRecordAnnotationAgreement | Unset): Annotation agreement scores - keyed by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (None | PartialExtendedHttpSpanRecordMetricInfoType0 | Unset): Detailed information about the - metrics associated with this trace or span - files (None | PartialExtendedHttpSpanRecordFilesType0 | Unset): File metadata keyed by file ID for files - associated with this record - parent_id (None | Unset | UUID): Galileo ID of the parent of this span - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - """ - - type_: Literal["http"] | Unset = "http" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: PartialExtendedHttpSpanRecordUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: PartialExtendedHttpSpanRecordDatasetMetadata | Unset = UNSET - id: None | Unset | UUID = UNSET - session_id: None | Unset | UUID = UNSET - trace_id: None | str | Unset = UNSET - project_id: None | Unset | UUID = UNSET - run_id: None | Unset | UUID = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: PartialExtendedHttpSpanRecordFeedbackRatingInfo | Unset = UNSET - annotations: PartialExtendedHttpSpanRecordAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: PartialExtendedHttpSpanRecordAnnotationAggregates | Unset = UNSET - annotation_agreement: PartialExtendedHttpSpanRecordAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: None | PartialExtendedHttpSpanRecordMetricInfoType0 | Unset = UNSET - files: None | PartialExtendedHttpSpanRecordFilesType0 | Unset = UNSET - parent_id: None | Unset | UUID = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.message import Message - from ..models.partial_extended_http_span_record_files_type_0 import PartialExtendedHttpSpanRecordFilesType0 - from ..models.partial_extended_http_span_record_metric_info_type_0 import ( - PartialExtendedHttpSpanRecordMetricInfoType0, - ) - from ..models.text_content_part import TextContentPart - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - id: None | str | Unset - if isinstance(self.id, Unset): - id = UNSET - elif isinstance(self.id, UUID): - id = str(self.id) - else: - id = self.id - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - elif isinstance(self.session_id, UUID): - session_id = str(self.session_id) - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - project_id: None | str | Unset - if isinstance(self.project_id, Unset): - project_id = UNSET - elif isinstance(self.project_id, UUID): - project_id = str(self.project_id) - else: - project_id = self.project_id - - run_id: None | str | Unset - if isinstance(self.run_id, Unset): - run_id = UNSET - elif isinstance(self.run_id, UUID): - run_id = str(self.run_id) - else: - run_id = self.run_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, PartialExtendedHttpSpanRecordMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, PartialExtendedHttpSpanRecordFilesType0): - files = self.files.to_dict() - else: - files = self.files - - parent_id: None | str | Unset - if isinstance(self.parent_id, Unset): - parent_id = UNSET - elif isinstance(self.parent_id, UUID): - parent_id = str(self.parent_id) - else: - parent_id = self.parent_id - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if id is not UNSET: - field_dict["id"] = id - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if project_id is not UNSET: - field_dict["project_id"] = project_id - if run_id is not UNSET: - field_dict["run_id"] = run_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if parent_id is not UNSET: - field_dict["parent_id"] = parent_id - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.partial_extended_http_span_record_annotation_aggregates import ( - PartialExtendedHttpSpanRecordAnnotationAggregates, - ) - from ..models.partial_extended_http_span_record_annotation_agreement import ( - PartialExtendedHttpSpanRecordAnnotationAgreement, - ) - from ..models.partial_extended_http_span_record_annotations import PartialExtendedHttpSpanRecordAnnotations - from ..models.partial_extended_http_span_record_dataset_metadata import ( - PartialExtendedHttpSpanRecordDatasetMetadata, - ) - from ..models.partial_extended_http_span_record_feedback_rating_info import ( - PartialExtendedHttpSpanRecordFeedbackRatingInfo, - ) - from ..models.partial_extended_http_span_record_files_type_0 import PartialExtendedHttpSpanRecordFilesType0 - from ..models.partial_extended_http_span_record_metric_info_type_0 import ( - PartialExtendedHttpSpanRecordMetricInfoType0, - ) - from ..models.partial_extended_http_span_record_user_metadata import PartialExtendedHttpSpanRecordUserMetadata - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - type_ = cast(Literal["http"] | Unset, d.pop("type", UNSET)) - if type_ != "http" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'http', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: PartialExtendedHttpSpanRecordUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = PartialExtendedHttpSpanRecordUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: PartialExtendedHttpSpanRecordDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = PartialExtendedHttpSpanRecordDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - id_type_0 = UUID(data) - - return id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - id = _parse_id(d.pop("id", UNSET)) - - def _parse_session_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - session_id_type_0 = UUID(data) - - return session_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_project_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - project_id_type_0 = UUID(data) - - return project_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - project_id = _parse_project_id(d.pop("project_id", UNSET)) - - def _parse_run_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - run_id_type_0 = UUID(data) - - return run_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - run_id = _parse_run_id(d.pop("run_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: PartialExtendedHttpSpanRecordFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = PartialExtendedHttpSpanRecordFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: PartialExtendedHttpSpanRecordAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = PartialExtendedHttpSpanRecordAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: PartialExtendedHttpSpanRecordAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = PartialExtendedHttpSpanRecordAnnotationAggregates.from_dict(_annotation_aggregates) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: PartialExtendedHttpSpanRecordAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = PartialExtendedHttpSpanRecordAnnotationAgreement.from_dict(_annotation_agreement) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> None | PartialExtendedHttpSpanRecordMetricInfoType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = PartialExtendedHttpSpanRecordMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(None | PartialExtendedHttpSpanRecordMetricInfoType0 | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> None | PartialExtendedHttpSpanRecordFilesType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = PartialExtendedHttpSpanRecordFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(None | PartialExtendedHttpSpanRecordFilesType0 | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - def _parse_parent_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - parent_id_type_0 = UUID(data) - - return parent_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - parent_id = _parse_parent_id(d.pop("parent_id", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - partial_extended_http_span_record = cls( - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - id=id, - session_id=session_id, - trace_id=trace_id, - project_id=project_id, - run_id=run_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - parent_id=parent_id, - is_complete=is_complete, - step_number=step_number, - ) - - partial_extended_http_span_record.additional_properties = d - return partial_extended_http_span_record - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_http_span_record_annotation_aggregates.py b/src/splunk_ao/resources/models/partial_extended_http_span_record_annotation_aggregates.py deleted file mode 100644 index 9c50ea2e..00000000 --- a/src/splunk_ao/resources/models/partial_extended_http_span_record_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="PartialExtendedHttpSpanRecordAnnotationAggregates") - - -@_attrs_define -class PartialExtendedHttpSpanRecordAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - partial_extended_http_span_record_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_http_span_record_annotation_aggregates.additional_properties = additional_properties - return partial_extended_http_span_record_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_http_span_record_annotation_agreement.py b/src/splunk_ao/resources/models/partial_extended_http_span_record_annotation_agreement.py deleted file mode 100644 index 19085681..00000000 --- a/src/splunk_ao/resources/models/partial_extended_http_span_record_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedHttpSpanRecordAnnotationAgreement") - - -@_attrs_define -class PartialExtendedHttpSpanRecordAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_http_span_record_annotation_agreement = cls() - - partial_extended_http_span_record_annotation_agreement.additional_properties = d - return partial_extended_http_span_record_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_http_span_record_annotations.py b/src/splunk_ao/resources/models/partial_extended_http_span_record_annotations.py deleted file mode 100644 index d89ce2c7..00000000 --- a/src/splunk_ao/resources/models/partial_extended_http_span_record_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.partial_extended_http_span_record_annotations_additional_property import ( - PartialExtendedHttpSpanRecordAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="PartialExtendedHttpSpanRecordAnnotations") - - -@_attrs_define -class PartialExtendedHttpSpanRecordAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, PartialExtendedHttpSpanRecordAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.partial_extended_http_span_record_annotations_additional_property import ( - PartialExtendedHttpSpanRecordAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - partial_extended_http_span_record_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = PartialExtendedHttpSpanRecordAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_http_span_record_annotations.additional_properties = additional_properties - return partial_extended_http_span_record_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> PartialExtendedHttpSpanRecordAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: PartialExtendedHttpSpanRecordAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_http_span_record_annotations_additional_property.py b/src/splunk_ao/resources/models/partial_extended_http_span_record_annotations_additional_property.py deleted file mode 100644 index b628e030..00000000 --- a/src/splunk_ao/resources/models/partial_extended_http_span_record_annotations_additional_property.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="PartialExtendedHttpSpanRecordAnnotationsAdditionalProperty") - - -@_attrs_define -class PartialExtendedHttpSpanRecordAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - partial_extended_http_span_record_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_http_span_record_annotations_additional_property.additional_properties = additional_properties - return partial_extended_http_span_record_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_http_span_record_dataset_metadata.py b/src/splunk_ao/resources/models/partial_extended_http_span_record_dataset_metadata.py deleted file mode 100644 index ccaef132..00000000 --- a/src/splunk_ao/resources/models/partial_extended_http_span_record_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedHttpSpanRecordDatasetMetadata") - - -@_attrs_define -class PartialExtendedHttpSpanRecordDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_http_span_record_dataset_metadata = cls() - - partial_extended_http_span_record_dataset_metadata.additional_properties = d - return partial_extended_http_span_record_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_http_span_record_feedback_rating_info.py b/src/splunk_ao/resources/models/partial_extended_http_span_record_feedback_rating_info.py deleted file mode 100644 index e11789e8..00000000 --- a/src/splunk_ao/resources/models/partial_extended_http_span_record_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="PartialExtendedHttpSpanRecordFeedbackRatingInfo") - - -@_attrs_define -class PartialExtendedHttpSpanRecordFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - partial_extended_http_span_record_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_http_span_record_feedback_rating_info.additional_properties = additional_properties - return partial_extended_http_span_record_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_http_span_record_files_type_0.py b/src/splunk_ao/resources/models/partial_extended_http_span_record_files_type_0.py deleted file mode 100644 index ab2193fe..00000000 --- a/src/splunk_ao/resources/models/partial_extended_http_span_record_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="PartialExtendedHttpSpanRecordFilesType0") - - -@_attrs_define -class PartialExtendedHttpSpanRecordFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - partial_extended_http_span_record_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_http_span_record_files_type_0.additional_properties = additional_properties - return partial_extended_http_span_record_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_http_span_record_metric_info_type_0.py b/src/splunk_ao/resources/models/partial_extended_http_span_record_metric_info_type_0.py deleted file mode 100644 index f62d29a5..00000000 --- a/src/splunk_ao/resources/models/partial_extended_http_span_record_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="PartialExtendedHttpSpanRecordMetricInfoType0") - - -@_attrs_define -class PartialExtendedHttpSpanRecordMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - partial_extended_http_span_record_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_http_span_record_metric_info_type_0.additional_properties = additional_properties - return partial_extended_http_span_record_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_http_span_record_user_metadata.py b/src/splunk_ao/resources/models/partial_extended_http_span_record_user_metadata.py deleted file mode 100644 index fc30e382..00000000 --- a/src/splunk_ao/resources/models/partial_extended_http_span_record_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedHttpSpanRecordUserMetadata") - - -@_attrs_define -class PartialExtendedHttpSpanRecordUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_http_span_record_user_metadata = cls() - - partial_extended_http_span_record_user_metadata.additional_properties = d - return partial_extended_http_span_record_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_llm_span_record.py b/src/splunk_ao/resources/models/partial_extended_llm_span_record.py deleted file mode 100644 index 7a810d12..00000000 --- a/src/splunk_ao/resources/models/partial_extended_llm_span_record.py +++ /dev/null @@ -1,1289 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.image_generation_event import ImageGenerationEvent - from ..models.internal_tool_call import InternalToolCall - from ..models.llm_metrics import LlmMetrics - from ..models.mcp_approval_request_event import MCPApprovalRequestEvent - from ..models.mcp_call_event import MCPCallEvent - from ..models.mcp_list_tools_event import MCPListToolsEvent - from ..models.message import Message - from ..models.message_event import MessageEvent - from ..models.partial_extended_llm_span_record_annotation_aggregates import ( - PartialExtendedLlmSpanRecordAnnotationAggregates, - ) - from ..models.partial_extended_llm_span_record_annotation_agreement import ( - PartialExtendedLlmSpanRecordAnnotationAgreement, - ) - from ..models.partial_extended_llm_span_record_annotations import PartialExtendedLlmSpanRecordAnnotations - from ..models.partial_extended_llm_span_record_dataset_metadata import PartialExtendedLlmSpanRecordDatasetMetadata - from ..models.partial_extended_llm_span_record_feedback_rating_info import ( - PartialExtendedLlmSpanRecordFeedbackRatingInfo, - ) - from ..models.partial_extended_llm_span_record_files_type_0 import PartialExtendedLlmSpanRecordFilesType0 - from ..models.partial_extended_llm_span_record_metric_info_type_0 import PartialExtendedLlmSpanRecordMetricInfoType0 - from ..models.partial_extended_llm_span_record_tools_type_0_item import PartialExtendedLlmSpanRecordToolsType0Item - from ..models.partial_extended_llm_span_record_user_metadata import PartialExtendedLlmSpanRecordUserMetadata - from ..models.reasoning_event import ReasoningEvent - from ..models.web_search_call_event import WebSearchCallEvent - - -T = TypeVar("T", bound="PartialExtendedLlmSpanRecord") - - -@_attrs_define -class PartialExtendedLlmSpanRecord: - """ - Attributes: - type_ (Literal['llm'] | Unset): Type of the trace, span or session. Default: 'llm'. - input_ (list[Message] | Unset): Input to the trace or span. - redacted_input (list[Message] | None | Unset): Redacted input of the trace or span. - output (Message | Unset): - redacted_output (Message | None | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (PartialExtendedLlmSpanRecordUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (LlmMetrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (PartialExtendedLlmSpanRecordDatasetMetadata | Unset): Metadata from the dataset associated - with this trace - id (None | Unset | UUID): Galileo ID of the session, trace or span - session_id (None | Unset | UUID): Galileo ID of the session containing the trace (or the same value as id for a - trace) - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - project_id (None | Unset | UUID): Galileo ID of the project associated with this trace or span - run_id (None | Unset | UUID): Galileo ID of the run (log stream or experiment) associated with this trace or - span - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (PartialExtendedLlmSpanRecordFeedbackRatingInfo | Unset): Feedback information related to - the record - annotations (PartialExtendedLlmSpanRecordAnnotations | Unset): Annotations keyed by template ID and annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (PartialExtendedLlmSpanRecordAnnotationAggregates | Unset): Annotation aggregate - information keyed by template ID - annotation_agreement (PartialExtendedLlmSpanRecordAnnotationAgreement | Unset): Annotation agreement scores - keyed by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (None | PartialExtendedLlmSpanRecordMetricInfoType0 | Unset): Detailed information about the metrics - associated with this trace or span - files (None | PartialExtendedLlmSpanRecordFilesType0 | Unset): File metadata keyed by file ID for files - associated with this record - parent_id (None | Unset | UUID): Galileo ID of the parent of this span - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - tools (list[PartialExtendedLlmSpanRecordToolsType0Item] | None | Unset): List of available tools passed to the - LLM on invocation. - events (list[ImageGenerationEvent | InternalToolCall | MCPApprovalRequestEvent | MCPCallEvent | - MCPListToolsEvent | MessageEvent | ReasoningEvent | WebSearchCallEvent] | None | Unset): List of reasoning, - internal tool call, or MCP events that occurred during the LLM span. - model (None | str | Unset): Model used for this span. - provider (None | str | Unset): Provider used for this span. - temperature (float | None | Unset): Temperature used for generation. - finish_reason (None | str | Unset): Reason for finishing. - """ - - type_: Literal["llm"] | Unset = "llm" - input_: list[Message] | Unset = UNSET - redacted_input: list[Message] | None | Unset = UNSET - output: Message | Unset = UNSET - redacted_output: Message | None | Unset = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: PartialExtendedLlmSpanRecordUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: LlmMetrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: PartialExtendedLlmSpanRecordDatasetMetadata | Unset = UNSET - id: None | Unset | UUID = UNSET - session_id: None | Unset | UUID = UNSET - trace_id: None | str | Unset = UNSET - project_id: None | Unset | UUID = UNSET - run_id: None | Unset | UUID = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: PartialExtendedLlmSpanRecordFeedbackRatingInfo | Unset = UNSET - annotations: PartialExtendedLlmSpanRecordAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: PartialExtendedLlmSpanRecordAnnotationAggregates | Unset = UNSET - annotation_agreement: PartialExtendedLlmSpanRecordAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: None | PartialExtendedLlmSpanRecordMetricInfoType0 | Unset = UNSET - files: None | PartialExtendedLlmSpanRecordFilesType0 | Unset = UNSET - parent_id: None | Unset | UUID = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - tools: list[PartialExtendedLlmSpanRecordToolsType0Item] | None | Unset = UNSET - events: ( - list[ - ImageGenerationEvent - | InternalToolCall - | MCPApprovalRequestEvent - | MCPCallEvent - | MCPListToolsEvent - | MessageEvent - | ReasoningEvent - | WebSearchCallEvent - ] - | None - | Unset - ) = UNSET - model: None | str | Unset = UNSET - provider: None | str | Unset = UNSET - temperature: float | None | Unset = UNSET - finish_reason: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.image_generation_event import ImageGenerationEvent - from ..models.internal_tool_call import InternalToolCall - from ..models.mcp_call_event import MCPCallEvent - from ..models.mcp_list_tools_event import MCPListToolsEvent - from ..models.message import Message - from ..models.message_event import MessageEvent - from ..models.partial_extended_llm_span_record_files_type_0 import PartialExtendedLlmSpanRecordFilesType0 - from ..models.partial_extended_llm_span_record_metric_info_type_0 import ( - PartialExtendedLlmSpanRecordMetricInfoType0, - ) - from ..models.reasoning_event import ReasoningEvent - from ..models.web_search_call_event import WebSearchCallEvent - - type_ = self.type_ - - input_: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.input_, Unset): - input_ = [] - for input_item_data in self.input_: - input_item = input_item_data.to_dict() - input_.append(input_item) - - redacted_input: list[dict[str, Any]] | None | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_0_item_data in self.redacted_input: - redacted_input_type_0_item = redacted_input_type_0_item_data.to_dict() - redacted_input.append(redacted_input_type_0_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | Unset = UNSET - if not isinstance(self.output, Unset): - output = self.output.to_dict() - - redacted_output: dict[str, Any] | None | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - id: None | str | Unset - if isinstance(self.id, Unset): - id = UNSET - elif isinstance(self.id, UUID): - id = str(self.id) - else: - id = self.id - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - elif isinstance(self.session_id, UUID): - session_id = str(self.session_id) - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - project_id: None | str | Unset - if isinstance(self.project_id, Unset): - project_id = UNSET - elif isinstance(self.project_id, UUID): - project_id = str(self.project_id) - else: - project_id = self.project_id - - run_id: None | str | Unset - if isinstance(self.run_id, Unset): - run_id = UNSET - elif isinstance(self.run_id, UUID): - run_id = str(self.run_id) - else: - run_id = self.run_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, PartialExtendedLlmSpanRecordMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, PartialExtendedLlmSpanRecordFilesType0): - files = self.files.to_dict() - else: - files = self.files - - parent_id: None | str | Unset - if isinstance(self.parent_id, Unset): - parent_id = UNSET - elif isinstance(self.parent_id, UUID): - parent_id = str(self.parent_id) - else: - parent_id = self.parent_id - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - tools: list[dict[str, Any]] | None | Unset - if isinstance(self.tools, Unset): - tools = UNSET - elif isinstance(self.tools, list): - tools = [] - for tools_type_0_item_data in self.tools: - tools_type_0_item = tools_type_0_item_data.to_dict() - tools.append(tools_type_0_item) - - else: - tools = self.tools - - events: list[dict[str, Any]] | None | Unset - if isinstance(self.events, Unset): - events = UNSET - elif isinstance(self.events, list): - events = [] - for events_type_0_item_data in self.events: - events_type_0_item: dict[str, Any] - if isinstance(events_type_0_item_data, MessageEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, ReasoningEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, InternalToolCall): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, WebSearchCallEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, ImageGenerationEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, MCPCallEvent): - events_type_0_item = events_type_0_item_data.to_dict() - elif isinstance(events_type_0_item_data, MCPListToolsEvent): - events_type_0_item = events_type_0_item_data.to_dict() - else: - events_type_0_item = events_type_0_item_data.to_dict() - - events.append(events_type_0_item) - - else: - events = self.events - - model: None | str | Unset - if isinstance(self.model, Unset): - model = UNSET - else: - model = self.model - - provider: None | str | Unset - if isinstance(self.provider, Unset): - provider = UNSET - else: - provider = self.provider - - temperature: float | None | Unset - if isinstance(self.temperature, Unset): - temperature = UNSET - else: - temperature = self.temperature - - finish_reason: None | str | Unset - if isinstance(self.finish_reason, Unset): - finish_reason = UNSET - else: - finish_reason = self.finish_reason - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if id is not UNSET: - field_dict["id"] = id - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if project_id is not UNSET: - field_dict["project_id"] = project_id - if run_id is not UNSET: - field_dict["run_id"] = run_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if parent_id is not UNSET: - field_dict["parent_id"] = parent_id - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - if tools is not UNSET: - field_dict["tools"] = tools - if events is not UNSET: - field_dict["events"] = events - if model is not UNSET: - field_dict["model"] = model - if provider is not UNSET: - field_dict["provider"] = provider - if temperature is not UNSET: - field_dict["temperature"] = temperature - if finish_reason is not UNSET: - field_dict["finish_reason"] = finish_reason - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.image_generation_event import ImageGenerationEvent - from ..models.internal_tool_call import InternalToolCall - from ..models.llm_metrics import LlmMetrics - from ..models.mcp_approval_request_event import MCPApprovalRequestEvent - from ..models.mcp_call_event import MCPCallEvent - from ..models.mcp_list_tools_event import MCPListToolsEvent - from ..models.message import Message - from ..models.message_event import MessageEvent - from ..models.partial_extended_llm_span_record_annotation_aggregates import ( - PartialExtendedLlmSpanRecordAnnotationAggregates, - ) - from ..models.partial_extended_llm_span_record_annotation_agreement import ( - PartialExtendedLlmSpanRecordAnnotationAgreement, - ) - from ..models.partial_extended_llm_span_record_annotations import PartialExtendedLlmSpanRecordAnnotations - from ..models.partial_extended_llm_span_record_dataset_metadata import ( - PartialExtendedLlmSpanRecordDatasetMetadata, - ) - from ..models.partial_extended_llm_span_record_feedback_rating_info import ( - PartialExtendedLlmSpanRecordFeedbackRatingInfo, - ) - from ..models.partial_extended_llm_span_record_files_type_0 import PartialExtendedLlmSpanRecordFilesType0 - from ..models.partial_extended_llm_span_record_metric_info_type_0 import ( - PartialExtendedLlmSpanRecordMetricInfoType0, - ) - from ..models.partial_extended_llm_span_record_tools_type_0_item import ( - PartialExtendedLlmSpanRecordToolsType0Item, - ) - from ..models.partial_extended_llm_span_record_user_metadata import PartialExtendedLlmSpanRecordUserMetadata - from ..models.reasoning_event import ReasoningEvent - from ..models.web_search_call_event import WebSearchCallEvent - - d = dict(src_dict) - type_ = cast(Literal["llm"] | Unset, d.pop("type", UNSET)) - if type_ != "llm" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'llm', got '{type_}'") - - _input_ = d.pop("input", UNSET) - input_: list[Message] | Unset = UNSET - if _input_ is not UNSET: - input_ = [] - for input_item_data in _input_: - input_item = Message.from_dict(input_item_data) - - input_.append(input_item) - - def _parse_redacted_input(data: object) -> list[Message] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_0 = [] - _redacted_input_type_0 = data - for redacted_input_type_0_item_data in _redacted_input_type_0: - redacted_input_type_0_item = Message.from_dict(redacted_input_type_0_item_data) - - redacted_input_type_0.append(redacted_input_type_0_item) - - return redacted_input_type_0 - except: # noqa: E722 - pass - return cast(list[Message] | None | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - _output = d.pop("output", UNSET) - output: Message | Unset - if isinstance(_output, Unset): - output = UNSET - else: - output = Message.from_dict(_output) - - def _parse_redacted_output(data: object) -> Message | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_0 = Message.from_dict(data) - - return redacted_output_type_0 - except: # noqa: E722 - pass - return cast(Message | None | Unset, data) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: PartialExtendedLlmSpanRecordUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = PartialExtendedLlmSpanRecordUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: LlmMetrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = LlmMetrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: PartialExtendedLlmSpanRecordDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = PartialExtendedLlmSpanRecordDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - id_type_0 = UUID(data) - - return id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - id = _parse_id(d.pop("id", UNSET)) - - def _parse_session_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - session_id_type_0 = UUID(data) - - return session_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_project_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - project_id_type_0 = UUID(data) - - return project_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - project_id = _parse_project_id(d.pop("project_id", UNSET)) - - def _parse_run_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - run_id_type_0 = UUID(data) - - return run_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - run_id = _parse_run_id(d.pop("run_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: PartialExtendedLlmSpanRecordFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = PartialExtendedLlmSpanRecordFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: PartialExtendedLlmSpanRecordAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = PartialExtendedLlmSpanRecordAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: PartialExtendedLlmSpanRecordAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = PartialExtendedLlmSpanRecordAnnotationAggregates.from_dict(_annotation_aggregates) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: PartialExtendedLlmSpanRecordAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = PartialExtendedLlmSpanRecordAnnotationAgreement.from_dict(_annotation_agreement) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> None | PartialExtendedLlmSpanRecordMetricInfoType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = PartialExtendedLlmSpanRecordMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(None | PartialExtendedLlmSpanRecordMetricInfoType0 | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> None | PartialExtendedLlmSpanRecordFilesType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = PartialExtendedLlmSpanRecordFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(None | PartialExtendedLlmSpanRecordFilesType0 | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - def _parse_parent_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - parent_id_type_0 = UUID(data) - - return parent_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - parent_id = _parse_parent_id(d.pop("parent_id", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - def _parse_tools(data: object) -> list[PartialExtendedLlmSpanRecordToolsType0Item] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - tools_type_0 = [] - _tools_type_0 = data - for tools_type_0_item_data in _tools_type_0: - tools_type_0_item = PartialExtendedLlmSpanRecordToolsType0Item.from_dict(tools_type_0_item_data) - - tools_type_0.append(tools_type_0_item) - - return tools_type_0 - except: # noqa: E722 - pass - return cast(list[PartialExtendedLlmSpanRecordToolsType0Item] | None | Unset, data) - - tools = _parse_tools(d.pop("tools", UNSET)) - - def _parse_events( - data: object, - ) -> ( - list[ - ImageGenerationEvent - | InternalToolCall - | MCPApprovalRequestEvent - | MCPCallEvent - | MCPListToolsEvent - | MessageEvent - | ReasoningEvent - | WebSearchCallEvent - ] - | None - | Unset - ): - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - events_type_0 = [] - _events_type_0 = data - for events_type_0_item_data in _events_type_0: - - def _parse_events_type_0_item( - data: object, - ) -> ( - ImageGenerationEvent - | InternalToolCall - | MCPApprovalRequestEvent - | MCPCallEvent - | MCPListToolsEvent - | MessageEvent - | ReasoningEvent - | WebSearchCallEvent - ): - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_0 = MessageEvent.from_dict(data) - - return events_type_0_item_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_1 = ReasoningEvent.from_dict(data) - - return events_type_0_item_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_2 = InternalToolCall.from_dict(data) - - return events_type_0_item_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_3 = WebSearchCallEvent.from_dict(data) - - return events_type_0_item_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_4 = ImageGenerationEvent.from_dict(data) - - return events_type_0_item_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_5 = MCPCallEvent.from_dict(data) - - return events_type_0_item_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_6 = MCPListToolsEvent.from_dict(data) - - return events_type_0_item_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - events_type_0_item_type_7 = MCPApprovalRequestEvent.from_dict(data) - - return events_type_0_item_type_7 - - events_type_0_item = _parse_events_type_0_item(events_type_0_item_data) - - events_type_0.append(events_type_0_item) - - return events_type_0 - except: # noqa: E722 - pass - return cast( - list[ - ImageGenerationEvent - | InternalToolCall - | MCPApprovalRequestEvent - | MCPCallEvent - | MCPListToolsEvent - | MessageEvent - | ReasoningEvent - | WebSearchCallEvent - ] - | None - | Unset, - data, - ) - - events = _parse_events(d.pop("events", UNSET)) - - def _parse_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - model = _parse_model(d.pop("model", UNSET)) - - def _parse_provider(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - provider = _parse_provider(d.pop("provider", UNSET)) - - def _parse_temperature(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - temperature = _parse_temperature(d.pop("temperature", UNSET)) - - def _parse_finish_reason(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - finish_reason = _parse_finish_reason(d.pop("finish_reason", UNSET)) - - partial_extended_llm_span_record = cls( - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - id=id, - session_id=session_id, - trace_id=trace_id, - project_id=project_id, - run_id=run_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - parent_id=parent_id, - is_complete=is_complete, - step_number=step_number, - tools=tools, - events=events, - model=model, - provider=provider, - temperature=temperature, - finish_reason=finish_reason, - ) - - partial_extended_llm_span_record.additional_properties = d - return partial_extended_llm_span_record - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_llm_span_record_annotation_aggregates.py b/src/splunk_ao/resources/models/partial_extended_llm_span_record_annotation_aggregates.py deleted file mode 100644 index 2af56ee3..00000000 --- a/src/splunk_ao/resources/models/partial_extended_llm_span_record_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="PartialExtendedLlmSpanRecordAnnotationAggregates") - - -@_attrs_define -class PartialExtendedLlmSpanRecordAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - partial_extended_llm_span_record_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_llm_span_record_annotation_aggregates.additional_properties = additional_properties - return partial_extended_llm_span_record_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_llm_span_record_annotation_agreement.py b/src/splunk_ao/resources/models/partial_extended_llm_span_record_annotation_agreement.py deleted file mode 100644 index fb6148de..00000000 --- a/src/splunk_ao/resources/models/partial_extended_llm_span_record_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedLlmSpanRecordAnnotationAgreement") - - -@_attrs_define -class PartialExtendedLlmSpanRecordAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_llm_span_record_annotation_agreement = cls() - - partial_extended_llm_span_record_annotation_agreement.additional_properties = d - return partial_extended_llm_span_record_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_llm_span_record_annotations.py b/src/splunk_ao/resources/models/partial_extended_llm_span_record_annotations.py deleted file mode 100644 index 4682dcca..00000000 --- a/src/splunk_ao/resources/models/partial_extended_llm_span_record_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.partial_extended_llm_span_record_annotations_additional_property import ( - PartialExtendedLlmSpanRecordAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="PartialExtendedLlmSpanRecordAnnotations") - - -@_attrs_define -class PartialExtendedLlmSpanRecordAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, PartialExtendedLlmSpanRecordAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.partial_extended_llm_span_record_annotations_additional_property import ( - PartialExtendedLlmSpanRecordAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - partial_extended_llm_span_record_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = PartialExtendedLlmSpanRecordAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_llm_span_record_annotations.additional_properties = additional_properties - return partial_extended_llm_span_record_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> PartialExtendedLlmSpanRecordAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: PartialExtendedLlmSpanRecordAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_llm_span_record_annotations_additional_property.py b/src/splunk_ao/resources/models/partial_extended_llm_span_record_annotations_additional_property.py deleted file mode 100644 index 41be02a1..00000000 --- a/src/splunk_ao/resources/models/partial_extended_llm_span_record_annotations_additional_property.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="PartialExtendedLlmSpanRecordAnnotationsAdditionalProperty") - - -@_attrs_define -class PartialExtendedLlmSpanRecordAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - partial_extended_llm_span_record_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_llm_span_record_annotations_additional_property.additional_properties = additional_properties - return partial_extended_llm_span_record_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_llm_span_record_dataset_metadata.py b/src/splunk_ao/resources/models/partial_extended_llm_span_record_dataset_metadata.py deleted file mode 100644 index d0326317..00000000 --- a/src/splunk_ao/resources/models/partial_extended_llm_span_record_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedLlmSpanRecordDatasetMetadata") - - -@_attrs_define -class PartialExtendedLlmSpanRecordDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_llm_span_record_dataset_metadata = cls() - - partial_extended_llm_span_record_dataset_metadata.additional_properties = d - return partial_extended_llm_span_record_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_llm_span_record_feedback_rating_info.py b/src/splunk_ao/resources/models/partial_extended_llm_span_record_feedback_rating_info.py deleted file mode 100644 index 7d66045f..00000000 --- a/src/splunk_ao/resources/models/partial_extended_llm_span_record_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="PartialExtendedLlmSpanRecordFeedbackRatingInfo") - - -@_attrs_define -class PartialExtendedLlmSpanRecordFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - partial_extended_llm_span_record_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_llm_span_record_feedback_rating_info.additional_properties = additional_properties - return partial_extended_llm_span_record_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_llm_span_record_files_type_0.py b/src/splunk_ao/resources/models/partial_extended_llm_span_record_files_type_0.py deleted file mode 100644 index b02d6120..00000000 --- a/src/splunk_ao/resources/models/partial_extended_llm_span_record_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="PartialExtendedLlmSpanRecordFilesType0") - - -@_attrs_define -class PartialExtendedLlmSpanRecordFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - partial_extended_llm_span_record_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_llm_span_record_files_type_0.additional_properties = additional_properties - return partial_extended_llm_span_record_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_llm_span_record_metric_info_type_0.py b/src/splunk_ao/resources/models/partial_extended_llm_span_record_metric_info_type_0.py deleted file mode 100644 index fcd29eba..00000000 --- a/src/splunk_ao/resources/models/partial_extended_llm_span_record_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="PartialExtendedLlmSpanRecordMetricInfoType0") - - -@_attrs_define -class PartialExtendedLlmSpanRecordMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - partial_extended_llm_span_record_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_llm_span_record_metric_info_type_0.additional_properties = additional_properties - return partial_extended_llm_span_record_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_llm_span_record_user_metadata.py b/src/splunk_ao/resources/models/partial_extended_llm_span_record_user_metadata.py deleted file mode 100644 index a03fabb8..00000000 --- a/src/splunk_ao/resources/models/partial_extended_llm_span_record_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedLlmSpanRecordUserMetadata") - - -@_attrs_define -class PartialExtendedLlmSpanRecordUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_llm_span_record_user_metadata = cls() - - partial_extended_llm_span_record_user_metadata.additional_properties = d - return partial_extended_llm_span_record_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_session_record.py b/src/splunk_ao/resources/models/partial_extended_session_record.py deleted file mode 100644 index c37790cb..00000000 --- a/src/splunk_ao/resources/models/partial_extended_session_record.py +++ /dev/null @@ -1,1214 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.partial_extended_session_record_annotation_aggregates import ( - PartialExtendedSessionRecordAnnotationAggregates, - ) - from ..models.partial_extended_session_record_annotation_agreement import ( - PartialExtendedSessionRecordAnnotationAgreement, - ) - from ..models.partial_extended_session_record_annotations import PartialExtendedSessionRecordAnnotations - from ..models.partial_extended_session_record_dataset_metadata import PartialExtendedSessionRecordDatasetMetadata - from ..models.partial_extended_session_record_feedback_rating_info import ( - PartialExtendedSessionRecordFeedbackRatingInfo, - ) - from ..models.partial_extended_session_record_files_type_0 import PartialExtendedSessionRecordFilesType0 - from ..models.partial_extended_session_record_metric_info_type_0 import PartialExtendedSessionRecordMetricInfoType0 - from ..models.partial_extended_session_record_user_metadata import PartialExtendedSessionRecordUserMetadata - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="PartialExtendedSessionRecord") - - -@_attrs_define -class PartialExtendedSessionRecord: - """ - Attributes: - type_ (Literal['session'] | Unset): Type of the trace, span or session. Default: 'session'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (PartialExtendedSessionRecordUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (PartialExtendedSessionRecordDatasetMetadata | Unset): Metadata from the dataset associated - with this trace - id (None | Unset | UUID): Galileo ID of the session - session_id (None | str | Unset): Galileo ID of the session containing the trace or span or session - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - project_id (None | Unset | UUID): Galileo ID of the project associated with this trace or span - run_id (None | Unset | UUID): Galileo ID of the run (log stream or experiment) associated with this trace or - span - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (PartialExtendedSessionRecordFeedbackRatingInfo | Unset): Feedback information related to - the record - annotations (PartialExtendedSessionRecordAnnotations | Unset): Annotations keyed by template ID and annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (PartialExtendedSessionRecordAnnotationAggregates | Unset): Annotation aggregate - information keyed by template ID - annotation_agreement (PartialExtendedSessionRecordAnnotationAgreement | Unset): Annotation agreement scores - keyed by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (None | PartialExtendedSessionRecordMetricInfoType0 | Unset): Detailed information about the metrics - associated with this trace or span - files (None | PartialExtendedSessionRecordFilesType0 | Unset): File metadata keyed by file ID for files - associated with this record - previous_session_id (None | str | Unset): - num_traces (int | None | Unset): - """ - - type_: Literal["session"] | Unset = "session" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: PartialExtendedSessionRecordUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: PartialExtendedSessionRecordDatasetMetadata | Unset = UNSET - id: None | Unset | UUID = UNSET - session_id: None | str | Unset = UNSET - trace_id: None | str | Unset = UNSET - project_id: None | Unset | UUID = UNSET - run_id: None | Unset | UUID = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: PartialExtendedSessionRecordFeedbackRatingInfo | Unset = UNSET - annotations: PartialExtendedSessionRecordAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: PartialExtendedSessionRecordAnnotationAggregates | Unset = UNSET - annotation_agreement: PartialExtendedSessionRecordAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: None | PartialExtendedSessionRecordMetricInfoType0 | Unset = UNSET - files: None | PartialExtendedSessionRecordFilesType0 | Unset = UNSET - previous_session_id: None | str | Unset = UNSET - num_traces: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.message import Message - from ..models.partial_extended_session_record_files_type_0 import PartialExtendedSessionRecordFilesType0 - from ..models.partial_extended_session_record_metric_info_type_0 import ( - PartialExtendedSessionRecordMetricInfoType0, - ) - from ..models.text_content_part import TextContentPart - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - id: None | str | Unset - if isinstance(self.id, Unset): - id = UNSET - elif isinstance(self.id, UUID): - id = str(self.id) - else: - id = self.id - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - project_id: None | str | Unset - if isinstance(self.project_id, Unset): - project_id = UNSET - elif isinstance(self.project_id, UUID): - project_id = str(self.project_id) - else: - project_id = self.project_id - - run_id: None | str | Unset - if isinstance(self.run_id, Unset): - run_id = UNSET - elif isinstance(self.run_id, UUID): - run_id = str(self.run_id) - else: - run_id = self.run_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, PartialExtendedSessionRecordMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, PartialExtendedSessionRecordFilesType0): - files = self.files.to_dict() - else: - files = self.files - - previous_session_id: None | str | Unset - if isinstance(self.previous_session_id, Unset): - previous_session_id = UNSET - else: - previous_session_id = self.previous_session_id - - num_traces: int | None | Unset - if isinstance(self.num_traces, Unset): - num_traces = UNSET - else: - num_traces = self.num_traces - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if id is not UNSET: - field_dict["id"] = id - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if project_id is not UNSET: - field_dict["project_id"] = project_id - if run_id is not UNSET: - field_dict["run_id"] = run_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if previous_session_id is not UNSET: - field_dict["previous_session_id"] = previous_session_id - if num_traces is not UNSET: - field_dict["num_traces"] = num_traces - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.partial_extended_session_record_annotation_aggregates import ( - PartialExtendedSessionRecordAnnotationAggregates, - ) - from ..models.partial_extended_session_record_annotation_agreement import ( - PartialExtendedSessionRecordAnnotationAgreement, - ) - from ..models.partial_extended_session_record_annotations import PartialExtendedSessionRecordAnnotations - from ..models.partial_extended_session_record_dataset_metadata import ( - PartialExtendedSessionRecordDatasetMetadata, - ) - from ..models.partial_extended_session_record_feedback_rating_info import ( - PartialExtendedSessionRecordFeedbackRatingInfo, - ) - from ..models.partial_extended_session_record_files_type_0 import PartialExtendedSessionRecordFilesType0 - from ..models.partial_extended_session_record_metric_info_type_0 import ( - PartialExtendedSessionRecordMetricInfoType0, - ) - from ..models.partial_extended_session_record_user_metadata import PartialExtendedSessionRecordUserMetadata - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - type_ = cast(Literal["session"] | Unset, d.pop("type", UNSET)) - if type_ != "session" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'session', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: PartialExtendedSessionRecordUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = PartialExtendedSessionRecordUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: PartialExtendedSessionRecordDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = PartialExtendedSessionRecordDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - id_type_0 = UUID(data) - - return id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - id = _parse_id(d.pop("id", UNSET)) - - def _parse_session_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_project_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - project_id_type_0 = UUID(data) - - return project_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - project_id = _parse_project_id(d.pop("project_id", UNSET)) - - def _parse_run_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - run_id_type_0 = UUID(data) - - return run_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - run_id = _parse_run_id(d.pop("run_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: PartialExtendedSessionRecordFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = PartialExtendedSessionRecordFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: PartialExtendedSessionRecordAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = PartialExtendedSessionRecordAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: PartialExtendedSessionRecordAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = PartialExtendedSessionRecordAnnotationAggregates.from_dict(_annotation_aggregates) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: PartialExtendedSessionRecordAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = PartialExtendedSessionRecordAnnotationAgreement.from_dict(_annotation_agreement) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> None | PartialExtendedSessionRecordMetricInfoType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = PartialExtendedSessionRecordMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(None | PartialExtendedSessionRecordMetricInfoType0 | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> None | PartialExtendedSessionRecordFilesType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = PartialExtendedSessionRecordFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(None | PartialExtendedSessionRecordFilesType0 | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - def _parse_previous_session_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - previous_session_id = _parse_previous_session_id(d.pop("previous_session_id", UNSET)) - - def _parse_num_traces(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - num_traces = _parse_num_traces(d.pop("num_traces", UNSET)) - - partial_extended_session_record = cls( - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - id=id, - session_id=session_id, - trace_id=trace_id, - project_id=project_id, - run_id=run_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - previous_session_id=previous_session_id, - num_traces=num_traces, - ) - - partial_extended_session_record.additional_properties = d - return partial_extended_session_record - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_session_record_annotation_aggregates.py b/src/splunk_ao/resources/models/partial_extended_session_record_annotation_aggregates.py deleted file mode 100644 index 5598ce18..00000000 --- a/src/splunk_ao/resources/models/partial_extended_session_record_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="PartialExtendedSessionRecordAnnotationAggregates") - - -@_attrs_define -class PartialExtendedSessionRecordAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - partial_extended_session_record_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_session_record_annotation_aggregates.additional_properties = additional_properties - return partial_extended_session_record_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_session_record_annotation_agreement.py b/src/splunk_ao/resources/models/partial_extended_session_record_annotation_agreement.py deleted file mode 100644 index f0472137..00000000 --- a/src/splunk_ao/resources/models/partial_extended_session_record_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedSessionRecordAnnotationAgreement") - - -@_attrs_define -class PartialExtendedSessionRecordAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_session_record_annotation_agreement = cls() - - partial_extended_session_record_annotation_agreement.additional_properties = d - return partial_extended_session_record_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_session_record_annotations.py b/src/splunk_ao/resources/models/partial_extended_session_record_annotations.py deleted file mode 100644 index 99ad0cd0..00000000 --- a/src/splunk_ao/resources/models/partial_extended_session_record_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.partial_extended_session_record_annotations_additional_property import ( - PartialExtendedSessionRecordAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="PartialExtendedSessionRecordAnnotations") - - -@_attrs_define -class PartialExtendedSessionRecordAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, PartialExtendedSessionRecordAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.partial_extended_session_record_annotations_additional_property import ( - PartialExtendedSessionRecordAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - partial_extended_session_record_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = PartialExtendedSessionRecordAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_session_record_annotations.additional_properties = additional_properties - return partial_extended_session_record_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> PartialExtendedSessionRecordAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: PartialExtendedSessionRecordAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_session_record_annotations_additional_property.py b/src/splunk_ao/resources/models/partial_extended_session_record_annotations_additional_property.py deleted file mode 100644 index 84880e71..00000000 --- a/src/splunk_ao/resources/models/partial_extended_session_record_annotations_additional_property.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="PartialExtendedSessionRecordAnnotationsAdditionalProperty") - - -@_attrs_define -class PartialExtendedSessionRecordAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - partial_extended_session_record_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_session_record_annotations_additional_property.additional_properties = additional_properties - return partial_extended_session_record_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_session_record_dataset_metadata.py b/src/splunk_ao/resources/models/partial_extended_session_record_dataset_metadata.py deleted file mode 100644 index 54c0d515..00000000 --- a/src/splunk_ao/resources/models/partial_extended_session_record_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedSessionRecordDatasetMetadata") - - -@_attrs_define -class PartialExtendedSessionRecordDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_session_record_dataset_metadata = cls() - - partial_extended_session_record_dataset_metadata.additional_properties = d - return partial_extended_session_record_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_session_record_feedback_rating_info.py b/src/splunk_ao/resources/models/partial_extended_session_record_feedback_rating_info.py deleted file mode 100644 index 5a12679c..00000000 --- a/src/splunk_ao/resources/models/partial_extended_session_record_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="PartialExtendedSessionRecordFeedbackRatingInfo") - - -@_attrs_define -class PartialExtendedSessionRecordFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - partial_extended_session_record_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_session_record_feedback_rating_info.additional_properties = additional_properties - return partial_extended_session_record_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_session_record_files_type_0.py b/src/splunk_ao/resources/models/partial_extended_session_record_files_type_0.py deleted file mode 100644 index 29fc35fb..00000000 --- a/src/splunk_ao/resources/models/partial_extended_session_record_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="PartialExtendedSessionRecordFilesType0") - - -@_attrs_define -class PartialExtendedSessionRecordFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - partial_extended_session_record_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_session_record_files_type_0.additional_properties = additional_properties - return partial_extended_session_record_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_session_record_metric_info_type_0.py b/src/splunk_ao/resources/models/partial_extended_session_record_metric_info_type_0.py deleted file mode 100644 index 328b8df7..00000000 --- a/src/splunk_ao/resources/models/partial_extended_session_record_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="PartialExtendedSessionRecordMetricInfoType0") - - -@_attrs_define -class PartialExtendedSessionRecordMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - partial_extended_session_record_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_session_record_metric_info_type_0.additional_properties = additional_properties - return partial_extended_session_record_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_session_record_user_metadata.py b/src/splunk_ao/resources/models/partial_extended_session_record_user_metadata.py deleted file mode 100644 index e0f93f32..00000000 --- a/src/splunk_ao/resources/models/partial_extended_session_record_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedSessionRecordUserMetadata") - - -@_attrs_define -class PartialExtendedSessionRecordUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_session_record_user_metadata = cls() - - partial_extended_session_record_user_metadata.additional_properties = d - return partial_extended_session_record_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_trace_record.py b/src/splunk_ao/resources/models/partial_extended_trace_record.py index 57f6700a..9720632d 100644 --- a/src/splunk_ao/resources/models/partial_extended_trace_record.py +++ b/src/splunk_ao/resources/models/partial_extended_trace_record.py @@ -91,6 +91,8 @@ class PartialExtendedTraceRecord: dataset_generated_output (None | str | Unset): Generated output from the dataset associated with this trace is_complete (bool | Unset): Whether the trace is complete or not Default: True. num_spans (int | None | Unset): + is_synthetic (bool | Unset): Whether ingest created this trace row because the trace's root span was missing + Default: False. """ type_: Literal["trace"] | Unset = "trace" @@ -135,6 +137,7 @@ class PartialExtendedTraceRecord: dataset_generated_output: None | str | Unset = UNSET is_complete: bool | Unset = True num_spans: int | None | Unset = UNSET + is_synthetic: bool | Unset = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -418,6 +421,8 @@ def to_dict(self) -> dict[str, Any]: else: num_spans = self.num_spans + is_synthetic = self.is_synthetic + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -505,6 +510,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["is_complete"] = is_complete if num_spans is not UNSET: field_dict["num_spans"] = num_spans + if is_synthetic is not UNSET: + field_dict["is_synthetic"] = is_synthetic return field_dict @@ -1143,6 +1150,8 @@ def _parse_num_spans(data: object) -> int | None | Unset: num_spans = _parse_num_spans(d.pop("num_spans", UNSET)) + is_synthetic = d.pop("is_synthetic", UNSET) + partial_extended_trace_record = cls( type_=type_, input_=input_, @@ -1186,6 +1195,7 @@ def _parse_num_spans(data: object) -> int | None | Unset: dataset_generated_output=dataset_generated_output, is_complete=is_complete, num_spans=num_spans, + is_synthetic=is_synthetic, ) partial_extended_trace_record.additional_properties = d diff --git a/src/splunk_ao/resources/models/partial_extended_workflow_span_record.py b/src/splunk_ao/resources/models/partial_extended_workflow_span_record.py deleted file mode 100644 index 30cf22a0..00000000 --- a/src/splunk_ao/resources/models/partial_extended_workflow_span_record.py +++ /dev/null @@ -1,1263 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.annotation_status import AnnotationStatus -from ..models.content_modality import ContentModality -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.partial_extended_workflow_span_record_annotation_aggregates import ( - PartialExtendedWorkflowSpanRecordAnnotationAggregates, - ) - from ..models.partial_extended_workflow_span_record_annotation_agreement import ( - PartialExtendedWorkflowSpanRecordAnnotationAgreement, - ) - from ..models.partial_extended_workflow_span_record_annotations import PartialExtendedWorkflowSpanRecordAnnotations - from ..models.partial_extended_workflow_span_record_dataset_metadata import ( - PartialExtendedWorkflowSpanRecordDatasetMetadata, - ) - from ..models.partial_extended_workflow_span_record_feedback_rating_info import ( - PartialExtendedWorkflowSpanRecordFeedbackRatingInfo, - ) - from ..models.partial_extended_workflow_span_record_files_type_0 import PartialExtendedWorkflowSpanRecordFilesType0 - from ..models.partial_extended_workflow_span_record_metric_info_type_0 import ( - PartialExtendedWorkflowSpanRecordMetricInfoType0, - ) - from ..models.partial_extended_workflow_span_record_user_metadata import ( - PartialExtendedWorkflowSpanRecordUserMetadata, - ) - from ..models.text_content_part import TextContentPart - - -T = TypeVar("T", bound="PartialExtendedWorkflowSpanRecord") - - -@_attrs_define -class PartialExtendedWorkflowSpanRecord: - """ - Attributes: - type_ (Literal['workflow'] | Unset): Type of the trace, span or session. Default: 'workflow'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (PartialExtendedWorkflowSpanRecordUserMetadata | Unset): Metadata associated with this trace or - span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (PartialExtendedWorkflowSpanRecordDatasetMetadata | Unset): Metadata from the dataset - associated with this trace - id (None | Unset | UUID): Galileo ID of the session, trace or span - session_id (None | Unset | UUID): Galileo ID of the session containing the trace (or the same value as id for a - trace) - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - project_id (None | Unset | UUID): Galileo ID of the project associated with this trace or span - run_id (None | Unset | UUID): Galileo ID of the run (log stream or experiment) associated with this trace or - span - updated_at (datetime.datetime | None | Unset): Timestamp of the session or trace or span's last update - has_children (bool | None | Unset): Whether or not this trace or span has child spans - metrics_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - session_batch_id (None | str | Unset): Galileo ID of the metrics batch associated with this trace or span - feedback_rating_info (PartialExtendedWorkflowSpanRecordFeedbackRatingInfo | Unset): Feedback information related - to the record - annotations (PartialExtendedWorkflowSpanRecordAnnotations | Unset): Annotations keyed by template ID and - annotator ID - file_ids (list[str] | Unset): IDs of files associated with this record - file_modalities (list[ContentModality] | Unset): Modalities of files associated with this record - annotation_aggregates (PartialExtendedWorkflowSpanRecordAnnotationAggregates | Unset): Annotation aggregate - information keyed by template ID - annotation_agreement (PartialExtendedWorkflowSpanRecordAnnotationAgreement | Unset): Annotation agreement scores - keyed by template ID - overall_annotation_agreement (float | None | Unset): Average annotation agreement across all templates in the - queue - annotation_queue_ids (list[str] | Unset): IDs of annotation queues this record is in - fully_annotated (bool | None | Unset): Whether every field is annotated by every annotator in the queue - annotation_status (AnnotationStatus | None | Unset): Annotation review status of the record - annotated_members (list[str] | None | Unset): Emails of tracked queue members who rated the record - progress_message (str | Unset): Runner progress text written directly to CH span Default: ''. - error_message (str | Unset): Runner error text written directly to CH span Default: ''. - metric_info (None | PartialExtendedWorkflowSpanRecordMetricInfoType0 | Unset): Detailed information about the - metrics associated with this trace or span - files (None | PartialExtendedWorkflowSpanRecordFilesType0 | Unset): File metadata keyed by file ID for files - associated with this record - parent_id (None | Unset | UUID): Galileo ID of the parent of this span - is_complete (bool | Unset): Whether the parent trace is complete or not Default: True. - step_number (int | None | Unset): Topological step number of the span. - """ - - type_: Literal["workflow"] | Unset = "workflow" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: PartialExtendedWorkflowSpanRecordUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: PartialExtendedWorkflowSpanRecordDatasetMetadata | Unset = UNSET - id: None | Unset | UUID = UNSET - session_id: None | Unset | UUID = UNSET - trace_id: None | str | Unset = UNSET - project_id: None | Unset | UUID = UNSET - run_id: None | Unset | UUID = UNSET - updated_at: datetime.datetime | None | Unset = UNSET - has_children: bool | None | Unset = UNSET - metrics_batch_id: None | str | Unset = UNSET - session_batch_id: None | str | Unset = UNSET - feedback_rating_info: PartialExtendedWorkflowSpanRecordFeedbackRatingInfo | Unset = UNSET - annotations: PartialExtendedWorkflowSpanRecordAnnotations | Unset = UNSET - file_ids: list[str] | Unset = UNSET - file_modalities: list[ContentModality] | Unset = UNSET - annotation_aggregates: PartialExtendedWorkflowSpanRecordAnnotationAggregates | Unset = UNSET - annotation_agreement: PartialExtendedWorkflowSpanRecordAnnotationAgreement | Unset = UNSET - overall_annotation_agreement: float | None | Unset = UNSET - annotation_queue_ids: list[str] | Unset = UNSET - fully_annotated: bool | None | Unset = UNSET - annotation_status: AnnotationStatus | None | Unset = UNSET - annotated_members: list[str] | None | Unset = UNSET - progress_message: str | Unset = "" - error_message: str | Unset = "" - metric_info: None | PartialExtendedWorkflowSpanRecordMetricInfoType0 | Unset = UNSET - files: None | PartialExtendedWorkflowSpanRecordFilesType0 | Unset = UNSET - parent_id: None | Unset | UUID = UNSET - is_complete: bool | Unset = True - step_number: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.control_result import ControlResult - from ..models.message import Message - from ..models.partial_extended_workflow_span_record_files_type_0 import ( - PartialExtendedWorkflowSpanRecordFilesType0, - ) - from ..models.partial_extended_workflow_span_record_metric_info_type_0 import ( - PartialExtendedWorkflowSpanRecordMetricInfoType0, - ) - from ..models.text_content_part import TextContentPart - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - id: None | str | Unset - if isinstance(self.id, Unset): - id = UNSET - elif isinstance(self.id, UUID): - id = str(self.id) - else: - id = self.id - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - elif isinstance(self.session_id, UUID): - session_id = str(self.session_id) - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - project_id: None | str | Unset - if isinstance(self.project_id, Unset): - project_id = UNSET - elif isinstance(self.project_id, UUID): - project_id = str(self.project_id) - else: - project_id = self.project_id - - run_id: None | str | Unset - if isinstance(self.run_id, Unset): - run_id = UNSET - elif isinstance(self.run_id, UUID): - run_id = str(self.run_id) - else: - run_id = self.run_id - - updated_at: None | str | Unset - if isinstance(self.updated_at, Unset): - updated_at = UNSET - elif isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - has_children: bool | None | Unset - if isinstance(self.has_children, Unset): - has_children = UNSET - else: - has_children = self.has_children - - metrics_batch_id: None | str | Unset - if isinstance(self.metrics_batch_id, Unset): - metrics_batch_id = UNSET - else: - metrics_batch_id = self.metrics_batch_id - - session_batch_id: None | str | Unset - if isinstance(self.session_batch_id, Unset): - session_batch_id = UNSET - else: - session_batch_id = self.session_batch_id - - feedback_rating_info: dict[str, Any] | Unset = UNSET - if not isinstance(self.feedback_rating_info, Unset): - feedback_rating_info = self.feedback_rating_info.to_dict() - - annotations: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotations, Unset): - annotations = self.annotations.to_dict() - - file_ids: list[str] | Unset = UNSET - if not isinstance(self.file_ids, Unset): - file_ids = self.file_ids - - file_modalities: list[str] | Unset = UNSET - if not isinstance(self.file_modalities, Unset): - file_modalities = [] - for file_modalities_item_data in self.file_modalities: - file_modalities_item = file_modalities_item_data.value - file_modalities.append(file_modalities_item) - - annotation_aggregates: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_aggregates, Unset): - annotation_aggregates = self.annotation_aggregates.to_dict() - - annotation_agreement: dict[str, Any] | Unset = UNSET - if not isinstance(self.annotation_agreement, Unset): - annotation_agreement = self.annotation_agreement.to_dict() - - overall_annotation_agreement: float | None | Unset - if isinstance(self.overall_annotation_agreement, Unset): - overall_annotation_agreement = UNSET - else: - overall_annotation_agreement = self.overall_annotation_agreement - - annotation_queue_ids: list[str] | Unset = UNSET - if not isinstance(self.annotation_queue_ids, Unset): - annotation_queue_ids = self.annotation_queue_ids - - fully_annotated: bool | None | Unset - if isinstance(self.fully_annotated, Unset): - fully_annotated = UNSET - else: - fully_annotated = self.fully_annotated - - annotation_status: None | str | Unset - if isinstance(self.annotation_status, Unset): - annotation_status = UNSET - elif isinstance(self.annotation_status, AnnotationStatus): - annotation_status = self.annotation_status.value - else: - annotation_status = self.annotation_status - - annotated_members: list[str] | None | Unset - if isinstance(self.annotated_members, Unset): - annotated_members = UNSET - elif isinstance(self.annotated_members, list): - annotated_members = self.annotated_members - - else: - annotated_members = self.annotated_members - - progress_message = self.progress_message - - error_message = self.error_message - - metric_info: dict[str, Any] | None | Unset - if isinstance(self.metric_info, Unset): - metric_info = UNSET - elif isinstance(self.metric_info, PartialExtendedWorkflowSpanRecordMetricInfoType0): - metric_info = self.metric_info.to_dict() - else: - metric_info = self.metric_info - - files: dict[str, Any] | None | Unset - if isinstance(self.files, Unset): - files = UNSET - elif isinstance(self.files, PartialExtendedWorkflowSpanRecordFilesType0): - files = self.files.to_dict() - else: - files = self.files - - parent_id: None | str | Unset - if isinstance(self.parent_id, Unset): - parent_id = UNSET - elif isinstance(self.parent_id, UUID): - parent_id = str(self.parent_id) - else: - parent_id = self.parent_id - - is_complete = self.is_complete - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if id is not UNSET: - field_dict["id"] = id - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if project_id is not UNSET: - field_dict["project_id"] = project_id - if run_id is not UNSET: - field_dict["run_id"] = run_id - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - if has_children is not UNSET: - field_dict["has_children"] = has_children - if metrics_batch_id is not UNSET: - field_dict["metrics_batch_id"] = metrics_batch_id - if session_batch_id is not UNSET: - field_dict["session_batch_id"] = session_batch_id - if feedback_rating_info is not UNSET: - field_dict["feedback_rating_info"] = feedback_rating_info - if annotations is not UNSET: - field_dict["annotations"] = annotations - if file_ids is not UNSET: - field_dict["file_ids"] = file_ids - if file_modalities is not UNSET: - field_dict["file_modalities"] = file_modalities - if annotation_aggregates is not UNSET: - field_dict["annotation_aggregates"] = annotation_aggregates - if annotation_agreement is not UNSET: - field_dict["annotation_agreement"] = annotation_agreement - if overall_annotation_agreement is not UNSET: - field_dict["overall_annotation_agreement"] = overall_annotation_agreement - if annotation_queue_ids is not UNSET: - field_dict["annotation_queue_ids"] = annotation_queue_ids - if fully_annotated is not UNSET: - field_dict["fully_annotated"] = fully_annotated - if annotation_status is not UNSET: - field_dict["annotation_status"] = annotation_status - if annotated_members is not UNSET: - field_dict["annotated_members"] = annotated_members - if progress_message is not UNSET: - field_dict["progress_message"] = progress_message - if error_message is not UNSET: - field_dict["error_message"] = error_message - if metric_info is not UNSET: - field_dict["metric_info"] = metric_info - if files is not UNSET: - field_dict["files"] = files - if parent_id is not UNSET: - field_dict["parent_id"] = parent_id - if is_complete is not UNSET: - field_dict["is_complete"] = is_complete - if step_number is not UNSET: - field_dict["step_number"] = step_number - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.control_result import ControlResult - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.partial_extended_workflow_span_record_annotation_aggregates import ( - PartialExtendedWorkflowSpanRecordAnnotationAggregates, - ) - from ..models.partial_extended_workflow_span_record_annotation_agreement import ( - PartialExtendedWorkflowSpanRecordAnnotationAgreement, - ) - from ..models.partial_extended_workflow_span_record_annotations import ( - PartialExtendedWorkflowSpanRecordAnnotations, - ) - from ..models.partial_extended_workflow_span_record_dataset_metadata import ( - PartialExtendedWorkflowSpanRecordDatasetMetadata, - ) - from ..models.partial_extended_workflow_span_record_feedback_rating_info import ( - PartialExtendedWorkflowSpanRecordFeedbackRatingInfo, - ) - from ..models.partial_extended_workflow_span_record_files_type_0 import ( - PartialExtendedWorkflowSpanRecordFilesType0, - ) - from ..models.partial_extended_workflow_span_record_metric_info_type_0 import ( - PartialExtendedWorkflowSpanRecordMetricInfoType0, - ) - from ..models.partial_extended_workflow_span_record_user_metadata import ( - PartialExtendedWorkflowSpanRecordUserMetadata, - ) - from ..models.text_content_part import TextContentPart - - d = dict(src_dict) - type_ = cast(Literal["workflow"] | Unset, d.pop("type", UNSET)) - if type_ != "workflow" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'workflow', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: PartialExtendedWorkflowSpanRecordUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = PartialExtendedWorkflowSpanRecordUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: PartialExtendedWorkflowSpanRecordDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = PartialExtendedWorkflowSpanRecordDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - id_type_0 = UUID(data) - - return id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - id = _parse_id(d.pop("id", UNSET)) - - def _parse_session_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - session_id_type_0 = UUID(data) - - return session_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_project_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - project_id_type_0 = UUID(data) - - return project_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - project_id = _parse_project_id(d.pop("project_id", UNSET)) - - def _parse_run_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - run_id_type_0 = UUID(data) - - return run_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - run_id = _parse_run_id(d.pop("run_id", UNSET)) - - def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = datetime.datetime.fromisoformat(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(datetime.datetime | None | Unset, data) - - updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) - - def _parse_has_children(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - has_children = _parse_has_children(d.pop("has_children", UNSET)) - - def _parse_metrics_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metrics_batch_id = _parse_metrics_batch_id(d.pop("metrics_batch_id", UNSET)) - - def _parse_session_batch_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_batch_id = _parse_session_batch_id(d.pop("session_batch_id", UNSET)) - - _feedback_rating_info = d.pop("feedback_rating_info", UNSET) - feedback_rating_info: PartialExtendedWorkflowSpanRecordFeedbackRatingInfo | Unset - if isinstance(_feedback_rating_info, Unset): - feedback_rating_info = UNSET - else: - feedback_rating_info = PartialExtendedWorkflowSpanRecordFeedbackRatingInfo.from_dict(_feedback_rating_info) - - _annotations = d.pop("annotations", UNSET) - annotations: PartialExtendedWorkflowSpanRecordAnnotations | Unset - if isinstance(_annotations, Unset): - annotations = UNSET - else: - annotations = PartialExtendedWorkflowSpanRecordAnnotations.from_dict(_annotations) - - file_ids = cast(list[str], d.pop("file_ids", UNSET)) - - _file_modalities = d.pop("file_modalities", UNSET) - file_modalities: list[ContentModality] | Unset = UNSET - if _file_modalities is not UNSET: - file_modalities = [] - for file_modalities_item_data in _file_modalities: - file_modalities_item = ContentModality(file_modalities_item_data) - - file_modalities.append(file_modalities_item) - - _annotation_aggregates = d.pop("annotation_aggregates", UNSET) - annotation_aggregates: PartialExtendedWorkflowSpanRecordAnnotationAggregates | Unset - if isinstance(_annotation_aggregates, Unset): - annotation_aggregates = UNSET - else: - annotation_aggregates = PartialExtendedWorkflowSpanRecordAnnotationAggregates.from_dict( - _annotation_aggregates - ) - - _annotation_agreement = d.pop("annotation_agreement", UNSET) - annotation_agreement: PartialExtendedWorkflowSpanRecordAnnotationAgreement | Unset - if isinstance(_annotation_agreement, Unset): - annotation_agreement = UNSET - else: - annotation_agreement = PartialExtendedWorkflowSpanRecordAnnotationAgreement.from_dict(_annotation_agreement) - - def _parse_overall_annotation_agreement(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - overall_annotation_agreement = _parse_overall_annotation_agreement(d.pop("overall_annotation_agreement", UNSET)) - - annotation_queue_ids = cast(list[str], d.pop("annotation_queue_ids", UNSET)) - - def _parse_fully_annotated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - fully_annotated = _parse_fully_annotated(d.pop("fully_annotated", UNSET)) - - def _parse_annotation_status(data: object) -> AnnotationStatus | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - annotation_status_type_0 = AnnotationStatus(data) - - return annotation_status_type_0 - except: # noqa: E722 - pass - return cast(AnnotationStatus | None | Unset, data) - - annotation_status = _parse_annotation_status(d.pop("annotation_status", UNSET)) - - def _parse_annotated_members(data: object) -> list[str] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - annotated_members_type_0 = cast(list[str], data) - - return annotated_members_type_0 - except: # noqa: E722 - pass - return cast(list[str] | None | Unset, data) - - annotated_members = _parse_annotated_members(d.pop("annotated_members", UNSET)) - - progress_message = d.pop("progress_message", UNSET) - - error_message = d.pop("error_message", UNSET) - - def _parse_metric_info(data: object) -> None | PartialExtendedWorkflowSpanRecordMetricInfoType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metric_info_type_0 = PartialExtendedWorkflowSpanRecordMetricInfoType0.from_dict(data) - - return metric_info_type_0 - except: # noqa: E722 - pass - return cast(None | PartialExtendedWorkflowSpanRecordMetricInfoType0 | Unset, data) - - metric_info = _parse_metric_info(d.pop("metric_info", UNSET)) - - def _parse_files(data: object) -> None | PartialExtendedWorkflowSpanRecordFilesType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - files_type_0 = PartialExtendedWorkflowSpanRecordFilesType0.from_dict(data) - - return files_type_0 - except: # noqa: E722 - pass - return cast(None | PartialExtendedWorkflowSpanRecordFilesType0 | Unset, data) - - files = _parse_files(d.pop("files", UNSET)) - - def _parse_parent_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - parent_id_type_0 = UUID(data) - - return parent_id_type_0 - except: # noqa: E722 - pass - return cast(None | Unset | UUID, data) - - parent_id = _parse_parent_id(d.pop("parent_id", UNSET)) - - is_complete = d.pop("is_complete", UNSET) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - partial_extended_workflow_span_record = cls( - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - id=id, - session_id=session_id, - trace_id=trace_id, - project_id=project_id, - run_id=run_id, - updated_at=updated_at, - has_children=has_children, - metrics_batch_id=metrics_batch_id, - session_batch_id=session_batch_id, - feedback_rating_info=feedback_rating_info, - annotations=annotations, - file_ids=file_ids, - file_modalities=file_modalities, - annotation_aggregates=annotation_aggregates, - annotation_agreement=annotation_agreement, - overall_annotation_agreement=overall_annotation_agreement, - annotation_queue_ids=annotation_queue_ids, - fully_annotated=fully_annotated, - annotation_status=annotation_status, - annotated_members=annotated_members, - progress_message=progress_message, - error_message=error_message, - metric_info=metric_info, - files=files, - parent_id=parent_id, - is_complete=is_complete, - step_number=step_number, - ) - - partial_extended_workflow_span_record.additional_properties = d - return partial_extended_workflow_span_record - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotation_aggregates.py b/src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotation_aggregates.py deleted file mode 100644 index d08b73ad..00000000 --- a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotation_aggregates.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_aggregate import AnnotationAggregate - - -T = TypeVar("T", bound="PartialExtendedWorkflowSpanRecordAnnotationAggregates") - - -@_attrs_define -class PartialExtendedWorkflowSpanRecordAnnotationAggregates: - """Annotation aggregate information keyed by template ID""" - - additional_properties: dict[str, AnnotationAggregate] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_aggregate import AnnotationAggregate - - d = dict(src_dict) - partial_extended_workflow_span_record_annotation_aggregates = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationAggregate.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_workflow_span_record_annotation_aggregates.additional_properties = additional_properties - return partial_extended_workflow_span_record_annotation_aggregates - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationAggregate: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationAggregate) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotation_agreement.py b/src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotation_agreement.py deleted file mode 100644 index 46b34e65..00000000 --- a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotation_agreement.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedWorkflowSpanRecordAnnotationAgreement") - - -@_attrs_define -class PartialExtendedWorkflowSpanRecordAnnotationAgreement: - """Annotation agreement scores keyed by template ID""" - - additional_properties: dict[str, float] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_workflow_span_record_annotation_agreement = cls() - - partial_extended_workflow_span_record_annotation_agreement.additional_properties = d - return partial_extended_workflow_span_record_annotation_agreement - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> float: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: float) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotations.py b/src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotations.py deleted file mode 100644 index 49c71896..00000000 --- a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotations.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.partial_extended_workflow_span_record_annotations_additional_property import ( - PartialExtendedWorkflowSpanRecordAnnotationsAdditionalProperty, - ) - - -T = TypeVar("T", bound="PartialExtendedWorkflowSpanRecordAnnotations") - - -@_attrs_define -class PartialExtendedWorkflowSpanRecordAnnotations: - """Annotations keyed by template ID and annotator ID""" - - additional_properties: dict[str, PartialExtendedWorkflowSpanRecordAnnotationsAdditionalProperty] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.partial_extended_workflow_span_record_annotations_additional_property import ( - PartialExtendedWorkflowSpanRecordAnnotationsAdditionalProperty, - ) - - d = dict(src_dict) - partial_extended_workflow_span_record_annotations = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = PartialExtendedWorkflowSpanRecordAnnotationsAdditionalProperty.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_workflow_span_record_annotations.additional_properties = additional_properties - return partial_extended_workflow_span_record_annotations - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> PartialExtendedWorkflowSpanRecordAnnotationsAdditionalProperty: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: PartialExtendedWorkflowSpanRecordAnnotationsAdditionalProperty) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotations_additional_property.py b/src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotations_additional_property.py deleted file mode 100644 index b2b15c88..00000000 --- a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_annotations_additional_property.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.annotation_rating_info import AnnotationRatingInfo - - -T = TypeVar("T", bound="PartialExtendedWorkflowSpanRecordAnnotationsAdditionalProperty") - - -@_attrs_define -class PartialExtendedWorkflowSpanRecordAnnotationsAdditionalProperty: - """ """ - - additional_properties: dict[str, AnnotationRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.annotation_rating_info import AnnotationRatingInfo - - d = dict(src_dict) - partial_extended_workflow_span_record_annotations_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = AnnotationRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_workflow_span_record_annotations_additional_property.additional_properties = ( - additional_properties - ) - return partial_extended_workflow_span_record_annotations_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> AnnotationRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: AnnotationRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_dataset_metadata.py b/src/splunk_ao/resources/models/partial_extended_workflow_span_record_dataset_metadata.py deleted file mode 100644 index 82b271ab..00000000 --- a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedWorkflowSpanRecordDatasetMetadata") - - -@_attrs_define -class PartialExtendedWorkflowSpanRecordDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_workflow_span_record_dataset_metadata = cls() - - partial_extended_workflow_span_record_dataset_metadata.additional_properties = d - return partial_extended_workflow_span_record_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_feedback_rating_info.py b/src/splunk_ao/resources/models/partial_extended_workflow_span_record_feedback_rating_info.py deleted file mode 100644 index ada4747d..00000000 --- a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_feedback_rating_info.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.feedback_rating_info import FeedbackRatingInfo - - -T = TypeVar("T", bound="PartialExtendedWorkflowSpanRecordFeedbackRatingInfo") - - -@_attrs_define -class PartialExtendedWorkflowSpanRecordFeedbackRatingInfo: - """Feedback information related to the record""" - - additional_properties: dict[str, FeedbackRatingInfo] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feedback_rating_info import FeedbackRatingInfo - - d = dict(src_dict) - partial_extended_workflow_span_record_feedback_rating_info = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FeedbackRatingInfo.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_workflow_span_record_feedback_rating_info.additional_properties = additional_properties - return partial_extended_workflow_span_record_feedback_rating_info - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FeedbackRatingInfo: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FeedbackRatingInfo) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_files_type_0.py b/src/splunk_ao/resources/models/partial_extended_workflow_span_record_files_type_0.py deleted file mode 100644 index 19d9f11a..00000000 --- a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_files_type_0.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.file_metadata import FileMetadata - - -T = TypeVar("T", bound="PartialExtendedWorkflowSpanRecordFilesType0") - - -@_attrs_define -class PartialExtendedWorkflowSpanRecordFilesType0: - """ """ - - additional_properties: dict[str, FileMetadata] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_metadata import FileMetadata - - d = dict(src_dict) - partial_extended_workflow_span_record_files_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = FileMetadata.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_workflow_span_record_files_type_0.additional_properties = additional_properties - return partial_extended_workflow_span_record_files_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> FileMetadata: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: FileMetadata) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_metric_info_type_0.py b/src/splunk_ao/resources/models/partial_extended_workflow_span_record_metric_info_type_0.py deleted file mode 100644 index 0f0722df..00000000 --- a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_metric_info_type_0.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - -T = TypeVar("T", bound="PartialExtendedWorkflowSpanRecordMetricInfoType0") - - -@_attrs_define -class PartialExtendedWorkflowSpanRecordMetricInfoType0: - """ """ - - additional_properties: dict[ - str, - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_success import MetricSuccess - - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - if isinstance(prop, MetricNotComputed): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricPending): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricComputing): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricNotApplicable): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricSuccess): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricError): - field_dict[prop_name] = prop.to_dict() - elif isinstance(prop, MetricFailed): - field_dict[prop_name] = prop.to_dict() - else: - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.metric_computing import MetricComputing - from ..models.metric_error import MetricError - from ..models.metric_failed import MetricFailed - from ..models.metric_not_applicable import MetricNotApplicable - from ..models.metric_not_computed import MetricNotComputed - from ..models.metric_pending import MetricPending - from ..models.metric_roll_up import MetricRollUp - from ..models.metric_success import MetricSuccess - - d = dict(src_dict) - partial_extended_workflow_span_record_metric_info_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property( - data: object, - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_0 = MetricNotComputed.from_dict(data) - - return additional_property_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_1 = MetricPending.from_dict(data) - - return additional_property_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_2 = MetricComputing.from_dict(data) - - return additional_property_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_3 = MetricNotApplicable.from_dict(data) - - return additional_property_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_4 = MetricSuccess.from_dict(data) - - return additional_property_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_5 = MetricError.from_dict(data) - - return additional_property_type_5 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - additional_property_type_6 = MetricFailed.from_dict(data) - - return additional_property_type_6 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - additional_property_type_7 = MetricRollUp.from_dict(data) - - return additional_property_type_7 - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - partial_extended_workflow_span_record_metric_info_type_0.additional_properties = additional_properties - return partial_extended_workflow_span_record_metric_info_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: MetricComputing - | MetricError - | MetricFailed - | MetricNotApplicable - | MetricNotComputed - | MetricPending - | MetricRollUp - | MetricSuccess, - ) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_user_metadata.py b/src/splunk_ao/resources/models/partial_extended_workflow_span_record_user_metadata.py deleted file mode 100644 index 8d47593e..00000000 --- a/src/splunk_ao/resources/models/partial_extended_workflow_span_record_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PartialExtendedWorkflowSpanRecordUserMetadata") - - -@_attrs_define -class PartialExtendedWorkflowSpanRecordUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - partial_extended_workflow_span_record_user_metadata = cls() - - partial_extended_workflow_span_record_user_metadata.additional_properties = d - return partial_extended_workflow_span_record_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/permission.py b/src/splunk_ao/resources/models/permission.py index 94e3c14a..6ceca564 100644 --- a/src/splunk_ao/resources/models/permission.py +++ b/src/splunk_ao/resources/models/permission.py @@ -9,6 +9,7 @@ from ..models.annotation_queue_action import AnnotationQueueAction from ..models.api_key_action import ApiKeyAction from ..models.control_resource_action import ControlResourceAction +from ..models.custom_dashboard_action import CustomDashboardAction from ..models.dataset_action import DatasetAction from ..models.fine_tuned_scorer_action import FineTunedScorerAction from ..models.generated_scorer_action import GeneratedScorerAction @@ -19,6 +20,7 @@ from ..models.project_action import ProjectAction from ..models.registered_scorer_action import RegisteredScorerAction from ..models.scorer_action import ScorerAction +from ..models.tokenomics_delegation_action import TokenomicsDelegationAction from ..models.user_action import UserAction from ..types import UNSET, Unset @@ -29,9 +31,10 @@ class Permission: """ Attributes: - action (AnnotationQueueAction | ApiKeyAction | ControlResourceAction | DatasetAction | FineTunedScorerAction | - GeneratedScorerAction | GroupAction | GroupMemberAction | IntegrationAction | OrganizationAction | ProjectAction - | RegisteredScorerAction | ScorerAction | UserAction): + action (AnnotationQueueAction | ApiKeyAction | ControlResourceAction | CustomDashboardAction | DatasetAction | + FineTunedScorerAction | GeneratedScorerAction | GroupAction | GroupMemberAction | IntegrationAction | + OrganizationAction | ProjectAction | RegisteredScorerAction | ScorerAction | TokenomicsDelegationAction | + UserAction): allowed (bool): message (None | str | Unset): """ @@ -40,6 +43,7 @@ class Permission: AnnotationQueueAction | ApiKeyAction | ControlResourceAction + | CustomDashboardAction | DatasetAction | FineTunedScorerAction | GeneratedScorerAction @@ -50,6 +54,7 @@ class Permission: | ProjectAction | RegisteredScorerAction | ScorerAction + | TokenomicsDelegationAction | UserAction ) allowed: bool @@ -84,6 +89,10 @@ def to_dict(self) -> dict[str, Any]: action = self.action.value elif isinstance(self.action, AnnotationQueueAction): action = self.action.value + elif isinstance(self.action, ControlResourceAction): + action = self.action.value + elif isinstance(self.action, CustomDashboardAction): + action = self.action.value else: action = self.action.value @@ -113,6 +122,7 @@ def _parse_action( AnnotationQueueAction | ApiKeyAction | ControlResourceAction + | CustomDashboardAction | DatasetAction | FineTunedScorerAction | GeneratedScorerAction @@ -123,6 +133,7 @@ def _parse_action( | ProjectAction | RegisteredScorerAction | ScorerAction + | TokenomicsDelegationAction | UserAction ): try: @@ -229,11 +240,27 @@ def _parse_action( return action_type_12 except: # noqa: E722 pass + try: + if not isinstance(data, str): + raise TypeError() + action_type_13 = ControlResourceAction(data) + + return action_type_13 + except: # noqa: E722 + pass + try: + if not isinstance(data, str): + raise TypeError() + action_type_14 = CustomDashboardAction(data) + + return action_type_14 + except: # noqa: E722 + pass if not isinstance(data, str): raise TypeError() - action_type_13 = ControlResourceAction(data) + action_type_15 = TokenomicsDelegationAction(data) - return action_type_13 + return action_type_15 action = _parse_action(d.pop("action")) diff --git a/src/splunk_ao/resources/models/policy_package_notice.py b/src/splunk_ao/resources/models/policy_package_notice.py new file mode 100644 index 00000000..6389f1df --- /dev/null +++ b/src/splunk_ao/resources/models/policy_package_notice.py @@ -0,0 +1,115 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.violation_reason import ViolationReason + +T = TypeVar("T", bound="PolicyPackageNotice") + + +@_attrs_define +class PolicyPackageNotice: + """ + Attributes: + package (str): + version (str): + reason (ViolationReason): + advisory_id (None | str): + blocked_from (datetime.date | None): + """ + + package: str + version: str + reason: ViolationReason + advisory_id: None | str + blocked_from: datetime.date | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + package = self.package + + version = self.version + + reason = self.reason.value + + advisory_id: None | str + advisory_id = self.advisory_id + + blocked_from: None | str + if isinstance(self.blocked_from, datetime.date): + blocked_from = self.blocked_from.isoformat() + else: + blocked_from = self.blocked_from + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "package": package, + "version": version, + "reason": reason, + "advisory_id": advisory_id, + "blocked_from": blocked_from, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + package = d.pop("package") + + version = d.pop("version") + + reason = ViolationReason(d.pop("reason")) + + def _parse_advisory_id(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + advisory_id = _parse_advisory_id(d.pop("advisory_id")) + + def _parse_blocked_from(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + blocked_from_type_0 = datetime.date.fromisoformat(data) + + return blocked_from_type_0 + except: # noqa: E722 + pass + return cast(datetime.date | None, data) + + blocked_from = _parse_blocked_from(d.pop("blocked_from")) + + policy_package_notice = cls( + package=package, version=version, reason=reason, advisory_id=advisory_id, blocked_from=blocked_from + ) + + policy_package_notice.additional_properties = d + return policy_package_notice + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/project_action.py b/src/splunk_ao/resources/models/project_action.py index bd7d37e5..2f0d2250 100644 --- a/src/splunk_ao/resources/models/project_action.py +++ b/src/splunk_ao/resources/models/project_action.py @@ -5,6 +5,7 @@ class ProjectAction(str, Enum): CONFIGURE_CROWN_LOGIC = "configure_crown_logic" CONFIGURE_HUMAN_FEEDBACK = "configure_human_feedback" CONFIGURE_RATE_LIMIT = "configure_rate_limit" + CREATE_EVALUATOR = "create_evaluator" CREATE_RUN = "create_run" CREATE_STAGE = "create_stage" DELETE = "delete" @@ -18,6 +19,7 @@ class ProjectAction(str, Enum): EDIT_STAGE = "edit_stage" EXPORT_DATA = "export_data" LOG_DATA = "log_data" + MANAGE_LOG_VIEWS = "manage_log_views" MOVE_RUN = "move_run" READ_ALL_LOGS = "read_all_logs" READ_FILTERED_LOGS = "read_filtered_logs" @@ -28,6 +30,7 @@ class ProjectAction(str, Enum): SHARE = "share" TOGGLE_METRIC = "toggle_metric" UPDATE_CONTROL_BINDINGS = "update_control_bindings" + UPDATE_EVALUATOR_COST_CAP = "update_evaluator_cost_cap" USE_CONTROL_RUNTIME = "use_control_runtime" def __str__(self) -> str: diff --git a/src/splunk_ao/resources/models/project_name_filter_operator.py b/src/splunk_ao/resources/models/project_name_filter_operator.py index 02284fe7..6d5a7c08 100644 --- a/src/splunk_ao/resources/models/project_name_filter_operator.py +++ b/src/splunk_ao/resources/models/project_name_filter_operator.py @@ -7,6 +7,7 @@ class ProjectNameFilterOperator(str, Enum): NE = "ne" NOT_IN = "not_in" ONE_OF = "one_of" + REGEX = "regex" def __str__(self) -> str: return str(self.value) diff --git a/src/splunk_ao/resources/models/prompt_template_name_filter_operator.py b/src/splunk_ao/resources/models/prompt_template_name_filter_operator.py index ed869fbb..10c35d3c 100644 --- a/src/splunk_ao/resources/models/prompt_template_name_filter_operator.py +++ b/src/splunk_ao/resources/models/prompt_template_name_filter_operator.py @@ -7,6 +7,7 @@ class PromptTemplateNameFilterOperator(str, Enum): NE = "ne" NOT_IN = "not_in" ONE_OF = "one_of" + REGEX = "regex" def __str__(self) -> str: return str(self.value) diff --git a/src/splunk_ao/resources/models/recommended_model_purpose.py b/src/splunk_ao/resources/models/recommended_model_purpose.py index ca4b5b22..01ac986e 100644 --- a/src/splunk_ao/resources/models/recommended_model_purpose.py +++ b/src/splunk_ao/resources/models/recommended_model_purpose.py @@ -2,10 +2,12 @@ class RecommendedModelPurpose(str, Enum): + AGENT_INTENT = "agent_intent" AI_ASSISTANT = "ai_assistant" AUTOTUNE = "autotune" CUSTOM_METRIC_AUTOGEN = "custom_metric_autogen" CUSTOM_METRIC_JUDGE = "custom_metric_judge" + GENAI_LENS_SUGGESTIONS = "genai_lens_suggestions" SIGNALS = "signals" SIGNALS_V2 = "signals_v2" diff --git a/src/splunk_ao/resources/models/registered_scorer_task_result_response.py b/src/splunk_ao/resources/models/registered_scorer_task_result_response.py index 81d21b16..eabd2740 100644 --- a/src/splunk_ao/resources/models/registered_scorer_task_result_response.py +++ b/src/splunk_ao/resources/models/registered_scorer_task_result_response.py @@ -7,6 +7,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.registered_scorer_validation_stage import RegisteredScorerValidationStage from ..models.task_result_status import TaskResultStatus from ..types import UNSET, Unset @@ -26,6 +27,8 @@ class RegisteredScorerTaskResultResponse: updated_at (datetime.datetime): status (TaskResultStatus): result (None | str | Unset | ValidateRegisteredScorerResult): + stage (None | RegisteredScorerValidationStage | Unset): + stage_started_at (datetime.datetime | None | Unset): """ id: str @@ -33,6 +36,8 @@ class RegisteredScorerTaskResultResponse: updated_at: datetime.datetime status: TaskResultStatus result: None | str | Unset | ValidateRegisteredScorerResult = UNSET + stage: None | RegisteredScorerValidationStage | Unset = UNSET + stage_started_at: datetime.datetime | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,11 +59,31 @@ def to_dict(self) -> dict[str, Any]: else: result = self.result + stage: None | str | Unset + if isinstance(self.stage, Unset): + stage = UNSET + elif isinstance(self.stage, RegisteredScorerValidationStage): + stage = self.stage.value + else: + stage = self.stage + + stage_started_at: None | str | Unset + if isinstance(self.stage_started_at, Unset): + stage_started_at = UNSET + elif isinstance(self.stage_started_at, datetime.datetime): + stage_started_at = self.stage_started_at.isoformat() + else: + stage_started_at = self.stage_started_at + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"id": id, "created_at": created_at, "updated_at": updated_at, "status": status}) if result is not UNSET: field_dict["result"] = result + if stage is not UNSET: + field_dict["stage"] = stage + if stage_started_at is not UNSET: + field_dict["stage_started_at"] = stage_started_at return field_dict @@ -92,8 +117,48 @@ def _parse_result(data: object) -> None | str | Unset | ValidateRegisteredScorer result = _parse_result(d.pop("result", UNSET)) + def _parse_stage(data: object) -> None | RegisteredScorerValidationStage | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + stage_type_0 = RegisteredScorerValidationStage(data) + + return stage_type_0 + except: # noqa: E722 + pass + return cast(None | RegisteredScorerValidationStage | Unset, data) + + stage = _parse_stage(d.pop("stage", UNSET)) + + def _parse_stage_started_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + stage_started_at_type_0 = datetime.datetime.fromisoformat(data) + + return stage_started_at_type_0 + except: # noqa: E722 + pass + return cast(datetime.datetime | None | Unset, data) + + stage_started_at = _parse_stage_started_at(d.pop("stage_started_at", UNSET)) + registered_scorer_task_result_response = cls( - id=id, created_at=created_at, updated_at=updated_at, status=status, result=result + id=id, + created_at=created_at, + updated_at=updated_at, + status=status, + result=result, + stage=stage, + stage_started_at=stage_started_at, ) registered_scorer_task_result_response.additional_properties = d diff --git a/src/splunk_ao/resources/models/registered_scorer_validation_stage.py b/src/splunk_ao/resources/models/registered_scorer_validation_stage.py new file mode 100644 index 00000000..49e47a22 --- /dev/null +++ b/src/splunk_ao/resources/models/registered_scorer_validation_stage.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class RegisteredScorerValidationStage(str, Enum): + CHECKING_DEPENDENCIES = "checking_dependencies" + PREPARING_ENVIRONMENT = "preparing_environment" + RUNNING_TEST = "running_test" + SCANNING_CODE = "scanning_code" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/run_enabled_evaluator.py b/src/splunk_ao/resources/models/run_enabled_evaluator.py new file mode 100644 index 00000000..6ea1d089 --- /dev/null +++ b/src/splunk_ao/resources/models/run_enabled_evaluator.py @@ -0,0 +1,65 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RunEnabledEvaluator") + + +@_attrs_define +class RunEnabledEvaluator: + """ + Attributes: + scorer_id (str): + scoreable_node_types (list[str]): + scorer_version_id (None | str | Unset): + """ + + scorer_id: str + scoreable_node_types: list[str] + scorer_version_id: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + scorer_id = self.scorer_id + + scoreable_node_types = self.scoreable_node_types + + scorer_version_id: None | str | Unset + if isinstance(self.scorer_version_id, Unset): + scorer_version_id = UNSET + else: + scorer_version_id = self.scorer_version_id + + field_dict: dict[str, Any] = {} + + field_dict.update({"scorer_id": scorer_id, "scoreable_node_types": scoreable_node_types}) + if scorer_version_id is not UNSET: + field_dict["scorer_version_id"] = scorer_version_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + scorer_id = d.pop("scorer_id") + + scoreable_node_types = cast(list[str], d.pop("scoreable_node_types")) + + def _parse_scorer_version_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scorer_version_id = _parse_scorer_version_id(d.pop("scorer_version_id", UNSET)) + + run_enabled_evaluator = cls( + scorer_id=scorer_id, scoreable_node_types=scoreable_node_types, scorer_version_id=scorer_version_id + ) + + return run_enabled_evaluator diff --git a/src/splunk_ao/resources/models/run_evaluator_binding.py b/src/splunk_ao/resources/models/run_evaluator_binding.py new file mode 100644 index 00000000..66e51b9b --- /dev/null +++ b/src/splunk_ao/resources/models/run_evaluator_binding.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RunEvaluatorBinding") + + +@_attrs_define +class RunEvaluatorBinding: + """ + Attributes: + scorer_id (str): + name (str): + label (None | str): + enabled (bool): + compatible (bool): + output_type (None | str): + scoreable_node_types (list[str]): + required_metric_ids (list[str]): + filters (list[Any] | None): + scorer_version_id (None | str | Unset): + """ + + scorer_id: str + name: str + label: None | str + enabled: bool + compatible: bool + output_type: None | str + scoreable_node_types: list[str] + required_metric_ids: list[str] + filters: list[Any] | None + scorer_version_id: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + scorer_id = self.scorer_id + + name = self.name + + label: None | str + label = self.label + + enabled = self.enabled + + compatible = self.compatible + + output_type: None | str + output_type = self.output_type + + scoreable_node_types = self.scoreable_node_types + + required_metric_ids = self.required_metric_ids + + filters: list[Any] | None + if isinstance(self.filters, list): + filters = self.filters + + else: + filters = self.filters + + scorer_version_id: None | str | Unset + if isinstance(self.scorer_version_id, Unset): + scorer_version_id = UNSET + else: + scorer_version_id = self.scorer_version_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "scorer_id": scorer_id, + "name": name, + "label": label, + "enabled": enabled, + "compatible": compatible, + "output_type": output_type, + "scoreable_node_types": scoreable_node_types, + "required_metric_ids": required_metric_ids, + "filters": filters, + } + ) + if scorer_version_id is not UNSET: + field_dict["scorer_version_id"] = scorer_version_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + scorer_id = d.pop("scorer_id") + + name = d.pop("name") + + def _parse_label(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + label = _parse_label(d.pop("label")) + + enabled = d.pop("enabled") + + compatible = d.pop("compatible") + + def _parse_output_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + output_type = _parse_output_type(d.pop("output_type")) + + scoreable_node_types = cast(list[str], d.pop("scoreable_node_types")) + + required_metric_ids = cast(list[str], d.pop("required_metric_ids")) + + def _parse_filters(data: object) -> list[Any] | None: + if data is None: + return data + try: + if not isinstance(data, list): + raise TypeError() + filters_type_0 = cast(list[Any], data) + + return filters_type_0 + except: # noqa: E722 + pass + return cast(list[Any] | None, data) + + filters = _parse_filters(d.pop("filters")) + + def _parse_scorer_version_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scorer_version_id = _parse_scorer_version_id(d.pop("scorer_version_id", UNSET)) + + run_evaluator_binding = cls( + scorer_id=scorer_id, + name=name, + label=label, + enabled=enabled, + compatible=compatible, + output_type=output_type, + scoreable_node_types=scoreable_node_types, + required_metric_ids=required_metric_ids, + filters=filters, + scorer_version_id=scorer_version_id, + ) + + return run_evaluator_binding diff --git a/src/splunk_ao/resources/models/run_evaluators_enabled.py b/src/splunk_ao/resources/models/run_evaluators_enabled.py new file mode 100644 index 00000000..839bdf32 --- /dev/null +++ b/src/splunk_ao/resources/models/run_evaluators_enabled.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.run_enabled_evaluator import RunEnabledEvaluator + + +T = TypeVar("T", bound="RunEvaluatorsEnabled") + + +@_attrs_define +class RunEvaluatorsEnabled: + """ + Attributes: + project_id (str): + log_stream_id (str): + evaluators (list[RunEnabledEvaluator]): + """ + + project_id: str + log_stream_id: str + evaluators: list[RunEnabledEvaluator] + + def to_dict(self) -> dict[str, Any]: + project_id = self.project_id + + log_stream_id = self.log_stream_id + + evaluators = [] + for evaluators_item_data in self.evaluators: + evaluators_item = evaluators_item_data.to_dict() + evaluators.append(evaluators_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({"project_id": project_id, "log_stream_id": log_stream_id, "evaluators": evaluators}) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_enabled_evaluator import RunEnabledEvaluator + + d = dict(src_dict) + project_id = d.pop("project_id") + + log_stream_id = d.pop("log_stream_id") + + evaluators = [] + _evaluators = d.pop("evaluators") + for evaluators_item_data in _evaluators: + evaluators_item = RunEnabledEvaluator.from_dict(evaluators_item_data) + + evaluators.append(evaluators_item) + + run_evaluators_enabled = cls(project_id=project_id, log_stream_id=log_stream_id, evaluators=evaluators) + + return run_evaluators_enabled diff --git a/src/splunk_ao/resources/models/run_evaluators_inspection.py b/src/splunk_ao/resources/models/run_evaluators_inspection.py new file mode 100644 index 00000000..5dea3a6d --- /dev/null +++ b/src/splunk_ao/resources/models/run_evaluators_inspection.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.run_evaluator_binding import RunEvaluatorBinding + + +T = TypeVar("T", bound="RunEvaluatorsInspection") + + +@_attrs_define +class RunEvaluatorsInspection: + """ + Attributes: + project_id (str): + log_stream_id (str): + log_stream_name (str): + bindings (list[RunEvaluatorBinding]): + """ + + project_id: str + log_stream_id: str + log_stream_name: str + bindings: list[RunEvaluatorBinding] + + def to_dict(self) -> dict[str, Any]: + project_id = self.project_id + + log_stream_id = self.log_stream_id + + log_stream_name = self.log_stream_name + + bindings = [] + for bindings_item_data in self.bindings: + bindings_item = bindings_item_data.to_dict() + bindings.append(bindings_item) + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "project_id": project_id, + "log_stream_id": log_stream_id, + "log_stream_name": log_stream_name, + "bindings": bindings, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_evaluator_binding import RunEvaluatorBinding + + d = dict(src_dict) + project_id = d.pop("project_id") + + log_stream_id = d.pop("log_stream_id") + + log_stream_name = d.pop("log_stream_name") + + bindings = [] + _bindings = d.pop("bindings") + for bindings_item_data in _bindings: + bindings_item = RunEvaluatorBinding.from_dict(bindings_item_data) + + bindings.append(bindings_item) + + run_evaluators_inspection = cls( + project_id=project_id, log_stream_id=log_stream_id, log_stream_name=log_stream_name, bindings=bindings + ) + + return run_evaluators_inspection diff --git a/src/splunk_ao/resources/models/run_evaluators_request.py b/src/splunk_ao/resources/models/run_evaluators_request.py new file mode 100644 index 00000000..93c87f67 --- /dev/null +++ b/src/splunk_ao/resources/models/run_evaluators_request.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.saved_evaluator_reference import SavedEvaluatorReference + + +T = TypeVar("T", bound="RunEvaluatorsRequest") + + +@_attrs_define +class RunEvaluatorsRequest: + """ + Attributes: + evaluators (list[SavedEvaluatorReference]): + """ + + evaluators: list[SavedEvaluatorReference] + + def to_dict(self) -> dict[str, Any]: + evaluators = [] + for evaluators_item_data in self.evaluators: + evaluators_item = evaluators_item_data.to_dict() + evaluators.append(evaluators_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({"evaluators": evaluators}) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.saved_evaluator_reference import SavedEvaluatorReference + + d = dict(src_dict) + evaluators = [] + _evaluators = d.pop("evaluators") + for evaluators_item_data in _evaluators: + evaluators_item = SavedEvaluatorReference.from_dict(evaluators_item_data) + + evaluators.append(evaluators_item) + + run_evaluators_request = cls(evaluators=evaluators) + + return run_evaluators_request diff --git a/src/splunk_ao/resources/models/run_name_filter_operator.py b/src/splunk_ao/resources/models/run_name_filter_operator.py index bad328be..0297c5f9 100644 --- a/src/splunk_ao/resources/models/run_name_filter_operator.py +++ b/src/splunk_ao/resources/models/run_name_filter_operator.py @@ -7,6 +7,7 @@ class RunNameFilterOperator(str, Enum): NE = "ne" NOT_IN = "not_in" ONE_OF = "one_of" + REGEX = "regex" def __str__(self) -> str: return str(self.value) diff --git a/src/splunk_ao/resources/models/run_scorer_settings_patch_request.py b/src/splunk_ao/resources/models/run_scorer_settings_patch_request.py index 73329977..40abfe4d 100644 --- a/src/splunk_ao/resources/models/run_scorer_settings_patch_request.py +++ b/src/splunk_ao/resources/models/run_scorer_settings_patch_request.py @@ -21,18 +21,29 @@ class RunScorerSettingsPatchRequest: """ Attributes: run_id (str): ID of the run. + expected_settings_revision (None | str | Unset): Revision read before replacing settings. A stale revision + returns 409. scorers (list[RuntimeScorerConfig] | None | Unset): List of Galileo scorers to enable. segment_filters (list[SegmentFilter] | None | Unset): List of segment filters to apply to the run. + signals_novelty_enabled (bool | Unset): Enable online Signals scoring for this run. Default: False. """ run_id: str + expected_settings_revision: None | str | Unset = UNSET scorers: list[RuntimeScorerConfig] | None | Unset = UNSET segment_filters: list[SegmentFilter] | None | Unset = UNSET + signals_novelty_enabled: bool | Unset = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: run_id = self.run_id + expected_settings_revision: None | str | Unset + if isinstance(self.expected_settings_revision, Unset): + expected_settings_revision = UNSET + else: + expected_settings_revision = self.expected_settings_revision + scorers: list[dict[str, Any]] | None | Unset if isinstance(self.scorers, Unset): scorers = UNSET @@ -57,13 +68,19 @@ def to_dict(self) -> dict[str, Any]: else: segment_filters = self.segment_filters + signals_novelty_enabled = self.signals_novelty_enabled + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"run_id": run_id}) + if expected_settings_revision is not UNSET: + field_dict["expected_settings_revision"] = expected_settings_revision if scorers is not UNSET: field_dict["scorers"] = scorers if segment_filters is not UNSET: field_dict["segment_filters"] = segment_filters + if signals_novelty_enabled is not UNSET: + field_dict["signals_novelty_enabled"] = signals_novelty_enabled return field_dict @@ -75,6 +92,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) run_id = d.pop("run_id") + def _parse_expected_settings_revision(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + expected_settings_revision = _parse_expected_settings_revision(d.pop("expected_settings_revision", UNSET)) + def _parse_scorers(data: object) -> list[RuntimeScorerConfig] | None | Unset: if data is None: return data @@ -119,7 +145,15 @@ def _parse_segment_filters(data: object) -> list[SegmentFilter] | None | Unset: segment_filters = _parse_segment_filters(d.pop("segment_filters", UNSET)) - run_scorer_settings_patch_request = cls(run_id=run_id, scorers=scorers, segment_filters=segment_filters) + signals_novelty_enabled = d.pop("signals_novelty_enabled", UNSET) + + run_scorer_settings_patch_request = cls( + run_id=run_id, + expected_settings_revision=expected_settings_revision, + scorers=scorers, + segment_filters=segment_filters, + signals_novelty_enabled=signals_novelty_enabled, + ) run_scorer_settings_patch_request.additional_properties = d return run_scorer_settings_patch_request diff --git a/src/splunk_ao/resources/models/run_scorer_settings_response.py b/src/splunk_ao/resources/models/run_scorer_settings_response.py index 7a745302..68341eef 100644 --- a/src/splunk_ao/resources/models/run_scorer_settings_response.py +++ b/src/splunk_ao/resources/models/run_scorer_settings_response.py @@ -22,12 +22,19 @@ class RunScorerSettingsResponse: Attributes: scorers (list[RuntimeScorerConfig]): run_id (str): ID of the run. + expected_settings_revision (None | str | Unset): Revision read before replacing settings. A stale revision + returns 409. segment_filters (list[SegmentFilter] | None | Unset): List of segment filters to apply to the run. + signals_novelty_enabled (bool | Unset): Enable online Signals scoring for this run. Default: False. + settings_revision (None | str | Unset): Revision of the persisted evaluator settings. """ scorers: list[RuntimeScorerConfig] run_id: str + expected_settings_revision: None | str | Unset = UNSET segment_filters: list[SegmentFilter] | None | Unset = UNSET + signals_novelty_enabled: bool | Unset = False + settings_revision: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,6 +45,12 @@ def to_dict(self) -> dict[str, Any]: run_id = self.run_id + expected_settings_revision: None | str | Unset + if isinstance(self.expected_settings_revision, Unset): + expected_settings_revision = UNSET + else: + expected_settings_revision = self.expected_settings_revision + segment_filters: list[dict[str, Any]] | None | Unset if isinstance(self.segment_filters, Unset): segment_filters = UNSET @@ -50,11 +63,25 @@ def to_dict(self) -> dict[str, Any]: else: segment_filters = self.segment_filters + signals_novelty_enabled = self.signals_novelty_enabled + + settings_revision: None | str | Unset + if isinstance(self.settings_revision, Unset): + settings_revision = UNSET + else: + settings_revision = self.settings_revision + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"scorers": scorers, "run_id": run_id}) + if expected_settings_revision is not UNSET: + field_dict["expected_settings_revision"] = expected_settings_revision if segment_filters is not UNSET: field_dict["segment_filters"] = segment_filters + if signals_novelty_enabled is not UNSET: + field_dict["signals_novelty_enabled"] = signals_novelty_enabled + if settings_revision is not UNSET: + field_dict["settings_revision"] = settings_revision return field_dict @@ -73,6 +100,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: run_id = d.pop("run_id") + def _parse_expected_settings_revision(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + expected_settings_revision = _parse_expected_settings_revision(d.pop("expected_settings_revision", UNSET)) + def _parse_segment_filters(data: object) -> list[SegmentFilter] | None | Unset: if data is None: return data @@ -95,7 +131,25 @@ def _parse_segment_filters(data: object) -> list[SegmentFilter] | None | Unset: segment_filters = _parse_segment_filters(d.pop("segment_filters", UNSET)) - run_scorer_settings_response = cls(scorers=scorers, run_id=run_id, segment_filters=segment_filters) + signals_novelty_enabled = d.pop("signals_novelty_enabled", UNSET) + + def _parse_settings_revision(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + settings_revision = _parse_settings_revision(d.pop("settings_revision", UNSET)) + + run_scorer_settings_response = cls( + scorers=scorers, + run_id=run_id, + expected_settings_revision=expected_settings_revision, + segment_filters=segment_filters, + signals_novelty_enabled=signals_novelty_enabled, + settings_revision=settings_revision, + ) run_scorer_settings_response.additional_properties = d return run_scorer_settings_response diff --git a/src/splunk_ao/resources/models/runtime_scorer_config.py b/src/splunk_ao/resources/models/runtime_scorer_config.py index 443d5834..d8a0a014 100644 --- a/src/splunk_ao/resources/models/runtime_scorer_config.py +++ b/src/splunk_ao/resources/models/runtime_scorer_config.py @@ -30,6 +30,8 @@ from ..models.runtime_scorer_config_class_name_to_vocab_ix_type_0 import RuntimeScorerConfigClassNameToVocabIxType0 from ..models.runtime_scorer_config_class_name_to_vocab_ix_type_1 import RuntimeScorerConfigClassNameToVocabIxType1 from ..models.scorer_invocation_config import ScorerInvocationConfig + from ..models.scorer_metadata_selection import ScorerMetadataSelection + from ..models.span_input_selection import SpanInputSelection T = TypeVar("T", bound="RuntimeScorerConfig") @@ -61,6 +63,10 @@ class RuntimeScorerConfig: categorical, etc.). input_type (InputTypeEnum | None | Unset): What type of input to use for model-based scorers (sessions_normalized, trace_io_only, etc..). + metadata_selection (None | ScorerMetadataSelection | Unset): + span_input_selections (list[SpanInputSelection] | None | Unset): + require_matching_span (bool | Unset): Default: False. + child_span_filters (list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset): multimodal_capabilities (list[MultimodalCapability] | None | Unset): Multimodal capabilities which this scorer can utilize in its evaluation. roll_up_config (BaseMetricRollUpConfigDB | None | Unset): @@ -108,6 +114,10 @@ class RuntimeScorerConfig: cot_enabled: bool | None | Unset = UNSET output_type: None | OutputTypeEnum | Unset = UNSET input_type: InputTypeEnum | None | Unset = UNSET + metadata_selection: None | ScorerMetadataSelection | Unset = UNSET + span_input_selections: list[SpanInputSelection] | None | Unset = UNSET + require_matching_span: bool | Unset = False + child_span_filters: list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset = UNSET multimodal_capabilities: list[MultimodalCapability] | None | Unset = UNSET roll_up_config: BaseMetricRollUpConfigDB | None | Unset = UNSET score_type: None | str | Unset = UNSET @@ -156,6 +166,7 @@ def to_dict(self) -> dict[str, Any]: RuntimeScorerConfigClassNameToVocabIxType1, ) from ..models.scorer_invocation_config import ScorerInvocationConfig + from ..models.scorer_metadata_selection import ScorerMetadataSelection id = self.id @@ -257,6 +268,47 @@ def to_dict(self) -> dict[str, Any]: else: input_type = self.input_type + metadata_selection: dict[str, Any] | None | Unset + if isinstance(self.metadata_selection, Unset): + metadata_selection = UNSET + elif isinstance(self.metadata_selection, ScorerMetadataSelection): + metadata_selection = self.metadata_selection.to_dict() + else: + metadata_selection = self.metadata_selection + + span_input_selections: list[dict[str, Any]] | None | Unset + if isinstance(self.span_input_selections, Unset): + span_input_selections = UNSET + elif isinstance(self.span_input_selections, list): + span_input_selections = [] + for span_input_selections_type_0_item_data in self.span_input_selections: + span_input_selections_type_0_item = span_input_selections_type_0_item_data.to_dict() + span_input_selections.append(span_input_selections_type_0_item) + + else: + span_input_selections = self.span_input_selections + + require_matching_span = self.require_matching_span + + child_span_filters: list[dict[str, Any]] | None | Unset + if isinstance(self.child_span_filters, Unset): + child_span_filters = UNSET + elif isinstance(self.child_span_filters, list): + child_span_filters = [] + for child_span_filters_type_0_item_data in self.child_span_filters: + child_span_filters_type_0_item: dict[str, Any] + if isinstance(child_span_filters_type_0_item_data, NodeNameFilter): + child_span_filters_type_0_item = child_span_filters_type_0_item_data.to_dict() + elif isinstance(child_span_filters_type_0_item_data, MetadataFilter): + child_span_filters_type_0_item = child_span_filters_type_0_item_data.to_dict() + else: + child_span_filters_type_0_item = child_span_filters_type_0_item_data.to_dict() + + child_span_filters.append(child_span_filters_type_0_item) + + else: + child_span_filters = self.child_span_filters + multimodal_capabilities: list[str] | None | Unset if isinstance(self.multimodal_capabilities, Unset): multimodal_capabilities = UNSET @@ -487,6 +539,14 @@ def to_dict(self) -> dict[str, Any]: field_dict["output_type"] = output_type if input_type is not UNSET: field_dict["input_type"] = input_type + if metadata_selection is not UNSET: + field_dict["metadata_selection"] = metadata_selection + if span_input_selections is not UNSET: + field_dict["span_input_selections"] = span_input_selections + if require_matching_span is not UNSET: + field_dict["require_matching_span"] = require_matching_span + if child_span_filters is not UNSET: + field_dict["child_span_filters"] = child_span_filters if multimodal_capabilities is not UNSET: field_dict["multimodal_capabilities"] = multimodal_capabilities if roll_up_config is not UNSET: @@ -564,6 +624,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: RuntimeScorerConfigClassNameToVocabIxType1, ) from ..models.scorer_invocation_config import ScorerInvocationConfig + from ..models.scorer_metadata_selection import ScorerMetadataSelection + from ..models.span_input_selection import SpanInputSelection d = dict(src_dict) id = d.pop("id") @@ -761,6 +823,101 @@ def _parse_input_type(data: object) -> InputTypeEnum | None | Unset: input_type = _parse_input_type(d.pop("input_type", UNSET)) + def _parse_metadata_selection(data: object) -> None | ScorerMetadataSelection | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + metadata_selection_type_0 = ScorerMetadataSelection.from_dict(data) + + return metadata_selection_type_0 + except: # noqa: E722 + pass + return cast(None | ScorerMetadataSelection | Unset, data) + + metadata_selection = _parse_metadata_selection(d.pop("metadata_selection", UNSET)) + + def _parse_span_input_selections(data: object) -> list[SpanInputSelection] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + span_input_selections_type_0 = [] + _span_input_selections_type_0 = data + for span_input_selections_type_0_item_data in _span_input_selections_type_0: + span_input_selections_type_0_item = SpanInputSelection.from_dict( + span_input_selections_type_0_item_data + ) + + span_input_selections_type_0.append(span_input_selections_type_0_item) + + return span_input_selections_type_0 + except: # noqa: E722 + pass + return cast(list[SpanInputSelection] | None | Unset, data) + + span_input_selections = _parse_span_input_selections(d.pop("span_input_selections", UNSET)) + + require_matching_span = d.pop("require_matching_span", UNSET) + + def _parse_child_span_filters( + data: object, + ) -> list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + child_span_filters_type_0 = [] + _child_span_filters_type_0 = data + for child_span_filters_type_0_item_data in _child_span_filters_type_0: + + def _parse_child_span_filters_type_0_item( + data: object, + ) -> MetadataFilter | ModalityFilter | NodeNameFilter: + try: + if not isinstance(data, dict): + raise TypeError() + child_span_filters_type_0_item_type_0 = NodeNameFilter.from_dict(data) + + return child_span_filters_type_0_item_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + child_span_filters_type_0_item_type_1 = MetadataFilter.from_dict(data) + + return child_span_filters_type_0_item_type_1 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + child_span_filters_type_0_item_type_2 = ModalityFilter.from_dict(data) + + return child_span_filters_type_0_item_type_2 + + child_span_filters_type_0_item = _parse_child_span_filters_type_0_item( + child_span_filters_type_0_item_data + ) + + child_span_filters_type_0.append(child_span_filters_type_0_item) + + return child_span_filters_type_0 + except: # noqa: E722 + pass + return cast(list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset, data) + + child_span_filters = _parse_child_span_filters(d.pop("child_span_filters", UNSET)) + def _parse_multimodal_capabilities(data: object) -> list[MultimodalCapability] | None | Unset: if data is None: return data @@ -1162,6 +1319,10 @@ def _parse_decision_answer_options( cot_enabled=cot_enabled, output_type=output_type, input_type=input_type, + metadata_selection=metadata_selection, + span_input_selections=span_input_selections, + require_matching_span=require_matching_span, + child_span_filters=child_span_filters, multimodal_capabilities=multimodal_capabilities, roll_up_config=roll_up_config, score_type=score_type, diff --git a/src/splunk_ao/resources/models/saved_evaluator_reference.py b/src/splunk_ao/resources/models/saved_evaluator_reference.py new file mode 100644 index 00000000..7e42361f --- /dev/null +++ b/src/splunk_ao/resources/models/saved_evaluator_reference.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SavedEvaluatorReference") + + +@_attrs_define +class SavedEvaluatorReference: + """A saved Evaluator and the optional exact version selected by its caller. + + Attributes: + scorer_id (str): + scorer_version_id (None | str | Unset): + """ + + scorer_id: str + scorer_version_id: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + scorer_id = self.scorer_id + + scorer_version_id: None | str | Unset + if isinstance(self.scorer_version_id, Unset): + scorer_version_id = UNSET + else: + scorer_version_id = self.scorer_version_id + + field_dict: dict[str, Any] = {} + + field_dict.update({"scorer_id": scorer_id}) + if scorer_version_id is not UNSET: + field_dict["scorer_version_id"] = scorer_version_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + scorer_id = d.pop("scorer_id") + + def _parse_scorer_version_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scorer_version_id = _parse_scorer_version_id(d.pop("scorer_version_id", UNSET)) + + saved_evaluator_reference = cls(scorer_id=scorer_id, scorer_version_id=scorer_version_id) + + return saved_evaluator_reference diff --git a/src/splunk_ao/resources/models/score_rating.py b/src/splunk_ao/resources/models/score_rating.py index de31349b..c14466ac 100644 --- a/src/splunk_ao/resources/models/score_rating.py +++ b/src/splunk_ao/resources/models/score_rating.py @@ -16,23 +16,23 @@ class ScoreRating: """ Attributes: value (int): - annotation_type (Literal['score'] | Unset): Default: 'score'. + feedback_type (Literal['score'] | Unset): Default: 'score'. """ value: int - annotation_type: Literal["score"] | Unset = "score" + feedback_type: Literal["score"] | Unset = "score" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: value = self.value - annotation_type = self.annotation_type + feedback_type = self.feedback_type field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"value": value}) - if annotation_type is not UNSET: - field_dict["annotation_type"] = annotation_type + if feedback_type is not UNSET: + field_dict["feedback_type"] = feedback_type return field_dict @@ -41,11 +41,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) value = d.pop("value") - annotation_type = cast(Literal["score"] | Unset, d.pop("annotation_type", UNSET)) - if annotation_type != "score" and not isinstance(annotation_type, Unset): - raise ValueError(f"annotation_type must match const 'score', got '{annotation_type}'") + feedback_type = cast(Literal["score"] | Unset, d.pop("feedback_type", UNSET)) + if feedback_type != "score" and not isinstance(feedback_type, Unset): + raise ValueError(f"feedback_type must match const 'score', got '{feedback_type}'") - score_rating = cls(value=value, annotation_type=annotation_type) + score_rating = cls(value=value, feedback_type=feedback_type) score_rating.additional_properties = d return score_rating diff --git a/src/splunk_ao/resources/models/scorer_catalog_version_response.py b/src/splunk_ao/resources/models/scorer_catalog_version_response.py new file mode 100644 index 00000000..e8915279 --- /dev/null +++ b/src/splunk_ao/resources/models/scorer_catalog_version_response.py @@ -0,0 +1,389 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.base_finetuned_scorer_db import BaseFinetunedScorerDB + from ..models.base_generated_scorer_db import BaseGeneratedScorerDB + from ..models.base_luna_3_scorer_db import BaseLuna3ScorerDB + from ..models.base_registered_scorer_db import BaseRegisteredScorerDB + from ..models.decision_scorer_db import DecisionScorerDB + from ..models.scorer_catalog_version_response_luna_validation_contract_type_0 import ( + ScorerCatalogVersionResponseLunaValidationContractType0, + ) + + +T = TypeVar("T", bound="ScorerCatalogVersionResponse") + + +@_attrs_define +class ScorerCatalogVersionResponse: + """ + Attributes: + id (str): + version (int): + scorer_id (str): + generated_scorer (BaseGeneratedScorerDB | None | Unset): + registered_scorer (BaseRegisteredScorerDB | None | Unset): + finetuned_scorer (BaseFinetunedScorerDB | None | Unset): + luna3_scorer (BaseLuna3ScorerDB | None | Unset): + decision_scorer (DecisionScorerDB | None | Unset): + model_name (None | str | Unset): + num_judges (int | None | Unset): + cot_enabled (bool | None | Unset): Whether to enable chain of thought for this scorer. Defaults to False for llm + scorers. + runtime (None | str | Unset): The runtime a code metric version runs on, such as python3.14. Null for a version + saved before runtimes were recorded, which runs on the legacy Python 3.12 runtime. + code_sha256 (None | str | Unset): SHA-256 of the code bytes uploaded for a code metric version. Null for a + version saved before digests were recorded. + luna_validation_contract (None | ScorerCatalogVersionResponseLunaValidationContractType0 | Unset): + """ + + id: str + version: int + scorer_id: str + generated_scorer: BaseGeneratedScorerDB | None | Unset = UNSET + registered_scorer: BaseRegisteredScorerDB | None | Unset = UNSET + finetuned_scorer: BaseFinetunedScorerDB | None | Unset = UNSET + luna3_scorer: BaseLuna3ScorerDB | None | Unset = UNSET + decision_scorer: DecisionScorerDB | None | Unset = UNSET + model_name: None | str | Unset = UNSET + num_judges: int | None | Unset = UNSET + cot_enabled: bool | None | Unset = UNSET + runtime: None | str | Unset = UNSET + code_sha256: None | str | Unset = UNSET + luna_validation_contract: None | ScorerCatalogVersionResponseLunaValidationContractType0 | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.base_finetuned_scorer_db import BaseFinetunedScorerDB + from ..models.base_generated_scorer_db import BaseGeneratedScorerDB + from ..models.base_luna_3_scorer_db import BaseLuna3ScorerDB + from ..models.base_registered_scorer_db import BaseRegisteredScorerDB + from ..models.decision_scorer_db import DecisionScorerDB + from ..models.scorer_catalog_version_response_luna_validation_contract_type_0 import ( + ScorerCatalogVersionResponseLunaValidationContractType0, + ) + + id = self.id + + version = self.version + + scorer_id = self.scorer_id + + generated_scorer: dict[str, Any] | None | Unset + if isinstance(self.generated_scorer, Unset): + generated_scorer = UNSET + elif isinstance(self.generated_scorer, BaseGeneratedScorerDB): + generated_scorer = self.generated_scorer.to_dict() + else: + generated_scorer = self.generated_scorer + + registered_scorer: dict[str, Any] | None | Unset + if isinstance(self.registered_scorer, Unset): + registered_scorer = UNSET + elif isinstance(self.registered_scorer, BaseRegisteredScorerDB): + registered_scorer = self.registered_scorer.to_dict() + else: + registered_scorer = self.registered_scorer + + finetuned_scorer: dict[str, Any] | None | Unset + if isinstance(self.finetuned_scorer, Unset): + finetuned_scorer = UNSET + elif isinstance(self.finetuned_scorer, BaseFinetunedScorerDB): + finetuned_scorer = self.finetuned_scorer.to_dict() + else: + finetuned_scorer = self.finetuned_scorer + + luna3_scorer: dict[str, Any] | None | Unset + if isinstance(self.luna3_scorer, Unset): + luna3_scorer = UNSET + elif isinstance(self.luna3_scorer, BaseLuna3ScorerDB): + luna3_scorer = self.luna3_scorer.to_dict() + else: + luna3_scorer = self.luna3_scorer + + decision_scorer: dict[str, Any] | None | Unset + if isinstance(self.decision_scorer, Unset): + decision_scorer = UNSET + elif isinstance(self.decision_scorer, DecisionScorerDB): + decision_scorer = self.decision_scorer.to_dict() + else: + decision_scorer = self.decision_scorer + + model_name: None | str | Unset + if isinstance(self.model_name, Unset): + model_name = UNSET + else: + model_name = self.model_name + + num_judges: int | None | Unset + if isinstance(self.num_judges, Unset): + num_judges = UNSET + else: + num_judges = self.num_judges + + cot_enabled: bool | None | Unset + if isinstance(self.cot_enabled, Unset): + cot_enabled = UNSET + else: + cot_enabled = self.cot_enabled + + runtime: None | str | Unset + if isinstance(self.runtime, Unset): + runtime = UNSET + else: + runtime = self.runtime + + code_sha256: None | str | Unset + if isinstance(self.code_sha256, Unset): + code_sha256 = UNSET + else: + code_sha256 = self.code_sha256 + + luna_validation_contract: dict[str, Any] | None | Unset + if isinstance(self.luna_validation_contract, Unset): + luna_validation_contract = UNSET + elif isinstance(self.luna_validation_contract, ScorerCatalogVersionResponseLunaValidationContractType0): + luna_validation_contract = self.luna_validation_contract.to_dict() + else: + luna_validation_contract = self.luna_validation_contract + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({"id": id, "version": version, "scorer_id": scorer_id}) + if generated_scorer is not UNSET: + field_dict["generated_scorer"] = generated_scorer + if registered_scorer is not UNSET: + field_dict["registered_scorer"] = registered_scorer + if finetuned_scorer is not UNSET: + field_dict["finetuned_scorer"] = finetuned_scorer + if luna3_scorer is not UNSET: + field_dict["luna3_scorer"] = luna3_scorer + if decision_scorer is not UNSET: + field_dict["decision_scorer"] = decision_scorer + if model_name is not UNSET: + field_dict["model_name"] = model_name + if num_judges is not UNSET: + field_dict["num_judges"] = num_judges + if cot_enabled is not UNSET: + field_dict["cot_enabled"] = cot_enabled + if runtime is not UNSET: + field_dict["runtime"] = runtime + if code_sha256 is not UNSET: + field_dict["code_sha256"] = code_sha256 + if luna_validation_contract is not UNSET: + field_dict["luna_validation_contract"] = luna_validation_contract + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.base_finetuned_scorer_db import BaseFinetunedScorerDB + from ..models.base_generated_scorer_db import BaseGeneratedScorerDB + from ..models.base_luna_3_scorer_db import BaseLuna3ScorerDB + from ..models.base_registered_scorer_db import BaseRegisteredScorerDB + from ..models.decision_scorer_db import DecisionScorerDB + from ..models.scorer_catalog_version_response_luna_validation_contract_type_0 import ( + ScorerCatalogVersionResponseLunaValidationContractType0, + ) + + d = dict(src_dict) + id = d.pop("id") + + version = d.pop("version") + + scorer_id = d.pop("scorer_id") + + def _parse_generated_scorer(data: object) -> BaseGeneratedScorerDB | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + generated_scorer_type_0 = BaseGeneratedScorerDB.from_dict(data) + + return generated_scorer_type_0 + except: # noqa: E722 + pass + return cast(BaseGeneratedScorerDB | None | Unset, data) + + generated_scorer = _parse_generated_scorer(d.pop("generated_scorer", UNSET)) + + def _parse_registered_scorer(data: object) -> BaseRegisteredScorerDB | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + registered_scorer_type_0 = BaseRegisteredScorerDB.from_dict(data) + + return registered_scorer_type_0 + except: # noqa: E722 + pass + return cast(BaseRegisteredScorerDB | None | Unset, data) + + registered_scorer = _parse_registered_scorer(d.pop("registered_scorer", UNSET)) + + def _parse_finetuned_scorer(data: object) -> BaseFinetunedScorerDB | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + finetuned_scorer_type_0 = BaseFinetunedScorerDB.from_dict(data) + + return finetuned_scorer_type_0 + except: # noqa: E722 + pass + return cast(BaseFinetunedScorerDB | None | Unset, data) + + finetuned_scorer = _parse_finetuned_scorer(d.pop("finetuned_scorer", UNSET)) + + def _parse_luna3_scorer(data: object) -> BaseLuna3ScorerDB | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + luna3_scorer_type_0 = BaseLuna3ScorerDB.from_dict(data) + + return luna3_scorer_type_0 + except: # noqa: E722 + pass + return cast(BaseLuna3ScorerDB | None | Unset, data) + + luna3_scorer = _parse_luna3_scorer(d.pop("luna3_scorer", UNSET)) + + def _parse_decision_scorer(data: object) -> DecisionScorerDB | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + decision_scorer_type_0 = DecisionScorerDB.from_dict(data) + + return decision_scorer_type_0 + except: # noqa: E722 + pass + return cast(DecisionScorerDB | None | Unset, data) + + decision_scorer = _parse_decision_scorer(d.pop("decision_scorer", UNSET)) + + def _parse_model_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + model_name = _parse_model_name(d.pop("model_name", UNSET)) + + def _parse_num_judges(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + num_judges = _parse_num_judges(d.pop("num_judges", UNSET)) + + def _parse_cot_enabled(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + cot_enabled = _parse_cot_enabled(d.pop("cot_enabled", UNSET)) + + def _parse_runtime(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + runtime = _parse_runtime(d.pop("runtime", UNSET)) + + def _parse_code_sha256(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + code_sha256 = _parse_code_sha256(d.pop("code_sha256", UNSET)) + + def _parse_luna_validation_contract( + data: object, + ) -> None | ScorerCatalogVersionResponseLunaValidationContractType0 | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + luna_validation_contract_type_0 = ScorerCatalogVersionResponseLunaValidationContractType0.from_dict( + data + ) + + return luna_validation_contract_type_0 + except: # noqa: E722 + pass + return cast(None | ScorerCatalogVersionResponseLunaValidationContractType0 | Unset, data) + + luna_validation_contract = _parse_luna_validation_contract(d.pop("luna_validation_contract", UNSET)) + + scorer_catalog_version_response = cls( + id=id, + version=version, + scorer_id=scorer_id, + generated_scorer=generated_scorer, + registered_scorer=registered_scorer, + finetuned_scorer=finetuned_scorer, + luna3_scorer=luna3_scorer, + decision_scorer=decision_scorer, + model_name=model_name, + num_judges=num_judges, + cot_enabled=cot_enabled, + runtime=runtime, + code_sha256=code_sha256, + luna_validation_contract=luna_validation_contract, + ) + + scorer_catalog_version_response.additional_properties = d + return scorer_catalog_version_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/partial_extended_llm_span_record_tools_type_0_item.py b/src/splunk_ao/resources/models/scorer_catalog_version_response_luna_validation_contract_type_0.py similarity index 72% rename from src/splunk_ao/resources/models/partial_extended_llm_span_record_tools_type_0_item.py rename to src/splunk_ao/resources/models/scorer_catalog_version_response_luna_validation_contract_type_0.py index 061ce4af..55a7f802 100644 --- a/src/splunk_ao/resources/models/partial_extended_llm_span_record_tools_type_0_item.py +++ b/src/splunk_ao/resources/models/scorer_catalog_version_response_luna_validation_contract_type_0.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="PartialExtendedLlmSpanRecordToolsType0Item") +T = TypeVar("T", bound="ScorerCatalogVersionResponseLunaValidationContractType0") @_attrs_define -class PartialExtendedLlmSpanRecordToolsType0Item: +class ScorerCatalogVersionResponseLunaValidationContractType0: """ """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - partial_extended_llm_span_record_tools_type_0_item = cls() + scorer_catalog_version_response_luna_validation_contract_type_0 = cls() - partial_extended_llm_span_record_tools_type_0_item.additional_properties = d - return partial_extended_llm_span_record_tools_type_0_item + scorer_catalog_version_response_luna_validation_contract_type_0.additional_properties = d + return scorer_catalog_version_response_luna_validation_contract_type_0 @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/scorer_defaults.py b/src/splunk_ao/resources/models/scorer_defaults.py index 33e8f0f2..4cc1c8ef 100644 --- a/src/splunk_ao/resources/models/scorer_defaults.py +++ b/src/splunk_ao/resources/models/scorer_defaults.py @@ -15,6 +15,8 @@ from ..models.modality_filter import ModalityFilter from ..models.node_name_filter import NodeNameFilter from ..models.scorer_invocation_config import ScorerInvocationConfig + from ..models.scorer_metadata_selection import ScorerMetadataSelection + from ..models.span_input_selection import SpanInputSelection T = TypeVar("T", bound="ScorerDefaults") @@ -28,6 +30,8 @@ class ScorerDefaults: num_judges (int | None | Unset): filters (list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset): List of filters to apply to the scorer. + child_span_filters (list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset): Filters applied to + descendants of the trace. scoreable_node_types (list[str] | None | Unset): List of node types that can be scored by this scorer. Defaults to llm/chat. cot_enabled (bool | None | Unset): Whether to enable chain of thought for this scorer. Defaults to False for llm @@ -36,6 +40,10 @@ class ScorerDefaults: categorical, etc.). input_type (InputTypeEnum | None | Unset): What type of input to use for model-based scorers (sessions_normalized, trace_io_only, etc..). + metadata_selection (None | ScorerMetadataSelection | Unset): + span_input_selections (list[SpanInputSelection] | None | Unset): + require_matching_span (bool | Unset): For trace scorers with named span selections, require a matching child + span. Default: False. invocation (None | ScorerInvocationConfig | Unset): Deprecated compatibility location for direct-invocation metadata. Use ScorerInfo.invocation or BaseScorerDB.invocation instead. """ @@ -43,10 +51,14 @@ class ScorerDefaults: model_name: None | str | Unset = UNSET num_judges: int | None | Unset = UNSET filters: list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset = UNSET + child_span_filters: list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset = UNSET scoreable_node_types: list[str] | None | Unset = UNSET cot_enabled: bool | None | Unset = UNSET output_type: None | OutputTypeEnum | Unset = UNSET input_type: InputTypeEnum | None | Unset = UNSET + metadata_selection: None | ScorerMetadataSelection | Unset = UNSET + span_input_selections: list[SpanInputSelection] | None | Unset = UNSET + require_matching_span: bool | Unset = False invocation: None | ScorerInvocationConfig | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -54,6 +66,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.metadata_filter import MetadataFilter from ..models.node_name_filter import NodeNameFilter from ..models.scorer_invocation_config import ScorerInvocationConfig + from ..models.scorer_metadata_selection import ScorerMetadataSelection model_name: None | str | Unset if isinstance(self.model_name, Unset): @@ -86,6 +99,25 @@ def to_dict(self) -> dict[str, Any]: else: filters = self.filters + child_span_filters: list[dict[str, Any]] | None | Unset + if isinstance(self.child_span_filters, Unset): + child_span_filters = UNSET + elif isinstance(self.child_span_filters, list): + child_span_filters = [] + for child_span_filters_type_0_item_data in self.child_span_filters: + child_span_filters_type_0_item: dict[str, Any] + if isinstance(child_span_filters_type_0_item_data, NodeNameFilter): + child_span_filters_type_0_item = child_span_filters_type_0_item_data.to_dict() + elif isinstance(child_span_filters_type_0_item_data, MetadataFilter): + child_span_filters_type_0_item = child_span_filters_type_0_item_data.to_dict() + else: + child_span_filters_type_0_item = child_span_filters_type_0_item_data.to_dict() + + child_span_filters.append(child_span_filters_type_0_item) + + else: + child_span_filters = self.child_span_filters + scoreable_node_types: list[str] | None | Unset if isinstance(self.scoreable_node_types, Unset): scoreable_node_types = UNSET @@ -117,6 +149,28 @@ def to_dict(self) -> dict[str, Any]: else: input_type = self.input_type + metadata_selection: dict[str, Any] | None | Unset + if isinstance(self.metadata_selection, Unset): + metadata_selection = UNSET + elif isinstance(self.metadata_selection, ScorerMetadataSelection): + metadata_selection = self.metadata_selection.to_dict() + else: + metadata_selection = self.metadata_selection + + span_input_selections: list[dict[str, Any]] | None | Unset + if isinstance(self.span_input_selections, Unset): + span_input_selections = UNSET + elif isinstance(self.span_input_selections, list): + span_input_selections = [] + for span_input_selections_type_0_item_data in self.span_input_selections: + span_input_selections_type_0_item = span_input_selections_type_0_item_data.to_dict() + span_input_selections.append(span_input_selections_type_0_item) + + else: + span_input_selections = self.span_input_selections + + require_matching_span = self.require_matching_span + invocation: dict[str, Any] | None | Unset if isinstance(self.invocation, Unset): invocation = UNSET @@ -134,6 +188,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["num_judges"] = num_judges if filters is not UNSET: field_dict["filters"] = filters + if child_span_filters is not UNSET: + field_dict["child_span_filters"] = child_span_filters if scoreable_node_types is not UNSET: field_dict["scoreable_node_types"] = scoreable_node_types if cot_enabled is not UNSET: @@ -142,6 +198,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["output_type"] = output_type if input_type is not UNSET: field_dict["input_type"] = input_type + if metadata_selection is not UNSET: + field_dict["metadata_selection"] = metadata_selection + if span_input_selections is not UNSET: + field_dict["span_input_selections"] = span_input_selections + if require_matching_span is not UNSET: + field_dict["require_matching_span"] = require_matching_span if invocation is not UNSET: field_dict["invocation"] = invocation @@ -153,6 +215,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.modality_filter import ModalityFilter from ..models.node_name_filter import NodeNameFilter from ..models.scorer_invocation_config import ScorerInvocationConfig + from ..models.scorer_metadata_selection import ScorerMetadataSelection + from ..models.span_input_selection import SpanInputSelection d = dict(src_dict) @@ -220,6 +284,58 @@ def _parse_filters_type_0_item(data: object) -> MetadataFilter | ModalityFilter filters = _parse_filters(d.pop("filters", UNSET)) + def _parse_child_span_filters( + data: object, + ) -> list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + child_span_filters_type_0 = [] + _child_span_filters_type_0 = data + for child_span_filters_type_0_item_data in _child_span_filters_type_0: + + def _parse_child_span_filters_type_0_item( + data: object, + ) -> MetadataFilter | ModalityFilter | NodeNameFilter: + try: + if not isinstance(data, dict): + raise TypeError() + child_span_filters_type_0_item_type_0 = NodeNameFilter.from_dict(data) + + return child_span_filters_type_0_item_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + child_span_filters_type_0_item_type_1 = MetadataFilter.from_dict(data) + + return child_span_filters_type_0_item_type_1 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + child_span_filters_type_0_item_type_2 = ModalityFilter.from_dict(data) + + return child_span_filters_type_0_item_type_2 + + child_span_filters_type_0_item = _parse_child_span_filters_type_0_item( + child_span_filters_type_0_item_data + ) + + child_span_filters_type_0.append(child_span_filters_type_0_item) + + return child_span_filters_type_0 + except: # noqa: E722 + pass + return cast(list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset, data) + + child_span_filters = _parse_child_span_filters(d.pop("child_span_filters", UNSET)) + def _parse_scoreable_node_types(data: object) -> list[str] | None | Unset: if data is None: return data @@ -280,6 +396,49 @@ def _parse_input_type(data: object) -> InputTypeEnum | None | Unset: input_type = _parse_input_type(d.pop("input_type", UNSET)) + def _parse_metadata_selection(data: object) -> None | ScorerMetadataSelection | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + metadata_selection_type_0 = ScorerMetadataSelection.from_dict(data) + + return metadata_selection_type_0 + except: # noqa: E722 + pass + return cast(None | ScorerMetadataSelection | Unset, data) + + metadata_selection = _parse_metadata_selection(d.pop("metadata_selection", UNSET)) + + def _parse_span_input_selections(data: object) -> list[SpanInputSelection] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + span_input_selections_type_0 = [] + _span_input_selections_type_0 = data + for span_input_selections_type_0_item_data in _span_input_selections_type_0: + span_input_selections_type_0_item = SpanInputSelection.from_dict( + span_input_selections_type_0_item_data + ) + + span_input_selections_type_0.append(span_input_selections_type_0_item) + + return span_input_selections_type_0 + except: # noqa: E722 + pass + return cast(list[SpanInputSelection] | None | Unset, data) + + span_input_selections = _parse_span_input_selections(d.pop("span_input_selections", UNSET)) + + require_matching_span = d.pop("require_matching_span", UNSET) + def _parse_invocation(data: object) -> None | ScorerInvocationConfig | Unset: if data is None: return data @@ -301,10 +460,14 @@ def _parse_invocation(data: object) -> None | ScorerInvocationConfig | Unset: model_name=model_name, num_judges=num_judges, filters=filters, + child_span_filters=child_span_filters, scoreable_node_types=scoreable_node_types, cot_enabled=cot_enabled, output_type=output_type, input_type=input_type, + metadata_selection=metadata_selection, + span_input_selections=span_input_selections, + require_matching_span=require_matching_span, invocation=invocation, ) diff --git a/src/splunk_ao/resources/models/scorer_defaults_request.py b/src/splunk_ao/resources/models/scorer_defaults_request.py new file mode 100644 index 00000000..151cde19 --- /dev/null +++ b/src/splunk_ao/resources/models/scorer_defaults_request.py @@ -0,0 +1,492 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.input_type_enum import InputTypeEnum +from ..models.output_type_enum import OutputTypeEnum +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata_filter import MetadataFilter + from ..models.modality_filter import ModalityFilter + from ..models.node_name_filter import NodeNameFilter + from ..models.scorer_invocation_config import ScorerInvocationConfig + from ..models.scorer_metadata_selection import ScorerMetadataSelection + from ..models.span_input_selection_request import SpanInputSelectionRequest + + +T = TypeVar("T", bound="ScorerDefaultsRequest") + + +@_attrs_define +class ScorerDefaultsRequest: + """Apply span selection limits to new settings while allowing stored defaults to load. + + Attributes: + model_name (None | str | Unset): + num_judges (int | None | Unset): + filters (list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset): List of filters to apply to the + scorer. + child_span_filters (list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset): Filters applied to + descendants of the trace. + scoreable_node_types (list[str] | None | Unset): List of node types that can be scored by this scorer. Defaults + to llm/chat. + cot_enabled (bool | None | Unset): Whether to enable chain of thought for this scorer. Defaults to False for llm + scorers. + output_type (None | OutputTypeEnum | Unset): What type of output to use for model-based scorers (boolean, + categorical, etc.). + input_type (InputTypeEnum | None | Unset): What type of input to use for model-based scorers + (sessions_normalized, trace_io_only, etc..). + metadata_selection (None | ScorerMetadataSelection | Unset): + span_input_selections (list[SpanInputSelectionRequest] | None | Unset): + require_matching_span (bool | Unset): For trace scorers with named span selections, require a matching child + span. Default: False. + invocation (None | ScorerInvocationConfig | Unset): Deprecated compatibility location for direct-invocation + metadata. Use ScorerInfo.invocation or BaseScorerDB.invocation instead. + """ + + model_name: None | str | Unset = UNSET + num_judges: int | None | Unset = UNSET + filters: list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset = UNSET + child_span_filters: list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset = UNSET + scoreable_node_types: list[str] | None | Unset = UNSET + cot_enabled: bool | None | Unset = UNSET + output_type: None | OutputTypeEnum | Unset = UNSET + input_type: InputTypeEnum | None | Unset = UNSET + metadata_selection: None | ScorerMetadataSelection | Unset = UNSET + span_input_selections: list[SpanInputSelectionRequest] | None | Unset = UNSET + require_matching_span: bool | Unset = False + invocation: None | ScorerInvocationConfig | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.metadata_filter import MetadataFilter + from ..models.node_name_filter import NodeNameFilter + from ..models.scorer_invocation_config import ScorerInvocationConfig + from ..models.scorer_metadata_selection import ScorerMetadataSelection + + model_name: None | str | Unset + if isinstance(self.model_name, Unset): + model_name = UNSET + else: + model_name = self.model_name + + num_judges: int | None | Unset + if isinstance(self.num_judges, Unset): + num_judges = UNSET + else: + num_judges = self.num_judges + + filters: list[dict[str, Any]] | None | Unset + if isinstance(self.filters, Unset): + filters = UNSET + elif isinstance(self.filters, list): + filters = [] + for filters_type_0_item_data in self.filters: + filters_type_0_item: dict[str, Any] + if isinstance(filters_type_0_item_data, NodeNameFilter): + filters_type_0_item = filters_type_0_item_data.to_dict() + elif isinstance(filters_type_0_item_data, MetadataFilter): + filters_type_0_item = filters_type_0_item_data.to_dict() + else: + filters_type_0_item = filters_type_0_item_data.to_dict() + + filters.append(filters_type_0_item) + + else: + filters = self.filters + + child_span_filters: list[dict[str, Any]] | None | Unset + if isinstance(self.child_span_filters, Unset): + child_span_filters = UNSET + elif isinstance(self.child_span_filters, list): + child_span_filters = [] + for child_span_filters_type_0_item_data in self.child_span_filters: + child_span_filters_type_0_item: dict[str, Any] + if isinstance(child_span_filters_type_0_item_data, NodeNameFilter): + child_span_filters_type_0_item = child_span_filters_type_0_item_data.to_dict() + elif isinstance(child_span_filters_type_0_item_data, MetadataFilter): + child_span_filters_type_0_item = child_span_filters_type_0_item_data.to_dict() + else: + child_span_filters_type_0_item = child_span_filters_type_0_item_data.to_dict() + + child_span_filters.append(child_span_filters_type_0_item) + + else: + child_span_filters = self.child_span_filters + + scoreable_node_types: list[str] | None | Unset + if isinstance(self.scoreable_node_types, Unset): + scoreable_node_types = UNSET + elif isinstance(self.scoreable_node_types, list): + scoreable_node_types = self.scoreable_node_types + + else: + scoreable_node_types = self.scoreable_node_types + + cot_enabled: bool | None | Unset + if isinstance(self.cot_enabled, Unset): + cot_enabled = UNSET + else: + cot_enabled = self.cot_enabled + + output_type: None | str | Unset + if isinstance(self.output_type, Unset): + output_type = UNSET + elif isinstance(self.output_type, OutputTypeEnum): + output_type = self.output_type.value + else: + output_type = self.output_type + + input_type: None | str | Unset + if isinstance(self.input_type, Unset): + input_type = UNSET + elif isinstance(self.input_type, InputTypeEnum): + input_type = self.input_type.value + else: + input_type = self.input_type + + metadata_selection: dict[str, Any] | None | Unset + if isinstance(self.metadata_selection, Unset): + metadata_selection = UNSET + elif isinstance(self.metadata_selection, ScorerMetadataSelection): + metadata_selection = self.metadata_selection.to_dict() + else: + metadata_selection = self.metadata_selection + + span_input_selections: list[dict[str, Any]] | None | Unset + if isinstance(self.span_input_selections, Unset): + span_input_selections = UNSET + elif isinstance(self.span_input_selections, list): + span_input_selections = [] + for span_input_selections_type_0_item_data in self.span_input_selections: + span_input_selections_type_0_item = span_input_selections_type_0_item_data.to_dict() + span_input_selections.append(span_input_selections_type_0_item) + + else: + span_input_selections = self.span_input_selections + + require_matching_span = self.require_matching_span + + invocation: dict[str, Any] | None | Unset + if isinstance(self.invocation, Unset): + invocation = UNSET + elif isinstance(self.invocation, ScorerInvocationConfig): + invocation = self.invocation.to_dict() + else: + invocation = self.invocation + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if model_name is not UNSET: + field_dict["model_name"] = model_name + if num_judges is not UNSET: + field_dict["num_judges"] = num_judges + if filters is not UNSET: + field_dict["filters"] = filters + if child_span_filters is not UNSET: + field_dict["child_span_filters"] = child_span_filters + if scoreable_node_types is not UNSET: + field_dict["scoreable_node_types"] = scoreable_node_types + if cot_enabled is not UNSET: + field_dict["cot_enabled"] = cot_enabled + if output_type is not UNSET: + field_dict["output_type"] = output_type + if input_type is not UNSET: + field_dict["input_type"] = input_type + if metadata_selection is not UNSET: + field_dict["metadata_selection"] = metadata_selection + if span_input_selections is not UNSET: + field_dict["span_input_selections"] = span_input_selections + if require_matching_span is not UNSET: + field_dict["require_matching_span"] = require_matching_span + if invocation is not UNSET: + field_dict["invocation"] = invocation + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata_filter import MetadataFilter + from ..models.modality_filter import ModalityFilter + from ..models.node_name_filter import NodeNameFilter + from ..models.scorer_invocation_config import ScorerInvocationConfig + from ..models.scorer_metadata_selection import ScorerMetadataSelection + from ..models.span_input_selection_request import SpanInputSelectionRequest + + d = dict(src_dict) + + def _parse_model_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + model_name = _parse_model_name(d.pop("model_name", UNSET)) + + def _parse_num_judges(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + num_judges = _parse_num_judges(d.pop("num_judges", UNSET)) + + def _parse_filters(data: object) -> list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + filters_type_0 = [] + _filters_type_0 = data + for filters_type_0_item_data in _filters_type_0: + + def _parse_filters_type_0_item(data: object) -> MetadataFilter | ModalityFilter | NodeNameFilter: + try: + if not isinstance(data, dict): + raise TypeError() + filters_type_0_item_type_0 = NodeNameFilter.from_dict(data) + + return filters_type_0_item_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + filters_type_0_item_type_1 = MetadataFilter.from_dict(data) + + return filters_type_0_item_type_1 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + filters_type_0_item_type_2 = ModalityFilter.from_dict(data) + + return filters_type_0_item_type_2 + + filters_type_0_item = _parse_filters_type_0_item(filters_type_0_item_data) + + filters_type_0.append(filters_type_0_item) + + return filters_type_0 + except: # noqa: E722 + pass + return cast(list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset, data) + + filters = _parse_filters(d.pop("filters", UNSET)) + + def _parse_child_span_filters( + data: object, + ) -> list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + child_span_filters_type_0 = [] + _child_span_filters_type_0 = data + for child_span_filters_type_0_item_data in _child_span_filters_type_0: + + def _parse_child_span_filters_type_0_item( + data: object, + ) -> MetadataFilter | ModalityFilter | NodeNameFilter: + try: + if not isinstance(data, dict): + raise TypeError() + child_span_filters_type_0_item_type_0 = NodeNameFilter.from_dict(data) + + return child_span_filters_type_0_item_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, dict): + raise TypeError() + child_span_filters_type_0_item_type_1 = MetadataFilter.from_dict(data) + + return child_span_filters_type_0_item_type_1 + except: # noqa: E722 + pass + if not isinstance(data, dict): + raise TypeError() + child_span_filters_type_0_item_type_2 = ModalityFilter.from_dict(data) + + return child_span_filters_type_0_item_type_2 + + child_span_filters_type_0_item = _parse_child_span_filters_type_0_item( + child_span_filters_type_0_item_data + ) + + child_span_filters_type_0.append(child_span_filters_type_0_item) + + return child_span_filters_type_0 + except: # noqa: E722 + pass + return cast(list[MetadataFilter | ModalityFilter | NodeNameFilter] | None | Unset, data) + + child_span_filters = _parse_child_span_filters(d.pop("child_span_filters", UNSET)) + + def _parse_scoreable_node_types(data: object) -> list[str] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + scoreable_node_types_type_0 = cast(list[str], data) + + return scoreable_node_types_type_0 + except: # noqa: E722 + pass + return cast(list[str] | None | Unset, data) + + scoreable_node_types = _parse_scoreable_node_types(d.pop("scoreable_node_types", UNSET)) + + def _parse_cot_enabled(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + cot_enabled = _parse_cot_enabled(d.pop("cot_enabled", UNSET)) + + def _parse_output_type(data: object) -> None | OutputTypeEnum | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + output_type_type_0 = OutputTypeEnum(data) + + return output_type_type_0 + except: # noqa: E722 + pass + return cast(None | OutputTypeEnum | Unset, data) + + output_type = _parse_output_type(d.pop("output_type", UNSET)) + + def _parse_input_type(data: object) -> InputTypeEnum | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + input_type_type_0 = InputTypeEnum(data) + + return input_type_type_0 + except: # noqa: E722 + pass + return cast(InputTypeEnum | None | Unset, data) + + input_type = _parse_input_type(d.pop("input_type", UNSET)) + + def _parse_metadata_selection(data: object) -> None | ScorerMetadataSelection | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + metadata_selection_type_0 = ScorerMetadataSelection.from_dict(data) + + return metadata_selection_type_0 + except: # noqa: E722 + pass + return cast(None | ScorerMetadataSelection | Unset, data) + + metadata_selection = _parse_metadata_selection(d.pop("metadata_selection", UNSET)) + + def _parse_span_input_selections(data: object) -> list[SpanInputSelectionRequest] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + span_input_selections_type_0 = [] + _span_input_selections_type_0 = data + for span_input_selections_type_0_item_data in _span_input_selections_type_0: + span_input_selections_type_0_item = SpanInputSelectionRequest.from_dict( + span_input_selections_type_0_item_data + ) + + span_input_selections_type_0.append(span_input_selections_type_0_item) + + return span_input_selections_type_0 + except: # noqa: E722 + pass + return cast(list[SpanInputSelectionRequest] | None | Unset, data) + + span_input_selections = _parse_span_input_selections(d.pop("span_input_selections", UNSET)) + + require_matching_span = d.pop("require_matching_span", UNSET) + + def _parse_invocation(data: object) -> None | ScorerInvocationConfig | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + invocation_type_0 = ScorerInvocationConfig.from_dict(data) + + return invocation_type_0 + except: # noqa: E722 + pass + return cast(None | ScorerInvocationConfig | Unset, data) + + invocation = _parse_invocation(d.pop("invocation", UNSET)) + + scorer_defaults_request = cls( + model_name=model_name, + num_judges=num_judges, + filters=filters, + child_span_filters=child_span_filters, + scoreable_node_types=scoreable_node_types, + cot_enabled=cot_enabled, + output_type=output_type, + input_type=input_type, + metadata_selection=metadata_selection, + span_input_selections=span_input_selections, + require_matching_span=require_matching_span, + invocation=invocation, + ) + + scorer_defaults_request.additional_properties = d + return scorer_defaults_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/scorer_label_filter_operator.py b/src/splunk_ao/resources/models/scorer_label_filter_operator.py index c1011128..8c9ae3ea 100644 --- a/src/splunk_ao/resources/models/scorer_label_filter_operator.py +++ b/src/splunk_ao/resources/models/scorer_label_filter_operator.py @@ -7,6 +7,7 @@ class ScorerLabelFilterOperator(str, Enum): NE = "ne" NOT_IN = "not_in" ONE_OF = "one_of" + REGEX = "regex" def __str__(self) -> str: return str(self.value) diff --git a/src/splunk_ao/resources/models/scorer_metadata_selection.py b/src/splunk_ao/resources/models/scorer_metadata_selection.py new file mode 100644 index 00000000..15c97aba --- /dev/null +++ b/src/splunk_ao/resources/models/scorer_metadata_selection.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ScorerMetadataSelection") + + +@_attrs_define +class ScorerMetadataSelection: + """Select all metadata or specific user-metadata keys for trace and span inputs. + + Attributes: + trace (bool | list[str] | Unset): Default: False. + spans (bool | list[str] | None | Unset): Omit or set to null to follow the named span fields. Set to false to + disable span metadata. + """ + + trace: bool | list[str] | Unset = False + spans: bool | list[str] | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + trace: bool | list[str] | Unset + if isinstance(self.trace, Unset): + trace = UNSET + elif isinstance(self.trace, list): + trace = self.trace + + else: + trace = self.trace + + spans: bool | list[str] | None | Unset + if isinstance(self.spans, Unset): + spans = UNSET + elif isinstance(self.spans, list): + spans = self.spans + + else: + spans = self.spans + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if trace is not UNSET: + field_dict["trace"] = trace + if spans is not UNSET: + field_dict["spans"] = spans + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_trace(data: object) -> bool | list[str] | Unset: + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + trace_type_1 = cast(list[str], data) + + return trace_type_1 + except: # noqa: E722 + pass + return cast(bool | list[str] | Unset, data) + + trace = _parse_trace(d.pop("trace", UNSET)) + + def _parse_spans(data: object) -> bool | list[str] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + spans_type_1 = cast(list[str], data) + + return spans_type_1 + except: # noqa: E722 + pass + return cast(bool | list[str] | None | Unset, data) + + spans = _parse_spans(d.pop("spans", UNSET)) + + scorer_metadata_selection = cls(trace=trace, spans=spans) + + scorer_metadata_selection.additional_properties = d + return scorer_metadata_selection + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/scorer_name_filter_operator.py b/src/splunk_ao/resources/models/scorer_name_filter_operator.py index 4725461a..a2b8585a 100644 --- a/src/splunk_ao/resources/models/scorer_name_filter_operator.py +++ b/src/splunk_ao/resources/models/scorer_name_filter_operator.py @@ -7,6 +7,7 @@ class ScorerNameFilterOperator(str, Enum): NE = "ne" NOT_IN = "not_in" ONE_OF = "one_of" + REGEX = "regex" def __str__(self) -> str: return str(self.value) diff --git a/src/splunk_ao/resources/models/scorer_prompt_message.py b/src/splunk_ao/resources/models/scorer_prompt_message.py new file mode 100644 index 00000000..cde54c25 --- /dev/null +++ b/src/splunk_ao/resources/models/scorer_prompt_message.py @@ -0,0 +1,91 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.scorer_prompt_message_content_type_1_item import ScorerPromptMessageContentType1Item + + +T = TypeVar("T", bound="ScorerPromptMessage") + + +@_attrs_define +class ScorerPromptMessage: + """ + Attributes: + role (str): + content (list[ScorerPromptMessageContentType1Item] | str): + """ + + role: str + content: list[ScorerPromptMessageContentType1Item] | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + role = self.role + + content: list[dict[str, Any]] | str + if isinstance(self.content, list): + content = [] + for content_type_1_item_data in self.content: + content_type_1_item = content_type_1_item_data.to_dict() + content.append(content_type_1_item) + + else: + content = self.content + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({"role": role, "content": content}) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.scorer_prompt_message_content_type_1_item import ScorerPromptMessageContentType1Item + + d = dict(src_dict) + role = d.pop("role") + + def _parse_content(data: object) -> list[ScorerPromptMessageContentType1Item] | str: + try: + if not isinstance(data, list): + raise TypeError() + content_type_1 = [] + _content_type_1 = data + for content_type_1_item_data in _content_type_1: + content_type_1_item = ScorerPromptMessageContentType1Item.from_dict(content_type_1_item_data) + + content_type_1.append(content_type_1_item) + + return content_type_1 + except: # noqa: E722 + pass + return cast(list[ScorerPromptMessageContentType1Item] | str, data) + + content = _parse_content(d.pop("content")) + + scorer_prompt_message = cls(role=role, content=content) + + scorer_prompt_message.additional_properties = d + return scorer_prompt_message + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/llm_span_tools_type_0_item.py b/src/splunk_ao/resources/models/scorer_prompt_message_content_type_1_item.py similarity index 78% rename from src/splunk_ao/resources/models/llm_span_tools_type_0_item.py rename to src/splunk_ao/resources/models/scorer_prompt_message_content_type_1_item.py index 1f241519..99c6125f 100644 --- a/src/splunk_ao/resources/models/llm_span_tools_type_0_item.py +++ b/src/splunk_ao/resources/models/scorer_prompt_message_content_type_1_item.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="LlmSpanToolsType0Item") +T = TypeVar("T", bound="ScorerPromptMessageContentType1Item") @_attrs_define -class LlmSpanToolsType0Item: +class ScorerPromptMessageContentType1Item: """ """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - llm_span_tools_type_0_item = cls() + scorer_prompt_message_content_type_1_item = cls() - llm_span_tools_type_0_item.additional_properties = d - return llm_span_tools_type_0_item + scorer_prompt_message_content_type_1_item.additional_properties = d + return scorer_prompt_message_content_type_1_item @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/scorer_prompt_preview_response.py b/src/splunk_ao/resources/models/scorer_prompt_preview_response.py new file mode 100644 index 00000000..f19f4614 --- /dev/null +++ b/src/splunk_ao/resources/models/scorer_prompt_preview_response.py @@ -0,0 +1,159 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.scorer_prompt_message import ScorerPromptMessage + from ..models.scorer_prompt_preview_response_normalized_input_item import ( + ScorerPromptPreviewResponseNormalizedInputItem, + ) + + +T = TypeVar("T", bound="ScorerPromptPreviewResponse") + + +@_attrs_define +class ScorerPromptPreviewResponse: + """ + Attributes: + scorer_id (str): + scorer_version_id (str): + messages (list[ScorerPromptMessage]): + normalized_input (list[ScorerPromptPreviewResponseNormalizedInputItem]): + status (Literal['available'] | Unset): Default: 'available'. + label (Literal['Reconstructed evaluator prompt'] | Unset): Default: 'Reconstructed evaluator prompt'. + description (Literal['Uses the selected evaluator version with current run settings and log data.'] | Unset): + Default: 'Uses the selected evaluator version with current run settings and log data.'. + """ + + scorer_id: str + scorer_version_id: str + messages: list[ScorerPromptMessage] + normalized_input: list[ScorerPromptPreviewResponseNormalizedInputItem] + status: Literal["available"] | Unset = "available" + label: Literal["Reconstructed evaluator prompt"] | Unset = "Reconstructed evaluator prompt" + description: Literal["Uses the selected evaluator version with current run settings and log data."] | Unset = ( + "Uses the selected evaluator version with current run settings and log data." + ) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + scorer_id = self.scorer_id + + scorer_version_id = self.scorer_version_id + + messages = [] + for messages_item_data in self.messages: + messages_item = messages_item_data.to_dict() + messages.append(messages_item) + + normalized_input = [] + for normalized_input_item_data in self.normalized_input: + normalized_input_item = normalized_input_item_data.to_dict() + normalized_input.append(normalized_input_item) + + status = self.status + + label = self.label + + description = self.description + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "scorer_id": scorer_id, + "scorer_version_id": scorer_version_id, + "messages": messages, + "normalized_input": normalized_input, + } + ) + if status is not UNSET: + field_dict["status"] = status + if label is not UNSET: + field_dict["label"] = label + if description is not UNSET: + field_dict["description"] = description + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.scorer_prompt_message import ScorerPromptMessage + from ..models.scorer_prompt_preview_response_normalized_input_item import ( + ScorerPromptPreviewResponseNormalizedInputItem, + ) + + d = dict(src_dict) + scorer_id = d.pop("scorer_id") + + scorer_version_id = d.pop("scorer_version_id") + + messages = [] + _messages = d.pop("messages") + for messages_item_data in _messages: + messages_item = ScorerPromptMessage.from_dict(messages_item_data) + + messages.append(messages_item) + + normalized_input = [] + _normalized_input = d.pop("normalized_input") + for normalized_input_item_data in _normalized_input: + normalized_input_item = ScorerPromptPreviewResponseNormalizedInputItem.from_dict(normalized_input_item_data) + + normalized_input.append(normalized_input_item) + + status = cast(Literal["available"] | Unset, d.pop("status", UNSET)) + if status != "available" and not isinstance(status, Unset): + raise ValueError(f"status must match const 'available', got '{status}'") + + label = cast(Literal["Reconstructed evaluator prompt"] | Unset, d.pop("label", UNSET)) + if label != "Reconstructed evaluator prompt" and not isinstance(label, Unset): + raise ValueError(f"label must match const 'Reconstructed evaluator prompt', got '{label}'") + + description = cast( + Literal["Uses the selected evaluator version with current run settings and log data."] | Unset, + d.pop("description", UNSET), + ) + if ( + description != "Uses the selected evaluator version with current run settings and log data." + and not isinstance(description, Unset) + ): + raise ValueError( + f"description must match const 'Uses the selected evaluator version with current run settings and log data.', got '{description}'" + ) + + scorer_prompt_preview_response = cls( + scorer_id=scorer_id, + scorer_version_id=scorer_version_id, + messages=messages, + normalized_input=normalized_input, + status=status, + label=label, + description=description, + ) + + scorer_prompt_preview_response.additional_properties = d + return scorer_prompt_preview_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/extended_llm_span_record_tools_type_0_item.py b/src/splunk_ao/resources/models/scorer_prompt_preview_response_normalized_input_item.py similarity index 75% rename from src/splunk_ao/resources/models/extended_llm_span_record_tools_type_0_item.py rename to src/splunk_ao/resources/models/scorer_prompt_preview_response_normalized_input_item.py index 24d0e9cc..f74af3b7 100644 --- a/src/splunk_ao/resources/models/extended_llm_span_record_tools_type_0_item.py +++ b/src/splunk_ao/resources/models/scorer_prompt_preview_response_normalized_input_item.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="ExtendedLlmSpanRecordToolsType0Item") +T = TypeVar("T", bound="ScorerPromptPreviewResponseNormalizedInputItem") @_attrs_define -class ExtendedLlmSpanRecordToolsType0Item: +class ScorerPromptPreviewResponseNormalizedInputItem: """ """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - extended_llm_span_record_tools_type_0_item = cls() + scorer_prompt_preview_response_normalized_input_item = cls() - extended_llm_span_record_tools_type_0_item.additional_properties = d - return extended_llm_span_record_tools_type_0_item + scorer_prompt_preview_response_normalized_input_item.additional_properties = d + return scorer_prompt_preview_response_normalized_input_item @property def additional_keys(self) -> list[str]: diff --git a/src/splunk_ao/resources/models/scorer_prompt_preview_unavailable_reason.py b/src/splunk_ao/resources/models/scorer_prompt_preview_unavailable_reason.py new file mode 100644 index 00000000..f42e7378 --- /dev/null +++ b/src/splunk_ao/resources/models/scorer_prompt_preview_unavailable_reason.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class ScorerPromptPreviewUnavailableReason(str, Enum): + ROLL_UP = "roll_up" + RUN_SETTINGS_UNAVAILABLE = "run_settings_unavailable" + SCORE_NOT_DIRECTLY_ATTRIBUTABLE = "score_not_directly_attributable" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/scorer_prompt_preview_unavailable_response.py b/src/splunk_ao/resources/models/scorer_prompt_preview_unavailable_response.py new file mode 100644 index 00000000..6da63928 --- /dev/null +++ b/src/splunk_ao/resources/models/scorer_prompt_preview_unavailable_response.py @@ -0,0 +1,90 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.scorer_prompt_preview_unavailable_reason import ScorerPromptPreviewUnavailableReason +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ScorerPromptPreviewUnavailableResponse") + + +@_attrs_define +class ScorerPromptPreviewUnavailableResponse: + """ + Attributes: + scorer_id (str): + scorer_version_id (str): + reason (ScorerPromptPreviewUnavailableReason): + message (str): + status (Literal['unavailable'] | Unset): Default: 'unavailable'. + """ + + scorer_id: str + scorer_version_id: str + reason: ScorerPromptPreviewUnavailableReason + message: str + status: Literal["unavailable"] | Unset = "unavailable" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + scorer_id = self.scorer_id + + scorer_version_id = self.scorer_version_id + + reason = self.reason.value + + message = self.message + + status = self.status + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + {"scorer_id": scorer_id, "scorer_version_id": scorer_version_id, "reason": reason, "message": message} + ) + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + scorer_id = d.pop("scorer_id") + + scorer_version_id = d.pop("scorer_version_id") + + reason = ScorerPromptPreviewUnavailableReason(d.pop("reason")) + + message = d.pop("message") + + status = cast(Literal["unavailable"] | Unset, d.pop("status", UNSET)) + if status != "unavailable" and not isinstance(status, Unset): + raise ValueError(f"status must match const 'unavailable', got '{status}'") + + scorer_prompt_preview_unavailable_response = cls( + scorer_id=scorer_id, scorer_version_id=scorer_version_id, reason=reason, message=message, status=status + ) + + scorer_prompt_preview_unavailable_response.additional_properties = d + return scorer_prompt_preview_unavailable_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/scorer_response.py b/src/splunk_ao/resources/models/scorer_response.py index de0e744a..0fc66021 100644 --- a/src/splunk_ao/resources/models/scorer_response.py +++ b/src/splunk_ao/resources/models/scorer_response.py @@ -2,7 +2,7 @@ import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,12 +17,12 @@ if TYPE_CHECKING: from ..models.base_metric_roll_up_config_db import BaseMetricRollUpConfigDB - from ..models.base_scorer_version_db import BaseScorerVersionDB from ..models.metric_color_picker_boolean import MetricColorPickerBoolean from ..models.metric_color_picker_categorical import MetricColorPickerCategorical from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric from ..models.permission import Permission + from ..models.scorer_catalog_version_response import ScorerCatalogVersionResponse from ..models.scorer_defaults import ScorerDefaults from ..models.scorer_invocation_config import ScorerInvocationConfig from ..models.scorer_scope_project_ref import ScorerScopeProjectRef @@ -44,11 +44,11 @@ class ScorerResponse: defaults (None | ScorerDefaults | Unset): invocation (None | ScorerInvocationConfig | Unset): Intrinsic metadata for invoking this scorer directly with query and response inputs. - latest_version (BaseScorerVersionDB | None | Unset): + latest_version (None | ScorerCatalogVersionResponse | Unset): model_type (ModelType | None | Unset): ground_truth (bool | None | Unset): default_version_id (None | str | Unset): - default_version (BaseScorerVersionDB | None | Unset): + default_version (None | ScorerCatalogVersionResponse | Unset): user_prompt (None | str | Unset): scoreable_node_types (list[str] | None | Unset): output_type (None | OutputTypeEnum | Unset): @@ -59,6 +59,7 @@ class ScorerResponse: deprecated (bool | None | Unset): roll_up_method (None | RollUpMethodDisplayOptions | Unset): roll_up_config (BaseMetricRollUpConfigDB | None | Unset): + registration_origin (Literal['luna_studio'] | None | Unset): included_fields (list[str] | Unset): Fields that can be used in the scorer to configure it. i.e. model, num_judges, etc. This enables the ui to know which fields a user can configure when they're setting a scorer description (None | str | Unset): @@ -82,11 +83,11 @@ class ScorerResponse: label: None | str | Unset = "" defaults: None | ScorerDefaults | Unset = UNSET invocation: None | ScorerInvocationConfig | Unset = UNSET - latest_version: BaseScorerVersionDB | None | Unset = UNSET + latest_version: None | ScorerCatalogVersionResponse | Unset = UNSET model_type: ModelType | None | Unset = UNSET ground_truth: bool | None | Unset = UNSET default_version_id: None | str | Unset = UNSET - default_version: BaseScorerVersionDB | None | Unset = UNSET + default_version: None | ScorerCatalogVersionResponse | Unset = UNSET user_prompt: None | str | Unset = UNSET scoreable_node_types: list[str] | None | Unset = UNSET output_type: None | OutputTypeEnum | Unset = UNSET @@ -97,6 +98,7 @@ class ScorerResponse: deprecated: bool | None | Unset = UNSET roll_up_method: None | RollUpMethodDisplayOptions | Unset = UNSET roll_up_config: BaseMetricRollUpConfigDB | None | Unset = UNSET + registration_origin: Literal["luna_studio"] | None | Unset = UNSET included_fields: list[str] | Unset = UNSET description: None | str | Unset = UNSET created_by: None | str | Unset = UNSET @@ -119,11 +121,11 @@ class ScorerResponse: def to_dict(self) -> dict[str, Any]: from ..models.base_metric_roll_up_config_db import BaseMetricRollUpConfigDB - from ..models.base_scorer_version_db import BaseScorerVersionDB from ..models.metric_color_picker_boolean import MetricColorPickerBoolean from ..models.metric_color_picker_categorical import MetricColorPickerCategorical from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric + from ..models.scorer_catalog_version_response import ScorerCatalogVersionResponse from ..models.scorer_defaults import ScorerDefaults from ..models.scorer_invocation_config import ScorerInvocationConfig @@ -167,7 +169,7 @@ def to_dict(self) -> dict[str, Any]: latest_version: dict[str, Any] | None | Unset if isinstance(self.latest_version, Unset): latest_version = UNSET - elif isinstance(self.latest_version, BaseScorerVersionDB): + elif isinstance(self.latest_version, ScorerCatalogVersionResponse): latest_version = self.latest_version.to_dict() else: latest_version = self.latest_version @@ -195,7 +197,7 @@ def to_dict(self) -> dict[str, Any]: default_version: dict[str, Any] | None | Unset if isinstance(self.default_version, Unset): default_version = UNSET - elif isinstance(self.default_version, BaseScorerVersionDB): + elif isinstance(self.default_version, ScorerCatalogVersionResponse): default_version = self.default_version.to_dict() else: default_version = self.default_version @@ -283,6 +285,12 @@ def to_dict(self) -> dict[str, Any]: else: roll_up_config = self.roll_up_config + registration_origin: Literal["luna_studio"] | None | Unset + if isinstance(self.registration_origin, Unset): + registration_origin = UNSET + else: + registration_origin = self.registration_origin + included_fields: list[str] | Unset = UNSET if not isinstance(self.included_fields, Unset): included_fields = self.included_fields @@ -400,6 +408,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["roll_up_method"] = roll_up_method if roll_up_config is not UNSET: field_dict["roll_up_config"] = roll_up_config + if registration_origin is not UNSET: + field_dict["registration_origin"] = registration_origin if included_fields is not UNSET: field_dict["included_fields"] = included_fields if description is not UNSET: @@ -428,12 +438,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.base_metric_roll_up_config_db import BaseMetricRollUpConfigDB - from ..models.base_scorer_version_db import BaseScorerVersionDB from ..models.metric_color_picker_boolean import MetricColorPickerBoolean from ..models.metric_color_picker_categorical import MetricColorPickerCategorical from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric from ..models.permission import Permission + from ..models.scorer_catalog_version_response import ScorerCatalogVersionResponse from ..models.scorer_defaults import ScorerDefaults from ..models.scorer_invocation_config import ScorerInvocationConfig from ..models.scorer_scope_project_ref import ScorerScopeProjectRef @@ -499,7 +509,7 @@ def _parse_invocation(data: object) -> None | ScorerInvocationConfig | Unset: invocation = _parse_invocation(d.pop("invocation", UNSET)) - def _parse_latest_version(data: object) -> BaseScorerVersionDB | None | Unset: + def _parse_latest_version(data: object) -> None | ScorerCatalogVersionResponse | Unset: if data is None: return data if isinstance(data, Unset): @@ -507,12 +517,12 @@ def _parse_latest_version(data: object) -> BaseScorerVersionDB | None | Unset: try: if not isinstance(data, dict): raise TypeError() - latest_version_type_0 = BaseScorerVersionDB.from_dict(data) + latest_version_type_0 = ScorerCatalogVersionResponse.from_dict(data) return latest_version_type_0 except: # noqa: E722 pass - return cast(BaseScorerVersionDB | None | Unset, data) + return cast(None | ScorerCatalogVersionResponse | Unset, data) latest_version = _parse_latest_version(d.pop("latest_version", UNSET)) @@ -551,7 +561,7 @@ def _parse_default_version_id(data: object) -> None | str | Unset: default_version_id = _parse_default_version_id(d.pop("default_version_id", UNSET)) - def _parse_default_version(data: object) -> BaseScorerVersionDB | None | Unset: + def _parse_default_version(data: object) -> None | ScorerCatalogVersionResponse | Unset: if data is None: return data if isinstance(data, Unset): @@ -559,12 +569,12 @@ def _parse_default_version(data: object) -> BaseScorerVersionDB | None | Unset: try: if not isinstance(data, dict): raise TypeError() - default_version_type_0 = BaseScorerVersionDB.from_dict(data) + default_version_type_0 = ScorerCatalogVersionResponse.from_dict(data) return default_version_type_0 except: # noqa: E722 pass - return cast(BaseScorerVersionDB | None | Unset, data) + return cast(None | ScorerCatalogVersionResponse | Unset, data) default_version = _parse_default_version(d.pop("default_version", UNSET)) @@ -727,6 +737,21 @@ def _parse_roll_up_config(data: object) -> BaseMetricRollUpConfigDB | None | Uns roll_up_config = _parse_roll_up_config(d.pop("roll_up_config", UNSET)) + def _parse_registration_origin(data: object) -> Literal["luna_studio"] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + registration_origin_type_0 = cast(Literal["luna_studio"], data) + if registration_origin_type_0 != "luna_studio": + raise ValueError( + f"registration_origin_type_0 must match const 'luna_studio', got '{registration_origin_type_0}'" + ) + return registration_origin_type_0 + return cast(Literal["luna_studio"] | None | Unset, data) + + registration_origin = _parse_registration_origin(d.pop("registration_origin", UNSET)) + included_fields = cast(list[str], d.pop("included_fields", UNSET)) def _parse_description(data: object) -> None | str | Unset: @@ -909,6 +934,7 @@ def _parse_metric_name(data: object) -> None | str | Unset: deprecated=deprecated, roll_up_method=roll_up_method, roll_up_config=roll_up_config, + registration_origin=registration_origin, included_fields=included_fields, description=description, created_by=created_by, diff --git a/src/splunk_ao/resources/models/span_input_selection.py b/src/splunk_ao/resources/models/span_input_selection.py new file mode 100644 index 00000000..94c073a6 --- /dev/null +++ b/src/splunk_ao/resources/models/span_input_selection.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.span_input_selection_fields_item import SpanInputSelectionFieldsItem +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SpanInputSelection") + + +@_attrs_define +class SpanInputSelection: + """Select the input fields included for spans with this name. + + Attributes: + span_name (str): + fields (list[SpanInputSelectionFieldsItem] | Unset): + """ + + span_name: str + fields: list[SpanInputSelectionFieldsItem] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + span_name = self.span_name + + fields: list[str] | Unset = UNSET + if not isinstance(self.fields, Unset): + fields = [] + for fields_item_data in self.fields: + fields_item = fields_item_data.value + fields.append(fields_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({"span_name": span_name}) + if fields is not UNSET: + field_dict["fields"] = fields + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + span_name = d.pop("span_name") + + _fields = d.pop("fields", UNSET) + fields: list[SpanInputSelectionFieldsItem] | Unset = UNSET + if _fields is not UNSET: + fields = [] + for fields_item_data in _fields: + fields_item = SpanInputSelectionFieldsItem(fields_item_data) + + fields.append(fields_item) + + span_input_selection = cls(span_name=span_name, fields=fields) + + span_input_selection.additional_properties = d + return span_input_selection + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/span_input_selection_fields_item.py b/src/splunk_ao/resources/models/span_input_selection_fields_item.py new file mode 100644 index 00000000..7ac8f918 --- /dev/null +++ b/src/splunk_ao/resources/models/span_input_selection_fields_item.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class SpanInputSelectionFieldsItem(str, Enum): + INPUT = "input" + METADATA = "metadata" + OUTPUT = "output" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/span_input_selection_request.py b/src/splunk_ao/resources/models/span_input_selection_request.py new file mode 100644 index 00000000..854a1ef3 --- /dev/null +++ b/src/splunk_ao/resources/models/span_input_selection_request.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.span_input_selection_request_fields_item import SpanInputSelectionRequestFieldsItem +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SpanInputSelectionRequest") + + +@_attrs_define +class SpanInputSelectionRequest: + """Select at least one input field for the named span. + + Attributes: + span_name (str): + fields (list[SpanInputSelectionRequestFieldsItem] | Unset): + """ + + span_name: str + fields: list[SpanInputSelectionRequestFieldsItem] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + span_name = self.span_name + + fields: list[str] | Unset = UNSET + if not isinstance(self.fields, Unset): + fields = [] + for fields_item_data in self.fields: + fields_item = fields_item_data.value + fields.append(fields_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({"span_name": span_name}) + if fields is not UNSET: + field_dict["fields"] = fields + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + span_name = d.pop("span_name") + + _fields = d.pop("fields", UNSET) + fields: list[SpanInputSelectionRequestFieldsItem] | Unset = UNSET + if _fields is not UNSET: + fields = [] + for fields_item_data in _fields: + fields_item = SpanInputSelectionRequestFieldsItem(fields_item_data) + + fields.append(fields_item) + + span_input_selection_request = cls(span_name=span_name, fields=fields) + + span_input_selection_request.additional_properties = d + return span_input_selection_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/span_input_selection_request_fields_item.py b/src/splunk_ao/resources/models/span_input_selection_request_fields_item.py new file mode 100644 index 00000000..8c680cc6 --- /dev/null +++ b/src/splunk_ao/resources/models/span_input_selection_request_fields_item.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class SpanInputSelectionRequestFieldsItem(str, Enum): + INPUT = "input" + METADATA = "metadata" + OUTPUT = "output" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/star_rating.py b/src/splunk_ao/resources/models/star_rating.py index 227d3f0c..e186fc8e 100644 --- a/src/splunk_ao/resources/models/star_rating.py +++ b/src/splunk_ao/resources/models/star_rating.py @@ -16,23 +16,23 @@ class StarRating: """ Attributes: value (int): - annotation_type (Literal['star'] | Unset): Default: 'star'. + feedback_type (Literal['star'] | Unset): Default: 'star'. """ value: int - annotation_type: Literal["star"] | Unset = "star" + feedback_type: Literal["star"] | Unset = "star" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: value = self.value - annotation_type = self.annotation_type + feedback_type = self.feedback_type field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"value": value}) - if annotation_type is not UNSET: - field_dict["annotation_type"] = annotation_type + if feedback_type is not UNSET: + field_dict["feedback_type"] = feedback_type return field_dict @@ -41,11 +41,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) value = d.pop("value") - annotation_type = cast(Literal["star"] | Unset, d.pop("annotation_type", UNSET)) - if annotation_type != "star" and not isinstance(annotation_type, Unset): - raise ValueError(f"annotation_type must match const 'star', got '{annotation_type}'") + feedback_type = cast(Literal["star"] | Unset, d.pop("feedback_type", UNSET)) + if feedback_type != "star" and not isinstance(feedback_type, Unset): + raise ValueError(f"feedback_type must match const 'star', got '{feedback_type}'") - star_rating = cls(value=value, annotation_type=annotation_type) + star_rating = cls(value=value, feedback_type=feedback_type) star_rating.additional_properties = d return star_rating diff --git a/src/splunk_ao/resources/models/stub_trace_record.py b/src/splunk_ao/resources/models/stub_trace_record.py index 9a59e2c9..d1fff24a 100644 --- a/src/splunk_ao/resources/models/stub_trace_record.py +++ b/src/splunk_ao/resources/models/stub_trace_record.py @@ -40,9 +40,9 @@ class StubTraceRecord: ExtendedWorkflowSpanRecordWithChildren] | Unset): type_ (Literal['stub_trace'] | Unset): Discriminator; identifies this as a synthesized placeholder, not a real trace. Default: 'stub_trace'. - project_id (None | str | Unset): Project ID inferred from child spans, if all agree; otherwise None. - run_id (None | str | Unset): Run ID inferred from child spans, if all agree; otherwise None. - session_id (None | str | Unset): Session ID inferred from child spans, if all agree; otherwise None. + project_id (None | str | Unset): Project ID of the trace's earliest span. + run_id (None | str | Unset): Run ID of the trace's earliest span. + session_id (None | str | Unset): Session ID of the trace's earliest span. """ id: str diff --git a/src/splunk_ao/resources/models/tags_rating.py b/src/splunk_ao/resources/models/tags_rating.py index 6bad8d99..476f6aaf 100644 --- a/src/splunk_ao/resources/models/tags_rating.py +++ b/src/splunk_ao/resources/models/tags_rating.py @@ -16,23 +16,23 @@ class TagsRating: """ Attributes: value (list[str]): - annotation_type (Literal['tags'] | Unset): Default: 'tags'. + feedback_type (Literal['tags'] | Unset): Default: 'tags'. """ value: list[str] - annotation_type: Literal["tags"] | Unset = "tags" + feedback_type: Literal["tags"] | Unset = "tags" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: value = self.value - annotation_type = self.annotation_type + feedback_type = self.feedback_type field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"value": value}) - if annotation_type is not UNSET: - field_dict["annotation_type"] = annotation_type + if feedback_type is not UNSET: + field_dict["feedback_type"] = feedback_type return field_dict @@ -41,11 +41,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) value = cast(list[str], d.pop("value")) - annotation_type = cast(Literal["tags"] | Unset, d.pop("annotation_type", UNSET)) - if annotation_type != "tags" and not isinstance(annotation_type, Unset): - raise ValueError(f"annotation_type must match const 'tags', got '{annotation_type}'") + feedback_type = cast(Literal["tags"] | Unset, d.pop("feedback_type", UNSET)) + if feedback_type != "tags" and not isinstance(feedback_type, Unset): + raise ValueError(f"feedback_type must match const 'tags', got '{feedback_type}'") - tags_rating = cls(value=value, annotation_type=annotation_type) + tags_rating = cls(value=value, feedback_type=feedback_type) tags_rating.additional_properties = d return tags_rating diff --git a/src/splunk_ao/resources/models/text_rating.py b/src/splunk_ao/resources/models/text_rating.py index 342018b4..950b0906 100644 --- a/src/splunk_ao/resources/models/text_rating.py +++ b/src/splunk_ao/resources/models/text_rating.py @@ -16,23 +16,23 @@ class TextRating: """ Attributes: value (str): - annotation_type (Literal['text'] | Unset): Default: 'text'. + feedback_type (Literal['text'] | Unset): Default: 'text'. """ value: str - annotation_type: Literal["text"] | Unset = "text" + feedback_type: Literal["text"] | Unset = "text" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: value = self.value - annotation_type = self.annotation_type + feedback_type = self.feedback_type field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"value": value}) - if annotation_type is not UNSET: - field_dict["annotation_type"] = annotation_type + if feedback_type is not UNSET: + field_dict["feedback_type"] = feedback_type return field_dict @@ -41,11 +41,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) value = d.pop("value") - annotation_type = cast(Literal["text"] | Unset, d.pop("annotation_type", UNSET)) - if annotation_type != "text" and not isinstance(annotation_type, Unset): - raise ValueError(f"annotation_type must match const 'text', got '{annotation_type}'") + feedback_type = cast(Literal["text"] | Unset, d.pop("feedback_type", UNSET)) + if feedback_type != "text" and not isinstance(feedback_type, Unset): + raise ValueError(f"feedback_type must match const 'text', got '{feedback_type}'") - text_rating = cls(value=value, annotation_type=annotation_type) + text_rating = cls(value=value, feedback_type=feedback_type) text_rating.additional_properties = d return text_rating diff --git a/src/splunk_ao/resources/models/tokenomics_delegation_action.py b/src/splunk_ao/resources/models/tokenomics_delegation_action.py new file mode 100644 index 00000000..3659f521 --- /dev/null +++ b/src/splunk_ao/resources/models/tokenomics_delegation_action.py @@ -0,0 +1,20 @@ +from enum import Enum + + +class TokenomicsDelegationAction(str, Enum): + ADMIN_APPROVE = "admin_approve" + ADMIN_ASSIGN = "admin_assign" + ADMIN_REJECT = "admin_reject" + ADMIN_REVOKE = "admin_revoke" + APPROVE = "approve" + ASSIGN = "assign" + LIST_ALL = "list_all" + READ = "read" + REJECT = "reject" + RELINQUISH = "relinquish" + REQUEST = "request" + REVOKE = "revoke" + WITHDRAW = "withdraw" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/tree_choice_rating.py b/src/splunk_ao/resources/models/tree_choice_rating.py index 76ed6506..065eba80 100644 --- a/src/splunk_ao/resources/models/tree_choice_rating.py +++ b/src/splunk_ao/resources/models/tree_choice_rating.py @@ -16,23 +16,23 @@ class TreeChoiceRating: """ Attributes: value (str): - annotation_type (Literal['tree_choice'] | Unset): Default: 'tree_choice'. + feedback_type (Literal['tree_choice'] | Unset): Default: 'tree_choice'. """ value: str - annotation_type: Literal["tree_choice"] | Unset = "tree_choice" + feedback_type: Literal["tree_choice"] | Unset = "tree_choice" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: value = self.value - annotation_type = self.annotation_type + feedback_type = self.feedback_type field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"value": value}) - if annotation_type is not UNSET: - field_dict["annotation_type"] = annotation_type + if feedback_type is not UNSET: + field_dict["feedback_type"] = feedback_type return field_dict @@ -41,11 +41,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) value = d.pop("value") - annotation_type = cast(Literal["tree_choice"] | Unset, d.pop("annotation_type", UNSET)) - if annotation_type != "tree_choice" and not isinstance(annotation_type, Unset): - raise ValueError(f"annotation_type must match const 'tree_choice', got '{annotation_type}'") + feedback_type = cast(Literal["tree_choice"] | Unset, d.pop("feedback_type", UNSET)) + if feedback_type != "tree_choice" and not isinstance(feedback_type, Unset): + raise ValueError(f"feedback_type must match const 'tree_choice', got '{feedback_type}'") - tree_choice_rating = cls(value=value, annotation_type=annotation_type) + tree_choice_rating = cls(value=value, feedback_type=feedback_type) tree_choice_rating.additional_properties = d return tree_choice_rating diff --git a/src/splunk_ao/resources/models/update_annotation_queue_settings_request.py b/src/splunk_ao/resources/models/update_annotation_queue_settings_request.py new file mode 100644 index 00000000..68e26f9e --- /dev/null +++ b/src/splunk_ao/resources/models/update_annotation_queue_settings_request.py @@ -0,0 +1,110 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.annotator_view_span_type import AnnotatorViewSpanType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateAnnotationQueueSettingsRequest") + + +@_attrs_define +class UpdateAnnotationQueueSettingsRequest: + """PUT body. Rejects unknown keys; the base model must not, since it also validates stored JSON on GET. + + Attributes: + show_full_session (bool | Unset): Default: True. + show_conversation_history (bool | Unset): Default: True. + show_span_types (bool | Unset): Default: True. + span_types (list[AnnotatorViewSpanType] | Unset): + show_parameters (bool | Unset): Default: True. + show_span_metadata (bool | Unset): Default: True. + show_evaluators (bool | Unset): Default: True. + """ + + show_full_session: bool | Unset = True + show_conversation_history: bool | Unset = True + show_span_types: bool | Unset = True + span_types: list[AnnotatorViewSpanType] | Unset = UNSET + show_parameters: bool | Unset = True + show_span_metadata: bool | Unset = True + show_evaluators: bool | Unset = True + + def to_dict(self) -> dict[str, Any]: + show_full_session = self.show_full_session + + show_conversation_history = self.show_conversation_history + + show_span_types = self.show_span_types + + span_types: list[str] | Unset = UNSET + if not isinstance(self.span_types, Unset): + span_types = [] + for span_types_item_data in self.span_types: + span_types_item = span_types_item_data.value + span_types.append(span_types_item) + + show_parameters = self.show_parameters + + show_span_metadata = self.show_span_metadata + + show_evaluators = self.show_evaluators + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if show_full_session is not UNSET: + field_dict["show_full_session"] = show_full_session + if show_conversation_history is not UNSET: + field_dict["show_conversation_history"] = show_conversation_history + if show_span_types is not UNSET: + field_dict["show_span_types"] = show_span_types + if span_types is not UNSET: + field_dict["span_types"] = span_types + if show_parameters is not UNSET: + field_dict["show_parameters"] = show_parameters + if show_span_metadata is not UNSET: + field_dict["show_span_metadata"] = show_span_metadata + if show_evaluators is not UNSET: + field_dict["show_evaluators"] = show_evaluators + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + show_full_session = d.pop("show_full_session", UNSET) + + show_conversation_history = d.pop("show_conversation_history", UNSET) + + show_span_types = d.pop("show_span_types", UNSET) + + _span_types = d.pop("span_types", UNSET) + span_types: list[AnnotatorViewSpanType] | Unset = UNSET + if _span_types is not UNSET: + span_types = [] + for span_types_item_data in _span_types: + span_types_item = AnnotatorViewSpanType(span_types_item_data) + + span_types.append(span_types_item) + + show_parameters = d.pop("show_parameters", UNSET) + + show_span_metadata = d.pop("show_span_metadata", UNSET) + + show_evaluators = d.pop("show_evaluators", UNSET) + + update_annotation_queue_settings_request = cls( + show_full_session=show_full_session, + show_conversation_history=show_conversation_history, + show_span_types=show_span_types, + span_types=span_types, + show_parameters=show_parameters, + show_span_metadata=show_span_metadata, + show_evaluators=show_evaluators, + ) + + return update_annotation_queue_settings_request diff --git a/src/splunk_ao/resources/models/update_scorer_request.py b/src/splunk_ao/resources/models/update_scorer_request.py index b37d3b06..bd14df00 100644 --- a/src/splunk_ao/resources/models/update_scorer_request.py +++ b/src/splunk_ao/resources/models/update_scorer_request.py @@ -18,7 +18,7 @@ from ..models.metric_color_picker_categorical import MetricColorPickerCategorical from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric - from ..models.scorer_defaults import ScorerDefaults + from ..models.scorer_defaults_request import ScorerDefaultsRequest T = TypeVar("T", bound="UpdateScorerRequest") @@ -31,7 +31,7 @@ class UpdateScorerRequest: name (None | str | Unset): description (None | str | Unset): tags (list[str] | None | Unset): - defaults (None | ScorerDefaults | Unset): + defaults (None | ScorerDefaultsRequest | Unset): model_type (ModelType | None | Unset): ground_truth (bool | None | Unset): default_version_id (None | str | Unset): @@ -48,7 +48,7 @@ class UpdateScorerRequest: name: None | str | Unset = UNSET description: None | str | Unset = UNSET tags: list[str] | None | Unset = UNSET - defaults: None | ScorerDefaults | Unset = UNSET + defaults: None | ScorerDefaultsRequest | Unset = UNSET model_type: ModelType | None | Unset = UNSET ground_truth: bool | None | Unset = UNSET default_version_id: None | str | Unset = UNSET @@ -73,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.metric_color_picker_categorical import MetricColorPickerCategorical from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric - from ..models.scorer_defaults import ScorerDefaults + from ..models.scorer_defaults_request import ScorerDefaultsRequest name: None | str | Unset if isinstance(self.name, Unset): @@ -99,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: defaults: dict[str, Any] | None | Unset if isinstance(self.defaults, Unset): defaults = UNSET - elif isinstance(self.defaults, ScorerDefaults): + elif isinstance(self.defaults, ScorerDefaultsRequest): defaults = self.defaults.to_dict() else: defaults = self.defaults @@ -229,7 +229,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.metric_color_picker_categorical import MetricColorPickerCategorical from ..models.metric_color_picker_multi_label import MetricColorPickerMultiLabel from ..models.metric_color_picker_numeric import MetricColorPickerNumeric - from ..models.scorer_defaults import ScorerDefaults + from ..models.scorer_defaults_request import ScorerDefaultsRequest d = dict(src_dict) @@ -268,7 +268,7 @@ def _parse_tags(data: object) -> list[str] | None | Unset: tags = _parse_tags(d.pop("tags", UNSET)) - def _parse_defaults(data: object) -> None | ScorerDefaults | Unset: + def _parse_defaults(data: object) -> None | ScorerDefaultsRequest | Unset: if data is None: return data if isinstance(data, Unset): @@ -276,12 +276,12 @@ def _parse_defaults(data: object) -> None | ScorerDefaults | Unset: try: if not isinstance(data, dict): raise TypeError() - defaults_type_0 = ScorerDefaults.from_dict(data) + defaults_type_0 = ScorerDefaultsRequest.from_dict(data) return defaults_type_0 except: # noqa: E722 pass - return cast(None | ScorerDefaults | Unset, data) + return cast(None | ScorerDefaultsRequest | Unset, data) defaults = _parse_defaults(d.pop("defaults", UNSET)) diff --git a/src/splunk_ao/resources/models/user_db.py b/src/splunk_ao/resources/models/user_db.py index 36483896..95b0a0af 100644 --- a/src/splunk_ao/resources/models/user_db.py +++ b/src/splunk_ao/resources/models/user_db.py @@ -8,6 +8,7 @@ from attrs import field as _attrs_field from ..models.auth_method import AuthMethod +from ..models.user_lifecycle_state import UserLifecycleState from ..models.user_role import UserRole from ..types import UNSET, Unset @@ -34,6 +35,11 @@ class UserDB: auth_method (AuthMethod | Unset): role (UserRole | Unset): email_is_verified (bool | None | Unset): + lifecycle_state (UserLifecycleState | Unset): Retention state, separate from invitation, verification, and sign- + in status. + + Active identities are neither deactivated nor removed. Deactivated identities retain + their profile with access revoked. Removed identities have an anonymized live profile. """ id: str @@ -48,6 +54,7 @@ class UserDB: auth_method: AuthMethod | Unset = UNSET role: UserRole | Unset = UNSET email_is_verified: bool | None | Unset = UNSET + lifecycle_state: UserLifecycleState | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -96,6 +103,10 @@ def to_dict(self) -> dict[str, Any]: else: email_is_verified = self.email_is_verified + lifecycle_state: str | Unset = UNSET + if not isinstance(self.lifecycle_state, Unset): + lifecycle_state = self.lifecycle_state.value + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -120,6 +131,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["role"] = role if email_is_verified is not UNSET: field_dict["email_is_verified"] = email_is_verified + if lifecycle_state is not UNSET: + field_dict["lifecycle_state"] = lifecycle_state return field_dict @@ -190,6 +203,13 @@ def _parse_email_is_verified(data: object) -> bool | None | Unset: email_is_verified = _parse_email_is_verified(d.pop("email_is_verified", UNSET)) + _lifecycle_state = d.pop("lifecycle_state", UNSET) + lifecycle_state: UserLifecycleState | Unset + if isinstance(_lifecycle_state, Unset): + lifecycle_state = UNSET + else: + lifecycle_state = UserLifecycleState(_lifecycle_state) + user_db = cls( id=id, email=email, @@ -203,6 +223,7 @@ def _parse_email_is_verified(data: object) -> bool | None | Unset: auth_method=auth_method, role=role, email_is_verified=email_is_verified, + lifecycle_state=lifecycle_state, ) user_db.additional_properties = d diff --git a/src/splunk_ao/resources/models/user_info.py b/src/splunk_ao/resources/models/user_info.py index a21be827..5bb41533 100644 --- a/src/splunk_ao/resources/models/user_info.py +++ b/src/splunk_ao/resources/models/user_info.py @@ -6,6 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.user_lifecycle_state import UserLifecycleState from ..types import UNSET, Unset T = TypeVar("T", bound="UserInfo") @@ -18,12 +19,18 @@ class UserInfo: Attributes: id (str): email (str): + lifecycle_state (UserLifecycleState | Unset): Retention state, separate from invitation, verification, and sign- + in status. + + Active identities are neither deactivated nor removed. Deactivated identities retain + their profile with access revoked. Removed identities have an anonymized live profile. first_name (None | str | Unset): last_name (None | str | Unset): """ id: str email: str + lifecycle_state: UserLifecycleState | Unset = UNSET first_name: None | str | Unset = UNSET last_name: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -33,6 +40,10 @@ def to_dict(self) -> dict[str, Any]: email = self.email + lifecycle_state: str | Unset = UNSET + if not isinstance(self.lifecycle_state, Unset): + lifecycle_state = self.lifecycle_state.value + first_name: None | str | Unset if isinstance(self.first_name, Unset): first_name = UNSET @@ -48,6 +59,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({"id": id, "email": email}) + if lifecycle_state is not UNSET: + field_dict["lifecycle_state"] = lifecycle_state if first_name is not UNSET: field_dict["first_name"] = first_name if last_name is not UNSET: @@ -62,6 +75,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: email = d.pop("email") + _lifecycle_state = d.pop("lifecycle_state", UNSET) + lifecycle_state: UserLifecycleState | Unset + if isinstance(_lifecycle_state, Unset): + lifecycle_state = UNSET + else: + lifecycle_state = UserLifecycleState(_lifecycle_state) + def _parse_first_name(data: object) -> None | str | Unset: if data is None: return data @@ -80,7 +100,7 @@ def _parse_last_name(data: object) -> None | str | Unset: last_name = _parse_last_name(d.pop("last_name", UNSET)) - user_info = cls(id=id, email=email, first_name=first_name, last_name=last_name) + user_info = cls(id=id, email=email, lifecycle_state=lifecycle_state, first_name=first_name, last_name=last_name) user_info.additional_properties = d return user_info diff --git a/src/splunk_ao/resources/models/user_lifecycle_state.py b/src/splunk_ao/resources/models/user_lifecycle_state.py new file mode 100644 index 00000000..ed47b508 --- /dev/null +++ b/src/splunk_ao/resources/models/user_lifecycle_state.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class UserLifecycleState(str, Enum): + ACTIVE = "active" + DEACTIVATED = "deactivated" + REMOVED = "removed" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/validate_llm_scorer_log_record_request.py b/src/splunk_ao/resources/models/validate_llm_scorer_log_record_request.py index bf099d9b..fedfd818 100644 --- a/src/splunk_ao/resources/models/validate_llm_scorer_log_record_request.py +++ b/src/splunk_ao/resources/models/validate_llm_scorer_log_record_request.py @@ -13,7 +13,7 @@ from ..models.chain_poll_template import ChainPollTemplate from ..models.file_content_part import FileContentPart from ..models.filter_leaf_log_records_filter import FilterLeafLogRecordsFilter - from ..models.generated_scorer_configuration import GeneratedScorerConfiguration + from ..models.llm_scorer_log_record_configuration import LLMScorerLogRecordConfiguration from ..models.log_records_boolean_filter import LogRecordsBooleanFilter from ..models.log_records_collection_filter import LogRecordsCollectionFilter from ..models.log_records_date_filter import LogRecordsDateFilter @@ -40,7 +40,7 @@ class ValidateLLMScorerLogRecordRequest: response (str): chain_poll_template (ChainPollTemplate): Template for a chainpoll metric prompt, containing all the info necessary to send a chainpoll prompt. - scorer_configuration (GeneratedScorerConfiguration): + scorer_configuration (LLMScorerLogRecordConfiguration): user_prompt (str): starting_token (int | Unset): Default: 0. limit (int | Unset): Records per page, at most 1000. Page through larger result sets with starting_token or @@ -70,7 +70,7 @@ class ValidateLLMScorerLogRecordRequest: query: str response: str chain_poll_template: ChainPollTemplate - scorer_configuration: GeneratedScorerConfiguration + scorer_configuration: LLMScorerLogRecordConfiguration user_prompt: str starting_token: int | Unset = 0 limit: int | Unset = 100 @@ -279,7 +279,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.chain_poll_template import ChainPollTemplate from ..models.file_content_part import FileContentPart from ..models.filter_leaf_log_records_filter import FilterLeafLogRecordsFilter - from ..models.generated_scorer_configuration import GeneratedScorerConfiguration + from ..models.llm_scorer_log_record_configuration import LLMScorerLogRecordConfiguration from ..models.log_records_boolean_filter import LogRecordsBooleanFilter from ..models.log_records_collection_filter import LogRecordsCollectionFilter from ..models.log_records_date_filter import LogRecordsDateFilter @@ -299,7 +299,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: chain_poll_template = ChainPollTemplate.from_dict(d.pop("chain_poll_template")) - scorer_configuration = GeneratedScorerConfiguration.from_dict(d.pop("scorer_configuration")) + scorer_configuration = LLMScorerLogRecordConfiguration.from_dict(d.pop("scorer_configuration")) user_prompt = d.pop("user_prompt") diff --git a/src/splunk_ao/resources/models/violation_reason.py b/src/splunk_ao/resources/models/violation_reason.py new file mode 100644 index 00000000..9c848611 --- /dev/null +++ b/src/splunk_ao/resources/models/violation_reason.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class ViolationReason(str, Enum): + ADVISORY = "advisory" + END_OF_LIFE = "end_of_life" + NOT_ALLOWED = "not_allowed" + SECURITY_DECISION = "security_decision" + YANKED = "yanked" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/splunk_ao/resources/models/workflow_span.py b/src/splunk_ao/resources/models/workflow_span.py deleted file mode 100644 index 2c4bbf51..00000000 --- a/src/splunk_ao/resources/models/workflow_span.py +++ /dev/null @@ -1,840 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.agent_span import AgentSpan - from ..models.control_result import ControlResult - from ..models.control_span import ControlSpan - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.http_span import HttpSpan - from ..models.llm_span import LlmSpan - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.retriever_span import RetrieverSpan - from ..models.text_content_part import TextContentPart - from ..models.tool_span import ToolSpan - from ..models.workflow_span_dataset_metadata import WorkflowSpanDatasetMetadata - from ..models.workflow_span_user_metadata import WorkflowSpanUserMetadata - - -T = TypeVar("T", bound="WorkflowSpan") - - -@_attrs_define -class WorkflowSpan: - """ - Attributes: - type_ (Literal['workflow'] | Unset): Type of the trace, span or session. Default: 'workflow'. - input_ (list[FileContentPart | TextContentPart] | list[Message] | str | Unset): Input to the trace or span. - Default: ''. - redacted_input (list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset): Redacted input of - the trace or span. - output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | - Unset): Output of the trace or span. - redacted_output (ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str - | Unset): Redacted output of the trace or span. - name (str | Unset): Name of the trace, span or session. Default: ''. - created_at (datetime.datetime | Unset): Timestamp of the trace or span's creation. - user_metadata (WorkflowSpanUserMetadata | Unset): Metadata associated with this trace or span. - tags (list[str] | Unset): Tags associated with this trace or span. - status_code (int | None | Unset): Status code of the trace or span. Used for logging failure or error states. - metrics (Metrics | Unset): - external_id (None | str | Unset): A user-provided session, trace or span ID. - dataset_input (None | str | Unset): Input to the dataset associated with this trace - dataset_output (None | str | Unset): Output from the dataset associated with this trace - dataset_metadata (WorkflowSpanDatasetMetadata | Unset): Metadata from the dataset associated with this trace - id (None | str | Unset): Galileo ID of the session, trace or span - session_id (None | str | Unset): Galileo ID of the session containing the trace or span or session - trace_id (None | str | Unset): Galileo ID of the trace containing the span (or the same value as id for a trace) - step_number (int | None | Unset): Topological step number of the span. - parent_id (None | str | Unset): Galileo ID of the parent of this span - spans (list[AgentSpan | ControlSpan | HttpSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan] | Unset): - Child spans. - """ - - type_: Literal["workflow"] | Unset = "workflow" - input_: list[FileContentPart | TextContentPart] | list[Message] | str | Unset = "" - redacted_input: list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset = UNSET - output: ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset = ( - UNSET - ) - redacted_output: ( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset - ) = UNSET - name: str | Unset = "" - created_at: datetime.datetime | Unset = UNSET - user_metadata: WorkflowSpanUserMetadata | Unset = UNSET - tags: list[str] | Unset = UNSET - status_code: int | None | Unset = UNSET - metrics: Metrics | Unset = UNSET - external_id: None | str | Unset = UNSET - dataset_input: None | str | Unset = UNSET - dataset_output: None | str | Unset = UNSET - dataset_metadata: WorkflowSpanDatasetMetadata | Unset = UNSET - id: None | str | Unset = UNSET - session_id: None | str | Unset = UNSET - trace_id: None | str | Unset = UNSET - step_number: int | None | Unset = UNSET - parent_id: None | str | Unset = UNSET - spans: list[AgentSpan | ControlSpan | HttpSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.agent_span import AgentSpan - from ..models.control_result import ControlResult - from ..models.control_span import ControlSpan - from ..models.llm_span import LlmSpan - from ..models.message import Message - from ..models.retriever_span import RetrieverSpan - from ..models.text_content_part import TextContentPart - from ..models.tool_span import ToolSpan - - type_ = self.type_ - - input_: list[dict[str, Any]] | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - elif isinstance(self.input_, list): - input_ = [] - for input_type_1_item_data in self.input_: - input_type_1_item = input_type_1_item_data.to_dict() - input_.append(input_type_1_item) - - elif isinstance(self.input_, list): - input_ = [] - for input_type_2_item_data in self.input_: - input_type_2_item: dict[str, Any] - if isinstance(input_type_2_item_data, TextContentPart): - input_type_2_item = input_type_2_item_data.to_dict() - else: - input_type_2_item = input_type_2_item_data.to_dict() - - input_.append(input_type_2_item) - - else: - input_ = self.input_ - - redacted_input: list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_input, Unset): - redacted_input = UNSET - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_1_item_data in self.redacted_input: - redacted_input_type_1_item = redacted_input_type_1_item_data.to_dict() - redacted_input.append(redacted_input_type_1_item) - - elif isinstance(self.redacted_input, list): - redacted_input = [] - for redacted_input_type_2_item_data in self.redacted_input: - redacted_input_type_2_item: dict[str, Any] - if isinstance(redacted_input_type_2_item_data, TextContentPart): - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - else: - redacted_input_type_2_item = redacted_input_type_2_item_data.to_dict() - - redacted_input.append(redacted_input_type_2_item) - - else: - redacted_input = self.redacted_input - - output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, Message): - output = self.output.to_dict() - elif isinstance(self.output, list): - output = [] - for output_type_2_item_data in self.output: - output_type_2_item = output_type_2_item_data.to_dict() - output.append(output_type_2_item) - - elif isinstance(self.output, list): - output = [] - for output_type_3_item_data in self.output: - output_type_3_item: dict[str, Any] - if isinstance(output_type_3_item_data, TextContentPart): - output_type_3_item = output_type_3_item_data.to_dict() - else: - output_type_3_item = output_type_3_item_data.to_dict() - - output.append(output_type_3_item) - - elif isinstance(self.output, ControlResult): - output = self.output.to_dict() - else: - output = self.output - - redacted_output: dict[str, Any] | list[dict[str, Any]] | None | str | Unset - if isinstance(self.redacted_output, Unset): - redacted_output = UNSET - elif isinstance(self.redacted_output, Message): - redacted_output = self.redacted_output.to_dict() - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_2_item_data in self.redacted_output: - redacted_output_type_2_item = redacted_output_type_2_item_data.to_dict() - redacted_output.append(redacted_output_type_2_item) - - elif isinstance(self.redacted_output, list): - redacted_output = [] - for redacted_output_type_3_item_data in self.redacted_output: - redacted_output_type_3_item: dict[str, Any] - if isinstance(redacted_output_type_3_item_data, TextContentPart): - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - else: - redacted_output_type_3_item = redacted_output_type_3_item_data.to_dict() - - redacted_output.append(redacted_output_type_3_item) - - elif isinstance(self.redacted_output, ControlResult): - redacted_output = self.redacted_output.to_dict() - else: - redacted_output = self.redacted_output - - name = self.name - - created_at: str | Unset = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - - user_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.user_metadata, Unset): - user_metadata = self.user_metadata.to_dict() - - tags: list[str] | Unset = UNSET - if not isinstance(self.tags, Unset): - tags = self.tags - - status_code: int | None | Unset - if isinstance(self.status_code, Unset): - status_code = UNSET - else: - status_code = self.status_code - - metrics: dict[str, Any] | Unset = UNSET - if not isinstance(self.metrics, Unset): - metrics = self.metrics.to_dict() - - external_id: None | str | Unset - if isinstance(self.external_id, Unset): - external_id = UNSET - else: - external_id = self.external_id - - dataset_input: None | str | Unset - if isinstance(self.dataset_input, Unset): - dataset_input = UNSET - else: - dataset_input = self.dataset_input - - dataset_output: None | str | Unset - if isinstance(self.dataset_output, Unset): - dataset_output = UNSET - else: - dataset_output = self.dataset_output - - dataset_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.dataset_metadata, Unset): - dataset_metadata = self.dataset_metadata.to_dict() - - id: None | str | Unset - if isinstance(self.id, Unset): - id = UNSET - else: - id = self.id - - session_id: None | str | Unset - if isinstance(self.session_id, Unset): - session_id = UNSET - else: - session_id = self.session_id - - trace_id: None | str | Unset - if isinstance(self.trace_id, Unset): - trace_id = UNSET - else: - trace_id = self.trace_id - - step_number: int | None | Unset - if isinstance(self.step_number, Unset): - step_number = UNSET - else: - step_number = self.step_number - - parent_id: None | str | Unset - if isinstance(self.parent_id, Unset): - parent_id = UNSET - else: - parent_id = self.parent_id - - spans: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.spans, Unset): - spans = [] - for spans_item_data in self.spans: - spans_item: dict[str, Any] - if isinstance(spans_item_data, AgentSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, WorkflowSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, LlmSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, RetrieverSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ToolSpan): - spans_item = spans_item_data.to_dict() - elif isinstance(spans_item_data, ControlSpan): - spans_item = spans_item_data.to_dict() - else: - spans_item = spans_item_data.to_dict() - - spans.append(spans_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if input_ is not UNSET: - field_dict["input"] = input_ - if redacted_input is not UNSET: - field_dict["redacted_input"] = redacted_input - if output is not UNSET: - field_dict["output"] = output - if redacted_output is not UNSET: - field_dict["redacted_output"] = redacted_output - if name is not UNSET: - field_dict["name"] = name - if created_at is not UNSET: - field_dict["created_at"] = created_at - if user_metadata is not UNSET: - field_dict["user_metadata"] = user_metadata - if tags is not UNSET: - field_dict["tags"] = tags - if status_code is not UNSET: - field_dict["status_code"] = status_code - if metrics is not UNSET: - field_dict["metrics"] = metrics - if external_id is not UNSET: - field_dict["external_id"] = external_id - if dataset_input is not UNSET: - field_dict["dataset_input"] = dataset_input - if dataset_output is not UNSET: - field_dict["dataset_output"] = dataset_output - if dataset_metadata is not UNSET: - field_dict["dataset_metadata"] = dataset_metadata - if id is not UNSET: - field_dict["id"] = id - if session_id is not UNSET: - field_dict["session_id"] = session_id - if trace_id is not UNSET: - field_dict["trace_id"] = trace_id - if step_number is not UNSET: - field_dict["step_number"] = step_number - if parent_id is not UNSET: - field_dict["parent_id"] = parent_id - if spans is not UNSET: - field_dict["spans"] = spans - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_span import AgentSpan - from ..models.control_result import ControlResult - from ..models.control_span import ControlSpan - from ..models.document import Document - from ..models.file_content_part import FileContentPart - from ..models.http_span import HttpSpan - from ..models.llm_span import LlmSpan - from ..models.message import Message - from ..models.metrics import Metrics - from ..models.retriever_span import RetrieverSpan - from ..models.text_content_part import TextContentPart - from ..models.tool_span import ToolSpan - from ..models.workflow_span_dataset_metadata import WorkflowSpanDatasetMetadata - from ..models.workflow_span_user_metadata import WorkflowSpanUserMetadata - - d = dict(src_dict) - type_ = cast(Literal["workflow"] | Unset, d.pop("type", UNSET)) - if type_ != "workflow" and not isinstance(type_, Unset): - raise ValueError(f"type must match const 'workflow', got '{type_}'") - - def _parse_input_(data: object) -> list[FileContentPart | TextContentPart] | list[Message] | str | Unset: - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_type_1 = [] - _input_type_1 = data - for input_type_1_item_data in _input_type_1: - input_type_1_item = Message.from_dict(input_type_1_item_data) - - input_type_1.append(input_type_1_item) - - return input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - input_type_2 = [] - _input_type_2 = data - for input_type_2_item_data in _input_type_2: - - def _parse_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return input_type_2_item_type_1 - - input_type_2_item = _parse_input_type_2_item(input_type_2_item_data) - - input_type_2.append(input_type_2_item) - - return input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_redacted_input( - data: object, - ) -> list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_1 = [] - _redacted_input_type_1 = data - for redacted_input_type_1_item_data in _redacted_input_type_1: - redacted_input_type_1_item = Message.from_dict(redacted_input_type_1_item_data) - - redacted_input_type_1.append(redacted_input_type_1_item) - - return redacted_input_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_input_type_2 = [] - _redacted_input_type_2 = data - for redacted_input_type_2_item_data in _redacted_input_type_2: - - def _parse_redacted_input_type_2_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_0 = TextContentPart.from_dict(data) - - return redacted_input_type_2_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_input_type_2_item_type_1 = FileContentPart.from_dict(data) - - return redacted_input_type_2_item_type_1 - - redacted_input_type_2_item = _parse_redacted_input_type_2_item(redacted_input_type_2_item_data) - - redacted_input_type_2.append(redacted_input_type_2_item) - - return redacted_input_type_2 - except: # noqa: E722 - pass - return cast(list[FileContentPart | TextContentPart] | list[Message] | None | str | Unset, data) - - redacted_input = _parse_redacted_input(d.pop("redacted_input", UNSET)) - - def _parse_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_1 = Message.from_dict(data) - - return output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_2 = [] - _output_type_2 = data - for output_type_2_item_data in _output_type_2: - output_type_2_item = Document.from_dict(output_type_2_item_data) - - output_type_2.append(output_type_2_item) - - return output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - output_type_3 = [] - _output_type_3 = data - for output_type_3_item_data in _output_type_3: - - def _parse_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return output_type_3_item_type_1 - - output_type_3_item = _parse_output_type_3_item(output_type_3_item_data) - - output_type_3.append(output_type_3_item) - - return output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - output_type_4 = ControlResult.from_dict(data) - - return output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_redacted_output( - data: object, - ) -> ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_1 = Message.from_dict(data) - - return redacted_output_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_2 = [] - _redacted_output_type_2 = data - for redacted_output_type_2_item_data in _redacted_output_type_2: - redacted_output_type_2_item = Document.from_dict(redacted_output_type_2_item_data) - - redacted_output_type_2.append(redacted_output_type_2_item) - - return redacted_output_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, list): - raise TypeError() - redacted_output_type_3 = [] - _redacted_output_type_3 = data - for redacted_output_type_3_item_data in _redacted_output_type_3: - - def _parse_redacted_output_type_3_item(data: object) -> FileContentPart | TextContentPart: - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_0 = TextContentPart.from_dict(data) - - return redacted_output_type_3_item_type_0 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_3_item_type_1 = FileContentPart.from_dict(data) - - return redacted_output_type_3_item_type_1 - - redacted_output_type_3_item = _parse_redacted_output_type_3_item(redacted_output_type_3_item_data) - - redacted_output_type_3.append(redacted_output_type_3_item) - - return redacted_output_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - redacted_output_type_4 = ControlResult.from_dict(data) - - return redacted_output_type_4 - except: # noqa: E722 - pass - return cast( - ControlResult | list[Document] | list[FileContentPart | TextContentPart] | Message | None | str | Unset, - data, - ) - - redacted_output = _parse_redacted_output(d.pop("redacted_output", UNSET)) - - name = d.pop("name", UNSET) - - _created_at = d.pop("created_at", UNSET) - created_at: datetime.datetime | Unset - if isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = datetime.datetime.fromisoformat(_created_at) - - _user_metadata = d.pop("user_metadata", UNSET) - user_metadata: WorkflowSpanUserMetadata | Unset - if isinstance(_user_metadata, Unset): - user_metadata = UNSET - else: - user_metadata = WorkflowSpanUserMetadata.from_dict(_user_metadata) - - tags = cast(list[str], d.pop("tags", UNSET)) - - def _parse_status_code(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - status_code = _parse_status_code(d.pop("status_code", UNSET)) - - _metrics = d.pop("metrics", UNSET) - metrics: Metrics | Unset - if isinstance(_metrics, Unset): - metrics = UNSET - else: - metrics = Metrics.from_dict(_metrics) - - def _parse_external_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - external_id = _parse_external_id(d.pop("external_id", UNSET)) - - def _parse_dataset_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_input = _parse_dataset_input(d.pop("dataset_input", UNSET)) - - def _parse_dataset_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dataset_output = _parse_dataset_output(d.pop("dataset_output", UNSET)) - - _dataset_metadata = d.pop("dataset_metadata", UNSET) - dataset_metadata: WorkflowSpanDatasetMetadata | Unset - if isinstance(_dataset_metadata, Unset): - dataset_metadata = UNSET - else: - dataset_metadata = WorkflowSpanDatasetMetadata.from_dict(_dataset_metadata) - - def _parse_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - id = _parse_id(d.pop("id", UNSET)) - - def _parse_session_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - session_id = _parse_session_id(d.pop("session_id", UNSET)) - - def _parse_trace_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trace_id = _parse_trace_id(d.pop("trace_id", UNSET)) - - def _parse_step_number(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - step_number = _parse_step_number(d.pop("step_number", UNSET)) - - def _parse_parent_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - parent_id = _parse_parent_id(d.pop("parent_id", UNSET)) - - _spans = d.pop("spans", UNSET) - spans: list[AgentSpan | ControlSpan | HttpSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan] | Unset = ( - UNSET - ) - if _spans is not UNSET: - spans = [] - for spans_item_data in _spans: - - def _parse_spans_item( - data: object, - ) -> AgentSpan | ControlSpan | HttpSpan | LlmSpan | RetrieverSpan | ToolSpan | WorkflowSpan: - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_0 = AgentSpan.from_dict(data) - - return spans_item_type_0 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_1 = WorkflowSpan.from_dict(data) - - return spans_item_type_1 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_2 = LlmSpan.from_dict(data) - - return spans_item_type_2 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_3 = RetrieverSpan.from_dict(data) - - return spans_item_type_3 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_4 = ToolSpan.from_dict(data) - - return spans_item_type_4 - except: # noqa: E722 - pass - try: - if not isinstance(data, dict): - raise TypeError() - spans_item_type_5 = ControlSpan.from_dict(data) - - return spans_item_type_5 - except: # noqa: E722 - pass - if not isinstance(data, dict): - raise TypeError() - spans_item_type_6 = HttpSpan.from_dict(data) - - return spans_item_type_6 - - spans_item = _parse_spans_item(spans_item_data) - - spans.append(spans_item) - - workflow_span = cls( - type_=type_, - input_=input_, - redacted_input=redacted_input, - output=output, - redacted_output=redacted_output, - name=name, - created_at=created_at, - user_metadata=user_metadata, - tags=tags, - status_code=status_code, - metrics=metrics, - external_id=external_id, - dataset_input=dataset_input, - dataset_output=dataset_output, - dataset_metadata=dataset_metadata, - id=id, - session_id=session_id, - trace_id=trace_id, - step_number=step_number, - parent_id=parent_id, - spans=spans, - ) - - workflow_span.additional_properties = d - return workflow_span - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/workflow_span_dataset_metadata.py b/src/splunk_ao/resources/models/workflow_span_dataset_metadata.py deleted file mode 100644 index 56986afb..00000000 --- a/src/splunk_ao/resources/models/workflow_span_dataset_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="WorkflowSpanDatasetMetadata") - - -@_attrs_define -class WorkflowSpanDatasetMetadata: - """Metadata from the dataset associated with this trace""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - workflow_span_dataset_metadata = cls() - - workflow_span_dataset_metadata.additional_properties = d - return workflow_span_dataset_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/splunk_ao/resources/models/workflow_span_user_metadata.py b/src/splunk_ao/resources/models/workflow_span_user_metadata.py deleted file mode 100644 index 6ab90bc7..00000000 --- a/src/splunk_ao/resources/models/workflow_span_user_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="WorkflowSpanUserMetadata") - - -@_attrs_define -class WorkflowSpanUserMetadata: - """Metadata associated with this trace or span.""" - - additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - workflow_span_user_metadata = cls() - - workflow_span_user_metadata.additional_properties = d - return workflow_span_user_metadata - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties