From 07c957fb7a57d0122ed20c4e331e384f91e2d3b3 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Wed, 21 Oct 2026 09:18:32 -0700 Subject: [PATCH 1/8] Squashed '.claude/skills/seclai-sdk-sync/' changes from 177d423..b62c912 b62c912 Updated tools git-subtree-dir: .claude/skills/seclai-sdk-sync git-subtree-split: b62c912a31a9a89ae5e398ef193e7cf064a09895 --- .claude/settings.json | 8 - .claude/skills/seclai-changelog/SKILL.md | 188 - .claude/skills/seclai-changelog/validate.py | 134 - .gitattributes | 22 - .github/copilot-instructions.md | 58 - .github/workflows/main-build.yaml | 172 - .github/workflows/pr-build.yaml | 53 - .gitignore | 23 - CHANGELOG.md | 177 - LICENSE | 21 - Makefile | 94 - README.md | 828 - .../seclai-sdk-sync/SKILL.md => SKILL.md | 9 + .../docexamples.py => docexamples.py | 0 openapi/seclai.openapi.json | 21267 ---------------- poetry.lock | 1035 - pyproject.toml | 164 - scripts/set-doc-url-version.py | 52 - scripts/set-readme-version.py | 52 - .../seclai-sdk-sync/sdksync.py => sdksync.py | 217 +- seclai/__init__.py | 65 - seclai/_generated/.gitignore | 23 - seclai/_generated/.gitkeep | 0 seclai/_generated/README.md | 124 - seclai/_generated/__init__.py | 8 - seclai/_generated/api/__init__.py | 1 - .../api/agent_evaluations/__init__.py | 1 - ...gents_agent_id_evaluation_criteria_post.py | 246 - ...ation_criteria_criteria_id_results_post.py | 238 - ..._evaluation_criteria_criteria_id_delete.py | 214 - ...nts_evaluation_criteria_criteria_id_get.py | 216 - ...uation_criteria_criteria_id_summary_get.py | 216 - ...aluation_results_non_manual_summary_get.py | 306 - ..._agents_agent_id_evaluation_results_get.py | 350 - ...riteria_criteria_id_compatible_runs_get.py | 274 - ...agents_agent_id_evaluation_criteria_get.py | 294 - ...uation_criteria_criteria_id_results_get.py | 330 - ...api_agents_agent_id_evaluation_runs_get.py | 333 - ...t_id_runs_run_id_evaluation_results_get.py | 306 - ..._id_evaluation_criteria_test_draft_post.py | 254 - ...s_evaluation_criteria_criteria_id_patch.py | 246 - .../api/agent_run_attachments/__init__.py | 1 - ...ns_run_id_attachments_attachment_id_get.py | 299 - seclai/_generated/api/agents/__init__.py | 1 - ...ents_agent_id_attachment_references_get.py | 224 - ...ts_agent_id_input_uploads_upload_id_get.py | 242 - ...t_api_agents_agent_id_upload_input_post.py | 292 - ...i_api_agents_blocked_email_senders_post.py | 226 - ...inbound_email_status_cancel_queued_post.py | 198 - .../agents/create_agent_api_agents_post.py | 300 - ...delete_agent_api_agents_agent_id_delete.py | 218 - ...agent_run_api_agents_runs_run_id_delete.py | 240 - ...nt_api_api_agents_agent_id_disable_post.py | 232 - ...ent_api_api_agents_agent_id_enable_post.py | 220 - ...rt_agent_api_agents_agent_id_export_get.py | 308 - ...ent_id_ai_assistant_generate_steps_post.py | 254 - ..._agent_id_ai_assistant_step_config_post.py | 254 - ...ers_api_api_agents_agent_id_callers_get.py | 225 - ...tion_api_agents_agent_id_definition_get.py | 436 - ..._agent_metadata_api_agents_agent_id_get.py | 220 - ...et_agent_run_api_agents_runs_run_id_get.py | 260 - ...agent_id_ai_assistant_conversations_get.py | 306 - ...api_api_agents_inbound_email_status_get.py | 202 - ..._api_api_agents_agent_email_optouts_get.py | 263 - ...agent_runs_api_agents_agent_id_runs_get.py | 308 - .../api/agents/list_agents_api_agents_get.py | 239 - ...pi_api_agents_blocked_email_senders_get.py | 239 - ...api_agents_inbound_email_rejections_get.py | 251 - ...t_id_ai_assistant_conversation_id_patch.py | 264 - ...rt_agent_api_agents_preview_import_post.py | 240 - ...ts_agent_email_optouts_optout_id_delete.py | 214 - ...agents_inbound_email_status_resume_post.py | 198 - ...run_agent_api_agents_agent_id_runs_post.py | 328 - ...nt_api_agents_agent_id_runs_stream_post.py | 322 - ..._agent_runs_api_agents_runs_search_post.py | 242 - ...i_agents_blocked_email_senders_mode_put.py | 226 - ...id_triggers_trigger_id_email_config_put.py | 272 - ...blocked_email_senders_blocked_id_delete.py | 214 - .../update_agent_api_agents_agent_id_put.py | 316 - ...tion_api_agents_agent_id_definition_put.py | 338 - .../_generated/api/ai_assistant/__init__.py | 1 - ...i_assistant_conversation_id_accept_post.py | 234 - ..._assistant_conversation_id_decline_post.py | 214 - ...feedback_api_ai_assistant_feedback_post.py | 218 - ...se_api_ai_assistant_knowledge_base_post.py | 218 - ...stant_memory_bank_conversation_id_patch.py | 238 - ..._bank_api_ai_assistant_memory_bank_post.py | 218 - ...stant_memory_bank_last_conversation_get.py | 241 - ...solution_api_ai_assistant_solution_post.py | 218 - ..._ai_source_api_ai_assistant_source_post.py | 218 - seclai/_generated/api/alerts/__init__.py | 1 - ...mment_api_alerts_alert_id_comments_post.py | 238 - ..._status_api_alerts_alert_id_status_post.py | 234 - ...te_alert_config_api_alerts_configs_post.py | 254 - ...fig_api_alerts_configs_config_id_delete.py | 218 - ...config_api_alerts_configs_config_id_get.py | 228 - ...et_alert_detail_api_alerts_alert_id_get.py | 216 - ...st_alert_configs_api_alerts_configs_get.py | 335 - .../api/alerts/list_alerts_api_alerts_get.py | 364 - ...lerts_organization_preferences_list_get.py | 266 - ...lert_api_alerts_alert_id_subscribe_post.py | 220 - ...rt_api_alerts_alert_id_unsubscribe_post.py | 220 - ...nfig_api_alerts_configs_config_id_patch.py | 234 - ...rences_organization_id_alert_type_patch.py | 268 - seclai/_generated/api/contents/__init__.py | 1 - ...ource_connection_content_version_delete.py | 232 - ...s_source_connection_content_version_get.py | 289 - ...nnection_content_version_embeddings_get.py | 269 - ...s_source_connection_content_version_put.py | 288 - ..._connection_content_version_upload_post.py | 436 - .../_generated/api/email_domains/__init__.py | 1 - ...email_domain_api_api_email_domains_post.py | 230 - ...i_api_email_domains_domain_id_dmarc_get.py | 263 - ...email_domains_api_api_email_domains_get.py | 206 - ..._api_api_email_domains_domain_id_delete.py | 228 - ...email_domains_domain_id_test_email_post.py | 224 - ...pi_email_domains_domain_id_primary_post.py | 224 - ...pi_email_domains_use_shared_domain_post.py | 129 - ...api_email_domains_domain_id_verify_post.py | 224 - seclai/_generated/api/governance/__init__.py | 1 - ...i_assistant_conversation_id_accept_post.py | 224 - ..._assistant_conversation_id_decline_post.py | 222 - ...nerate_api_governance_ai_assistant_post.py | 226 - ...vernance_ai_assistant_conversations_get.py | 227 - seclai/_generated/api/identity/__init__.py | 1 - .../api/identity/get_me_api_me_get.py | 190 - .../api/knowledge_bases/__init__.py | 1 - ...knowledge_base_api_knowledge_bases_post.py | 218 - ...nowledge_bases_knowledge_base_id_delete.py | 214 - ...i_knowledge_bases_knowledge_base_id_get.py | 220 - ...knowledge_bases_api_knowledge_bases_get.py | 273 - ...i_knowledge_bases_knowledge_base_id_put.py | 242 - .../_generated/api/memory_banks/__init__.py | 1 - ...emory_banks_memory_bank_id_compact_post.py | 216 - ...reate_memory_bank_api_memory_banks_post.py | 218 - ..._api_memory_banks_memory_bank_id_delete.py | 210 - ...mory_banks_memory_bank_id_source_delete.py | 214 - ..._memory_banks_memory_bank_id_agents_get.py | 210 - ...ank_api_memory_banks_memory_bank_id_get.py | 220 - ...i_memory_banks_memory_bank_id_stats_get.py | 302 - .../list_memory_banks_api_memory_banks_get.py | 293 - ...emplates_api_memory_banks_templates_get.py | 125 - ...anks_ai_assistant_conversation_id_patch.py | 238 - ...rate_api_memory_banks_ai_assistant_post.py | 222 - ...anks_ai_assistant_last_conversation_get.py | 237 - ...nks_memory_bank_id_test_compaction_post.py | 278 - ...e_api_memory_banks_test_compaction_post.py | 238 - ...ank_api_memory_banks_memory_bank_id_put.py | 250 - seclai/_generated/api/models/__init__.py | 1 - ...d_experiments_experiment_id_cancel_post.py | 228 - ..._api_models_playground_experiments_post.py | 230 - ...ground_experiments_experiment_id_delete.py | 226 - ...ount_api_models_alerts_unread_count_get.py | 202 - ...layground_experiments_experiment_id_get.py | 232 - ...n_tiers_api_models_generation_tiers_get.py | 218 - ...t_model_api_models_model_id_details_get.py | 236 - ...api_models_model_id_recommendations_get.py | 341 - .../list_alerts_api_models_alerts_get.py | 282 - ...s_api_models_playground_experiments_get.py | 303 - .../api/models/list_models_api_models_get.py | 370 - ...ad_api_models_alerts_mark_all_read_post.py | 125 - ...d_api_models_alerts_alert_id_read_patch.py | 214 - seclai/_generated/api/search/__init__.py | 1 - .../search/docs_search_api_docs_search_get.py | 279 - .../api/search/search_api_search_get.py | 263 - seclai/_generated/api/solutions/__init__.py | 1 - ...olutions_solution_id_conversations_post.py | 234 - ...i_assistant_conversation_id_accept_post.py | 252 - ..._assistant_conversation_id_decline_post.py | 228 - ..._solution_id_ai_assistant_generate_post.py | 246 - ...ion_id_ai_assistant_knowledge_base_post.py | 238 - ...ns_solution_id_ai_assistant_source_post.py | 238 - .../create_solution_api_solutions_post.py | 218 - ...lution_api_solutions_solution_id_delete.py | 214 - ..._solution_api_solutions_solution_id_get.py | 212 - ...s_api_solutions_solution_id_agents_post.py | 234 - ...utions_solution_id_knowledge_bases_post.py | 234 - ...ons_solution_id_source_connections_post.py | 234 - ...solutions_solution_id_conversations_get.py | 223 - .../list_solutions_api_solutions_get.py | 317 - ..._id_conversations_conversation_id_patch.py | 246 - ...api_solutions_solution_id_agents_delete.py | 234 - ...ions_solution_id_knowledge_bases_delete.py | 234 - ...s_solution_id_source_connections_delete.py | 234 - ...olution_api_solutions_solution_id_patch.py | 230 - .../_generated/api/source_exports/__init__.py | 1 - ...ection_id_exports_export_id_cancel_post.py | 222 - ...urces_source_connection_id_exports_post.py | 226 - ..._connection_id_exports_export_id_delete.py | 220 - ...ction_id_exports_export_id_download_get.py | 224 - ...rce_connection_id_exports_estimate_post.py | 226 - ...rce_connection_id_exports_export_id_get.py | 222 - ...ources_source_connection_id_exports_get.py | 247 - seclai/_generated/api/sources/__init__.py | 1 - ...tion_id_embedding_migration_cancel_post.py | 214 - .../sources/create_source_api_sources_post.py | 246 - ...api_sources_source_connection_id_delete.py | 214 - ...ce_api_sources_source_connection_id_get.py | 220 - ...e_connection_id_embedding_migration_get.py | 230 - .../sources/list_sources_api_sources_get.py | 325 - ..._connection_id_embedding_migration_post.py | 282 - ...ce_api_sources_source_connection_id_put.py | 234 - ...ources_source_connection_id_upload_post.py | 416 - ...e_api_sources_source_connection_id_post.py | 280 - seclai/_generated/api/version/__init__.py | 1 - .../get_api_version_api_version_get.py | 190 - .../update_api_version_api_version_put.py | 218 - seclai/_generated/client.py | 282 - seclai/_generated/errors.py | 16 - seclai/_generated/models/__init__.py | 625 - .../_generated/models/add_comment_request.py | 61 - .../models/add_conversation_turn_request.py | 135 - ...ation_turn_request_actions_taken_type_0.py | 46 - .../models/add_email_domain_request.py | 80 - .../agent_attachment_refs_api_response.py | 97 - .../models/agent_caller_api_response.py | 79 - .../agent_definition_import_error_response.py | 106 - .../models/agent_definition_response.py | 146 - .../agent_definition_response_definition.py | 52 - ...efinition_response_warnings_type_0_item.py | 46 - .../agent_email_opt_out_list_response.py | 84 - .../models/agent_email_opt_out_response.py | 147 - .../models/agent_evaluation_tier.py | 10 - .../models/agent_export_response.py | 358 - .../models/agent_export_response_agent.py | 50 - ...port_response_alert_configs_type_0_item.py | 46 - ...ent_export_response_dependencies_type_0.py | 46 - ...esponse_evaluation_criteria_type_0_item.py | 46 - ...esponse_governance_policies_type_0_item.py | 46 - .../agent_export_response_trigger_type_0.py | 46 - .../models/agent_import_preview_request.py | 75 - ...import_preview_request_agent_definition.py | 46 - .../models/agent_import_preview_response.py | 222 - ...t_preview_response_unresolved_refs_item.py | 46 - .../_generated/models/agent_list_response.py | 85 - .../models/agent_run_attempt_response.py | 122 - .../models/agent_run_list_response.py | 85 - seclai/_generated/models/agent_run_request.py | 249 - .../agent_run_request_metadata_type_0.py | 46 - .../_generated/models/agent_run_response.py | 405 - .../models/agent_run_step_response.py | 204 - .../models/agent_run_stream_request.py | 228 - ...gent_run_stream_request_metadata_type_0.py | 46 - .../models/agent_run_tool_call_response.py | 228 - .../models/agent_summary_response.py | 388 - ...summary_response_sampling_config_type_0.py | 46 - .../models/agent_trace_match_response.py | 168 - .../models/agent_trace_search_request.py | 132 - .../models/agent_trace_search_response.py | 83 - .../models/ai_assistant_accept_request.py | 106 - .../models/ai_assistant_accept_response.py | 148 - .../models/ai_assistant_feedback_request.py | 231 - ...sistant_feedback_request_context_type_0.py | 46 - .../models/ai_assistant_feedback_response.py | 93 - .../models/ai_assistant_generate_request.py | 98 - .../models/ai_assistant_generate_response.py | 142 - .../ai_conversation_history_response.py | 83 - .../models/ai_conversation_turn_response.py | 172 - ...n_turn_response_resulting_config_type_0.py | 46 - .../models/alert_comment_response.py | 105 - .../models/alert_config_list_response.py | 88 - .../models/alert_config_response.py | 220 - .../alert_config_response_threshold_type_0.py | 46 - .../models/alert_detail_response.py | 121 - .../models/alert_history_entry_response.py | 140 - .../_generated/models/alert_list_response.py | 86 - seclai/_generated/models/alert_response.py | 258 - .../models/alert_subscriber_response.py | 98 - .../_generated/models/api_version_response.py | 100 - .../models/applied_action_response.py | 120 - .../attachment_refs_source_api_summary.py | 106 - .../models/block_email_sender_request.py | 93 - .../blocked_email_sender_list_response.py | 92 - .../models/blocked_email_sender_response.py | 109 - ..._connection_content_version_upload_post.py | 124 - ...ources_source_connection_id_upload_post.py | 121 - .../models/cancel_experiment_response.py | 61 - .../models/cancel_queued_runs_response.py | 61 - .../models/change_status_request.py | 83 - .../models/compaction_evaluation_model.py | 78 - .../models/compaction_scheduled_response.py | 70 - .../models/compaction_test_response_model.py | 107 - .../models/compatible_run_list_response.py | 100 - .../models/compatible_run_response.py | 161 - .../models/content_detail_response.py | 325 - ...nt_detail_response_metadata_type_0_item.py | 46 - .../models/content_embedding_response.py | 110 - .../content_embeddings_list_response.py | 86 - .../_generated/models/create_agent_request.py | 209 - ...e_agent_request_agent_definition_type_0.py | 46 - ...reate_agent_request_entity_remap_type_0.py | 46 - .../models/create_alert_config_request.py | 213 - ...e_alert_config_request_threshold_type_0.py | 46 - .../create_evaluation_criteria_request.py | 216 - ...teria_request_expectation_config_type_0.py | 48 - .../create_evaluation_result_request.py | 199 - ...valuation_result_request_details_type_0.py | 46 - .../models/create_experiment_response.py | 69 - .../models/create_export_request.py | 196 - ...e_export_request_metadata_filter_type_0.py | 46 - .../models/create_knowledge_base_body.py | 174 - .../models/create_memory_bank_body.py | 288 - .../models/create_solution_request.py | 73 - .../_generated/models/create_source_body.py | 338 - .../models/dmarc_failing_source_response.py | 91 - .../models/dmarc_summary_response.py | 175 - .../dmarc_summary_response_dispositions.py | 46 - .../models/dns_provider_response.py | 120 - .../_generated/models/dns_record_response.py | 163 - .../docs_search_api_docs_search_get_mode.py | 9 - .../_generated/models/docs_search_response.py | 77 - .../models/docs_search_result_response.py | 120 - .../models/email_domain_response.py | 275 - .../models/email_domains_list_response.py | 137 - .../models/email_trigger_config_response.py | 172 - .../models/estimate_export_request.py | 196 - ...e_export_request_metadata_filter_type_0.py | 46 - .../models/estimate_export_response.py | 70 - .../models/evaluation_criteria_response.py | 253 - ...eria_response_expectation_config_type_0.py | 46 - ...uation_criteria_response_result_summary.py | 46 - .../models/evaluation_result_list_response.py | 100 - .../models/evaluation_result_response.py | 221 - ...aluation_result_response_details_type_0.py | 46 - .../evaluation_result_summary_response.py | 116 - ...tion_result_with_criteria_list_response.py | 104 - ...valuation_result_with_criteria_response.py | 255 - ...t_with_criteria_response_details_type_0.py | 48 - .../evaluation_run_summary_list_response.py | 102 - .../models/evaluation_run_summary_response.py | 127 - seclai/_generated/models/evaluation_status.py | 12 - seclai/_generated/models/example_prompt.py | 46 - .../models/executed_action_response.py | 151 - .../models/experiment_detail_response.py | 297 - ...ment_detail_response_result_data_type_0.py | 46 - .../models/experiment_list_response.py | 87 - .../models/experiment_summary_response.py | 101 - seclai/_generated/models/export_format.py | 11 - .../_generated/models/export_list_response.py | 76 - seclai/_generated/models/export_response.py | 474 - .../export_response_metadata_filter_type_0.py | 46 - .../_generated/models/file_upload_response.py | 103 - .../models/generate_agent_steps_request.py | 173 - ...t_steps_request_agent_steps_type_0_item.py | 46 - .../models/generate_agent_steps_response.py | 199 - ...gent_steps_response_agent_config_type_0.py | 46 - ...enerate_agent_steps_response_steps_item.py | 46 - .../models/generate_step_config_request.py | 201 - ..._config_request_agent_steps_type_0_item.py | 46 - ...ep_config_request_current_config_type_0.py | 46 - .../models/generate_step_config_response.py | 168 - ...config_response_resulting_config_type_0.py | 46 - .../models/generation_tier_list_response.py | 77 - .../models/generation_tier_response.py | 128 - ...i_memory_banks_memory_bank_id_stats_get.py | 53 - .../models/governance_ai_accept_response.py | 116 - .../models/governance_ai_assistant_request.py | 62 - .../governance_ai_assistant_response.py | 153 - .../governance_conversation_response.py | 152 - ...sation_response_proposed_actions_type_0.py | 48 - .../models/governance_policy_ref_response.py | 85 - .../models/http_validation_error.py | 79 - .../models/import_field_error_model.py | 86 - .../_generated/models/import_skip_response.py | 105 - .../models/import_skip_response_details.py | 49 - .../inbound_email_rejection_response.py | 163 - .../models/inbound_email_status_response.py | 69 - .../models/inline_text_replace_request.py | 150 - ...ne_text_replace_request_metadata_type_0.py | 46 - .../models/inline_text_upload_request.py | 150 - ...ine_text_upload_request_metadata_type_0.py | 46 - .../models/insufficient_credits_detail.py | 82 - .../models/insufficient_credits_response.py | 68 - seclai/_generated/models/knowledge_base.py | 230 - .../knowledge_base_list_response_model.py | 100 - .../models/link_resources_request.py | 70 - .../models/mark_ai_suggestion_request.py | 61 - .../models/mark_conversation_turn_request.py | 61 - seclai/_generated/models/me_response.py | 86 - seclai/_generated/models/memory_bank.py | 330 - .../models/memory_bank_accept_request.py | 62 - .../memory_bank_ai_assistant_request.py | 153 - ...assistant_request_current_config_type_0.py | 46 - .../memory_bank_ai_assistant_response.py | 165 - .../models/memory_bank_config_response.py | 200 - .../memory_bank_conversation_turn_response.py | 171 - ...n_turn_response_resulting_config_type_0.py | 48 - .../memory_bank_last_conversation_response.py | 156 - .../models/memory_bank_list_response_model.py | 100 - .../models/modality_rate_response.py | 116 - .../models/model_alert_list_response.py | 85 - .../_generated/models/model_alert_response.py | 153 - .../models/model_recommendation_response.py | 267 - .../models/model_recommendations_response.py | 163 - ...on_manual_evaluation_mode_stat_response.py | 110 - .../non_manual_evaluation_summary_response.py | 130 - seclai/_generated/models/ok_response.py | 63 - ...nization_alert_preference_list_response.py | 89 - .../organization_alert_preference_response.py | 85 - .../models/organization_info_response.py | 78 - .../_generated/models/pagination_response.py | 102 - ...ding_processing_completed_failed_status.py | 14 - .../models/playground_create_request.py | 205 - ...nd_create_request_evaluation_complexity.py | 10 - ...ayground_create_request_evaluation_mode.py | 9 - .../prompt_model_auto_upgrade_strategy.py | 11 - .../models/prompt_model_response.py | 1001 - ...model_response_generation_params_type_0.py | 46 - ...pt_model_response_payload_schema_type_0.py | 46 - .../_generated/models/prompt_tool_response.py | 246 - .../prompt_tool_response_headers_type_0.py | 46 - .../models/proposed_action_response.py | 145 - .../models/proposed_action_response_params.py | 46 - ...proposed_action_response_preview_type_0.py | 46 - .../models/proposed_policy_action_response.py | 88 - .../proposed_policy_action_response_params.py | 46 - .../models/provider_group_response.py | 84 - .../models/remove_email_domain_response.py | 82 - .../models/resume_inbound_response.py | 61 - seclai/_generated/models/search_response.py | 77 - .../models/search_result_response.py | 92 - .../models/send_test_email_response.py | 61 - .../models/set_auto_block_mode_request.py | 62 - .../set_email_trigger_config_request.py | 181 - .../models/solution_agent_response.py | 93 - .../models/solution_conversation_response.py | 153 - ...versation_response_actions_taken_type_0.py | 46 - .../solution_knowledge_base_response.py | 93 - .../models/solution_list_response.py | 86 - seclai/_generated/models/solution_response.py | 163 - .../solution_source_connection_response.py | 70 - .../models/solution_summary_response.py | 127 - .../source_connection_response_model.py | 108 - .../source_embedding_migration_response.py | 249 - seclai/_generated/models/source_index_mode.py | 11 - .../_generated/models/source_list_response.py | 86 - seclai/_generated/models/source_response.py | 522 - .../standalone_test_compaction_request.py | 141 - ...tart_source_embedding_migration_request.py | 207 - .../models/test_compaction_request.py | 149 - .../models/test_draft_evaluation_request.py | 246 - ...ation_request_expectation_config_type_0.py | 48 - .../models/test_draft_evaluation_response.py | 85 - .../models/unlink_resources_request.py | 70 - .../models/unread_count_response.py | 61 - .../models/update_agent_definition_request.py | 84 - ...ate_agent_definition_request_definition.py | 50 - .../_generated/models/update_agent_request.py | 467 - ...e_agent_request_agent_definition_type_0.py | 46 - ...pdate_agent_request_entity_remap_type_0.py | 46 - ...te_agent_request_sampling_config_type_0.py | 46 - .../models/update_alert_config_request.py | 194 - ...e_alert_config_request_threshold_type_0.py | 46 - .../models/update_api_version_request.py | 74 - .../update_evaluation_criteria_request.py | 247 - ...teria_request_expectation_config_type_0.py | 48 - .../models/update_knowledge_base_body.py | 207 - .../models/update_memory_bank_body.py | 202 - ...e_organization_alert_preference_request.py | 61 - .../models/update_solution_request.py | 94 - .../_generated/models/update_source_body.py | 147 - .../models/upload_agent_input_api_response.py | 115 - seclai/_generated/models/validation_error.py | 90 - .../models/variant_category_response.py | 108 - .../models/variant_option_response.py | 348 - seclai/_generated/pyproject.toml | 26 - .../_generated/seclai_api_client/__init__.py | 8 - .../seclai_api_client/api/__init__.py | 1 - .../seclai_api_client/api/agents/__init__.py | 1 - ..._api_agents_agent_id_runs_run_id_delete.py | 182 - ...run_api_agents_agent_id_runs_run_id_get.py | 182 - ...agent_runs_api_agents_agent_id_runs_get.py | 204 - ...run_agent_api_agents_agent_id_runs_post.py | 190 - .../api/contents/__init__.py | 1 - ...ource_connection_content_version_delete.py | 168 - ...s_source_connection_content_version_get.py | 206 - ...nnection_content_version_embeddings_get.py | 206 - .../seclai_api_client/api/sources/__init__.py | 1 - .../sources/list_sources_api_sources_get.py | 242 - ...ources_source_connection_id_upload_post.py | 190 - seclai/_generated/seclai_api_client/client.py | 282 - seclai/_generated/seclai_api_client/errors.py | 16 - .../seclai_api_client/models/__init__.py | 473 - .../models/account_budget_response.py | 117 - .../models/account_details_response.py | 627 - .../models/account_response.py | 83 - .../models/activity_budget_response.py | 78 - .../models/activity_credit_usage_response.py | 77 - .../models/agent_list_response.py | 76 - .../models/agent_response.py | 154 - .../models/agent_run_attempt_response.py | 122 - .../models/agent_run_details_response.py | 160 - ...nt_run_details_response_metadata_type_0.py | 46 - .../models/agent_run_list_response.py | 85 - .../models/agent_run_request.py | 117 - .../agent_run_request_metadata_type_0.py | 46 - .../models/agent_run_response.py | 153 - .../models/agent_run_status_response.py | 157 - .../models/agent_run_step_details_response.py | 190 - .../models/agent_run_summary_response.py | 183 - .../models/agent_trigger_frequency.py | 11 - .../models/agent_trigger_type.py | 12 - .../models/agent_warning_model.py | 81 - .../models/analyze_substitutions_request.py | 62 - .../models/analyze_substitutions_response.py | 68 - .../models/api_call_list_response.py | 75 - .../models/api_key_create_request.py | 73 - .../models/api_key_create_response.py | 91 - .../models/api_key_list_item_response.py | 97 - .../models/api_key_list_response.py | 75 - ...ources_source_connection_id_upload_post.py | 89 - ...ources_source_connection_id_upload_post.py | 77 - .../models/branch_current_state_response.py | 255 - ...ranch_current_state_response_definition.py | 46 - ...rent_state_response_dependencies_type_0.py | 77 - ...dependencies_type_0_additional_property.py | 78 - ...additional_property_additional_property.py | 53 - .../models/branch_summary_response.py | 103 - .../models/budget_request.py | 70 - .../models/change_plan_request.py | 62 - .../seclai_api_client/models/chat_request.py | 92 - .../seclai_api_client/models/chat_response.py | 132 - .../models/comment_list_response.py | 76 - .../seclai_api_client/models/company_size.py | 11 - .../models/content_detail_response.py | 325 - ...nt_detail_response_metadata_type_0_item.py | 46 - .../models/content_embedding_response.py | 110 - .../content_embeddings_list_response.py | 86 - .../models/content_filter_type.py | 11 - .../models/conversation_data.py | 110 - .../models/conversation_list_response.py | 76 - .../models/conversation_message_response.py | 110 - .../conversation_with_messages_response.py | 86 - .../models/cost_estimate_request.py | 192 - .../models/cost_estimate_response.py | 330 - .../models/create_agent_request.py | 236 - .../create_agent_request_metadata_type_0.py | 46 - .../models/create_knowledge_base_request.py | 121 - .../models/create_source_request.py | 482 - .../models/create_trigger_schedule_request.py | 175 - .../models/credit_purchase_confirm_request.py | 61 - .../models/credit_purchase_price_response.py | 77 - .../models/credit_purchase_request.py | 61 - .../models/credit_purchase_response.py | 131 - ...it_purchase_with_payment_method_request.py | 69 - ...t_purchase_with_payment_method_response.py | 151 - .../models/credit_usage_slice_response.py | 93 - .../models/default_chunking_config.py | 78 - .../models/delete_account_response.py | 84 - .../models/detect_source_request.py | 62 - .../models/detect_source_response.py | 452 - .../models/email_preference_response.py | 78 - .../models/embedding_cost_info.py | 83 - .../models/embedding_model_info.py | 190 - .../models/embedding_models_response.py | 176 - .../models/embedding_storage_credits.py | 70 - .../seclai_api_client/models/feed_item.py | 90 - .../models/file_upload_config_response.py | 83 - ..._upload_config_response_supported_types.py | 75 - ...nse_supported_types_additional_property.py | 48 - .../models/file_upload_response.py | 103 - .../models/http_validation_error.py | 79 - .../models/invitation_create_request.py | 81 - .../models/invitations_list_response.py | 76 - .../seclai_api_client/models/json_type.py | 9 - ...knowledge_base_content_version_response.py | 120 - .../models/knowledge_base_list_response.py | 76 - .../models/knowledge_base_response.py | 184 - .../models/language_option.py | 70 - .../models/list_payment_methods_response.py | 96 - .../mcp_server_request_list_response.py | 76 - .../models/members_list_response.py | 76 - .../models/membership_type.py | 10 - .../models/membership_update_request.py | 64 - .../models/message_response.py | 92 - .../models/onboarding_request.py | 171 - .../models/organization_create_request.py | 84 - .../models/organization_list_response.py | 76 - .../organization_resource_counts_response.py | 70 - .../models/organization_response.py | 140 - .../seclai_api_client/models/page_link.py | 77 - .../models/pagination_response.py | 102 - .../models/patch_branch_state_request.py | 129 - .../patch_branch_state_request_data_type_0.py | 46 - .../models/payment_intent_history_item.py | 117 - .../models/payment_intent_history_response.py | 120 - .../models/payment_intent_status_response.py | 123 - ...t_status_response_payment_intent_type_0.py | 46 - .../models/payment_method_action_response.py | 69 - .../models/payment_method_response.py | 91 - .../models/payment_method_response_card.py | 46 - .../models/pending_completed_failed_status.py | 10 - ...ding_processing_completed_failed_status.py | 11 - .../models/plan_price_response.py | 107 - .../seclai_api_client/models/plan_response.py | 212 - .../models/plan_response_prices.py | 61 - .../models/polling_action.py | 9 - .../seclai_api_client/models/polling_type.py | 12 - .../models/processing_phase_response.py | 86 - .../models/prompt_model_response.py | 432 - .../models/prompt_tool_response.py | 246 - .../prompt_tool_response_headers_type_0.py | 46 - .../models/provider_group_response.py | 84 - .../seclai_api_client/models/pull_request.py | 116 - .../seclai_api_client/models/pull_response.py | 91 - .../models/related_account_response.py | 131 - .../models/reranker_model_info.py | 128 - .../models/reranker_models_response.py | 112 - .../models/rss_content_option.py | 78 - .../models/run_agent_request.py | 161 - .../run_agent_request_metadata_type_0.py | 46 - .../models/run_agent_response.py | 87 - .../seclai_api_client/models/seed_type.py | 10 - .../models/setup_intent_response.py | 91 - ...rce_connection_embeddings_list_response.py | 76 - .../source_connection_pull_list_response.py | 76 - .../models/source_connection_response.py | 109 - .../models/source_content_list_response.py | 76 - .../models/source_list_response.py | 86 - .../models/source_pull_progress_response.py | 147 - .../models/source_response.py | 446 - .../seclai_api_client/models/source_type.py | 12 - .../models/start_subscription_request.py | 84 - .../models/start_subscription_response.py | 94 - .../models/step_debug_run_request.py | 178 - .../step_debug_run_request_manual_inputs.py | 46 - .../step_debug_run_request_manual_metadata.py | 46 - .../step_debug_run_request_manual_outputs.py | 46 - .../models/step_debug_run_response.py | 134 - .../models/step_run_attempt_list_response.py | 108 - .../models/step_run_attempt_response.py | 137 - .../models/stripe_webhook_response.py | 61 - .../models/submit_feedback_request.py | 186 - .../models/subscription_cancelation_reason.py | 16 - .../subscription_payment_intent_request.py | 83 - .../subscription_payment_intent_response.py | 171 - .../models/subscription_response.py | 198 - .../models/substitution_dependencies.py | 94 - .../models/test_display_result_request.py | 93 - .../models/test_display_result_response.py | 104 - .../models/test_extract_html_request.py | 84 - .../models/test_extract_html_response.py | 104 - .../models/test_extract_json_request.py | 93 - .../models/test_extract_json_response.py | 104 - .../models/test_extract_xml_request.py | 104 - .../models/test_extract_xml_response.py | 104 - .../models/test_prompt_call_request.py | 327 - ...rompt_call_request_json_template_type_0.py | 46 - ...rompt_call_request_manual_inputs_type_0.py | 46 - .../models/test_prompt_call_response.py | 131 - ...test_prompt_call_response_result_type_0.py | 46 - .../models/test_retrieval_request.py | 251 - ...etrieval_request_metadata_filter_type_0.py | 46 - .../models/test_retrieval_response.py | 104 - .../models/test_s3_write_request.py | 97 - .../models/test_s3_write_response.py | 131 - .../test_s3_write_response_result_type_0.py | 46 - .../models/test_send_email_request.py | 112 - .../models/test_send_email_response.py | 130 - .../test_send_email_response_result_type_0.py | 46 - .../models/test_transform_request.py | 111 - ...st_transform_request_placeholder_values.py | 46 - .../models/test_transform_response.py | 200 - .../models/test_webhook_call_request.py | 156 - ...est_webhook_call_request_headers_type_0.py | 46 - .../models/test_webhook_call_response.py | 171 - ...st_webhook_call_response_request_type_0.py | 46 - ...t_webhook_call_response_response_type_0.py | 46 - .../models/transform_rule_test.py | 70 - .../models/trigger_response.py | 237 - .../trigger_response_metadata_type_0.py | 46 - .../models/trigger_schedule_response.py | 175 - .../models/update_agent_request.py | 94 - .../models/update_auto_purchase_request.py | 61 - .../models/update_branch_state_request.py | 81 - .../update_branch_state_request_definition.py | 46 - .../models/update_email_preference_request.py | 62 - .../models/update_knowledge_base_request.py | 242 - .../update_monthly_overage_budget_request.py | 61 - .../models/update_source_request.py | 207 - .../update_stop_at_budget_limit_request.py | 61 - .../models/update_trigger_request.py | 202 - .../update_trigger_request_metadata_type_0.py | 46 - .../models/update_trigger_schedule_request.py | 205 - .../models/update_user_profile_request.py | 70 - .../models/usage_detail_activity_response.py | 69 - .../models/usage_details_granularity.py | 10 - .../models/usage_origin_slice_response.py | 93 - .../seclai_api_client/models/use_case_type.py | 12 - .../models/user_profile_response.py | 90 - .../seclai_api_client/models/user_response.py | 86 - .../models/validation_error.py | 90 - .../models/validation_error_response.py | 97 - .../models/validation_field_error.py | 70 - .../models/variant_category_response.py | 108 - .../models/variant_option_response.py | 236 - seclai/_generated/seclai_api_client/py.typed | 1 - seclai/_generated/seclai_api_client/types.py | 54 - seclai/_generated/types.py | 54 - seclai/auth.py | 601 - seclai/py.typed | 0 seclai/seclai.py | 8691 ------- seclai/versions.py | 53 - tests/test_auth_and_headers.py | 235 - tests/test_convenience_methods.py | 266 - tests/test_generated_bridge.py | 17 - tests/test_new_methods.py | 3657 --- tests/test_status_errors.py | 21 - tests/test_streaming_agent_runs.py | 134 - 709 files changed, 165 insertions(+), 136235 deletions(-) delete mode 100644 .claude/settings.json delete mode 100644 .claude/skills/seclai-changelog/SKILL.md delete mode 100755 .claude/skills/seclai-changelog/validate.py delete mode 100644 .gitattributes delete mode 100644 .github/copilot-instructions.md delete mode 100644 .github/workflows/main-build.yaml delete mode 100644 .github/workflows/pr-build.yaml delete mode 100644 .gitignore delete mode 100644 CHANGELOG.md delete mode 100644 LICENSE delete mode 100644 Makefile delete mode 100644 README.md rename .claude/skills/seclai-sdk-sync/SKILL.md => SKILL.md (96%) rename .claude/skills/seclai-sdk-sync/docexamples.py => docexamples.py (100%) delete mode 100644 openapi/seclai.openapi.json delete mode 100644 poetry.lock delete mode 100644 pyproject.toml delete mode 100644 scripts/set-doc-url-version.py delete mode 100644 scripts/set-readme-version.py rename .claude/skills/seclai-sdk-sync/sdksync.py => sdksync.py (88%) delete mode 100644 seclai/__init__.py delete mode 100644 seclai/_generated/.gitignore delete mode 100644 seclai/_generated/.gitkeep delete mode 100644 seclai/_generated/README.md delete mode 100644 seclai/_generated/__init__.py delete mode 100644 seclai/_generated/api/__init__.py delete mode 100644 seclai/_generated/api/agent_evaluations/__init__.py delete mode 100644 seclai/_generated/api/agent_evaluations/create_evaluation_criteria_api_agents_agent_id_evaluation_criteria_post.py delete mode 100644 seclai/_generated/api/agent_evaluations/create_evaluation_result_api_agents_evaluation_criteria_criteria_id_results_post.py delete mode 100644 seclai/_generated/api/agent_evaluations/delete_evaluation_criteria_api_agents_evaluation_criteria_criteria_id_delete.py delete mode 100644 seclai/_generated/api/agent_evaluations/get_evaluation_criteria_api_agents_evaluation_criteria_criteria_id_get.py delete mode 100644 seclai/_generated/api/agent_evaluations/get_evaluation_summary_api_agents_evaluation_criteria_criteria_id_summary_get.py delete mode 100644 seclai/_generated/api/agent_evaluations/get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get.py delete mode 100644 seclai/_generated/api/agent_evaluations/list_agent_evaluation_results_api_agents_agent_id_evaluation_results_get.py delete mode 100644 seclai/_generated/api/agent_evaluations/list_compatible_runs_api_agents_evaluation_criteria_criteria_id_compatible_runs_get.py delete mode 100644 seclai/_generated/api/agent_evaluations/list_evaluation_criteria_api_agents_agent_id_evaluation_criteria_get.py delete mode 100644 seclai/_generated/api/agent_evaluations/list_evaluation_results_api_agents_evaluation_criteria_criteria_id_results_get.py delete mode 100644 seclai/_generated/api/agent_evaluations/list_evaluation_runs_api_agents_agent_id_evaluation_runs_get.py delete mode 100644 seclai/_generated/api/agent_evaluations/list_run_evaluation_results_api_agents_agent_id_runs_run_id_evaluation_results_get.py delete mode 100644 seclai/_generated/api/agent_evaluations/test_draft_evaluation_api_agents_agent_id_evaluation_criteria_test_draft_post.py delete mode 100644 seclai/_generated/api/agent_evaluations/update_evaluation_criteria_api_agents_evaluation_criteria_criteria_id_patch.py delete mode 100644 seclai/_generated/api/agent_run_attachments/__init__.py delete mode 100644 seclai/_generated/api/agent_run_attachments/serve_agent_run_attachment_api_v2_agent_runs_run_id_attachments_attachment_id_get.py delete mode 100644 seclai/_generated/api/agents/__init__.py delete mode 100644 seclai/_generated/api/agents/api_get_agent_attachment_references_api_agents_agent_id_attachment_references_get.py delete mode 100644 seclai/_generated/api/agents/api_get_agent_input_upload_status_api_agents_agent_id_input_uploads_upload_id_get.py delete mode 100644 seclai/_generated/api/agents/api_upload_agent_input_api_agents_agent_id_upload_input_post.py delete mode 100644 seclai/_generated/api/agents/block_email_sender_api_api_agents_blocked_email_senders_post.py delete mode 100644 seclai/_generated/api/agents/cancel_queued_email_runs_api_api_agents_inbound_email_status_cancel_queued_post.py delete mode 100644 seclai/_generated/api/agents/create_agent_api_agents_post.py delete mode 100644 seclai/_generated/api/agents/delete_agent_api_agents_agent_id_delete.py delete mode 100644 seclai/_generated/api/agents/delete_agent_run_api_agents_runs_run_id_delete.py delete mode 100644 seclai/_generated/api/agents/disable_agent_api_api_agents_agent_id_disable_post.py delete mode 100644 seclai/_generated/api/agents/enable_agent_api_api_agents_agent_id_enable_post.py delete mode 100644 seclai/_generated/api/agents/export_agent_api_agents_agent_id_export_get.py delete mode 100644 seclai/_generated/api/agents/generate_agent_steps_api_agents_agent_id_ai_assistant_generate_steps_post.py delete mode 100644 seclai/_generated/api/agents/generate_step_config_api_agents_agent_id_ai_assistant_step_config_post.py delete mode 100644 seclai/_generated/api/agents/get_agent_callers_api_api_agents_agent_id_callers_get.py delete mode 100644 seclai/_generated/api/agents/get_agent_definition_api_agents_agent_id_definition_get.py delete mode 100644 seclai/_generated/api/agents/get_agent_metadata_api_agents_agent_id_get.py delete mode 100644 seclai/_generated/api/agents/get_agent_run_api_agents_runs_run_id_get.py delete mode 100644 seclai/_generated/api/agents/get_ai_conversation_history_api_agents_agent_id_ai_assistant_conversations_get.py delete mode 100644 seclai/_generated/api/agents/get_inbound_email_status_api_api_agents_inbound_email_status_get.py delete mode 100644 seclai/_generated/api/agents/list_agent_email_optouts_api_api_agents_agent_email_optouts_get.py delete mode 100644 seclai/_generated/api/agents/list_agent_runs_api_agents_agent_id_runs_get.py delete mode 100644 seclai/_generated/api/agents/list_agents_api_agents_get.py delete mode 100644 seclai/_generated/api/agents/list_blocked_email_senders_api_api_agents_blocked_email_senders_get.py delete mode 100644 seclai/_generated/api/agents/list_inbound_email_rejections_api_api_agents_inbound_email_rejections_get.py delete mode 100644 seclai/_generated/api/agents/mark_ai_suggestion_api_agents_agent_id_ai_assistant_conversation_id_patch.py delete mode 100644 seclai/_generated/api/agents/preview_import_agent_api_agents_preview_import_post.py delete mode 100644 seclai/_generated/api/agents/remove_agent_email_optout_api_api_agents_agent_email_optouts_optout_id_delete.py delete mode 100644 seclai/_generated/api/agents/resume_inbound_email_api_api_agents_inbound_email_status_resume_post.py delete mode 100644 seclai/_generated/api/agents/run_agent_api_agents_agent_id_runs_post.py delete mode 100644 seclai/_generated/api/agents/run_streaming_agent_api_agents_agent_id_runs_stream_post.py delete mode 100644 seclai/_generated/api/agents/search_agent_runs_api_agents_runs_search_post.py delete mode 100644 seclai/_generated/api/agents/set_auto_block_mode_api_api_agents_blocked_email_senders_mode_put.py delete mode 100644 seclai/_generated/api/agents/set_email_trigger_config_api_api_agents_agent_id_triggers_trigger_id_email_config_put.py delete mode 100644 seclai/_generated/api/agents/unblock_email_sender_api_api_agents_blocked_email_senders_blocked_id_delete.py delete mode 100644 seclai/_generated/api/agents/update_agent_api_agents_agent_id_put.py delete mode 100644 seclai/_generated/api/agents/update_agent_definition_api_agents_agent_id_definition_put.py delete mode 100644 seclai/_generated/api/ai_assistant/__init__.py delete mode 100644 seclai/_generated/api/ai_assistant/api_ai_accept_api_ai_assistant_conversation_id_accept_post.py delete mode 100644 seclai/_generated/api/ai_assistant/api_ai_decline_api_ai_assistant_conversation_id_decline_post.py delete mode 100644 seclai/_generated/api/ai_assistant/api_ai_feedback_api_ai_assistant_feedback_post.py delete mode 100644 seclai/_generated/api/ai_assistant/api_ai_knowledge_base_api_ai_assistant_knowledge_base_post.py delete mode 100644 seclai/_generated/api/ai_assistant/api_ai_memory_bank_accept_api_ai_assistant_memory_bank_conversation_id_patch.py delete mode 100644 seclai/_generated/api/ai_assistant/api_ai_memory_bank_api_ai_assistant_memory_bank_post.py delete mode 100644 seclai/_generated/api/ai_assistant/api_ai_memory_bank_history_api_ai_assistant_memory_bank_last_conversation_get.py delete mode 100644 seclai/_generated/api/ai_assistant/api_ai_solution_api_ai_assistant_solution_post.py delete mode 100644 seclai/_generated/api/ai_assistant/api_ai_source_api_ai_assistant_source_post.py delete mode 100644 seclai/_generated/api/alerts/__init__.py delete mode 100644 seclai/_generated/api/alerts/add_alert_comment_api_alerts_alert_id_comments_post.py delete mode 100644 seclai/_generated/api/alerts/change_alert_status_api_alerts_alert_id_status_post.py delete mode 100644 seclai/_generated/api/alerts/create_alert_config_api_alerts_configs_post.py delete mode 100644 seclai/_generated/api/alerts/delete_alert_config_api_alerts_configs_config_id_delete.py delete mode 100644 seclai/_generated/api/alerts/get_alert_config_api_alerts_configs_config_id_get.py delete mode 100644 seclai/_generated/api/alerts/get_alert_detail_api_alerts_alert_id_get.py delete mode 100644 seclai/_generated/api/alerts/list_alert_configs_api_alerts_configs_get.py delete mode 100644 seclai/_generated/api/alerts/list_alerts_api_alerts_get.py delete mode 100644 seclai/_generated/api/alerts/list_organization_preferences_api_alerts_organization_preferences_list_get.py delete mode 100644 seclai/_generated/api/alerts/subscribe_to_alert_api_alerts_alert_id_subscribe_post.py delete mode 100644 seclai/_generated/api/alerts/unsubscribe_from_alert_api_alerts_alert_id_unsubscribe_post.py delete mode 100644 seclai/_generated/api/alerts/update_alert_config_api_alerts_configs_config_id_patch.py delete mode 100644 seclai/_generated/api/alerts/update_organization_preference_api_alerts_organization_preferences_organization_id_alert_type_patch.py delete mode 100644 seclai/_generated/api/contents/__init__.py delete mode 100644 seclai/_generated/api/contents/delete_content_api_contents_source_connection_content_version_delete.py delete mode 100644 seclai/_generated/api/contents/get_content_detail_api_contents_source_connection_content_version_get.py delete mode 100644 seclai/_generated/api/contents/list_content_embeddings_api_contents_source_connection_content_version_embeddings_get.py delete mode 100644 seclai/_generated/api/contents/replace_content_with_inline_text_api_contents_source_connection_content_version_put.py delete mode 100644 seclai/_generated/api/contents/upload_file_to_content_api_contents_source_connection_content_version_upload_post.py delete mode 100644 seclai/_generated/api/email_domains/__init__.py delete mode 100644 seclai/_generated/api/email_domains/add_email_domain_api_api_email_domains_post.py delete mode 100644 seclai/_generated/api/email_domains/get_dmarc_summary_api_api_email_domains_domain_id_dmarc_get.py delete mode 100644 seclai/_generated/api/email_domains/list_email_domains_api_api_email_domains_get.py delete mode 100644 seclai/_generated/api/email_domains/remove_email_domain_api_api_email_domains_domain_id_delete.py delete mode 100644 seclai/_generated/api/email_domains/send_test_email_api_api_email_domains_domain_id_test_email_post.py delete mode 100644 seclai/_generated/api/email_domains/set_primary_email_domain_api_api_email_domains_domain_id_primary_post.py delete mode 100644 seclai/_generated/api/email_domains/use_shared_domain_api_api_email_domains_use_shared_domain_post.py delete mode 100644 seclai/_generated/api/email_domains/verify_email_domain_api_api_email_domains_domain_id_verify_post.py delete mode 100644 seclai/_generated/api/governance/__init__.py delete mode 100644 seclai/_generated/api/governance/governance_ai_accept_api_governance_ai_assistant_conversation_id_accept_post.py delete mode 100644 seclai/_generated/api/governance/governance_ai_decline_api_governance_ai_assistant_conversation_id_decline_post.py delete mode 100644 seclai/_generated/api/governance/governance_ai_generate_api_governance_ai_assistant_post.py delete mode 100644 seclai/_generated/api/governance/list_governance_ai_conversations_api_governance_ai_assistant_conversations_get.py delete mode 100644 seclai/_generated/api/identity/__init__.py delete mode 100644 seclai/_generated/api/identity/get_me_api_me_get.py delete mode 100644 seclai/_generated/api/knowledge_bases/__init__.py delete mode 100644 seclai/_generated/api/knowledge_bases/create_knowledge_base_api_knowledge_bases_post.py delete mode 100644 seclai/_generated/api/knowledge_bases/delete_knowledge_base_api_knowledge_bases_knowledge_base_id_delete.py delete mode 100644 seclai/_generated/api/knowledge_bases/get_knowledge_base_api_knowledge_bases_knowledge_base_id_get.py delete mode 100644 seclai/_generated/api/knowledge_bases/list_knowledge_bases_api_knowledge_bases_get.py delete mode 100644 seclai/_generated/api/knowledge_bases/update_knowledge_base_api_knowledge_bases_knowledge_base_id_put.py delete mode 100644 seclai/_generated/api/memory_banks/__init__.py delete mode 100644 seclai/_generated/api/memory_banks/compact_memory_bank_api_memory_banks_memory_bank_id_compact_post.py delete mode 100644 seclai/_generated/api/memory_banks/create_memory_bank_api_memory_banks_post.py delete mode 100644 seclai/_generated/api/memory_banks/delete_memory_bank_api_memory_banks_memory_bank_id_delete.py delete mode 100644 seclai/_generated/api/memory_banks/delete_memory_bank_source_api_memory_banks_memory_bank_id_source_delete.py delete mode 100644 seclai/_generated/api/memory_banks/get_agents_using_bank_api_memory_banks_memory_bank_id_agents_get.py delete mode 100644 seclai/_generated/api/memory_banks/get_memory_bank_api_memory_banks_memory_bank_id_get.py delete mode 100644 seclai/_generated/api/memory_banks/get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get.py delete mode 100644 seclai/_generated/api/memory_banks/list_memory_banks_api_memory_banks_get.py delete mode 100644 seclai/_generated/api/memory_banks/list_templates_api_memory_banks_templates_get.py delete mode 100644 seclai/_generated/api/memory_banks/memory_bank_ai_accept_api_memory_banks_ai_assistant_conversation_id_patch.py delete mode 100644 seclai/_generated/api/memory_banks/memory_bank_ai_generate_api_memory_banks_ai_assistant_post.py delete mode 100644 seclai/_generated/api/memory_banks/memory_bank_ai_last_conversation_api_memory_banks_ai_assistant_last_conversation_get.py delete mode 100644 seclai/_generated/api/memory_banks/test_compaction_prompt_api_memory_banks_memory_bank_id_test_compaction_post.py delete mode 100644 seclai/_generated/api/memory_banks/test_compaction_prompt_standalone_api_memory_banks_test_compaction_post.py delete mode 100644 seclai/_generated/api/memory_banks/update_memory_bank_api_memory_banks_memory_bank_id_put.py delete mode 100644 seclai/_generated/api/models/__init__.py delete mode 100644 seclai/_generated/api/models/cancel_experiment_endpoint_api_models_playground_experiments_experiment_id_cancel_post.py delete mode 100644 seclai/_generated/api/models/create_experiment_api_models_playground_experiments_post.py delete mode 100644 seclai/_generated/api/models/delete_experiment_endpoint_api_models_playground_experiments_experiment_id_delete.py delete mode 100644 seclai/_generated/api/models/get_alert_unread_count_api_models_alerts_unread_count_get.py delete mode 100644 seclai/_generated/api/models/get_experiment_api_models_playground_experiments_experiment_id_get.py delete mode 100644 seclai/_generated/api/models/get_generation_tiers_api_models_generation_tiers_get.py delete mode 100644 seclai/_generated/api/models/get_model_api_models_model_id_details_get.py delete mode 100644 seclai/_generated/api/models/get_recommendations_api_models_model_id_recommendations_get.py delete mode 100644 seclai/_generated/api/models/list_alerts_api_models_alerts_get.py delete mode 100644 seclai/_generated/api/models/list_experiments_api_models_playground_experiments_get.py delete mode 100644 seclai/_generated/api/models/list_models_api_models_get.py delete mode 100644 seclai/_generated/api/models/mark_all_read_api_models_alerts_mark_all_read_post.py delete mode 100644 seclai/_generated/api/models/mark_read_api_models_alerts_alert_id_read_patch.py delete mode 100644 seclai/_generated/api/search/__init__.py delete mode 100644 seclai/_generated/api/search/docs_search_api_docs_search_get.py delete mode 100644 seclai/_generated/api/search/search_api_search_get.py delete mode 100644 seclai/_generated/api/solutions/__init__.py delete mode 100644 seclai/_generated/api/solutions/add_conversation_turn_api_solutions_solution_id_conversations_post.py delete mode 100644 seclai/_generated/api/solutions/ai_assistant_accept_api_solutions_solution_id_ai_assistant_conversation_id_accept_post.py delete mode 100644 seclai/_generated/api/solutions/ai_assistant_decline_api_solutions_solution_id_ai_assistant_conversation_id_decline_post.py delete mode 100644 seclai/_generated/api/solutions/ai_assistant_generate_api_solutions_solution_id_ai_assistant_generate_post.py delete mode 100644 seclai/_generated/api/solutions/ai_assistant_knowledge_base_api_solutions_solution_id_ai_assistant_knowledge_base_post.py delete mode 100644 seclai/_generated/api/solutions/ai_assistant_source_api_solutions_solution_id_ai_assistant_source_post.py delete mode 100644 seclai/_generated/api/solutions/create_solution_api_solutions_post.py delete mode 100644 seclai/_generated/api/solutions/delete_solution_api_solutions_solution_id_delete.py delete mode 100644 seclai/_generated/api/solutions/get_solution_api_solutions_solution_id_get.py delete mode 100644 seclai/_generated/api/solutions/link_agents_api_solutions_solution_id_agents_post.py delete mode 100644 seclai/_generated/api/solutions/link_knowledge_bases_api_solutions_solution_id_knowledge_bases_post.py delete mode 100644 seclai/_generated/api/solutions/link_source_connections_api_solutions_solution_id_source_connections_post.py delete mode 100644 seclai/_generated/api/solutions/list_conversations_api_solutions_solution_id_conversations_get.py delete mode 100644 seclai/_generated/api/solutions/list_solutions_api_solutions_get.py delete mode 100644 seclai/_generated/api/solutions/mark_conversation_turn_api_solutions_solution_id_conversations_conversation_id_patch.py delete mode 100644 seclai/_generated/api/solutions/unlink_agents_api_solutions_solution_id_agents_delete.py delete mode 100644 seclai/_generated/api/solutions/unlink_knowledge_bases_api_solutions_solution_id_knowledge_bases_delete.py delete mode 100644 seclai/_generated/api/solutions/unlink_source_connections_api_solutions_solution_id_source_connections_delete.py delete mode 100644 seclai/_generated/api/solutions/update_solution_api_solutions_solution_id_patch.py delete mode 100644 seclai/_generated/api/source_exports/__init__.py delete mode 100644 seclai/_generated/api/source_exports/cancel_source_export_api_sources_source_connection_id_exports_export_id_cancel_post.py delete mode 100644 seclai/_generated/api/source_exports/create_source_export_api_sources_source_connection_id_exports_post.py delete mode 100644 seclai/_generated/api/source_exports/delete_source_export_api_sources_source_connection_id_exports_export_id_delete.py delete mode 100644 seclai/_generated/api/source_exports/download_source_export_api_sources_source_connection_id_exports_export_id_download_get.py delete mode 100644 seclai/_generated/api/source_exports/estimate_source_export_api_sources_source_connection_id_exports_estimate_post.py delete mode 100644 seclai/_generated/api/source_exports/get_source_export_api_sources_source_connection_id_exports_export_id_get.py delete mode 100644 seclai/_generated/api/source_exports/list_source_exports_api_sources_source_connection_id_exports_get.py delete mode 100644 seclai/_generated/api/sources/__init__.py delete mode 100644 seclai/_generated/api/sources/cancel_source_embedding_migration_api_sources_source_connection_id_embedding_migration_cancel_post.py delete mode 100644 seclai/_generated/api/sources/create_source_api_sources_post.py delete mode 100644 seclai/_generated/api/sources/delete_source_api_sources_source_connection_id_delete.py delete mode 100644 seclai/_generated/api/sources/get_source_api_sources_source_connection_id_get.py delete mode 100644 seclai/_generated/api/sources/get_source_embedding_migration_api_sources_source_connection_id_embedding_migration_get.py delete mode 100644 seclai/_generated/api/sources/list_sources_api_sources_get.py delete mode 100644 seclai/_generated/api/sources/start_source_embedding_migration_api_sources_source_connection_id_embedding_migration_post.py delete mode 100644 seclai/_generated/api/sources/update_source_api_sources_source_connection_id_put.py delete mode 100644 seclai/_generated/api/sources/upload_file_to_source_api_sources_source_connection_id_upload_post.py delete mode 100644 seclai/_generated/api/sources/upload_inline_text_to_source_api_sources_source_connection_id_post.py delete mode 100644 seclai/_generated/api/version/__init__.py delete mode 100644 seclai/_generated/api/version/get_api_version_api_version_get.py delete mode 100644 seclai/_generated/api/version/update_api_version_api_version_put.py delete mode 100644 seclai/_generated/client.py delete mode 100644 seclai/_generated/errors.py delete mode 100644 seclai/_generated/models/__init__.py delete mode 100644 seclai/_generated/models/add_comment_request.py delete mode 100644 seclai/_generated/models/add_conversation_turn_request.py delete mode 100644 seclai/_generated/models/add_conversation_turn_request_actions_taken_type_0.py delete mode 100644 seclai/_generated/models/add_email_domain_request.py delete mode 100644 seclai/_generated/models/agent_attachment_refs_api_response.py delete mode 100644 seclai/_generated/models/agent_caller_api_response.py delete mode 100644 seclai/_generated/models/agent_definition_import_error_response.py delete mode 100644 seclai/_generated/models/agent_definition_response.py delete mode 100644 seclai/_generated/models/agent_definition_response_definition.py delete mode 100644 seclai/_generated/models/agent_definition_response_warnings_type_0_item.py delete mode 100644 seclai/_generated/models/agent_email_opt_out_list_response.py delete mode 100644 seclai/_generated/models/agent_email_opt_out_response.py delete mode 100644 seclai/_generated/models/agent_evaluation_tier.py delete mode 100644 seclai/_generated/models/agent_export_response.py delete mode 100644 seclai/_generated/models/agent_export_response_agent.py delete mode 100644 seclai/_generated/models/agent_export_response_alert_configs_type_0_item.py delete mode 100644 seclai/_generated/models/agent_export_response_dependencies_type_0.py delete mode 100644 seclai/_generated/models/agent_export_response_evaluation_criteria_type_0_item.py delete mode 100644 seclai/_generated/models/agent_export_response_governance_policies_type_0_item.py delete mode 100644 seclai/_generated/models/agent_export_response_trigger_type_0.py delete mode 100644 seclai/_generated/models/agent_import_preview_request.py delete mode 100644 seclai/_generated/models/agent_import_preview_request_agent_definition.py delete mode 100644 seclai/_generated/models/agent_import_preview_response.py delete mode 100644 seclai/_generated/models/agent_import_preview_response_unresolved_refs_item.py delete mode 100644 seclai/_generated/models/agent_list_response.py delete mode 100644 seclai/_generated/models/agent_run_attempt_response.py delete mode 100644 seclai/_generated/models/agent_run_list_response.py delete mode 100644 seclai/_generated/models/agent_run_request.py delete mode 100644 seclai/_generated/models/agent_run_request_metadata_type_0.py delete mode 100644 seclai/_generated/models/agent_run_response.py delete mode 100644 seclai/_generated/models/agent_run_step_response.py delete mode 100644 seclai/_generated/models/agent_run_stream_request.py delete mode 100644 seclai/_generated/models/agent_run_stream_request_metadata_type_0.py delete mode 100644 seclai/_generated/models/agent_run_tool_call_response.py delete mode 100644 seclai/_generated/models/agent_summary_response.py delete mode 100644 seclai/_generated/models/agent_summary_response_sampling_config_type_0.py delete mode 100644 seclai/_generated/models/agent_trace_match_response.py delete mode 100644 seclai/_generated/models/agent_trace_search_request.py delete mode 100644 seclai/_generated/models/agent_trace_search_response.py delete mode 100644 seclai/_generated/models/ai_assistant_accept_request.py delete mode 100644 seclai/_generated/models/ai_assistant_accept_response.py delete mode 100644 seclai/_generated/models/ai_assistant_feedback_request.py delete mode 100644 seclai/_generated/models/ai_assistant_feedback_request_context_type_0.py delete mode 100644 seclai/_generated/models/ai_assistant_feedback_response.py delete mode 100644 seclai/_generated/models/ai_assistant_generate_request.py delete mode 100644 seclai/_generated/models/ai_assistant_generate_response.py delete mode 100644 seclai/_generated/models/ai_conversation_history_response.py delete mode 100644 seclai/_generated/models/ai_conversation_turn_response.py delete mode 100644 seclai/_generated/models/ai_conversation_turn_response_resulting_config_type_0.py delete mode 100644 seclai/_generated/models/alert_comment_response.py delete mode 100644 seclai/_generated/models/alert_config_list_response.py delete mode 100644 seclai/_generated/models/alert_config_response.py delete mode 100644 seclai/_generated/models/alert_config_response_threshold_type_0.py delete mode 100644 seclai/_generated/models/alert_detail_response.py delete mode 100644 seclai/_generated/models/alert_history_entry_response.py delete mode 100644 seclai/_generated/models/alert_list_response.py delete mode 100644 seclai/_generated/models/alert_response.py delete mode 100644 seclai/_generated/models/alert_subscriber_response.py delete mode 100644 seclai/_generated/models/api_version_response.py delete mode 100644 seclai/_generated/models/applied_action_response.py delete mode 100644 seclai/_generated/models/attachment_refs_source_api_summary.py delete mode 100644 seclai/_generated/models/block_email_sender_request.py delete mode 100644 seclai/_generated/models/blocked_email_sender_list_response.py delete mode 100644 seclai/_generated/models/blocked_email_sender_response.py delete mode 100644 seclai/_generated/models/body_upload_file_to_content_api_contents_source_connection_content_version_upload_post.py delete mode 100644 seclai/_generated/models/body_upload_file_to_source_api_sources_source_connection_id_upload_post.py delete mode 100644 seclai/_generated/models/cancel_experiment_response.py delete mode 100644 seclai/_generated/models/cancel_queued_runs_response.py delete mode 100644 seclai/_generated/models/change_status_request.py delete mode 100644 seclai/_generated/models/compaction_evaluation_model.py delete mode 100644 seclai/_generated/models/compaction_scheduled_response.py delete mode 100644 seclai/_generated/models/compaction_test_response_model.py delete mode 100644 seclai/_generated/models/compatible_run_list_response.py delete mode 100644 seclai/_generated/models/compatible_run_response.py delete mode 100644 seclai/_generated/models/content_detail_response.py delete mode 100644 seclai/_generated/models/content_detail_response_metadata_type_0_item.py delete mode 100644 seclai/_generated/models/content_embedding_response.py delete mode 100644 seclai/_generated/models/content_embeddings_list_response.py delete mode 100644 seclai/_generated/models/create_agent_request.py delete mode 100644 seclai/_generated/models/create_agent_request_agent_definition_type_0.py delete mode 100644 seclai/_generated/models/create_agent_request_entity_remap_type_0.py delete mode 100644 seclai/_generated/models/create_alert_config_request.py delete mode 100644 seclai/_generated/models/create_alert_config_request_threshold_type_0.py delete mode 100644 seclai/_generated/models/create_evaluation_criteria_request.py delete mode 100644 seclai/_generated/models/create_evaluation_criteria_request_expectation_config_type_0.py delete mode 100644 seclai/_generated/models/create_evaluation_result_request.py delete mode 100644 seclai/_generated/models/create_evaluation_result_request_details_type_0.py delete mode 100644 seclai/_generated/models/create_experiment_response.py delete mode 100644 seclai/_generated/models/create_export_request.py delete mode 100644 seclai/_generated/models/create_export_request_metadata_filter_type_0.py delete mode 100644 seclai/_generated/models/create_knowledge_base_body.py delete mode 100644 seclai/_generated/models/create_memory_bank_body.py delete mode 100644 seclai/_generated/models/create_solution_request.py delete mode 100644 seclai/_generated/models/create_source_body.py delete mode 100644 seclai/_generated/models/dmarc_failing_source_response.py delete mode 100644 seclai/_generated/models/dmarc_summary_response.py delete mode 100644 seclai/_generated/models/dmarc_summary_response_dispositions.py delete mode 100644 seclai/_generated/models/dns_provider_response.py delete mode 100644 seclai/_generated/models/dns_record_response.py delete mode 100644 seclai/_generated/models/docs_search_api_docs_search_get_mode.py delete mode 100644 seclai/_generated/models/docs_search_response.py delete mode 100644 seclai/_generated/models/docs_search_result_response.py delete mode 100644 seclai/_generated/models/email_domain_response.py delete mode 100644 seclai/_generated/models/email_domains_list_response.py delete mode 100644 seclai/_generated/models/email_trigger_config_response.py delete mode 100644 seclai/_generated/models/estimate_export_request.py delete mode 100644 seclai/_generated/models/estimate_export_request_metadata_filter_type_0.py delete mode 100644 seclai/_generated/models/estimate_export_response.py delete mode 100644 seclai/_generated/models/evaluation_criteria_response.py delete mode 100644 seclai/_generated/models/evaluation_criteria_response_expectation_config_type_0.py delete mode 100644 seclai/_generated/models/evaluation_criteria_response_result_summary.py delete mode 100644 seclai/_generated/models/evaluation_result_list_response.py delete mode 100644 seclai/_generated/models/evaluation_result_response.py delete mode 100644 seclai/_generated/models/evaluation_result_response_details_type_0.py delete mode 100644 seclai/_generated/models/evaluation_result_summary_response.py delete mode 100644 seclai/_generated/models/evaluation_result_with_criteria_list_response.py delete mode 100644 seclai/_generated/models/evaluation_result_with_criteria_response.py delete mode 100644 seclai/_generated/models/evaluation_result_with_criteria_response_details_type_0.py delete mode 100644 seclai/_generated/models/evaluation_run_summary_list_response.py delete mode 100644 seclai/_generated/models/evaluation_run_summary_response.py delete mode 100644 seclai/_generated/models/evaluation_status.py delete mode 100644 seclai/_generated/models/example_prompt.py delete mode 100644 seclai/_generated/models/executed_action_response.py delete mode 100644 seclai/_generated/models/experiment_detail_response.py delete mode 100644 seclai/_generated/models/experiment_detail_response_result_data_type_0.py delete mode 100644 seclai/_generated/models/experiment_list_response.py delete mode 100644 seclai/_generated/models/experiment_summary_response.py delete mode 100644 seclai/_generated/models/export_format.py delete mode 100644 seclai/_generated/models/export_list_response.py delete mode 100644 seclai/_generated/models/export_response.py delete mode 100644 seclai/_generated/models/export_response_metadata_filter_type_0.py delete mode 100644 seclai/_generated/models/file_upload_response.py delete mode 100644 seclai/_generated/models/generate_agent_steps_request.py delete mode 100644 seclai/_generated/models/generate_agent_steps_request_agent_steps_type_0_item.py delete mode 100644 seclai/_generated/models/generate_agent_steps_response.py delete mode 100644 seclai/_generated/models/generate_agent_steps_response_agent_config_type_0.py delete mode 100644 seclai/_generated/models/generate_agent_steps_response_steps_item.py delete mode 100644 seclai/_generated/models/generate_step_config_request.py delete mode 100644 seclai/_generated/models/generate_step_config_request_agent_steps_type_0_item.py delete mode 100644 seclai/_generated/models/generate_step_config_request_current_config_type_0.py delete mode 100644 seclai/_generated/models/generate_step_config_response.py delete mode 100644 seclai/_generated/models/generate_step_config_response_resulting_config_type_0.py delete mode 100644 seclai/_generated/models/generation_tier_list_response.py delete mode 100644 seclai/_generated/models/generation_tier_response.py delete mode 100644 seclai/_generated/models/get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get_response_get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get.py delete mode 100644 seclai/_generated/models/governance_ai_accept_response.py delete mode 100644 seclai/_generated/models/governance_ai_assistant_request.py delete mode 100644 seclai/_generated/models/governance_ai_assistant_response.py delete mode 100644 seclai/_generated/models/governance_conversation_response.py delete mode 100644 seclai/_generated/models/governance_conversation_response_proposed_actions_type_0.py delete mode 100644 seclai/_generated/models/governance_policy_ref_response.py delete mode 100644 seclai/_generated/models/http_validation_error.py delete mode 100644 seclai/_generated/models/import_field_error_model.py delete mode 100644 seclai/_generated/models/import_skip_response.py delete mode 100644 seclai/_generated/models/import_skip_response_details.py delete mode 100644 seclai/_generated/models/inbound_email_rejection_response.py delete mode 100644 seclai/_generated/models/inbound_email_status_response.py delete mode 100644 seclai/_generated/models/inline_text_replace_request.py delete mode 100644 seclai/_generated/models/inline_text_replace_request_metadata_type_0.py delete mode 100644 seclai/_generated/models/inline_text_upload_request.py delete mode 100644 seclai/_generated/models/inline_text_upload_request_metadata_type_0.py delete mode 100644 seclai/_generated/models/insufficient_credits_detail.py delete mode 100644 seclai/_generated/models/insufficient_credits_response.py delete mode 100644 seclai/_generated/models/knowledge_base.py delete mode 100644 seclai/_generated/models/knowledge_base_list_response_model.py delete mode 100644 seclai/_generated/models/link_resources_request.py delete mode 100644 seclai/_generated/models/mark_ai_suggestion_request.py delete mode 100644 seclai/_generated/models/mark_conversation_turn_request.py delete mode 100644 seclai/_generated/models/me_response.py delete mode 100644 seclai/_generated/models/memory_bank.py delete mode 100644 seclai/_generated/models/memory_bank_accept_request.py delete mode 100644 seclai/_generated/models/memory_bank_ai_assistant_request.py delete mode 100644 seclai/_generated/models/memory_bank_ai_assistant_request_current_config_type_0.py delete mode 100644 seclai/_generated/models/memory_bank_ai_assistant_response.py delete mode 100644 seclai/_generated/models/memory_bank_config_response.py delete mode 100644 seclai/_generated/models/memory_bank_conversation_turn_response.py delete mode 100644 seclai/_generated/models/memory_bank_conversation_turn_response_resulting_config_type_0.py delete mode 100644 seclai/_generated/models/memory_bank_last_conversation_response.py delete mode 100644 seclai/_generated/models/memory_bank_list_response_model.py delete mode 100644 seclai/_generated/models/modality_rate_response.py delete mode 100644 seclai/_generated/models/model_alert_list_response.py delete mode 100644 seclai/_generated/models/model_alert_response.py delete mode 100644 seclai/_generated/models/model_recommendation_response.py delete mode 100644 seclai/_generated/models/model_recommendations_response.py delete mode 100644 seclai/_generated/models/non_manual_evaluation_mode_stat_response.py delete mode 100644 seclai/_generated/models/non_manual_evaluation_summary_response.py delete mode 100644 seclai/_generated/models/ok_response.py delete mode 100644 seclai/_generated/models/organization_alert_preference_list_response.py delete mode 100644 seclai/_generated/models/organization_alert_preference_response.py delete mode 100644 seclai/_generated/models/organization_info_response.py delete mode 100644 seclai/_generated/models/pagination_response.py delete mode 100644 seclai/_generated/models/pending_processing_completed_failed_status.py delete mode 100644 seclai/_generated/models/playground_create_request.py delete mode 100644 seclai/_generated/models/playground_create_request_evaluation_complexity.py delete mode 100644 seclai/_generated/models/playground_create_request_evaluation_mode.py delete mode 100644 seclai/_generated/models/prompt_model_auto_upgrade_strategy.py delete mode 100644 seclai/_generated/models/prompt_model_response.py delete mode 100644 seclai/_generated/models/prompt_model_response_generation_params_type_0.py delete mode 100644 seclai/_generated/models/prompt_model_response_payload_schema_type_0.py delete mode 100644 seclai/_generated/models/prompt_tool_response.py delete mode 100644 seclai/_generated/models/prompt_tool_response_headers_type_0.py delete mode 100644 seclai/_generated/models/proposed_action_response.py delete mode 100644 seclai/_generated/models/proposed_action_response_params.py delete mode 100644 seclai/_generated/models/proposed_action_response_preview_type_0.py delete mode 100644 seclai/_generated/models/proposed_policy_action_response.py delete mode 100644 seclai/_generated/models/proposed_policy_action_response_params.py delete mode 100644 seclai/_generated/models/provider_group_response.py delete mode 100644 seclai/_generated/models/remove_email_domain_response.py delete mode 100644 seclai/_generated/models/resume_inbound_response.py delete mode 100644 seclai/_generated/models/search_response.py delete mode 100644 seclai/_generated/models/search_result_response.py delete mode 100644 seclai/_generated/models/send_test_email_response.py delete mode 100644 seclai/_generated/models/set_auto_block_mode_request.py delete mode 100644 seclai/_generated/models/set_email_trigger_config_request.py delete mode 100644 seclai/_generated/models/solution_agent_response.py delete mode 100644 seclai/_generated/models/solution_conversation_response.py delete mode 100644 seclai/_generated/models/solution_conversation_response_actions_taken_type_0.py delete mode 100644 seclai/_generated/models/solution_knowledge_base_response.py delete mode 100644 seclai/_generated/models/solution_list_response.py delete mode 100644 seclai/_generated/models/solution_response.py delete mode 100644 seclai/_generated/models/solution_source_connection_response.py delete mode 100644 seclai/_generated/models/solution_summary_response.py delete mode 100644 seclai/_generated/models/source_connection_response_model.py delete mode 100644 seclai/_generated/models/source_embedding_migration_response.py delete mode 100644 seclai/_generated/models/source_index_mode.py delete mode 100644 seclai/_generated/models/source_list_response.py delete mode 100644 seclai/_generated/models/source_response.py delete mode 100644 seclai/_generated/models/standalone_test_compaction_request.py delete mode 100644 seclai/_generated/models/start_source_embedding_migration_request.py delete mode 100644 seclai/_generated/models/test_compaction_request.py delete mode 100644 seclai/_generated/models/test_draft_evaluation_request.py delete mode 100644 seclai/_generated/models/test_draft_evaluation_request_expectation_config_type_0.py delete mode 100644 seclai/_generated/models/test_draft_evaluation_response.py delete mode 100644 seclai/_generated/models/unlink_resources_request.py delete mode 100644 seclai/_generated/models/unread_count_response.py delete mode 100644 seclai/_generated/models/update_agent_definition_request.py delete mode 100644 seclai/_generated/models/update_agent_definition_request_definition.py delete mode 100644 seclai/_generated/models/update_agent_request.py delete mode 100644 seclai/_generated/models/update_agent_request_agent_definition_type_0.py delete mode 100644 seclai/_generated/models/update_agent_request_entity_remap_type_0.py delete mode 100644 seclai/_generated/models/update_agent_request_sampling_config_type_0.py delete mode 100644 seclai/_generated/models/update_alert_config_request.py delete mode 100644 seclai/_generated/models/update_alert_config_request_threshold_type_0.py delete mode 100644 seclai/_generated/models/update_api_version_request.py delete mode 100644 seclai/_generated/models/update_evaluation_criteria_request.py delete mode 100644 seclai/_generated/models/update_evaluation_criteria_request_expectation_config_type_0.py delete mode 100644 seclai/_generated/models/update_knowledge_base_body.py delete mode 100644 seclai/_generated/models/update_memory_bank_body.py delete mode 100644 seclai/_generated/models/update_organization_alert_preference_request.py delete mode 100644 seclai/_generated/models/update_solution_request.py delete mode 100644 seclai/_generated/models/update_source_body.py delete mode 100644 seclai/_generated/models/upload_agent_input_api_response.py delete mode 100644 seclai/_generated/models/validation_error.py delete mode 100644 seclai/_generated/models/variant_category_response.py delete mode 100644 seclai/_generated/models/variant_option_response.py delete mode 100644 seclai/_generated/pyproject.toml delete mode 100644 seclai/_generated/seclai_api_client/__init__.py delete mode 100644 seclai/_generated/seclai_api_client/api/__init__.py delete mode 100644 seclai/_generated/seclai_api_client/api/agents/__init__.py delete mode 100644 seclai/_generated/seclai_api_client/api/agents/delete_agent_run_api_agents_agent_id_runs_run_id_delete.py delete mode 100644 seclai/_generated/seclai_api_client/api/agents/get_agent_run_api_agents_agent_id_runs_run_id_get.py delete mode 100644 seclai/_generated/seclai_api_client/api/agents/list_agent_runs_api_agents_agent_id_runs_get.py delete mode 100644 seclai/_generated/seclai_api_client/api/agents/run_agent_api_agents_agent_id_runs_post.py delete mode 100644 seclai/_generated/seclai_api_client/api/contents/__init__.py delete mode 100644 seclai/_generated/seclai_api_client/api/contents/delete_content_api_contents_source_connection_content_version_delete.py delete mode 100644 seclai/_generated/seclai_api_client/api/contents/get_content_detail_api_contents_source_connection_content_version_get.py delete mode 100644 seclai/_generated/seclai_api_client/api/contents/list_content_embeddings_api_contents_source_connection_content_version_embeddings_get.py delete mode 100644 seclai/_generated/seclai_api_client/api/sources/__init__.py delete mode 100644 seclai/_generated/seclai_api_client/api/sources/list_sources_api_sources_get.py delete mode 100644 seclai/_generated/seclai_api_client/api/sources/upload_file_to_source_api_sources_source_connection_id_upload_post.py delete mode 100644 seclai/_generated/seclai_api_client/client.py delete mode 100644 seclai/_generated/seclai_api_client/errors.py delete mode 100644 seclai/_generated/seclai_api_client/models/__init__.py delete mode 100644 seclai/_generated/seclai_api_client/models/account_budget_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/account_details_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/account_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/activity_budget_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/activity_credit_usage_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_run_attempt_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_run_details_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_run_details_response_metadata_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_run_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_run_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_run_request_metadata_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_run_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_run_status_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_run_step_details_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_run_summary_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_trigger_frequency.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_trigger_type.py delete mode 100644 seclai/_generated/seclai_api_client/models/agent_warning_model.py delete mode 100644 seclai/_generated/seclai_api_client/models/analyze_substitutions_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/analyze_substitutions_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/api_call_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/api_key_create_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/api_key_create_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/api_key_list_item_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/api_key_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/body_upload_file_to_source_api_sources_source_connection_id_upload_post.py delete mode 100644 seclai/_generated/seclai_api_client/models/body_upload_file_to_source_authenticated_sources_source_connection_id_upload_post.py delete mode 100644 seclai/_generated/seclai_api_client/models/branch_current_state_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/branch_current_state_response_definition.py delete mode 100644 seclai/_generated/seclai_api_client/models/branch_current_state_response_dependencies_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/branch_current_state_response_dependencies_type_0_additional_property.py delete mode 100644 seclai/_generated/seclai_api_client/models/branch_current_state_response_dependencies_type_0_additional_property_additional_property.py delete mode 100644 seclai/_generated/seclai_api_client/models/branch_summary_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/budget_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/change_plan_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/chat_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/chat_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/comment_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/company_size.py delete mode 100644 seclai/_generated/seclai_api_client/models/content_detail_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/content_detail_response_metadata_type_0_item.py delete mode 100644 seclai/_generated/seclai_api_client/models/content_embedding_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/content_embeddings_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/content_filter_type.py delete mode 100644 seclai/_generated/seclai_api_client/models/conversation_data.py delete mode 100644 seclai/_generated/seclai_api_client/models/conversation_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/conversation_message_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/conversation_with_messages_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/cost_estimate_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/cost_estimate_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/create_agent_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/create_agent_request_metadata_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/create_knowledge_base_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/create_source_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/create_trigger_schedule_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/credit_purchase_confirm_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/credit_purchase_price_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/credit_purchase_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/credit_purchase_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/credit_purchase_with_payment_method_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/credit_purchase_with_payment_method_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/credit_usage_slice_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/default_chunking_config.py delete mode 100644 seclai/_generated/seclai_api_client/models/delete_account_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/detect_source_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/detect_source_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/email_preference_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/embedding_cost_info.py delete mode 100644 seclai/_generated/seclai_api_client/models/embedding_model_info.py delete mode 100644 seclai/_generated/seclai_api_client/models/embedding_models_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/embedding_storage_credits.py delete mode 100644 seclai/_generated/seclai_api_client/models/feed_item.py delete mode 100644 seclai/_generated/seclai_api_client/models/file_upload_config_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/file_upload_config_response_supported_types.py delete mode 100644 seclai/_generated/seclai_api_client/models/file_upload_config_response_supported_types_additional_property.py delete mode 100644 seclai/_generated/seclai_api_client/models/file_upload_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/http_validation_error.py delete mode 100644 seclai/_generated/seclai_api_client/models/invitation_create_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/invitations_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/json_type.py delete mode 100644 seclai/_generated/seclai_api_client/models/knowledge_base_content_version_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/knowledge_base_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/knowledge_base_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/language_option.py delete mode 100644 seclai/_generated/seclai_api_client/models/list_payment_methods_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/mcp_server_request_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/members_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/membership_type.py delete mode 100644 seclai/_generated/seclai_api_client/models/membership_update_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/message_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/onboarding_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/organization_create_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/organization_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/organization_resource_counts_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/organization_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/page_link.py delete mode 100644 seclai/_generated/seclai_api_client/models/pagination_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/patch_branch_state_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/patch_branch_state_request_data_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/payment_intent_history_item.py delete mode 100644 seclai/_generated/seclai_api_client/models/payment_intent_history_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/payment_intent_status_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/payment_intent_status_response_payment_intent_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/payment_method_action_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/payment_method_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/payment_method_response_card.py delete mode 100644 seclai/_generated/seclai_api_client/models/pending_completed_failed_status.py delete mode 100644 seclai/_generated/seclai_api_client/models/pending_processing_completed_failed_status.py delete mode 100644 seclai/_generated/seclai_api_client/models/plan_price_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/plan_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/plan_response_prices.py delete mode 100644 seclai/_generated/seclai_api_client/models/polling_action.py delete mode 100644 seclai/_generated/seclai_api_client/models/polling_type.py delete mode 100644 seclai/_generated/seclai_api_client/models/processing_phase_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/prompt_model_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/prompt_tool_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/prompt_tool_response_headers_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/provider_group_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/pull_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/pull_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/related_account_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/reranker_model_info.py delete mode 100644 seclai/_generated/seclai_api_client/models/reranker_models_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/rss_content_option.py delete mode 100644 seclai/_generated/seclai_api_client/models/run_agent_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/run_agent_request_metadata_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/run_agent_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/seed_type.py delete mode 100644 seclai/_generated/seclai_api_client/models/setup_intent_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/source_connection_embeddings_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/source_connection_pull_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/source_connection_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/source_content_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/source_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/source_pull_progress_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/source_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/source_type.py delete mode 100644 seclai/_generated/seclai_api_client/models/start_subscription_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/start_subscription_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/step_debug_run_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/step_debug_run_request_manual_inputs.py delete mode 100644 seclai/_generated/seclai_api_client/models/step_debug_run_request_manual_metadata.py delete mode 100644 seclai/_generated/seclai_api_client/models/step_debug_run_request_manual_outputs.py delete mode 100644 seclai/_generated/seclai_api_client/models/step_debug_run_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/step_run_attempt_list_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/step_run_attempt_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/stripe_webhook_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/submit_feedback_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/subscription_cancelation_reason.py delete mode 100644 seclai/_generated/seclai_api_client/models/subscription_payment_intent_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/subscription_payment_intent_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/subscription_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/substitution_dependencies.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_display_result_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_display_result_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_extract_html_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_extract_html_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_extract_json_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_extract_json_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_extract_xml_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_extract_xml_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_prompt_call_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_prompt_call_request_json_template_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_prompt_call_request_manual_inputs_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_prompt_call_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_prompt_call_response_result_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_retrieval_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_retrieval_request_metadata_filter_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_retrieval_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_s3_write_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_s3_write_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_s3_write_response_result_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_send_email_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_send_email_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_send_email_response_result_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_transform_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_transform_request_placeholder_values.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_transform_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_webhook_call_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_webhook_call_request_headers_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_webhook_call_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_webhook_call_response_request_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/test_webhook_call_response_response_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/transform_rule_test.py delete mode 100644 seclai/_generated/seclai_api_client/models/trigger_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/trigger_response_metadata_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/trigger_schedule_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_agent_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_auto_purchase_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_branch_state_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_branch_state_request_definition.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_email_preference_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_knowledge_base_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_monthly_overage_budget_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_source_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_stop_at_budget_limit_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_trigger_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_trigger_request_metadata_type_0.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_trigger_schedule_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/update_user_profile_request.py delete mode 100644 seclai/_generated/seclai_api_client/models/usage_detail_activity_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/usage_details_granularity.py delete mode 100644 seclai/_generated/seclai_api_client/models/usage_origin_slice_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/use_case_type.py delete mode 100644 seclai/_generated/seclai_api_client/models/user_profile_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/user_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/validation_error.py delete mode 100644 seclai/_generated/seclai_api_client/models/validation_error_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/validation_field_error.py delete mode 100644 seclai/_generated/seclai_api_client/models/variant_category_response.py delete mode 100644 seclai/_generated/seclai_api_client/models/variant_option_response.py delete mode 100644 seclai/_generated/seclai_api_client/py.typed delete mode 100644 seclai/_generated/seclai_api_client/types.py delete mode 100644 seclai/_generated/types.py delete mode 100644 seclai/auth.py delete mode 100644 seclai/py.typed delete mode 100644 seclai/seclai.py delete mode 100644 seclai/versions.py delete mode 100644 tests/test_auth_and_headers.py delete mode 100644 tests/test_convenience_methods.py delete mode 100644 tests/test_generated_bridge.py delete mode 100644 tests/test_new_methods.py delete mode 100644 tests/test_status_errors.py delete mode 100644 tests/test_streaming_agent_runs.py diff --git a/.claude/settings.json b/.claude/settings.json deleted file mode 100644 index d1990d8..0000000 --- a/.claude/settings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(bash -n sync.sh)", - "Bash(./sync.sh --check)" - ] - } -} diff --git a/.claude/skills/seclai-changelog/SKILL.md b/.claude/skills/seclai-changelog/SKILL.md deleted file mode 100644 index 06a0beb..0000000 --- a/.claude/skills/seclai-changelog/SKILL.md +++ /dev/null @@ -1,188 +0,0 @@ ---- -name: seclai-changelog -description: Write or update CHANGELOG.md in a Seclai SDK repo (seclai-python, seclai-javascript, seclai-go, seclai-csharp, seclai-cli, seclai-mcp) using the Common Changelog format. Use when adding a changelog entry, preparing a release, backfilling history from version tags, or finishing an OpenAPI spec sync in one of these repos. ---- - -# Seclai changelog entries - -> **Vendored file — do not edit in place.** The canonical copy lives in the -> `seclai/sdk-tools` repository at `skills/seclai-changelog/`, and is mirrored -> into each SDK repo with `git subtree`. Edits made here are reported as drift by -> `sdk-tools/sync.sh --check` and are overwritten on the next pull. To change it, -> change it upstream — or, if you can't reach that repo, open an issue on this -> one describing the fix and a maintainer will carry it across. - -All six Seclai SDK repos keep a root `CHANGELOG.md` in [Common Changelog](https://common-changelog.org) format. This skill covers writing a new entry and backfilling from tags. - -## Write against the last release, not against the branch - -An entry describes what changed between the **last released tag** and now. -Anything introduced and then revised inside the same unreleased version is -invisible to consumers and must not appear. - -Three of these shipped into a draft in 2026-07: - -- "Return `JsonElement` from `ListAlertsAsync` **as before**" — typed and then - untyped again within an unreleased version. Net change: nothing. -- "Omit unset properties on `SetEmailTriggerConfigRequest`" — that class was - *introduced* in the same version, so its serialization is not a change from - anything. Fold such detail into the `Added` entry instead. -- "`Total`/`Page`/`Limit` were always 0 **for callers who opted in**" — opting in - was itself new in that release, so no released version could have hit it. The - real defect predated it and needed describing on its own terms. - -Check it mechanically before publishing: - -```bash -python3 .claude/skills/seclai-sdk-sync/sdksync.py surface -git diff -- -``` - -If an entry does not correspond to something in that diff, delete it. Counts age -badly for the same reason: "adding 22 paths" was written mid-sync and was 23 by -the time the version shipped — derive them from the tag, do not carry them -forward. - -## Format rules - -- File starts with `# Changelog`, then releases sorted latest-first. -- Release heading: `## [1.4.0] - 2026-07-25` — semver without a `v`, ISO date. -- **No `Unreleased` section.** Entries are written in the PR that ships them, under the version that PR will become (see "Determine the version"). -- Change groups are third-level headings, only these four, always in this order: - `### Changed`, `### Added`, `### Removed`, `### Fixed`. -- A group heading is followed by an unordered list and nothing else. -- Entry form: `- Change ([ref](url))`. Imperative present tense, self-describing — it must read correctly without its group heading. "Support CentOS", never "Support of CentOS" or "Added support". -- Breaking changes take a `**Breaking:**` prefix and sort first within their group. Otherwise sort by importance. -- A release may open with a one-sentence italic notice instead of, or before, its groups — used for first releases (`_Initial release._`) and no-op version bumps. -- Version links are reference-style at the bottom: - `[1.4.0]: https://github.com/seclai//releases/tag/1.4.0`. **Check the tag - format per repo** — seclai-python and seclai-javascript tag without a prefix, - seclai-go tags `v1.4.0` because Go module resolution requires it. The heading - stays bare (`## [1.5.0]`); only the link target carries the `v`. Confirm with - `git tag --sort=-v:refname | head -1` before writing the link block. -- Authors are omitted — these are effectively single-contributor repos. - -## Determine the version - -Do not guess the next version. Releases are cut by `seclai/github-tag-action` in `.github/workflows/main-build.yaml`, which reads the **merge commit message**: - -- contains `#major` → major bump -- contains `#minor` → minor bump -- otherwise → `DEFAULT_BUMP: patch` - -So a PR that adds endpoints must say `#minor` in its title/merge commit, or the heading you write will not match the tag that gets cut. Confirm the intended bump with the user when it isn't stated, and flag the mismatch risk if the PR title lacks the keyword. - -Check `git tag --sort=-v:refname | head -1` for the current latest, then apply the bump. - -## Derive entries from diffs, not from release notes - -`gh release view` bodies are `--generate-notes` output — just "PR #N by @author". They are useless as entry text. Commit subjects like "2026 05 22 api sync" are equally useless. Always read the actual diff. - -Extract the public API delta for a range. Per repo: - -| Repo | Path | Pattern | -| --- | --- | --- | -| seclai-javascript | `src/client.ts` | `async ([a-zA-Z_][a-zA-Z0-9_]*)\(` | -| seclai-python | `seclai/seclai.py` | `^ (async )?def ([a-z][a-z0-9_]*)` | -| seclai-go | `*.go` | `^func \(c \*Client\) ([A-Z][A-Za-z0-9]*)\(` | -| seclai-csharp | `src/Seclai/SeclaiClient.cs` | `public (async )?[A-Za-z<>,? ]+ ([A-Z][A-Za-z0-9]*)\(` | -| seclai-cli | `src/commands/` | one file or subcommand per feature | -| seclai-mcp | `src/` | registered tool names | - -```bash -# methods added between two tags -git diff PREV TAG -- src/ | grep "^+" | grep -oE '' | sort -u -# and removed -git diff PREV TAG -- src/ | grep "^-" | grep -oE '' | sort -u -``` - -A name in **both** lists was modified, not removed — check the signature diff before writing a `Removed` entry. Renames and reordering produce false positives constantly. - -Also diff the type aliases (`src/types.ts`, `seclai/models`, etc.) and the bundled `openapi/seclai.openapi.json` — new schemas often mean new public types worth an entry even when no method changed. - -## Classify - -- New method, option, type export, or capability → **Added** -- Changed signature, default, accepted type, or behavior of something that already worked → **Changed** -- Deleted public surface → **Removed** -- It was broken and now works → **Fixed** - -Judgment calls that have come up: - -- A wrong default host or a wrong request path is **Fixed** — requests were failing — not Changed. -- Making a required parameter optional (via overload) is **Changed**, not Added. -- Exporting a type that should already have been exported is **Fixed**. -- Adding an endpoint to the bundled spec without a client method is worth its own entry; say so plainly rather than implying the method exists. -- A version bump with no code change gets a notice, not a group: `_Stable release. No functional changes since 0.0.1._` - -## Write - -Reference the PR when there is one (`([#9](https://github.com/seclai//pull/9))`), otherwise the short commit SHA (`([`36bff73`](https://github.com/seclai//commit/36bff73))`). For a PR not yet opened, omit the reference — never invent a number. - -Group related additions into one entry when they ship as a unit (e.g. eight email-domain methods), and give standalone capabilities their own line. Aim for entries a user scanning for "what changed for me" can act on. - -## Check the surface before you describe it - -The changelog is the last gate before a release, so use the entries you are -writing as a prompt to spot-check the public surface they describe. Fix these, or -raise them, before they ship — each one is far cheaper now than after consumers -depend on it. - -**Return the shape the spec declares.** Look up the endpoint's 2xx response schema -and mirror it: - -| Spec response | Return type | -| --- | --- | -| `$ref` to a schema | that aliased type — never `unknown` | -| `type: object`, `additionalProperties: true` | `Record` | -| `additionalProperties: {type: T}` | `Record` | -| `type: array` | `T[]` / `unknown[]` — **not** `Record` | - -A hand-written wrapper returning `unknown` where the generator had a real type -available is a bug, not a style choice. - -**Widening `unknown` is breaking.** Changing a released method from `unknown` to -`Record` breaks consumer code that does `result as SomeInterface` -— TypeScript rejects it with TS2352 and demands `as unknown as SomeInterface`. -That makes it a `#major`, never a patch or minor. New methods have no consumers -yet, so type them correctly from the start rather than inheriting a neighbour's -`unknown`. - -**Server-defaulted request fields must be optional.** openapi-typescript emits any -property carrying a `default` as **required**, even when the spec leaves it out of -`required`. Callers then have to pass a value the server would have defaulted. -Wrap the generated request in an input type: - -```ts -export type AddEmailDomainInput = Pick & - Partial>; -``` - -See `AddEmailDomainInput` and `CreateExperimentInput` in `src/types.ts`. - -**Compile the doc examples.** `npm run typecheck` covers `src/` and `tests/`, not -README or changelog snippets. Paste any example you write into a scratch `.ts` -that imports from `../src/index` and compile it — that is how the -`delegated`-is-required bug above was found, after the snippet had already shipped -in a PR. - -## Validate - -Run the bundled checker from the repo root before declaring done: - -```bash -python3 .claude/skills/seclai-changelog/validate.py CHANGELOG.md -``` - -That path holds in every SDK repo, since this skill is vendored into each one. When working inside `sdk-tools` itself, the canonical copy is `skills/seclai-changelog/validate.py`. - -It verifies heading format, descending version order, group names and ordering, `Breaking:` sorting, absence of an `Unreleased` section, and that every release has exactly one matching link definition. It exits non-zero on error, so the same invocation works as a CI gate. - -Also confirm `CHANGELOG.md` is in the published artifact list — `files` in `package.json` for the JS/CLI/MCP repos, the packaging config for the others. - -## Backfilling from tags - -1. `git tag --sort=-v:refname` and `gh release list` for versions and dates. Use the GitHub release published date (UTC) as the entry date. -2. Walk consecutive tag pairs oldest-first, extracting the API delta for each as above. -3. Map each range to its PR via `gh release view --json body`, which does at least carry the PR number reliably. -4. The earliest release gets `_Initial release._`. diff --git a/.claude/skills/seclai-changelog/validate.py b/.claude/skills/seclai-changelog/validate.py deleted file mode 100755 index b73deb7..0000000 --- a/.claude/skills/seclai-changelog/validate.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -"""Validate a Common Changelog file as used by the Seclai SDK repos. - -Usage: python3 validate.py [CHANGELOG.md] - -Exits non-zero and prints one line per problem. Warnings do not affect the -exit code. -""" -import re -import sys - -GROUPS = ["Changed", "Added", "Removed", "Fixed"] -RELEASE_RE = re.compile(r"^## \[([^\]]+)\] - (\d{4}-\d{2}-\d{2})\s*$") -GROUP_RE = re.compile(r"^### (.+?)\s*$") -LINKDEF_RE = re.compile(r"^\[([^\]]+)\]:\s+(\S+)\s*$") -SEMVER_RE = re.compile(r"^(\d+)\.(\d+)\.(\d+)$") - - -def semver_key(v): - m = SEMVER_RE.match(v) - return tuple(int(g) for g in m.groups()) if m else (-1, -1, -1) - - -def main(): - path = sys.argv[1] if len(sys.argv) > 1 else "CHANGELOG.md" - try: - lines = open(path, encoding="utf-8").read().split("\n") - except OSError as e: - print(f"error: cannot read {path}: {e}") - return 1 - - errors, warnings = [], [] - releases, linkdefs = [], [] - cur = None - seen_groups = [] - group_entries = [] - in_group = None - - def close_group(): - if in_group is None: - return - if not group_entries: - errors.append(f"{cur}: '### {in_group}' has no entries") - breaking = [i for i, e in enumerate(group_entries) if e.startswith("**Breaking:**")] - if breaking and breaking != list(range(len(breaking))): - errors.append(f"{cur}: breaking changes must sort first under '### {in_group}'") - - if not lines or lines[0].strip() != "# Changelog": - errors.append("file must start with '# Changelog'") - - for n, line in enumerate(lines, 1): - if line.strip().lower().startswith("## [unreleased") or line.strip().lower() == "## unreleased": - errors.append(f"line {n}: Common Changelog has no Unreleased section") - continue - - m = RELEASE_RE.match(line) - if m: - close_group() - cur, seen_groups, in_group, group_entries = m.group(1), [], None, [] - if not SEMVER_RE.match(cur): - errors.append(f"line {n}: '{cur}' is not a bare semver version") - releases.append(cur) - continue - - if line.startswith("## "): - errors.append(f"line {n}: malformed release heading: {line.strip()!r}") - continue - - m = GROUP_RE.match(line) - if m: - close_group() - g = m.group(1) - if cur is None: - # Stay outside the group. Entering it would let close_group() - # later report against a release that never started, emitting a - # confusing "None: ..." on top of the real error below. - in_group, group_entries = None, [] - errors.append(f"line {n}: '### {g}' before any release heading") - continue - in_group, group_entries = g, [] - if g not in GROUPS: - errors.append(f"{cur}: unknown group '{g}' (allowed: {', '.join(GROUPS)})") - continue - i = GROUPS.index(g) - if g in [GROUPS[j] for j in seen_groups]: - errors.append(f"{cur}: duplicate group '{g}'") - elif seen_groups and i < seen_groups[-1]: - errors.append( - f"{cur}: '{g}' out of order — required order is {' > '.join(GROUPS)}" - ) - seen_groups.append(i) - continue - - m = LINKDEF_RE.match(line) - if m: - linkdefs.append(m.group(1)) - continue - - if line.startswith("- ") and in_group is not None: - entry = line[2:].strip() - group_entries.append(entry) - if entry.endswith("."): - warnings.append(f"{cur}: entry ends with a period: {entry[:60]!r}") - - close_group() - - ordered = sorted(releases, key=semver_key, reverse=True) - if releases != ordered: - errors.append(f"releases not sorted latest-first: {' '.join(releases)}") - - for v in releases: - c = linkdefs.count(v) - if c == 0: - errors.append(f"{v}: missing link definition at the bottom of the file") - elif c > 1: - errors.append(f"{v}: {c} link definitions, expected 1") - for d in linkdefs: - if d not in releases: - errors.append(f"orphan link definition [{d}] with no matching release") - - for w in warnings: - print(f"warning: {w}") - for e in errors: - print(f"error: {e}") - - if errors: - print(f"\n{len(errors)} error(s) in {path}") - return 1 - print(f"{path}: OK — {len(releases)} releases, format valid") - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 2bfb455..0000000 --- a/.gitattributes +++ /dev/null @@ -1,22 +0,0 @@ -# Files produced by tooling rather than written by hand. -# -# `linguist-generated` collapses them in GitHub's diff view and drops them from -# the repository language stats, so a sync PR opens on the files a reviewer can -# actually act on. A 2026-07 sync changed 14,000 lines of which 864 were -# hand-written; everything else was regenerated, exported or vendored. -# -# They are still committed and still reviewable — just expand-on-demand. - -# openapi-python-client output. Regenerated wholesale by `make generate`. -seclai/_generated/** linguist-generated=true - -# Exported from the API repo, never edited here. Review it with -# `sdksync.py spec-diff`, which reports the client-observable changes; the raw -# JSON diff runs to thousands of lines that nobody reads line by line. -openapi/*.json linguist-generated=true - -poetry.lock linguist-generated=true - -# Vendored from seclai/sdk-tools by `sync.sh` via git subtree. Edited upstream, -# never here, so it is noise in a diff for this repo. -.claude/skills/** linguist-generated=true diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md deleted file mode 100644 index 7bab976..0000000 --- a/.github/copilot-instructions.md +++ /dev/null @@ -1,58 +0,0 @@ -# Copilot Instructions — seclai-python - -## Build & Lint Pipeline - -Run the full CI check before committing: - -```sh -make lint # ruff check + black + mypy -make test # pytest -``` - -Individual commands: - -- **Formatter**: `poetry run black .` — CI enforces formatting; always run before committing -- **Linter**: `poetry run ruff check --fix .` -- **Type checker**: `poetry run mypy .` — strict mode with `warn_unused_ignores` -- **Tests**: `poetry run pytest tests/ -q` - -## Quality gates (must pass to report completion) - -- **ALL tests must pass with ZERO failures. No exceptions.** CI/CD runs the full test suite on every PR. A test failure blocks the build. -- **ALL lint checks (including mypy) must pass with ZERO errors.** Run `make lint` — all files, not just ones you modified. -- **Do not dismiss test or lint failures as pre-existing or unrelated.** The `main` branch CI/CD is green. Any failure on a feature branch was caused by changes on that branch. -- **CRITICAL — NEVER INVESTIGATE ERROR ORIGIN OR BLAME**: When a lint, type-check, or test error appears, **fix it immediately**. Do NOT run `git blame` or use git history to argue that an error is "pre-existing" or not your responsibility. Tools like `git diff`, `git log`, and `git show` may be used to understand and review changes, but never to avoid fixing an error. There is no scenario where knowing the origin of an error changes what you must do: **fix it**. -- **CRITICAL — NEVER PIPE TEST OR LINT OUTPUT**: Do not append `| tail`, `| head`, `| grep`, or any pipe to `pytest`, `make lint`, `make test`, or similar commands. Piping hides errors. Use pytest flags like `--tb=short -q` to reduce verbosity — never pipe. - -## Key Rules - -- Always run `poetry run black .` after making changes — CI will fail if formatting differs. -- When fixing a type issue, remove the corresponding `# type: ignore` comment or mypy will error on the unused suppression. -- Do NOT edit files under `seclai/_generated/` — they are auto-generated from the OpenAPI spec. -- The OpenAPI spec at `openapi/seclai.openapi.json` is shared identically with `seclai-go`. Changes must be synced to both repos. -- OpenAPI specs are generated from the main `seclai` app repo. Description or endpoint changes made here must also be applied upstream, or they will be overwritten on the next generation. -- `.github/copilot-instructions.md` shares common sections (quality gates, git rules, editing rules, self-correction rules) across all SDK repos. When updating shared rules, apply the same change to all repos: `seclai-python`, `seclai-javascript`, `seclai-go`, `seclai-csharp`, `seclai-cli`, `seclai-mcp`. -- Use the existing virtualenv (`poetry run ...`); do not create or reconfigure Python environments. -- **CRITICAL — USE EXISTING VIRTUAL ENV**: The workspace Python virtual environment is already set up. Reuse with `poetry run ...`; do **not** create, activate, or reconfigure another environment unless the user explicitly asks. -- **CRITICAL — NEVER CALL PYTHON ENVIRONMENT TOOLS**: Do not call `configure_python_environment`, `activate_python_environment_tools`, or any similar environment-management tool unless the user explicitly asks. -- Do not run ad-hoc Python snippets; add tests instead. - -## Git rules - -- **NEVER use `git stash`.** Use `git diff`, `git log`, or `git show` instead. -- Do not run `git checkout` to switch branches, `git reset`, or any other destructive git operation without explicit user approval. - -## Editing rules - -- Do not use CLI text tools (sed/awk). Use the editor-based patch tool. - -## Self-correction rules - -- **NEVER promise to "do better" without updating these instruction files.** If a recurring mistake is identified, edit this file with a concrete rule that prevents the mistake. Do that FIRST, then continue work. - -## Architecture Notes - -- Auth modes: `api_key`, `bearer_static`, `bearer_provider`, `sso`. -- `_build_default_headers()` only sets static auth; dynamic modes (`bearer_provider`, `sso`) are resolved per-request in `_merge_request_headers` / `_merge_request_headers_async`. -- Typed wrapper methods use `_sync_generated_client()` / `_async_generated_client()` which return a `GeneratedClient` with its own internal `httpx.Client` (separate from the SDK's `self._client`). -- In tests, to mock typed methods you must wire the mock transport into the generated client via `gc.set_httpx_client(httpx.Client(transport=transport, base_url=..., headers=dict(gc._headers)))`. diff --git a/.github/workflows/main-build.yaml b/.github/workflows/main-build.yaml deleted file mode 100644 index 97397ba..0000000 --- a/.github/workflows/main-build.yaml +++ /dev/null @@ -1,172 +0,0 @@ -name: Release Build - -on: - push: - branches: - - main - -concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true - -jobs: - pypi: - name: Build, Test, and Publish to PyPI - runs-on: ubuntu-latest - permissions: - id-token: write - contents: write - outputs: - version: ${{ steps.next-tag.outputs.new_tag }} - steps: - - name: Checkout files - uses: actions/checkout@v5 - with: - fetch-depth: '0' - - - name: Determine next version tag - id: next-tag - uses: seclai/github-tag-action@1.75.0 - env: - DEFAULT_BUMP: patch - DRY_RUN: 'true' - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.13' - - - name: Install Poetry - run: pipx install poetry - - - name: Install dependencies - run: poetry install --no-root - - - name: Update package metadata docs link for PyPI (versioned) - env: - VERSION: ${{ steps.next-tag.outputs.new_tag }} - run: python scripts/set-doc-url-version.py apply - - - name: Update README docs link for PyPI (versioned) - env: - VERSION: ${{ steps.next-tag.outputs.new_tag }} - run: python scripts/set-readme-version.py apply - - - name: Build package - env: - VERSION: ${{ steps.next-tag.outputs.new_tag }} - run: make build - - - name: Restore README after build - run: python scripts/set-readme-version.py restore - - - name: Restore pyproject.toml after build - run: python scripts/set-doc-url-version.py restore - - - name: Lint checks - env: - VERSION: ${{ steps.next-tag.outputs.new_tag }} - run: make lint - - - name: Run tests - env: - VERSION: ${{ steps.next-tag.outputs.new_tag }} - run: make test - - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: dist - skip-existing: true - - - name: Push tag - run: | - git tag ${{ steps.next-tag.outputs.new_tag }} - git push origin ${{ steps.next-tag.outputs.new_tag }} - - - name: Create release - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release create ${{ steps.next-tag.outputs.new_tag }} \ - --title "Release ${{ steps.next-tag.outputs.new_tag }}" \ - --generate-notes - - pages: - name: Publish Docs to GitHub Pages - needs: pypi - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deploy-pages.outputs.page_url }} - permissions: - id-token: write - contents: write - pages: write - steps: - - name: Checkout files - uses: actions/checkout@v5 - with: - ref: ${{ needs.pypi.outputs.version }} - fetch-depth: '0' - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.13' - - - name: Install Poetry - run: pipx install poetry - - - name: Install dependencies - run: poetry install --no-root - - - name: Generate SDK documentation - env: - VERSION: ${{ needs.pypi.outputs.version }} - run: make docs - - - name: Checkout gh-pages branch - uses: actions/checkout@v5 - with: - ref: gh-pages - path: gh-pages - fetch-depth: 0 - - - name: Publish SDK docs to GitHub Pages (versioned) - env: - VERSION: ${{ needs.pypi.outputs.version }} - run: | - set -euo pipefail - - # Ensure Pages serves raw HTML (no Jekyll processing) - touch gh-pages/.nojekyll - - # Replace latest + this version, keep older versions - rm -rf "gh-pages/latest" "gh-pages/${VERSION}" "gh-pages/index.html" - cp -R "build/docs/latest" "gh-pages/latest" - cp -R "build/docs/${VERSION}" "gh-pages/${VERSION}" - cp "build/docs/index.html" "gh-pages/index.html" - - cd gh-pages - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add -A - if git diff --cached --quiet; then - echo "No doc changes to publish." - exit 0 - fi - git commit -m "Docs: ${VERSION}" - git push origin gh-pages - - - name: Configure GitHub Pages - uses: actions/configure-pages@v5 - - - name: Upload GitHub Pages artifact - uses: actions/upload-pages-artifact@v3 - with: - path: gh-pages - - - name: Deploy GitHub Pages - id: deploy-pages - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml deleted file mode 100644 index 7aea449..0000000 --- a/.github/workflows/pr-build.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: Pull Request Build - -on: - pull_request: - types: [opened, synchronize] - -concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - name: Build and Test - runs-on: ubuntu-latest - permissions: - id-token: write - contents: write - steps: - - name: Checkout files - uses: actions/checkout@v5 - with: - fetch-depth: '0' - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.13' - - - name: Install Poetry - run: pipx install poetry - - - name: Install dependencies - run: poetry install --no-root - - - name: Build package - env: - VERSION: ${{ steps.next-tag.outputs.new_tag }} - run: make build - - - name: Lint checks - env: - VERSION: ${{ steps.next-tag.outputs.new_tag }} - run: make lint - - - name: Run tests - env: - VERSION: ${{ steps.next-tag.outputs.new_tag }} - run: make test - - - name: Generate SDK documentation - env: - VERSION: ${{ steps.next-tag.outputs.new_tag }} - run: make docs diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 1bef57e..0000000 --- a/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ - -# Python -__pycache__/ -*.py[cod] - -# Virtualenv -.venv/ - -# Tooling caches -.pytest_cache/ -.ruff_cache/ -.mypy_cache/ - -# Build artifacts -build/ -dist/ - -# macOS -.DS_Store - -# Release helpers -.README.md.bak -.pyproject.toml.bak diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 5f35672..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,177 +0,0 @@ -# Changelog - -## [1.5.0] - 2026-07-27 - -### Changed - -- Document the version-gated top-level key on `list_alert_configs()`, `list_model_alerts()`, `list_experiments()` and `get_generation_tiers()`. All four flip from a per-resource key to the canonical `{data, pagination}` envelope once `api_version` is `2026-07-27` or later -- Note on `get_non_manual_evaluation_summary()` that `agent_id` scoping is part of the `2026-07-27` changeset. On the legacy baseline the API ignores it and returns the account-wide rollup, which is indistinguishable from a scoped result in the payload -- Accept either wire shape from `list_run_evaluation_results()`, and return the results rather than an envelope. It was annotated `dict` while the default API returns a bare array -- Stop sending `severity` from `list_alerts()`. `GET /alerts` declares no such filter, so it never filtered, and it becomes a 422 once `api_version` is `2026-07-27` or later. The argument is still accepted and ignored -- Accept either wire shape from `list_evaluation_criteria()`. The endpoint answers with a bare list by default and the canonical `{data, pagination}` envelope once opted in, so the client reads both and keeps returning a list -- Sync the bundled OpenAPI spec with the API fixes found while updating the SDKs: `agent_id` is now declared on the non-manual evaluation summary, and `page`/`limit` on the evaluation and alert-config listings - -### Added - -- Add the `ApiVersion` string enum plus `DEFAULT_API_VERSION` and `LATEST_API_VERSION`. An `api_version` this release was not built against raises `SeclaiConfigurationError`, since a newer version can reshape responses this client would mis-decode; pass `allow_unknown_api_version=True` to override -- Add `list_evaluation_criteria_page()` and `list_run_evaluation_results_page()` for the canonical `{data, pagination}` envelope, which those endpoints emit once `api_version` is `2026-07-27` or later -- Add an `api_version` client option, sent as the `Seclai-Version` header, opting into dated API changes released on or before that date. Omitted by default, so upgrading the SDK alone never changes response shapes -- Add `get_api_version()` and `update_api_version()` to read the version a request resolves to and to pin or clear the account's version. `update_api_version()` applies the same unknown-version guard as the client option, since the pin is account-wide and affects every header-less caller -- Add `unwrap_items()`, which reads a version-gated list response in either shape so a call site does not have to branch on the API version - -### Fixed - -- Validate the `Seclai-Version` that survives the header merge, and drop every differently-cased duplicate. Two spellings in `default_headers` previously bypassed the guard and put two values on the wire -- Validate a `Seclai-Version` supplied through `default_headers`, not just the `api_version` argument. `default_headers` is applied last so it wins, which left the unknown-version guard one header away from being bypassed -- Raise `SeclaiAPIValidationError` rather than a bare `SeclaiAPIStatusError` on a 422 from any method built on `request()` — most of the SDK. Only the generated-client path distinguished the two, so field-level validation detail was being discarded everywhere else -- Send `step_type` from `get_agent_ai_conversation_history()`, along with `step_id`, `limit` and `offset`. The API marks `step_type` required and the method had no way to supply it, so every call answered 422. Omitting it now raises `ValueError` naming the argument instead of deferring to a 422 naming the wire parameter -- Raise from `unwrap_items()` on a list response in a shape the client cannot read, rather than returning `[]`. Reporting "no results" for an unrecognised envelope is indistinguishable from a genuinely empty page -- Floor the `list_model_alerts()` page translation at zero. `offset` is declared `minimum: 0`, so `page=0` turned a previously-ignored parameter into a hard 422 -- Paginate `list_model_alerts()` with the `offset` the endpoint declares instead of `page`, which it does not accept — every page after the first returned page 1 -- Request `GET /sources` rather than `GET /sources/`. The trailing-slash form is no longer declared by the API -- Send `q` rather than `query` from `search()`. The API requires `q`, so every search call had been failing validation since 1.1.0 -- Cancel a run with `DELETE /agents/runs/{run_id}`. `cancel_agent_run()` posted to `/agents/runs/{run_id}/cancel`, a path the API has never exposed, so cancelling always failed - -## [1.4.0] - 2026-07-25 - -### Changed - -- Sync the bundled OpenAPI spec, adding 22 paths and 22 schemas - -### Added - -- Add `get_me()` returning the authenticated user's account id and organization memberships -- Add `disable_agent()`, `enable_agent()`, and `get_agent_callers()` to pause and resume an agent across every trigger path -- Add `set_email_trigger_config()` to set the alias, sender allowlist, and inbound-handling flags on an `EMAIL_RECEIVED` trigger -- Add agent-email opt-out methods `list_agent_email_optouts()` and `remove_agent_email_optout()` -- Add inbound sender blocklist methods `list_blocked_email_senders()`, `block_email_sender()`, `unblock_email_sender()`, and `set_auto_block_mode()` -- Add inbound-email observability methods `list_inbound_email_rejections()`, `get_inbound_email_status()`, `cancel_queued_email_runs()`, and `resume_inbound_email()` -- Add email domain management: `list_email_domains()`, `add_email_domain()`, `remove_email_domain()`, `verify_email_domain()`, `set_primary_email_domain()`, `use_shared_email_domain()`, `send_email_domain_test_email()`, and `get_dmarc_summary()` -- Add `get_generation_tiers()` mapping each media-generation modality and tier to its model and cost -- Add `search_docs()` for keyword or semantic search over the Seclai documentation - -## [1.3.0] - 2026-06-05 - -### Added - -- Add `get_agent_attachment_references()` to read an agent's static attachment-reference contract before staging uploads ([#9](https://github.com/seclai/seclai-python/pull/9)) -- Add `download_agent_run_attachment()` for a file emitted by a run step ([#9](https://github.com/seclai/seclai-python/pull/9)) -- Add `delete_experiment()` to soft-delete a model playground experiment ([#9](https://github.com/seclai/seclai-python/pull/9)) - -## [1.2.0] - 2026-05-22 - -### Added - -- Add `preview_import_agent()` to dry-run an agent definition import and surface unresolved entity refs ([#8](https://github.com/seclai/seclai-python/pull/8)) - -## [1.1.4] - 2026-04-24 - -### Added - -- Add `list_models()` and `get_model()` for the model catalog ([#7](https://github.com/seclai/seclai-python/pull/7)) -- Add model playground methods `list_experiments()`, `create_experiment()`, `get_experiment()`, and `cancel_experiment()` ([#7](https://github.com/seclai/seclai-python/pull/7)) - -## [1.1.3] - 2026-04-02 - -### Added - -- Add `export_agent()` returning a portable JSON snapshot of an agent definition ([#6](https://github.com/seclai/seclai-python/pull/6)) - -## [1.1.2] - 2026-03-27 - -### Changed - -- Default the SSO domain, client id, and region so a profile only needs `sso_account_id` ([#5](https://github.com/seclai/seclai-python/pull/5)) - -### Added - -- Add `GET /me` to the bundled OpenAPI spec; the corresponding `get_me()` client method arrived in 1.4.0 ([#5](https://github.com/seclai/seclai-python/pull/5)) - -## [1.1.1] - 2026-03-26 - -### Added - -- Add OAuth SSO authentication with `~/.seclai/config` profiles, an on-disk token cache, and automatic refresh ([#4](https://github.com/seclai/seclai-python/pull/4)) -- Add an `account_id` option, sent as the `X-Account-Id` header, to switch organization account context ([#4](https://github.com/seclai/seclai-python/pull/4)) - -## [1.1.0] - 2026-03-23 - -### Added - -- Expand endpoint coverage to knowledge bases, memory banks, sources, source exports, embedding migrations, content, solutions, alerts, governance, evaluations, and the AI assistants ([#3](https://github.com/seclai/seclai-python/pull/3)) -- Add `run_streaming_agent()`, an async generator yielding every SSE event of a run ([#3](https://github.com/seclai/seclai-python/pull/3)) -- Add `run_agent_and_poll()` for environments where SSE is impractical ([#3](https://github.com/seclai/seclai-python/pull/3)) -- Add `paginate()` to iterate a paginated endpoint automatically ([#3](https://github.com/seclai/seclai-python/pull/3)) -- Add `search()` across all resource types in an account ([#3](https://github.com/seclai/seclai-python/pull/3)) - -## [1.0.6] - 2026-01-30 - -### Added - -- Add `upload_file_to_content()` to replace existing content with a file upload ([`e0d353a`](https://github.com/seclai/seclai-python/commit/e0d353a)) -- Add a `metadata` argument to the upload methods ([`e0d353a`](https://github.com/seclai/seclai-python/commit/e0d353a)) - -### Fixed - -- Correct type annotations on the upload and content methods ([`206e020`](https://github.com/seclai/seclai-python/commit/206e020)) - -## [1.0.5] - 2026-01-27 - -### Changed - -- Accept a run id alone in `get_agent_run()` and `delete_agent_run()`; the agent id is no longer required ([`51926b8`](https://github.com/seclai/seclai-python/commit/51926b8)) - -## [1.0.4] - 2026-01-27 - -### Added - -- Add an `include_step_outputs` argument to `get_agent_run()` ([`d3b4501`](https://github.com/seclai/seclai-python/commit/d3b4501)) - -## [1.0.3] - 2026-01-27 - -### Added - -- Add `run_streaming_agent_and_wait()` to block until a streaming run completes ([`f7850df`](https://github.com/seclai/seclai-python/commit/f7850df)) - -### Fixed - -- Drop the `/api` prefix from request paths so they match the deployed API ([`4a33852`](https://github.com/seclai/seclai-python/commit/4a33852)) -- Correct the file upload endpoint ([`ea50e25`](https://github.com/seclai/seclai-python/commit/ea50e25)) - -## [1.0.2] - 2026-01-12 - -### Removed - -- Remove build artifacts that had been committed to the repository ([`d946d55`](https://github.com/seclai/seclai-python/commit/d946d55)) - -## [1.0.1] - 2026-01-12 - -### Added - -- Add a documentation homepage link to the package metadata ([`cc8e28f`](https://github.com/seclai/seclai-python/commit/cc8e28f)) - -## [1.0.0] - 2026-01-12 - -_Stable release. Packaging, CI, and documentation deployment only; no API changes since 0.0.1._ - -## [0.0.1] - 2026-01-12 - -_Initial release._ - -[1.5.0]: https://github.com/seclai/seclai-python/releases/tag/1.5.0 -[1.4.0]: https://github.com/seclai/seclai-python/releases/tag/1.4.0 -[1.3.0]: https://github.com/seclai/seclai-python/releases/tag/1.3.0 -[1.2.0]: https://github.com/seclai/seclai-python/releases/tag/1.2.0 -[1.1.4]: https://github.com/seclai/seclai-python/releases/tag/1.1.4 -[1.1.3]: https://github.com/seclai/seclai-python/releases/tag/1.1.3 -[1.1.2]: https://github.com/seclai/seclai-python/releases/tag/1.1.2 -[1.1.1]: https://github.com/seclai/seclai-python/releases/tag/1.1.1 -[1.1.0]: https://github.com/seclai/seclai-python/releases/tag/1.1.0 -[1.0.6]: https://github.com/seclai/seclai-python/releases/tag/1.0.6 -[1.0.5]: https://github.com/seclai/seclai-python/releases/tag/1.0.5 -[1.0.4]: https://github.com/seclai/seclai-python/releases/tag/1.0.4 -[1.0.3]: https://github.com/seclai/seclai-python/releases/tag/1.0.3 -[1.0.2]: https://github.com/seclai/seclai-python/releases/tag/1.0.2 -[1.0.1]: https://github.com/seclai/seclai-python/releases/tag/1.0.1 -[1.0.0]: https://github.com/seclai/seclai-python/releases/tag/1.0.0 -[0.0.1]: https://github.com/seclai/seclai-python/releases/tag/0.0.1 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d845663..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Seclai, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Makefile b/Makefile deleted file mode 100644 index 71f6fbd..0000000 --- a/Makefile +++ /dev/null @@ -1,94 +0,0 @@ -.PHONY: build publish dev init format lint lock test generate docs docs-clean - -ifndef VERSION -VERSION := local -endif - -.env: .env.example - @echo "Creating API service .env file from template..." - cp .env.example .env - -clean: - @echo "Cleaning up cache and build files..." - rm -rf .mypy_cache .pytest_cache .ruff_cache .venv pytest.ini - find . -name __pycache__ | xargs rm -rf - -init: - @echo "Installing dependencies..." - poetry config virtualenvs.in-project true - poetry env remove --all || true - poetry install --no-root - -build: - @echo "Building package into dist/..." - rm -rf dist - @orig_version=$$(poetry version -s); \ - trap 'poetry version "'"$$orig_version"'" >/dev/null 2>&1 || true' EXIT; \ - if [ "$(VERSION)" != "local" ] && [ -n "$(VERSION)" ]; then \ - echo "Using VERSION=$(VERSION)"; \ - poetry version "$(VERSION)" >/dev/null; \ - fi; \ - poetry build - -publish: - @echo "Publishing package to PyPI..." - @orig_version=$$(poetry version -s); \ - trap 'poetry version "'"$$orig_version"'" >/dev/null 2>&1 || true' EXIT; \ - if [ "$(VERSION)" != "local" ] && [ -n "$(VERSION)" ]; then \ - echo "Using VERSION=$(VERSION)"; \ - poetry version "$(VERSION)" >/dev/null; \ - fi; \ - poetry publish --build - -format: - @echo "Formatting code..." - poetry run black . - -lint: - @echo "Running linting and formatting..." - poetry run ruff check --fix . - poetry run black . - poetry run mypy . - -lock: - @echo "Locking dependencies..." - poetry lock - -test: - @echo "Running tests..." - poetry run pytest $(ARGS) - -generate: - @echo "Generating OpenAPI client into seclai/_generated..." - poetry run openapi-python-client generate --meta none --path openapi/seclai.openapi.json --output-path seclai/_generated --overwrite - -docs: - @echo "Generating SDK documentation into build/docs..." - @if [ "$(VERSION)" != "local" ] && [ -n "$(VERSION)" ]; then \ - echo "Building versioned docs: $(VERSION) (and latest)"; \ - rm -rf build/docs/$(VERSION) build/docs/latest; \ - mkdir -p build/docs/$(VERSION) build/docs/latest; \ - poetry run pdoc --output-directory build/docs/$(VERSION) seclai '!seclai\\._generated'; \ - poetry run pdoc --output-directory build/docs/latest seclai '!seclai\\._generated'; \ - printf '%s\n' \ - '' \ - '' \ - ' ' \ - ' ' \ - ' ' \ - ' ' \ - ' Seclai Python SDK Docs' \ - ' ' \ - ' ' \ - '

Redirecting to latest docs…

' \ - ' ' \ - '' \ - > build/docs/index.html; \ - else \ - mkdir -p build/docs; \ - poetry run pdoc --output-directory build/docs seclai '!seclai\\._generated'; \ - fi - -docs-clean: - @echo "Removing generated docs..." - rm -rf build/docs diff --git a/README.md b/README.md deleted file mode 100644 index 53c0051..0000000 --- a/README.md +++ /dev/null @@ -1,828 +0,0 @@ -# Seclai Python SDK - -The official Python SDK for the [Seclai](https://seclai.com) API. Provides typed wrappers for the Seclai API, file uploads, SSE streaming, polling helpers, and full async support. - -Requires Python 3.11+. - -## Install - -```bash -pip install seclai -``` - -## Exports - -All public symbols are available from the top-level `seclai` package: - -```python -from seclai import ( - Seclai, # Synchronous client - AsyncSeclai, # Asynchronous client - SeclaiError, # Base exception - SeclaiConfigurationError, # Missing API key / invalid config - SeclaiAPIStatusError, # Non-2xx HTTP response - SeclaiAPIValidationError, # HTTP 422 validation error - SeclaiStreamingError, # SSE stream error event - AgentRunStreamRequest, # TypedDict for streaming run requests - JSONValue, # Recursive JSON type alias -) -``` - -## Quick start - -```python -from seclai import Seclai - -client = Seclai(api_key="...") - -# List agents -agents = client.list_agents() -print(agents) - -# Run an agent and stream the result -from seclai import AgentRunStreamRequest - -run = client.run_streaming_agent_and_wait( - "agent_id", - body=AgentRunStreamRequest(input="Summarize the latest uploads", metadata={}), - timeout=60.0, -) -print("run:", run.run_id, "status:", run.status) -``` - -### Async client - -```python -import asyncio -from seclai import AsyncSeclai - -async def main(): - async with AsyncSeclai(api_key="...") as client: - agents = await client.list_agents() - print(agents) - -asyncio.run(main()) -``` - -## Configuration - -| Option | Environment variable | Default | -| --- | --- | --- | -| `api_key` | `SECLAI_API_KEY` | — | -| `access_token` | — | — | -| `profile` | `SECLAI_PROFILE` | `"default"` | -| `config_dir` | `SECLAI_CONFIG_DIR` | `~/.seclai` | -| `auto_refresh` | — | `True` | -| `account_id` | — | — | -| `timeout` | — | `30.0` (seconds) | -| `api_key_header` | — | `x-api-key` | -| `default_headers` | — | `None` | -| `http_client` | — | `None` (auto-created `httpx.Client`) | - -Set `SECLAI_API_URL` to point at a different API host (e.g., staging): - -```bash -export SECLAI_API_URL="https://staging-api.seclai.com" -``` - -### Authentication - -Credentials are resolved via a chain (first match wins): - -1. Explicit `api_key` option -2. Explicit `access_token` option (string or callable) -3. `SECLAI_API_KEY` environment variable -4. SSO — cached tokens from `~/.seclai/sso/cache/` (always available as fallback) - -```python -# API key -client = Seclai(api_key="sk-...") -``` - -```python -# Static bearer token -client = Seclai(access_token="eyJhbGciOi...") -``` - -```python -# Dynamic bearer token provider (sync callable, called per request) -client = Seclai(access_token=lambda: get_token_from_vault()) -``` - -```python -# Async provider — use AsyncSeclai for async callables -client = AsyncSeclai(access_token=get_token_async) -``` - -```python -# SSO profile (uses cached tokens, auto-refreshes) -client = Seclai(profile="my-profile") -``` - -```python -# Environment variable (no options needed) -# export SECLAI_API_KEY="sk-..." -client = Seclai() -``` - -#### SSO authentication - -SSO is the default fallback when no explicit credentials are provided. The SDK -includes built-in production SSO defaults, so no configuration is needed: - -```bash -npx @seclai/cli auth login # authenticate via browser — works immediately -``` - -To customize SSO settings (e.g. for a staging environment), use `seclai configure sso` -or set environment variables: - -| Variable | Description | Default | -|---|---|---| -| `SECLAI_SSO_DOMAIN` | Cognito domain | `auth.seclai.com` | -| `SECLAI_SSO_CLIENT_ID` | Cognito app client ID | `4bgf8v9qmc5puivbaqon9n5lmr` | -| `SECLAI_SSO_REGION` | AWS region | `us-west-2` | - -## API documentation - -Online API documentation (latest): - -https://seclai.github.io/seclai-python/latest/ - -## API versioning - -The API dates its backward-incompatible changes. Nothing changes for you until -you opt in, either per client or by pinning the account: - -```python -from seclai import ApiVersion - -client = Seclai(api_key="...", api_version=ApiVersion.V2026_07_27) # Seclai-Version header - -state = client.get_api_version() # what this request resolved to -client.update_api_version(ApiVersion.V2026_07_27) # pin the whole account -``` - -Leave `api_version` unset and the header is omitted, so the account's pinned -baseline applies and responses keep their current shapes. Upgrading this package -alone never changes the wire contract. - -Known versions are on the `ApiVersion` string enum, alongside -`DEFAULT_API_VERSION` and `LATEST_API_VERSION`. A version this release was -**not** built against raises `SeclaiConfigurationError`: a newer version can -reshape responses, and this client would decode them incorrectly rather than -reject them. Upgrade the package to adopt a new version, or pass -`allow_unknown_api_version=True` if you have to move first and accept that risk. - -The guard only covers the header. An account pinned server-side can still be -newer than this release — `get_api_version()` reports the `effective_version` the -request resolved to, and comparing it against `LATEST_API_VERSION` is how you -detect the gap. - -**What `2026-07-27` changes.** Undeclared query parameters become a 422 instead -of being ignored, and list endpoints move to the canonical -`{"data": [...], "pagination": {...}}` envelope. The affected methods read both -shapes, so they keep working either way — but the metadata moves: - -| Method | Before | From 2026-07-27 | -| --- | --- | --- | -| Method | Before | From 2026-07-27 | Legacy paging | -| --- | --- | --- | --- | -| `list_evaluation_criteria_page()` | bare list | `data` + `pagination` | none — returns everything | -| `list_run_evaluation_results_page()` | bare list | `data` + `pagination` | none — returns everything | -| `list_alert_configs()` | `configs` + `total` | `data` + `pagination` | `page` / `limit` | -| `list_model_alerts()` | `alerts` + `total` | `data` + `pagination` | `page` (sent as `offset`) / `limit` | -| `list_experiments()` | `experiments` + `total` | `data` + `pagination` | `limit` / `offset` | -| `get_generation_tiers()` | `tiers` | `data` + `pagination` | none | - -`unwrap_items()` reads either shape, so a call site does not have to branch on -the version: - -```python -from seclai import unwrap_items - -items = unwrap_items(client.list_alert_configs(), "configs") -items = unwrap_items(client.list_model_alerts(), "alerts") -``` - -Prefer `pagination` over the flat keys. The legacy keys will be deprecated and -then removed once the canonical envelope is the default. - -The two evaluation endpoints are **unpaginated** on the legacy shape — they -ignore `page`/`limit` and return everything — so a paginate-until-empty loop over -them only terminates once you have opted in. The other four paginate on either -shape. - -## Resources - -### Identity - -```python -me = client.get_me() -print(me["account_id"]) -for org in me["organizations"]: - print(org["name"], org["account_id"]) - -# Act as an organization: Seclai(account_id=org["account_id"]) -``` - -### Agents - -```python -# CRUD -agents = client.list_agents(page=1, limit=20) -agent = client.create_agent({"name": "My Agent", "description": "..."}) -fetched = client.get_agent("agent_id") - -# Pause / resume — a disabled agent stops firing from every trigger path -callers = client.get_agent_callers("agent_id") # live agents calling this one -client.disable_agent("agent_id") # 409 if any caller above is still live -client.enable_agent("agent_id") -updated = client.update_agent("agent_id", {"name": "Renamed"}) -client.delete_agent("agent_id") - -# Definition (step workflow) -definition = client.get_agent_definition("agent_id") -client.update_agent_definition("agent_id", { - "change_id": definition["change_id"], - "steps": [{"type": "llm", "config": {}}], -}) - -# Export / import an agent -exported = client.export_agent("agent_id") - -# Validate the payload first to surface unresolved entity refs in this account -preview = client.preview_import_agent({"agent_definition": exported}) -entity_remap = { - ref["ref_id"]: "" # pick a target uuid from ref["alternatives"] - for ref in preview.get("unresolved_refs", []) -} - -# Commit — `entity_remap` substitutes workflow refs before save -imported = client.create_agent({ - "name": "Imported", - "agent_definition": exported, - "entity_remap": entity_remap, -}) -# `imported["import_warnings"]` lists any items that couldn't be applied. -``` - -### Agent runs - -```python -from seclai._generated.models.agent_run_request import AgentRunRequest - -# Start a run -run = client.run_agent("agent_id", AgentRunRequest(input_="Hello")) - -# List & search runs -runs = client.list_agent_runs("agent_id") -search = client.search_agent_runs({"query": "test"}) - -# Fetch run details (optionally with step outputs) -detail = client.get_agent_run("run_id", include_step_outputs=True) - -# Cancel or delete -client.cancel_agent_run("run_id") -client.delete_agent_run("run_id") -``` - -### Streaming - -The SDK provides two streaming patterns over the SSE `/runs/stream` endpoint. - -**Block until done** — returns the final `done` payload or raises on timeout: - -```python -from seclai import AgentRunStreamRequest - -run = client.run_streaming_agent_and_wait( - "agent_id", - body=AgentRunStreamRequest(input="Hello from streaming", metadata={}), - timeout=60.0, -) -``` - -**Generator-based** — yields every SSE event as `(event_type, data)` tuples: - -```python -for event_type, data in client.run_streaming_agent( - "agent_id", - body=AgentRunStreamRequest(input="Hello", metadata={}), -): - print(event_type, data) -``` - -Async: - -```python -async for event_type, data in client.run_streaming_agent( - "agent_id", - body=AgentRunStreamRequest(input="Hello", metadata={}), -): - print(event_type, data) -``` - -### Polling - -For environments where SSE is not practical, poll for a completed run: - -```python -from seclai._generated.models.agent_run_request import AgentRunRequest - -result = client.run_agent_and_poll( - "agent_id", - AgentRunRequest(input_="Hello"), - poll_interval=2.0, -) -``` - -### Agent input uploads - -```python -# Discover which files (if any) the agent expects before staging uploads -refs = client.get_agent_attachment_references("agent_id") -# refs["requires_uploads"] -> bool; refs["agent"] lists the exact_names / -# indexes_max / patterns a run-time upload batch must satisfy. - -upload = client.upload_agent_input("agent_id", file=b"data", file_name="input.pdf") -status = client.get_agent_input_upload_status("agent_id", upload["upload_id"]) -``` - -### Agent run attachments - -```python -# Download a file emitted by a step in an agent run. attachment_id is the -# URL-safe-base64 storage_key surfaced in run output manifests / webhooks. -response = client.download_agent_run_attachment("run_id", "attachment_id") # raw httpx.Response -with response: - for chunk in response.iter_bytes(): - ... # write to disk -``` - -### Agent AI assistant - -```python -steps = client.generate_agent_steps("agent_id", {"user_input": "Build a RAG pipeline"}) -config = client.generate_step_config("agent_id", {"step_type": "llm", "user_input": "..."}) - -# Conversation history -history = client.get_agent_ai_conversation_history("agent_id") -client.mark_agent_ai_suggestion("agent_id", "conversation_id", {"accepted": True}) -``` - -### Agent evaluations - -```python -# CRUD -criteria_list = client.list_evaluation_criteria("agent_id", page=1, limit=50) -# page/limit only take effect with api_version="2026-07-27" or later; the legacy -# response is unpaginated. list_evaluation_criteria_page() returns the same items -# plus a "pagination" key when opted in. -criteria = client.create_evaluation_criteria("agent_id", {"name": "accuracy"}) -detail = client.get_evaluation_criteria("criteria_id") -client.update_evaluation_criteria("criteria_id", {"name": "updated"}) -client.delete_evaluation_criteria("criteria_id") - -# Test a draft -client.test_draft_evaluation("agent_id", {"criteria": {}, "run_id": "run_id"}) - -# Results & summaries -results = client.list_evaluation_results("criteria_id") -summary = client.get_evaluation_criteria_summary("criteria_id") -client.create_evaluation_result("criteria_id", {"run_id": "run_id", "score": 0.9}) - -# Results by run -run_results = client.list_run_evaluation_results("agent_id", "run_id") -non_manual = client.get_non_manual_evaluation_summary("agent_id") -compatible = client.list_compatible_runs("criteria_id") -``` - -### Knowledge bases - -```python -kbs = client.list_knowledge_bases() -kb = client.create_knowledge_base({"name": "My KB"}) -fetched = client.get_knowledge_base("kb_id") -client.update_knowledge_base("kb_id", {"name": "Renamed"}) -client.delete_knowledge_base("kb_id") -``` - -### Memory banks - -```python -banks = client.list_memory_banks() -bank = client.create_memory_bank({"name": "Chat Memory", "type": "conversation"}) -fetched = client.get_memory_bank("mb_id") -client.update_memory_bank("mb_id", {"name": "Updated"}) -client.delete_memory_bank("mb_id") - -# Stats & compaction -stats = client.get_memory_bank_stats("mb_id") -client.compact_memory_bank("mb_id") - -# Test compaction -test = client.test_memory_bank_compaction("mb_id", {"entries": []}) -standalone = client.test_compaction_prompt_standalone({"prompt": "test"}) - -# Templates & agents -templates = client.list_memory_bank_templates() -agents = client.get_agents_using_memory_bank("mb_id") - -# AI assistant -suggestion = client.generate_memory_bank_config({"user_input": "Create a bank"}) -last_conv = client.get_memory_bank_ai_last_conversation() -client.accept_memory_bank_ai_suggestion("conversation_id", {"accepted": True}) - -# Source management -client.delete_memory_bank_source("mb_id") -``` - -### Sources - -```python -sources = client.list_sources(page=1, limit=20) -source = client.create_source({"name": "My Source"}) -fetched = client.get_source("source_id") -client.update_source("source_id", {"name": "Updated"}) -client.delete_source("source_id") -``` - -### File uploads - -Upload a file to a source (max 200 MiB): - -```python -upload = client.upload_file_to_source( - "source_connection_id", - file="./document.pdf", - title="Q4 Report", - metadata={"department": "finance"}, -) -``` - -Upload inline text: - -```python -upload = client.upload_inline_text_to_source("source_connection_id", { - "title": "Greeting", - "content": "Hello, world!", -}) -``` - -Replace a content version with a new file: - -```python -upload = client.upload_file_to_content( - "source_connection_content_version", - file="./updated.pdf", - metadata={"revision": 2}, -) -``` - -Replace a content version with inline text: - -```python -client.replace_content_with_inline_text("source_connection_content_version", { - "title": "Updated", - "content": "New content text", -}) -``` - -### Source exports - -```python -exports = client.list_source_exports("source_id") -export = client.create_source_export("source_id", {"format": "json"}) -status = client.get_source_export("source_id", "export_id") -estimate = client.estimate_source_export("source_id", {"format": "json"}) -response = client.download_source_export("source_id", "export_id") # raw httpx.Response -client.delete_source_export("source_id", "export_id") -client.cancel_source_export("source_id", "export_id") -``` - -### Source embedding migrations - -```python -migration = client.get_source_embedding_migration("source_id") -client.start_source_embedding_migration("source_id", {"target_model": "v2"}) -client.cancel_source_embedding_migration("source_id") -``` - -### Content - -```python -detail = client.get_content_detail("source_connection_content_version") -embeddings = client.list_content_embeddings("source_connection_content_version") -client.delete_content("source_connection_content_version") -``` - -### Solutions - -```python -solutions = client.list_solutions() -sol = client.create_solution({"name": "My Solution"}) -fetched = client.get_solution("solution_id") -client.update_solution("solution_id", {"name": "Renamed"}) -client.delete_solution("solution_id") - -# Link / unlink resources -client.link_agents_to_solution("solution_id", {"agent_ids": ["a1"]}) -client.unlink_agents_from_solution("solution_id", {"agent_ids": ["a1"]}) -client.link_knowledge_bases_to_solution("solution_id", {"kb_ids": ["kb1"]}) -client.unlink_knowledge_bases_from_solution("solution_id", {"kb_ids": ["kb1"]}) -client.link_source_connections_to_solution("solution_id", {"sc_ids": ["sc1"]}) -client.unlink_source_connections_from_solution("solution_id", {"sc_ids": ["sc1"]}) - -# AI assistant -plan = client.generate_solution_ai_plan("solution_id", {"user_input": "Build it"}) -client.accept_solution_ai_plan("solution_id", "conversation_id", {}) -client.decline_solution_ai_plan("solution_id", "conversation_id") - -# AI-generated resources -client.generate_solution_ai_knowledge_base("solution_id", {"user_input": "..."}) -client.generate_solution_ai_source("solution_id", {"user_input": "..."}) - -# Conversations -convs = client.list_solution_conversations("solution_id") -client.add_solution_conversation_turn("solution_id", {"user_input": "..."}) -client.mark_solution_conversation_turn("solution_id", "conversation_id", {"accepted": True}) -``` - -### Governance AI - -```python -plan = client.generate_governance_ai_plan({"user_input": "Create a content policy"}) -convs = client.list_governance_ai_conversations() -client.accept_governance_ai_plan("conversation_id") -client.decline_governance_ai_plan("conversation_id") -``` - -### Alerts - -```python -alerts = client.list_alerts(status="active") -alert = client.get_alert("alert_id") -client.change_alert_status("alert_id", {"status": "resolved"}) -client.add_alert_comment("alert_id", {"text": "Investigating"}) - -# Subscriptions -client.subscribe_to_alert("alert_id") -client.unsubscribe_from_alert("alert_id") - -# Alert configs -configs = client.list_alert_configs() -client.create_alert_config({"name": "Config"}) -config = client.get_alert_config("config_id") -client.update_alert_config("config_id", {"name": "Updated"}) -client.delete_alert_config("config_id") - -# Organization preferences -prefs = client.list_organization_alert_preferences() -client.update_organization_alert_preference("org_id", "anomaly", {"enabled": True}) -``` - -### Agent email triggers - -```python -# Configure an EMAIL_RECEIVED trigger; omitted fields are left unchanged -config = client.set_email_trigger_config( - "agent_id", - "trigger_id", - { - "alias": "support", - "allowed_senders": ["example.com", "ops@partner.com"], - "ignore_auto_generated": True, # drop auto-replies to prevent loops - "require_sender_auth": True, # require SPF or DMARC - "queue_on_quota": False, # park over-rate mail instead of failing - }, -) -print(config["email_addresses"]) -``` - -### Agent email governance - -```python -# Recipients who opted out of this account's agent emails -opt_outs = client.list_agent_email_optouts(agent_id="agent_id", limit=50) -client.remove_agent_email_optout("optout_id") # opt them back in - -# Blocked inbound senders (owner/admin only) -blocked = client.list_blocked_email_senders(limit=50) -client.block_email_sender({"sender_email": "spam.example.com", "match_type": "domain"}) -client.unblock_email_sender("blocked_id") - -# Auto-block on a governance BLOCK: "disabled" | "input" | "input_and_output" -client.set_auto_block_mode({"mode": "input_and_output"}) - -# Inbound mail discarded before running an agent -rejections = client.list_inbound_email_rejections(agent_id="agent_id") - -# Account-wide overload circuit breaker -status = client.get_inbound_email_status() # {"paused": ..., "queued_backlog": ...} -client.cancel_queued_email_runs() # fail all QUEUED (over-quota parked) runs -client.resume_inbound_email() # one-shot; re-arms if still overloaded -``` - -### Email domains - -Send and receive agent email on your own domain instead of the shared -`agent.seclai.com`. Requires a user-bound credential; mutations require an -account owner/admin. - -```python -listing = client.list_email_domains() - -vanity = client.add_email_domain({"kind": "vanity", "value": "acme"}) -custom = client.add_email_domain( - {"kind": "custom", "value": "agent.mycompany.com", "delegated": True} -) - -# Publish custom["dns_records"], then check without waiting for the sweep -client.verify_email_domain(custom["id"]) - -client.set_primary_email_domain(custom["id"]) -client.use_shared_email_domain() # revert; domains stay configured & verified - -client.send_email_domain_test_email(custom["id"]) # always to the account owner -dmarc = client.get_dmarc_summary(custom["id"], days=30, top_sources=10) - -removed = client.remove_email_domain(custom["id"]) -print(removed.get("cleanup_note")) # set when the domain was Seclai-managed -``` - -### Models - -```python -# Media-generation quality tiers (fast/balanced/thorough) and what each resolves to -tiers = client.get_generation_tiers() - -alerts = client.list_model_alerts() -client.mark_model_alert_read("alert_id") -client.mark_all_model_alerts_read() -unread = client.get_unread_model_alert_count() -recs = client.get_model_recommendations("model_id") - -# Model playground experiments -experiment = client.create_experiment({"model_ids": ["model_id"], "prompt": "..."}) -experiments = client.list_experiments() -detail = client.get_experiment("experiment_id") -client.cancel_experiment("experiment_id") -client.delete_experiment("experiment_id") # soft-delete, preserves audit history -``` - -### Search - -```python -results = client.search(query="quarterly report") -filtered = client.search(query="my agent", entity_type="agent", limit=5) -``` - -### Documentation search - -Results are global (not account-scoped); each carries a `doc_slug` plus an -optional `anchor` for building a `https://seclai.com/docs/[#]` link. - -```python -hits = client.search_docs("email triggers") # fast keyword match -deep = client.search_docs("how do I stop auto-reply loops", - mode="semantic", limit=5) # adds a highlight -``` - -### Top-level AI assistant - -```python -# Generate plans for different resource types -kb_plan = client.ai_assistant_knowledge_base({"user_input": "Create a product FAQ KB"}) -source_plan = client.ai_assistant_source({"user_input": "Set up a docs source"}) -solution_plan = client.ai_assistant_solution({"user_input": "Build a support bot"}) -mb_plan = client.ai_assistant_memory_bank({"user_input": "Create a chat memory bank"}) - -# Accept or decline -client.accept_ai_assistant_plan("conversation_id", {"accepted": True}) -client.decline_ai_assistant_plan("conversation_id") - -# Memory bank conversation history -history = client.get_ai_assistant_memory_bank_history() -client.accept_ai_memory_bank_suggestion("conversation_id", {"accepted": True}) - -# Feedback -client.submit_ai_feedback({"rating": 5, "comment": "Helpful!"}) -``` - -### Pagination - -All list methods accept `page` and `limit` parameters. For auto-pagination across all pages, use the `paginate` helper: - -```python -# Sync — yields items one by one (generator) -for agent in client.paginate("GET", "/agents"): - print(agent["name"]) - -# With a custom items key -for alert in client.paginate("GET", "/alerts", items_key="items"): - print(alert["id"]) -``` - -```python -# Async — also an async generator -async for agent in client.paginate("GET", "/agents"): - print(agent["name"]) -``` - -## Error handling - -All SDK errors inherit from `SeclaiError`. Use specific exception types for targeted handling: - -```python -from seclai import ( - Seclai, - SeclaiAPIStatusError, - SeclaiAPIValidationError, - SeclaiConfigurationError, - SeclaiStreamingError, -) - -client = Seclai(api_key="...") - -try: - from seclai._generated.models.agent_run_request import AgentRunRequest - - result = client.run_agent("agent_id", AgentRunRequest(input_="Hello")) -except SeclaiAPIValidationError as e: - print("Validation error:", e.status_code, e.validation_error) -except SeclaiAPIStatusError as e: - print("API error:", e.status_code, e.response_text) -except SeclaiStreamingError as e: - print("Streaming error:", e.message, "run:", e.run_id) -except SeclaiConfigurationError as e: - print("Config error:", e) -``` - -| Error type | When | -| --- | --- | -| `SeclaiConfigurationError` | Missing API key, invalid configuration | -| `SeclaiAPIStatusError` | Non-2xx HTTP response | -| `SeclaiAPIValidationError` | HTTP 422 (inherits `SeclaiAPIStatusError`) | -| `SeclaiStreamingError` | SSE stream error event received | - -## Low-level access - -Use `client.request()` for direct API requests: - -```python -result = client.request("GET", "/custom/endpoint", params={"key": "value"}) -``` - -## Development - -### Testing - -```bash -make test -``` - -To pass args through to pytest: - -```bash -make test ARGS='-k auth' -``` - -### Formatting - -```bash -make format -``` - -### Linting - -```bash -make lint -``` - -### OpenAPI spec & regenerating the client - -Copy the OpenAPI JSON file into `openapi/seclai.openapi.json`, then run: - -```bash -make generate -``` - -### Generate docs - -```bash -make docs -``` - -## Reporting issues - -If you hit a bug or have a feature request, please open an issue and include: - -- what you were trying to do -- a minimal repro snippet (if possible) -- the exception / traceback -- your environment (Python version, OS) - -## License - -MIT — see [LICENSE](LICENSE) for details. diff --git a/.claude/skills/seclai-sdk-sync/SKILL.md b/SKILL.md similarity index 96% rename from .claude/skills/seclai-sdk-sync/SKILL.md rename to SKILL.md index bfdad17..16818d9 100644 --- a/.claude/skills/seclai-sdk-sync/SKILL.md +++ b/SKILL.md @@ -100,6 +100,15 @@ for those two SDKs will not drop as typing improves. Check the façade before concluding an endpoint is untyped. seclai-javascript needs no façade (`unknown` to a concrete type is source compatible) and does report zero. +**`params` and `returns` follow one hop into a non-public helper, and no further.** +A public method with no request of its own that calls a non-public method of the +same client holding the verb and path literal (Go `c.thingsBody(`, C# `internal +…ResponseAsync`, Python `self._x(`, JS `private`/`#x`) is audited as that request, +with its own declared return type; both summaries then print how many methods +were resolved that way, so a drop in that number is a narrower audit, not a +cleaner SDK. A second hop, a helper that takes its verb or path as an argument, +and a call from another class (the façade's `_client.X(`) are still not followed. + **Dated versioning breaks the one-shape assumption.** Since `Seclai-Version` (2026-07-28) an operation can have two legal response bodies — a bare array by default, the canonical `{data, pagination}` envelope once the caller opts in — diff --git a/.claude/skills/seclai-sdk-sync/docexamples.py b/docexamples.py similarity index 100% rename from .claude/skills/seclai-sdk-sync/docexamples.py rename to docexamples.py diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json deleted file mode 100644 index c497763..0000000 --- a/openapi/seclai.openapi.json +++ /dev/null @@ -1,21267 +0,0 @@ -{ - "components": { - "parameters": { - "Seclai-Version": { - "description": "Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it \u2014 e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key.", - "in": "header", - "name": "Seclai-Version", - "required": false, - "schema": { - "pattern": "^\\d{4}-\\d{2}-\\d{2}$", - "type": "string" - } - }, - "X-Account-Id": { - "description": "Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication \u2014 the key's account is always used.", - "in": "header", - "name": "X-Account-Id", - "required": false, - "schema": { - "format": "uuid", - "type": "string" - } - } - }, - "schemas": { - "AddConversationTurnRequest": { - "properties": { - "actions_taken": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Actions taken by the AI", - "title": "Actions Taken" - }, - "ai_response": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI response text", - "title": "Ai Response" - }, - "user_input": { - "description": "User input text", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "AddConversationTurnRequest", - "type": "object" - }, - "AddEmailDomainRequest": { - "properties": { - "delegated": { - "default": false, - "title": "Delegated", - "type": "boolean" - }, - "kind": { - "description": "'vanity' or 'custom'", - "title": "Kind", - "type": "string" - }, - "value": { - "maxLength": 253, - "minLength": 1, - "title": "Value", - "type": "string" - } - }, - "required": [ - "kind", - "value" - ], - "title": "AddEmailDomainRequest", - "type": "object" - }, - "AgentAttachmentRefsApiResponse": { - "description": "Static attachment-reference contract for an agent.\n\nMirrors the MCP ``get_agent_attachment_references`` tool: returns\nwhat files (if any) an agent's templates expect on a run so API\nconsumers can stage uploads correctly before calling\n``POST /agents/{id}/runs``.", - "properties": { - "agent": { - "$ref": "#/components/schemas/AttachmentRefsSourceApiSummary", - "description": "Aggregated selector summary across all consumer steps. ``exact_names`` entries must each appear in the upload batch; ``indexes_max+1`` is the minimum file count; every ``patterns`` glob must match at least one upload." - }, - "requires_uploads": { - "description": "When ``false`` the agent's definition does NOT reference any uploaded attachments \u2014 ``POST /agents/{id}/upload-input`` will reject with HTTP 400. When ``true`` the ``agent`` block lists the specific selectors a run-time batch must satisfy.", - "title": "Requires Uploads", - "type": "boolean" - } - }, - "required": [ - "requires_uploads" - ], - "title": "AgentAttachmentRefsApiResponse", - "type": "object" - }, - "AgentCallerApiResponse": { - "description": "One agent that calls another (blocks disabling the callee while live).", - "properties": { - "disabled": { - "title": "Disabled", - "type": "boolean" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name", - "disabled" - ], - "title": "AgentCallerApiResponse", - "type": "object" - }, - "AgentDefinitionImportErrorResponse": { - "description": "422 body for invalid `agent_definition` payloads.\n\nMirrors `AgentDefinitionImportError.to_response_dict`.", - "properties": { - "error": { - "const": "invalid_agent_definition", - "description": "Stable machine-readable error code.", - "title": "Error", - "type": "string" - }, - "errors": { - "items": { - "$ref": "#/components/schemas/ImportFieldErrorModel" - }, - "title": "Errors", - "type": "array" - }, - "message": { - "title": "Message", - "type": "string" - }, - "source": { - "description": "Canonical pretty-printed echo of the supplied payload \u2014 error line/column refer to this string.", - "title": "Source", - "type": "string" - } - }, - "required": [ - "error", - "message", - "errors", - "source" - ], - "title": "AgentDefinitionImportErrorResponse", - "type": "object" - }, - "AgentDefinitionResponse": { - "properties": { - "change_id": { - "description": "Current change ID (use as expected_change_id when updating).", - "title": "Change Id", - "type": "string" - }, - "definition": { - "additionalProperties": true, - "description": "The agent definition containing name, description, tags, and step workflow tree. Step types include prompt_call, retrieval, regex_replace, gate, retry, evaluate_step, extract_data, extract_content, add_chat_turn, load_chat_history, add_memory, search_memory, load_memory, streaming_result, send_email, webhook_call, call_agent, write_metadata, write_content_attachment, load_content_attachment, load_content, display_result, merge, for_each, if_else, switch, and others.", - "title": "Definition", - "type": "object" - }, - "schema_version": { - "description": "Agent schema version.", - "title": "Schema Version", - "type": "string" - }, - "warnings": { - "anyOf": [ - { - "items": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Validation warnings, if any.", - "title": "Warnings" - } - }, - "required": [ - "change_id", - "definition", - "schema_version" - ], - "title": "AgentDefinitionResponse", - "type": "object" - }, - "AgentEmailOptOutListResponse": { - "description": "A page of agent-email opt-outs plus the total (for pagination).", - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/AgentEmailOptOutResponse" - }, - "title": "Items", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "items", - "total" - ], - "title": "AgentEmailOptOutListResponse", - "type": "object" - }, - "AgentEmailOptOutResponse": { - "description": "A recipient's opt-out from an account's agent emails (one agent or all).", - "properties": { - "agent_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "agent_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Name" - }, - "comment": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Comment" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Reason" - }, - "recipient_email": { - "title": "Recipient Email", - "type": "string" - } - }, - "required": [ - "id", - "created_at", - "recipient_email", - "agent_id", - "agent_name", - "reason", - "comment" - ], - "title": "AgentEmailOptOutResponse", - "type": "object" - }, - "AgentEvaluationTier": { - "description": "Controls model selection for agent evaluation.\n\nLabels shown in UI:\n FAST \u2192 \"Fast and cheap\"\n BALANCED \u2192 \"Balanced speed and cost\"\n THOROUGH \u2192 \"Slow and thorough\"", - "enum": [ - "fast", - "balanced", - "thorough" - ], - "title": "AgentEvaluationTier", - "type": "string" - }, - "AgentExportResponse": { - "description": "Portable JSON snapshot of an agent definition.", - "properties": { - "agent": { - "additionalProperties": true, - "description": "Agent metadata and full definition. Keys: name, description, schema_version, definition, default_evaluation_tier, evaluation_mode, sampling_config, max_retries, retry_on_failure, prompt_model_auto_upgrade_strategy, prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, created_at, updated_at.", - "title": "Agent", - "type": "object" - }, - "alert_configs": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Alert configurations.", - "title": "Alert Configs" - }, - "dependencies": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Resolved dependency manifest. Keys: knowledge_bases, memory_banks, source_connections, agents, users \u2014 each a list of {id, name, description, \u2026}.", - "title": "Dependencies" - }, - "evaluation_criteria": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Evaluation criteria for agent steps.", - "title": "Evaluation Criteria" - }, - "export_version": { - "description": "Schema version of the export format (currently \"2\").", - "title": "Export Version", - "type": "string" - }, - "exported_at": { - "description": "ISO-8601 timestamp of when the export was generated.", - "title": "Exported At", - "type": "string" - }, - "governance_policies": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Agent-scoped governance policies.", - "title": "Governance Policies" - }, - "software_version": { - "description": "Application version that produced this export.", - "title": "Software Version", - "type": "string" - }, - "trigger": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Trigger configuration with schedules.", - "title": "Trigger" - } - }, - "required": [ - "export_version", - "exported_at", - "software_version", - "agent" - ], - "title": "AgentExportResponse", - "type": "object" - }, - "AgentRunAttemptResponse": { - "properties": { - "duration": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Duration of the attempt in seconds.", - "title": "Duration" - }, - "ended_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the attempt ended.", - "title": "Ended At" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if the attempt failed.", - "title": "Error" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the attempt started.", - "title": "Started At" - }, - "status": { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus", - "description": "Status of the agent run attempt." - } - }, - "required": [ - "status", - "started_at", - "ended_at", - "duration", - "error" - ], - "title": "AgentRunAttemptResponse", - "type": "object" - }, - "AgentRunRequest": { - "properties": { - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Input to provide to the agent upon running for agents with dynamic triggers.", - "title": "Input" - }, - "input_upload_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with the 'input' field. Use ``input_upload_ids`` to attach multiple files.\n\n**Attachment visibility:** a step only sees the upload when its template references the input \u2014 via ``{{input}}`` / ``{{agent.input}}`` / ``{{step..input|output}}`` (implicit, all attachments) or the ``{{attachments[\u2026]}}`` family (explicit narrowing \u2014 e.g. ``{{attachments[0]}}``, ``{{attachments[*.pdf]}}``).\n\n**Per-batch validation:** every selector the agent's definition declares must be satisfied or the run is rejected with HTTP 400. Exact-name selectors require that filename to be present; indexed selectors require at least N+1 files; glob patterns require at least one matching filename.", - "title": "Input Upload Id" - }, - "input_upload_ids": { - "anyOf": [ - { - "items": { - "format": "uuid", - "type": "string" - }, - "maxItems": 20, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "IDs of multiple previously uploaded files. Each upload's extracted text is concatenated under a heading; each upload's binary is surfaced as a separate ``MediaAttachment`` so multi-modal prompt steps reason over all files at once. Steps narrow visibility via ``{{attachments[\u2026]}}`` selectors (by index, filename, or fnmatch glob). The batch must satisfy every selector the agent declares \u2014 exact names, indexed references (length must exceed the highest index), and glob patterns (each pattern needs at least one match). Mismatches return HTTP 400 with the unmet requirements listed. Mutually exclusive with ``input`` and ``input_upload_id`` \u2014 pass exactly one of the three. Max 20 uploads per run.", - "title": "Input Upload Ids" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "$ref": "#/components/schemas/JsonValue" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Metadata to make available for string substitution expressions in agent tasks.", - "title": "Metadata" - }, - "priority": { - "default": false, - "description": "If true, the agent run will be treated as priority execution.", - "title": "Priority", - "type": "boolean" - }, - "replay_of_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Re-run this agent reusing a prior run's uploaded input files. The files are re-resolved server-side from the source run (which must belong to this account and agent) \u2014 you do not re-upload them. Combine with ``input`` to change the text while keeping the files. A fresh upload batch (``input_upload_id(s)``) takes precedence and disables replay. Binaries swept by retention fall back to their extracted text.", - "title": "Replay Of Run Id" - } - }, - "title": "AgentRunRequest", - "type": "object" - }, - "AgentRunResponse": { - "properties": { - "attempts": { - "description": "List of attempts made for this agent run.", - "items": { - "$ref": "#/components/schemas/AgentRunAttemptResponse" - }, - "title": "Attempts", - "type": "array" - }, - "blocked_policies": { - "description": "Governance policies that produced at least one BLOCK verdict during this run. Deduplicated by policy id.", - "items": { - "$ref": "#/components/schemas/routers__api__agents__GovernancePolicyRefResponse" - }, - "title": "Blocked Policies", - "type": "array" - }, - "credits": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits consumed by the agent run, if applicable.", - "title": "Credits" - }, - "error_count": { - "description": "Number of errors encountered during the run.", - "title": "Error Count", - "type": "integer" - }, - "flagged_policies": { - "description": "Governance policies that produced at least one FLAG verdict during this run. Deduplicated by policy id.", - "items": { - "$ref": "#/components/schemas/routers__api__agents__GovernancePolicyRefResponse" - }, - "title": "Flagged Policies", - "type": "array" - }, - "governance_input_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Result of the governance input evaluation: safe, blocked, skipped, or timed_out.", - "title": "Governance Input Status" - }, - "governance_input_wait_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Milliseconds spent waiting for governance input evaluation.", - "title": "Governance Input Wait Ms" - }, - "hitl_wait_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Cumulative milliseconds the run was parked waiting for a human decision on a human_in_the_loop step. Subtracted from active duration in run-detail and duration-stats responses.", - "title": "Hitl Wait Ms" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Input provided to the agent for this run.", - "title": "Input" - }, - "input_scan_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Result of the prompt injection scan: safe, unsafe, skipped, timed_out, or error.", - "title": "Input Scan Status" - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Output produced by the agent run.", - "title": "Output" - }, - "output_content_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "MIME type of `output` \u2014 mirrors the terminal step's `output_content_type`. Consumers interpret `output` differently depending on this value: `application/vnd.seclai.manifest+json` is a multi-asset manifest with shape `{text, attachments: [{storage_key, mime, name, bytes}]}` \u2014 fetch each attachment via `GET /v2/agent-runs/{run_id}/attachments/{attachment_id}`, where `attachment_id` is the URL-safe base64 of the attachment's `storage_key` (accepts an API key or OAuth token). `text/plain` / `text/*` are free-form text. `application/json` is a JSON document. Null on runs that produced no terminal output or that pre-date this column.", - "title": "Output Content Type" - }, - "priority": { - "description": "Indicates if the run was treated as a priority execution.", - "title": "Priority", - "type": "boolean" - }, - "run_id": { - "description": "Unique identifier for the agent run.", - "title": "Run Id", - "type": "string" - }, - "scan_wait_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Milliseconds spent waiting for prompt injection scan.", - "title": "Scan Wait Ms" - }, - "status": { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus", - "description": "Current status of the agent run." - }, - "steps": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/AgentRunStepResponse" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Step outputs and per-step timing/credits. Only included when requested.", - "title": "Steps" - }, - "wait_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Cumulative milliseconds the run was parked on standard-mode wait steps. Subtracted from active duration in run-detail and duration-stats responses, exactly like hitl_wait_ms. Priority waits block inline and are not counted here.", - "title": "Wait Ms" - } - }, - "required": [ - "run_id", - "status", - "error_count", - "credits", - "priority", - "input", - "output", - "attempts" - ], - "title": "AgentRunResponse", - "type": "object" - }, - "AgentRunStepResponse": { - "properties": { - "agent_step_id": { - "description": "Agent step identifier.", - "title": "Agent Step Id", - "type": "string" - }, - "credits_used": { - "description": "Credits consumed by the step attempt, if applicable.", - "title": "Credits Used", - "type": "number" - }, - "duration_seconds": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Duration of the step attempt in seconds.", - "title": "Duration Seconds" - }, - "ended_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the step attempt ended.", - "title": "Ended At" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Input provided to the step, if any.", - "title": "Input" - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Output produced by the step, if any.", - "title": "Output" - }, - "output_content_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Content type of the step output, if any.", - "title": "Output Content Type" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the step attempt started.", - "title": "Started At" - }, - "status": { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus", - "description": "Status of the step run." - }, - "step_type": { - "description": "Type of the agent step.", - "title": "Step Type", - "type": "string" - }, - "tool_calls": { - "description": "LLM tool calls made during this step (prompt_call steps only), ordered by execution. Empty for steps that invoked no tools.", - "items": { - "$ref": "#/components/schemas/AgentRunToolCallResponse" - }, - "title": "Tool Calls", - "type": "array" - } - }, - "required": [ - "agent_step_id", - "step_type", - "status", - "input", - "output", - "output_content_type", - "started_at", - "ended_at", - "duration_seconds", - "credits_used" - ], - "title": "AgentRunStepResponse", - "type": "object" - }, - "AgentRunStreamRequest": { - "properties": { - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Input to provide to the agent upon running for agents with dynamic triggers.", - "title": "Input" - }, - "input_upload_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with the 'input' field. Use ``input_upload_ids`` to attach multiple files. Subject to the same per-batch attachment-selector validation as the non-streaming endpoint.", - "title": "Input Upload Id" - }, - "input_upload_ids": { - "anyOf": [ - { - "items": { - "format": "uuid", - "type": "string" - }, - "maxItems": 20, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "IDs of multiple previously uploaded files. See the non-streaming endpoint for full semantics, including per-batch selector validation (exact names, indexed references, and glob patterns must all be satisfied or the run is rejected with HTTP 400). Max 20.", - "title": "Input Upload Ids" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "$ref": "#/components/schemas/JsonValue" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Metadata to make available for string substitution expressions in agent tasks.", - "title": "Metadata" - }, - "replay_of_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Re-run reusing a prior run's uploaded input files (re-resolved server-side from the source run, which must belong to this account and agent). A fresh upload batch takes precedence.", - "title": "Replay Of Run Id" - } - }, - "title": "AgentRunStreamRequest", - "type": "object" - }, - "AgentRunToolCallResponse": { - "description": "A single LLM tool call made during a prompt_call step.", - "properties": { - "credits_used": { - "default": 0.0, - "description": "Credits consumed by this tool call (0 for tools that don't bill).", - "title": "Credits Used", - "type": "number" - }, - "duration_seconds": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Duration of the tool call in seconds.", - "title": "Duration Seconds" - }, - "ended_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the tool call ended.", - "title": "Ended At" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message when the tool call failed.", - "title": "Error" - }, - "function_name": { - "description": "Name of the tool/function invoked.", - "title": "Function Name", - "type": "string" - }, - "id": { - "description": "Tool call identifier.", - "title": "Id", - "type": "string" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "JSON arguments the LLM passed to the tool, if persisted.", - "title": "Input" - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "JSON result the tool returned to the LLM, if persisted.", - "title": "Output" - }, - "round_index": { - "default": 0, - "description": "0-based tool-loop round this call belonged to.", - "title": "Round Index", - "type": "integer" - }, - "sequence": { - "default": 0, - "description": "0-based ordinal of this call within its step run.", - "title": "Sequence", - "type": "integer" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the tool call started.", - "title": "Started At" - }, - "succeeded": { - "default": true, - "description": "Whether the tool call completed without error.", - "title": "Succeeded", - "type": "boolean" - } - }, - "required": [ - "id", - "function_name" - ], - "title": "AgentRunToolCallResponse", - "type": "object" - }, - "AgentSummaryResponse": { - "properties": { - "created_at": { - "description": "ISO 8601 creation timestamp.", - "title": "Created At", - "type": "string" - }, - "default_evaluation_tier": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Default evaluation tier: fast, balanced, or thorough.", - "title": "Default Evaluation Tier" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent description.", - "title": "Description" - }, - "disabled": { - "default": false, - "description": "Whether the agent is paused (disabled).", - "title": "Disabled", - "type": "boolean" - }, - "disabled_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ISO 8601 timestamp the agent was paused.", - "title": "Disabled At" - }, - "disabled_reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Why the agent is paused: 'manual' or 'email_overload'.", - "title": "Disabled Reason" - }, - "evaluation_mode": { - "default": "eval_and_retry", - "description": "Evaluation mode: output_expectation, eval_and_retry, or sample_and_flag.", - "title": "Evaluation Mode", - "type": "string" - }, - "id": { - "description": "Unique agent identifier.", - "title": "Id", - "type": "string" - }, - "import_warnings": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/ImportSkipResponse" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "One entry per item dropped or substituted during import. Present only on endpoints that accept agent_definition; null on non-import calls; [] when the import had no skips.", - "title": "Import Warnings" - }, - "max_retries": { - "default": 3, - "description": "Max retries for eval_and_retry mode.", - "title": "Max Retries", - "type": "integer" - }, - "name": { - "description": "Agent name.", - "title": "Name", - "type": "string" - }, - "prompt_model_auto_rollback_enabled": { - "default": false, - "description": "Whether automatic rollback is enabled for upgraded models.", - "title": "Prompt Model Auto Rollback Enabled", - "type": "boolean" - }, - "prompt_model_auto_rollback_triggers": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Failure signals that trigger rollback. Defaults to agent_eval_fail, governance_block, agent_run_failed when null.", - "title": "Prompt Model Auto Rollback Triggers" - }, - "prompt_model_auto_upgrade_strategy": { - "default": "none", - "description": "Auto-upgrade strategy: none, early_adopter, middle_of_road, cautious_adopter.", - "title": "Prompt Model Auto Upgrade Strategy", - "type": "string" - }, - "retry_on_failure": { - "default": true, - "description": "Whether to retry on evaluation failure.", - "title": "Retry On Failure", - "type": "boolean" - }, - "sampling_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Sampling configuration for sample_and_flag mode.", - "title": "Sampling Config" - }, - "trigger_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Trigger type for the agent.", - "title": "Trigger Type" - }, - "updated_at": { - "description": "ISO 8601 last-updated timestamp.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "description", - "created_at", - "updated_at" - ], - "title": "AgentSummaryResponse", - "type": "object" - }, - "AgentTraceMatchResponse": { - "properties": { - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent ID.", - "title": "Agent Id" - }, - "agent_run_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent run ID.", - "title": "Agent Run Id" - }, - "agent_run_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Status of the agent run.", - "title": "Agent Run Status" - }, - "agent_step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step identifier.", - "title": "Agent Step Id" - }, - "agent_step_run_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent step run ID.", - "title": "Agent Step Run Id" - }, - "agent_step_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Type of the step.", - "title": "Agent Step Type" - }, - "score": { - "description": "Similarity score (0-1, higher is better).", - "title": "Score", - "type": "number" - }, - "text": { - "description": "Matching text chunk.", - "title": "Text", - "type": "string" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title of the indexed entry.", - "title": "Title" - } - }, - "required": [ - "agent_run_id", - "agent_step_run_id", - "agent_id", - "agent_step_id", - "agent_step_type", - "agent_run_status", - "title", - "text", - "score" - ], - "title": "AgentTraceMatchResponse", - "type": "object" - }, - "AgentTraceSearchResponse": { - "properties": { - "matches": { - "description": "List of matching entries.", - "items": { - "$ref": "#/components/schemas/AgentTraceMatchResponse" - }, - "title": "Matches", - "type": "array" - }, - "total": { - "description": "Number of matches returned.", - "title": "Total", - "type": "integer" - } - }, - "required": [ - "matches", - "total" - ], - "title": "AgentTraceSearchResponse", - "type": "object" - }, - "AiAssistantAcceptResponse": { - "description": "Response from accepting and executing a plan.", - "properties": { - "conversation_id": { - "description": "Conversation ID.", - "format": "uuid", - "title": "Conversation Id", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if failed.", - "title": "Error" - }, - "executed_actions": { - "description": "Results of each executed action.", - "items": { - "$ref": "#/components/schemas/ExecutedActionResponse" - }, - "title": "Executed Actions", - "type": "array" - }, - "solution_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Solution ID when a new solution was auto-created.", - "title": "Solution Id" - }, - "success": { - "default": true, - "description": "Whether execution succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "executed_actions" - ], - "title": "AiAssistantAcceptResponse", - "type": "object" - }, - "AiAssistantFeedbackResponse": { - "description": "Response after submitting feedback.", - "properties": { - "feedback_id": { - "format": "uuid", - "title": "Feedback Id", - "type": "string" - }, - "flag_reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Flag Reason" - }, - "flagged": { - "title": "Flagged", - "type": "boolean" - } - }, - "required": [ - "feedback_id", - "flagged" - ], - "title": "AiAssistantFeedbackResponse", - "type": "object" - }, - "AiAssistantGenerateResponse": { - "description": "Response from an AI assistant generate endpoint.", - "properties": { - "conversation_id": { - "description": "Conversation ID for accept/decline.", - "format": "uuid", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of this AI assistant.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "note": { - "description": "AI-generated note about the plan.", - "title": "Note", - "type": "string" - }, - "proposed_actions": { - "description": "List of proposed actions.", - "items": { - "$ref": "#/components/schemas/ProposedActionResponse" - }, - "title": "Proposed Actions", - "type": "array" - }, - "requires_delete_confirmation": { - "default": false, - "description": "Whether destructive actions require explicit confirmation.", - "title": "Requires Delete Confirmation", - "type": "boolean" - }, - "success": { - "default": false, - "description": "Whether plan generation succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "note", - "proposed_actions" - ], - "title": "AiAssistantGenerateResponse", - "type": "object" - }, - "AiConversationHistoryResponse": { - "properties": { - "total": { - "description": "Total number of conversation turns available.", - "title": "Total", - "type": "integer" - }, - "turns": { - "description": "Conversation turns, ordered oldest first.", - "items": { - "$ref": "#/components/schemas/AiConversationTurnResponse" - }, - "title": "Turns", - "type": "array" - } - }, - "required": [ - "turns", - "total" - ], - "title": "AiConversationHistoryResponse", - "type": "object" - }, - "AiConversationTurnResponse": { - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the user accepted this proposal (null if pending).", - "title": "Accepted" - }, - "ai_note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI explanation from this turn.", - "title": "Ai Note" - }, - "conversation_id": { - "description": "Unique conversation turn ID.", - "title": "Conversation Id", - "type": "string" - }, - "resulting_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "The proposed configuration from this turn.", - "title": "Resulting Config" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step ID for this conversation.", - "title": "Step Id" - }, - "step_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step type for this conversation.", - "title": "Step Type" - }, - "user_input": { - "description": "User input for this turn.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "conversation_id", - "user_input", - "ai_note", - "accepted", - "resulting_config", - "step_type", - "step_id" - ], - "title": "AiConversationTurnResponse", - "type": "object" - }, - "AlertConfigListResponse": { - "description": "``GET /alerts/configs`` legacy/default shape (header-less clients).\n\n``Seclai-Version: 2026-07-27+`` clients receive the canonical\n``{data, pagination}`` envelope instead (the handler returns a ``JSONResponse``\nthat bypasses this ``response_model``); this documents the default shape.", - "properties": { - "configs": { - "items": { - "$ref": "#/components/schemas/AlertConfigResponse" - }, - "title": "Configs", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "configs", - "total" - ], - "title": "AlertConfigListResponse", - "type": "object" - }, - "AlertConfigResponse": { - "properties": { - "account_id": { - "title": "Account Id", - "type": "string" - }, - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "cooldown_minutes": { - "title": "Cooldown Minutes", - "type": "integer" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "distribution_type": { - "title": "Distribution Type", - "type": "string" - }, - "enabled": { - "title": "Enabled", - "type": "boolean" - }, - "id": { - "title": "Id", - "type": "string" - }, - "last_alerted_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Last Alerted At" - }, - "recipient_user_ids": { - "items": { - "type": "string" - }, - "title": "Recipient User Ids", - "type": "array" - }, - "source_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Connection Id" - }, - "threshold": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Threshold" - }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Updated At" - } - }, - "required": [ - "id", - "agent_id", - "source_connection_id", - "account_id", - "alert_type", - "enabled", - "threshold", - "cooldown_minutes", - "last_alerted_at", - "distribution_type", - "recipient_user_ids", - "created_at", - "updated_at" - ], - "title": "AlertConfigResponse", - "type": "object" - }, - "AlertHistoryEntryResponse": { - "properties": { - "changed_by_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Changed By Name" - }, - "changed_by_user_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Changed By User Id" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "id": { - "title": "Id", - "type": "string" - }, - "new_status": { - "title": "New Status", - "type": "string" - }, - "note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Note" - }, - "previous_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Previous Status" - } - }, - "required": [ - "id", - "previous_status", - "new_status", - "changed_by_user_id", - "changed_by_name", - "note", - "created_at" - ], - "title": "AlertHistoryEntryResponse", - "type": "object" - }, - "ApiVersionResponse": { - "properties": { - "default_version": { - "description": "Baseline for an unpinned, header-less caller.", - "title": "Default Version", - "type": "string" - }, - "effective_version": { - "description": "The version THIS request resolved to (header > pin > default).", - "title": "Effective Version", - "type": "string" - }, - "known_versions": { - "description": "All dated versions, oldest first.", - "items": { - "type": "string" - }, - "title": "Known Versions", - "type": "array" - }, - "latest_version": { - "description": "Newest version the server knows about.", - "title": "Latest Version", - "type": "string" - }, - "pinned_version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The account's sticky pinned version, or null when unpinned (the account resolves to the default). Applies to header-less requests.", - "title": "Pinned Version" - } - }, - "required": [ - "pinned_version", - "effective_version", - "default_version", - "latest_version", - "known_versions" - ], - "title": "ApiVersionResponse", - "type": "object" - }, - "AppliedActionResponse": { - "description": "Result of a single executed governance action.", - "properties": { - "action_type": { - "description": "Type of action that was executed.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description of the executed action.", - "title": "Description", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if this action failed, or null.", - "title": "Error" - }, - "policy_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the policy that was created or modified, or null.", - "title": "Policy Id" - }, - "success": { - "description": "Whether this individual action succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "action_type", - "description", - "success" - ], - "title": "AppliedActionResponse", - "type": "object" - }, - "AttachmentRefsSourceApiSummary": { - "description": "Per-source attachment-reference summary.", - "properties": { - "exact_names": { - "items": { - "type": "string" - }, - "title": "Exact Names", - "type": "array" - }, - "indexes_max": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Indexes Max" - }, - "kinds": { - "items": { - "type": "string" - }, - "title": "Kinds", - "type": "array" - }, - "patterns": { - "items": { - "type": "string" - }, - "title": "Patterns", - "type": "array" - } - }, - "title": "AttachmentRefsSourceApiSummary", - "type": "object" - }, - "BlockEmailSenderRequest": { - "description": "Add one sender/domain to the account blocklist (shared REST request).", - "properties": { - "match_type": { - "default": "address", - "title": "Match Type", - "type": "string" - }, - "note": { - "anyOf": [ - { - "maxLength": 500, - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Note" - }, - "sender_email": { - "maxLength": 320, - "minLength": 3, - "title": "Sender Email", - "type": "string" - } - }, - "required": [ - "sender_email" - ], - "title": "BlockEmailSenderRequest", - "type": "object" - }, - "BlockedEmailSenderListResponse": { - "description": "A page of blocked senders + the account's auto-block mode.", - "properties": { - "auto_block_mode": { - "title": "Auto Block Mode", - "type": "string" - }, - "items": { - "items": { - "$ref": "#/components/schemas/BlockedEmailSenderResponse" - }, - "title": "Items", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "items", - "total", - "auto_block_mode" - ], - "title": "BlockedEmailSenderListResponse", - "type": "object" - }, - "BlockedEmailSenderResponse": { - "description": "A single blocked inbound email sender.", - "properties": { - "created_at": { - "title": "Created At", - "type": "string" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "match_type": { - "title": "Match Type", - "type": "string" - }, - "note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Note" - }, - "sender_email": { - "title": "Sender Email", - "type": "string" - }, - "source": { - "title": "Source", - "type": "string" - } - }, - "required": [ - "id", - "created_at", - "sender_email", - "match_type", - "source", - "note" - ], - "title": "BlockedEmailSenderResponse", - "type": "object" - }, - "Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post": { - "properties": { - "file": { - "description": "File to upload", - "format": "binary", - "title": "File", - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional JSON object string of metadata. Example: `{\"category\":\"docs\",\"author\":\"Ada\"}`. `title` will be merged into this dictionary as `metadata.title` if it is not already present.", - "title": "Metadata" - }, - "title": { - "description": "Optional title for the content", - "title": "Title", - "type": "string" - } - }, - "required": [ - "file" - ], - "title": "Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post", - "type": "object" - }, - "Body_upload_file_to_source_api_sources__source_connection_id__upload_post": { - "properties": { - "file": { - "description": "File to upload", - "format": "binary", - "title": "File", - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional JSON object string of metadata. Example: `{\"author\":\"Ada\",\"category\":\"docs\"}`. `title` will be merged into this dictionary as `metadata.title` if it is not already present.", - "title": "Metadata" - }, - "title": { - "description": "Optional title for the content", - "title": "Title", - "type": "string" - } - }, - "required": [ - "file" - ], - "title": "Body_upload_file_to_source_api_sources__source_connection_id__upload_post", - "type": "object" - }, - "CancelExperimentResponse": { - "properties": { - "status": { - "title": "Status", - "type": "string" - } - }, - "required": [ - "status" - ], - "title": "CancelExperimentResponse", - "type": "object" - }, - "CancelQueuedRunsResponse": { - "properties": { - "cancelled": { - "title": "Cancelled", - "type": "integer" - } - }, - "required": [ - "cancelled" - ], - "title": "CancelQueuedRunsResponse", - "type": "object" - }, - "ChangeStatusRequest": { - "properties": { - "note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional note", - "title": "Note" - }, - "status": { - "description": "New alert status", - "title": "Status", - "type": "string" - } - }, - "required": [ - "status" - ], - "title": "ChangeStatusRequest", - "type": "object" - }, - "CompactionEvaluationModel": { - "description": "Structured LLM-as-judge evaluation result.", - "properties": { - "reasoning": { - "description": "Explanation of the evaluation.", - "title": "Reasoning", - "type": "string" - }, - "score": { - "description": "Quality score from 1 to 5.", - "title": "Score", - "type": "integer" - }, - "verdict": { - "description": "'pass' or 'fail'.", - "title": "Verdict", - "type": "string" - } - }, - "required": [ - "verdict", - "score", - "reasoning" - ], - "title": "CompactionEvaluationModel", - "type": "object" - }, - "CompactionScheduledResponse": { - "description": "Acknowledgement that an on-demand compaction run was scheduled.", - "properties": { - "memory_bank_id": { - "title": "Memory Bank Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "required": [ - "memory_bank_id", - "status" - ], - "title": "CompactionScheduledResponse", - "type": "object" - }, - "CompactionTestResponseModel": { - "description": "Response from a compaction prompt test.", - "properties": { - "compaction_summary": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The generated compaction summary.", - "title": "Compaction Summary" - }, - "evaluation": { - "$ref": "#/components/schemas/CompactionEvaluationModel", - "description": "LLM-as-judge quality evaluation." - }, - "generated": { - "description": "True when entries were LLM-generated rather than real.", - "title": "Generated", - "type": "boolean" - }, - "original_entries": { - "description": "Entries fed into the compactor.", - "items": { - "type": "string" - }, - "title": "Original Entries", - "type": "array" - }, - "surviving_entries": { - "description": "Entries that survived after compaction.", - "items": { - "type": "string" - }, - "title": "Surviving Entries", - "type": "array" - } - }, - "required": [ - "original_entries", - "compaction_summary", - "surviving_entries", - "evaluation", - "generated" - ], - "title": "CompactionTestResponseModel", - "type": "object" - }, - "CompatibleRunListResponse": { - "description": "Paginated list of compatible runs.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/CompatibleRunResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "data", - "total", - "page", - "limit" - ], - "title": "CompatibleRunListResponse", - "type": "object" - }, - "CompatibleRunResponse": { - "description": "A run that has a completed step matching a criteria's step_id.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "format": "uuid", - "title": "Agent Step Run Id", - "type": "string" - }, - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Completed At" - }, - "input_preview": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Input Preview" - }, - "output_storage_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Output Storage Key" - }, - "run_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Run Status" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Started At" - } - }, - "required": [ - "agent_run_id", - "agent_step_run_id", - "completed_at", - "output_storage_key" - ], - "title": "CompatibleRunResponse", - "type": "object" - }, - "ContentEmbeddingResponse": { - "description": "Response model for content embedding.", - "properties": { - "batch_duration": { - "title": "Batch Duration", - "type": "number" - }, - "batch_size": { - "title": "Batch Size", - "type": "integer" - }, - "id": { - "title": "Id", - "type": "string" - }, - "text": { - "title": "Text", - "type": "string" - }, - "text_end": { - "title": "Text End", - "type": "integer" - }, - "text_start": { - "title": "Text Start", - "type": "integer" - }, - "vector": { - "items": { - "type": "number" - }, - "title": "Vector", - "type": "array" - } - }, - "required": [ - "id", - "text_start", - "text_end", - "text", - "vector", - "batch_size", - "batch_duration" - ], - "title": "ContentEmbeddingResponse", - "type": "object" - }, - "CreateAlertConfigRequest": { - "properties": { - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent ID (for agent alerts)", - "title": "Agent Id" - }, - "alert_type": { - "description": "Alert type", - "title": "Alert Type", - "type": "string" - }, - "cooldown_minutes": { - "default": 60, - "description": "Cooldown period in minutes", - "title": "Cooldown Minutes", - "type": "integer" - }, - "distribution_type": { - "default": "owner", - "description": "Distribution type (owner, owner_admins, selected_members)", - "title": "Distribution Type", - "type": "string" - }, - "enabled": { - "default": true, - "description": "Whether the alert config is enabled", - "title": "Enabled", - "type": "boolean" - }, - "recipient_user_ids": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "User IDs for selected_members distribution", - "title": "Recipient User Ids" - }, - "source_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Source connection ID (for source alerts)", - "title": "Source Connection Id" - }, - "threshold": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Threshold configuration", - "title": "Threshold" - } - }, - "required": [ - "alert_type" - ], - "title": "CreateAlertConfigRequest", - "type": "object" - }, - "CreateEvaluationCriteriaRequest": { - "description": "Request body for creating an evaluation criteria.\n\nThe evaluation mode, retry settings, and sample frequency are set at the\nagent level, not per-criteria.", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "enabled": { - "default": true, - "title": "Enabled", - "type": "boolean" - }, - "evaluation_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "$ref": "#/components/schemas/AgentEvaluationTier" - }, - { - "type": "null" - } - ] - }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" - }, - "pass_threshold": { - "default": 0.5, - "maximum": 1.0, - "minimum": 0.0, - "title": "Pass Threshold", - "type": "number" - }, - "step_id": { - "maxLength": 255, - "minLength": 1, - "title": "Step Id", - "type": "string" - } - }, - "required": [ - "step_id" - ], - "title": "CreateEvaluationCriteriaRequest", - "type": "object" - }, - "CreateEvaluationResultRequest": { - "description": "Request body for recording an evaluation result.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Step Run Id" - }, - "details": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Details" - }, - "flagged": { - "default": false, - "title": "Flagged", - "type": "boolean" - }, - "retry_count": { - "default": 0, - "minimum": 0.0, - "title": "Retry Count", - "type": "integer" - }, - "retry_triggered": { - "default": false, - "title": "Retry Triggered", - "type": "boolean" - }, - "score": { - "anyOf": [ - { - "maximum": 1.0, - "minimum": 0.0, - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Score" - }, - "status": { - "$ref": "#/components/schemas/EvaluationStatus" - } - }, - "required": [ - "agent_run_id", - "status" - ], - "title": "CreateEvaluationResultRequest", - "type": "object" - }, - "CreateExperimentResponse": { - "properties": { - "experiment_id": { - "title": "Experiment Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "required": [ - "experiment_id", - "status" - ], - "title": "CreateExperimentResponse", - "type": "object" - }, - "CreateKnowledgeBaseBody": { - "description": "Request body for creating a knowledge base.", - "properties": { - "default_score_threshold": { - "anyOf": [ - { - "maximum": 1.0, - "minimum": 0.0, - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Default minimum rerank score threshold.", - "title": "Default Score Threshold" - }, - "default_top_k": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "maximum": 200.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Default results after reranking.", - "title": "Default Top K" - }, - "default_top_n": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "maximum": 200.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Default number of results.", - "title": "Default Top N" - }, - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description.", - "title": "Description" - }, - "name": { - "description": "Knowledge base name.", - "maxLength": 255, - "minLength": 1, - "title": "Name", - "type": "string" - }, - "reranker_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Reranker model to use (null for no reranking).", - "title": "Reranker Model" - }, - "source_ids": { - "description": "List of source connection IDs to link.", - "items": { - "type": "string" - }, - "minItems": 1, - "title": "Source Ids", - "type": "array" - } - }, - "required": [ - "name", - "source_ids" - ], - "title": "CreateKnowledgeBaseBody", - "type": "object" - }, - "CreateMemoryBankBody": { - "description": "Request body for creating a memory bank.", - "properties": { - "chunk_overlap": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk overlap (custom mode only).", - "title": "Chunk Overlap" - }, - "chunk_size": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk size (custom mode only).", - "title": "Chunk Size" - }, - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted.", - "title": "Compaction Prompt" - }, - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description of the bank's purpose.", - "title": "Description" - }, - "dimensions": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Embedding dimensions (custom mode only).", - "title": "Dimensions" - }, - "embedding_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom embedding model (custom mode only).", - "title": "Embedding Model" - }, - "max_age_days": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max entry age in days before compaction. Checked inline after each write and by the hourly background sweep.", - "title": "Max Age Days" - }, - "max_size_tokens": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max total tokens (per partition) before compaction. Checked inline after each write and by the hourly background sweep.", - "title": "Max Size Tokens" - }, - "max_turns": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max conversation turns (per partition) before compaction. Checked inline after each write and by the hourly background sweep.", - "title": "Max Turns" - }, - "mode": { - "default": "fast_and_cheap", - "description": "Embedding quality / cost trade-off. One of: fast_and_cheap, balanced, slow_and_thorough, custom.", - "title": "Mode", - "type": "string" - }, - "name": { - "description": "Memory bank name.", - "maxLength": 255, - "minLength": 1, - "title": "Name", - "type": "string" - }, - "retention_days": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 30, - "description": "Content source retention in days.", - "title": "Retention Days" - }, - "type": { - "default": "conversation", - "description": "Bank type. 'conversation' for chat-turn data with conversation_key + speaker; 'general' for flat entries with optional group_key.", - "title": "Type", - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "CreateMemoryBankBody", - "type": "object" - }, - "CreateSolutionRequest": { - "description": "Request model for creating a new solution", - "properties": { - "description": { - "default": "", - "description": "Description of the solution", - "title": "Description", - "type": "string" - }, - "name": { - "description": "Name of the solution", - "title": "Name", - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "CreateSolutionRequest", - "type": "object" - }, - "CreateSourceBody": { - "description": "Request body for creating a content source.", - "properties": { - "chunk_overlap": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk overlap for content processing.", - "title": "Chunk Overlap" - }, - "chunk_size": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk size for content processing.", - "title": "Chunk Size" - }, - "content_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Content filter type.", - "title": "Content Filter" - }, - "dimensions": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Embedding dimensions override.", - "title": "Dimensions" - }, - "embedding_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Embedding model override.", - "title": "Embedding Model" - }, - "index_mode": { - "anyOf": [ - { - "$ref": "#/components/schemas/SourceIndexMode" - }, - { - "type": "null" - } - ], - "description": "Index mode for custom_index sources: fast_and_cheap (default), balanced, slow_and_thorough, or custom." - }, - "media_types": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Media kinds to extract from indexed content and embed as multi-modal KB chunks. Subset of ['images', 'video']. Only kinds the source's embedder can index are honored; unsupported values are dropped. Omit / [] for text-only.", - "title": "Media Types" - }, - "name": { - "description": "Source name.", - "maxLength": 255, - "minLength": 1, - "title": "Name", - "type": "string" - }, - "polling": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling interval (e.g. hourly, daily).", - "title": "Polling" - }, - "polling_action": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling action.", - "title": "Polling Action" - }, - "polling_max_items": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max items per poll.", - "title": "Polling Max Items" - }, - "retention": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Retention period in days.", - "title": "Retention" - }, - "source_type": { - "description": "Source type: rss, website, or custom_index. The legacy value 'file_uploads' is accepted as an alias for custom_index.", - "title": "Source Type", - "type": "string" - }, - "url_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "URL record ID (required for rss/website sources).", - "title": "Url Id" - } - }, - "required": [ - "name", - "source_type" - ], - "title": "CreateSourceBody", - "type": "object" - }, - "DmarcFailingSourceResponse": { - "properties": { - "failed_count": { - "title": "Failed Count", - "type": "integer" - }, - "header_from": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Header From" - }, - "source_ip": { - "title": "Source Ip", - "type": "string" - } - }, - "required": [ - "source_ip", - "failed_count" - ], - "title": "DmarcFailingSourceResponse", - "type": "object" - }, - "DmarcSummaryResponse": { - "properties": { - "dispositions": { - "additionalProperties": { - "type": "integer" - }, - "title": "Dispositions", - "type": "object" - }, - "failed_messages": { - "title": "Failed Messages", - "type": "integer" - }, - "monitored": { - "default": true, - "title": "Monitored", - "type": "boolean" - }, - "pass_rate": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Pass Rate" - }, - "passed_messages": { - "title": "Passed Messages", - "type": "integer" - }, - "report_count": { - "title": "Report Count", - "type": "integer" - }, - "top_failing_sources": { - "items": { - "$ref": "#/components/schemas/DmarcFailingSourceResponse" - }, - "title": "Top Failing Sources", - "type": "array" - }, - "total_messages": { - "title": "Total Messages", - "type": "integer" - }, - "window_days": { - "title": "Window Days", - "type": "integer" - } - }, - "required": [ - "window_days", - "report_count", - "total_messages", - "passed_messages", - "failed_messages" - ], - "title": "DmarcSummaryResponse", - "type": "object" - }, - "DnsProviderResponse": { - "properties": { - "dashboard_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Dashboard Url" - }, - "key": { - "title": "Key", - "type": "string" - }, - "mx_priority_separate": { - "default": true, - "title": "Mx Priority Separate", - "type": "boolean" - }, - "name": { - "title": "Name", - "type": "string" - }, - "tips": { - "items": { - "type": "string" - }, - "title": "Tips", - "type": "array" - }, - "txt_quotes": { - "default": "strip", - "title": "Txt Quotes", - "type": "string" - } - }, - "required": [ - "key", - "name" - ], - "title": "DnsProviderResponse", - "type": "object" - }, - "DnsRecordResponse": { - "properties": { - "detail": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Detail" - }, - "key": { - "title": "Key", - "type": "string" - }, - "mx_host": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Mx Host" - }, - "mx_priority": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Mx Priority" - }, - "name": { - "title": "Name", - "type": "string" - }, - "ok": { - "title": "Ok", - "type": "boolean" - }, - "relative_name": { - "title": "Relative Name", - "type": "string" - }, - "type": { - "title": "Type", - "type": "string" - }, - "value": { - "title": "Value", - "type": "string" - } - }, - "required": [ - "key", - "type", - "name", - "relative_name", - "value", - "ok" - ], - "title": "DnsRecordResponse", - "type": "object" - }, - "DocsSearchResultResponse": { - "properties": { - "anchor": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Anchor" - }, - "doc_slug": { - "title": "Doc Slug", - "type": "string" - }, - "highlight": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Highlight" - }, - "score": { - "title": "Score", - "type": "number" - }, - "snippet": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Snippet" - }, - "title": { - "title": "Title", - "type": "string" - } - }, - "required": [ - "doc_slug", - "title", - "snippet", - "score", - "anchor", - "highlight" - ], - "title": "DocsSearchResultResponse", - "type": "object" - }, - "EmailDomainResponse": { - "properties": { - "delegated": { - "default": false, - "title": "Delegated", - "type": "boolean" - }, - "dns_records": { - "items": { - "$ref": "#/components/schemas/DnsRecordResponse" - }, - "title": "Dns Records", - "type": "array" - }, - "domain": { - "title": "Domain", - "type": "string" - }, - "error_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Error Message" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "is_primary": { - "title": "Is Primary", - "type": "boolean" - }, - "kind": { - "title": "Kind", - "type": "string" - }, - "last_checked_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Last Checked At" - }, - "provider": { - "anyOf": [ - { - "$ref": "#/components/schemas/DnsProviderResponse" - }, - { - "type": "null" - } - ] - }, - "regressing": { - "default": false, - "title": "Regressing", - "type": "boolean" - }, - "status": { - "title": "Status", - "type": "string" - }, - "verified": { - "default": false, - "title": "Verified", - "type": "boolean" - }, - "verified_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Verified At" - }, - "zone_apex": { - "default": "", - "title": "Zone Apex", - "type": "string" - } - }, - "required": [ - "id", - "domain", - "kind", - "status", - "is_primary" - ], - "title": "EmailDomainResponse", - "type": "object" - }, - "EmailDomainsListResponse": { - "properties": { - "can_add_custom": { - "default": false, - "title": "Can Add Custom", - "type": "boolean" - }, - "can_add_vanity": { - "default": false, - "title": "Can Add Vanity", - "type": "boolean" - }, - "custom_plan_names": { - "items": { - "type": "string" - }, - "title": "Custom Plan Names", - "type": "array" - }, - "domains": { - "items": { - "$ref": "#/components/schemas/EmailDomainResponse" - }, - "title": "Domains", - "type": "array" - }, - "has_custom": { - "default": false, - "title": "Has Custom", - "type": "boolean" - }, - "has_vanity": { - "default": false, - "title": "Has Vanity", - "type": "boolean" - }, - "vanity_plan_names": { - "items": { - "type": "string" - }, - "title": "Vanity Plan Names", - "type": "array" - } - }, - "title": "EmailDomainsListResponse", - "type": "object" - }, - "EmailTriggerConfigResponse": { - "description": "An EMAIL_RECEIVED trigger's resolved address(es) and config.", - "properties": { - "agent_id": { - "format": "uuid", - "title": "Agent Id", - "type": "string" - }, - "email_addresses": { - "items": { - "type": "string" - }, - "title": "Email Addresses", - "type": "array" - }, - "email_alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Email Alias" - }, - "email_allowed_senders": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Email Allowed Senders" - }, - "email_ignore_auto_generated": { - "default": true, - "title": "Email Ignore Auto Generated", - "type": "boolean" - }, - "email_queue_on_quota": { - "default": false, - "title": "Email Queue On Quota", - "type": "boolean" - }, - "email_require_sender_auth": { - "default": true, - "title": "Email Require Sender Auth", - "type": "boolean" - }, - "trigger_id": { - "format": "uuid", - "title": "Trigger Id", - "type": "string" - }, - "trigger_type": { - "title": "Trigger Type", - "type": "string" - } - }, - "required": [ - "trigger_id", - "agent_id", - "trigger_type" - ], - "title": "EmailTriggerConfigResponse", - "type": "object" - }, - "EvaluationCriteriaResponse": { - "description": "Response schema for evaluation criteria.", - "properties": { - "account_id": { - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "agent_id": { - "format": "uuid", - "title": "Agent Id", - "type": "string" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "enabled": { - "title": "Enabled", - "type": "boolean" - }, - "evaluation_mode": { - "description": "Runtime behavior mode. output_expectation (manual validation), eval_and_retry (every run + retry), sample_and_flag (sampled monitoring).", - "title": "Evaluation Mode", - "type": "string" - }, - "evaluation_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Tier" - }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "max_retries": { - "title": "Max Retries", - "type": "integer" - }, - "pass_threshold": { - "description": "Score cutoff for pass/fail, inclusive (0.0 to 1.0).", - "maximum": 1.0, - "minimum": 0.0, - "title": "Pass Threshold", - "type": "number" - }, - "result_summary": { - "additionalProperties": { - "type": "integer" - }, - "title": "Result Summary", - "type": "object" - }, - "retry_on_failure": { - "title": "Retry On Failure", - "type": "boolean" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step Id" - }, - "updated_at": { - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "agent_id", - "account_id", - "description", - "evaluation_mode", - "enabled", - "step_id", - "expectation_config", - "max_retries", - "retry_on_failure", - "evaluation_prompt", - "pass_threshold", - "evaluation_tier", - "created_at", - "updated_at", - "result_summary" - ], - "title": "EvaluationCriteriaResponse", - "type": "object" - }, - "EvaluationResultListResponse": { - "description": "Paginated list of evaluation results.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/EvaluationResultResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "data", - "total", - "page", - "limit" - ], - "title": "EvaluationResultListResponse", - "type": "object" - }, - "EvaluationResultResponse": { - "description": "Response schema for a single evaluation result.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Step Run Id" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "criteria_id": { - "format": "uuid", - "title": "Criteria Id", - "type": "string" - }, - "details": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Evaluation details including explanation and raw LLM response.", - "title": "Details" - }, - "evaluated_at": { - "title": "Evaluated At", - "type": "string" - }, - "flagged": { - "description": "True when the result was flagged for human review.", - "title": "Flagged", - "type": "boolean" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "retry_count": { - "title": "Retry Count", - "type": "integer" - }, - "retry_triggered": { - "title": "Retry Triggered", - "type": "boolean" - }, - "score": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "LLM-assigned quality score between 0.0 (worst) and 1.0 (best).", - "title": "Score" - }, - "status": { - "description": "Outcome status: pending, passed, failed, skipped, or error.", - "title": "Status", - "type": "string" - } - }, - "required": [ - "id", - "criteria_id", - "agent_run_id", - "agent_step_run_id", - "status", - "retry_triggered", - "retry_count", - "flagged", - "evaluated_at", - "created_at" - ], - "title": "EvaluationResultResponse", - "type": "object" - }, - "EvaluationResultSummaryResponse": { - "description": "Aggregated pass/fail/error counts and average score for a criteria.", - "properties": { - "average_score": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Mean score across all evaluated results, or null if none.", - "title": "Average Score" - }, - "error": { - "title": "Error", - "type": "integer" - }, - "failed": { - "title": "Failed", - "type": "integer" - }, - "flagged": { - "title": "Flagged", - "type": "integer" - }, - "passed": { - "title": "Passed", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "total", - "passed", - "failed", - "error", - "flagged" - ], - "title": "EvaluationResultSummaryResponse", - "type": "object" - }, - "EvaluationResultWithCriteriaListResponse": { - "description": "Paginated list of evaluation results with criteria context.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/EvaluationResultWithCriteriaResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "data", - "total", - "page", - "limit" - ], - "title": "EvaluationResultWithCriteriaListResponse", - "type": "object" - }, - "EvaluationResultWithCriteriaResponse": { - "description": "Evaluation result including criteria context for aggregated listing.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Step Run Id" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "criteria_description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Criteria Description" - }, - "criteria_id": { - "format": "uuid", - "title": "Criteria Id", - "type": "string" - }, - "details": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Evaluation details including explanation and raw LLM response.", - "title": "Details" - }, - "evaluated_at": { - "title": "Evaluated At", - "type": "string" - }, - "flagged": { - "description": "True when the result was flagged for human review.", - "title": "Flagged", - "type": "boolean" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "retry_count": { - "title": "Retry Count", - "type": "integer" - }, - "retry_triggered": { - "title": "Retry Triggered", - "type": "boolean" - }, - "score": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "LLM-assigned quality score between 0.0 (worst) and 1.0 (best).", - "title": "Score" - }, - "status": { - "description": "Outcome status: pending, passed, failed, skipped, or error.", - "title": "Status", - "type": "string" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step Id" - } - }, - "required": [ - "id", - "criteria_id", - "agent_run_id", - "agent_step_run_id", - "status", - "retry_triggered", - "retry_count", - "flagged", - "evaluated_at", - "created_at", - "step_id", - "criteria_description" - ], - "title": "EvaluationResultWithCriteriaResponse", - "type": "object" - }, - "EvaluationRunSummaryListResponse": { - "description": "Paginated list of per-run evaluation summaries.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/EvaluationRunSummaryResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "data", - "total", - "page", - "limit" - ], - "title": "EvaluationRunSummaryListResponse", - "type": "object" - }, - "EvaluationRunSummaryResponse": { - "description": "Per-run evaluation summary with pass/fail/error breakdown.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "error_count": { - "title": "Error Count", - "type": "integer" - }, - "failed_count": { - "title": "Failed Count", - "type": "integer" - }, - "flagged_count": { - "title": "Flagged Count", - "type": "integer" - }, - "passed_count": { - "title": "Passed Count", - "type": "integer" - }, - "run_created_at": { - "title": "Run Created At", - "type": "string" - }, - "run_status": { - "description": "Status of the agent run (processing, completed, failed).", - "title": "Run Status", - "type": "string" - }, - "skipped_count": { - "title": "Skipped Count", - "type": "integer" - }, - "total_evaluations": { - "title": "Total Evaluations", - "type": "integer" - } - }, - "required": [ - "agent_run_id", - "run_status", - "run_created_at", - "total_evaluations", - "passed_count", - "failed_count", - "error_count", - "skipped_count", - "flagged_count" - ], - "title": "EvaluationRunSummaryResponse", - "type": "object" - }, - "EvaluationStatus": { - "description": "Result status of a single evaluation run.", - "enum": [ - "pending", - "passed", - "failed", - "skipped", - "error" - ], - "title": "EvaluationStatus", - "type": "string" - }, - "ExamplePrompt": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "ExecutedActionResponse": { - "description": "A single executed action result.", - "properties": { - "action_type": { - "description": "Type of the executed action.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description.", - "title": "Description", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if failed.", - "title": "Error" - }, - "needs_clarification": { - "default": false, - "description": "True when the action paused for a clarifying question rather than failing. The created resource is kept and the question is in ``description``/``error``.", - "title": "Needs Clarification", - "type": "boolean" - }, - "resource_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the affected resource.", - "title": "Resource Id" - }, - "resource_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Type of the affected resource.", - "title": "Resource Type" - }, - "success": { - "default": true, - "description": "Whether the action succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "action_type", - "description" - ], - "title": "ExecutedActionResponse", - "type": "object" - }, - "ExperimentDetailResponse": { - "properties": { - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Completed At" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "error_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Error Message" - }, - "evaluation_complexity": { - "title": "Evaluation Complexity", - "type": "string" - }, - "evaluation_mode": { - "title": "Evaluation Mode", - "type": "string" - }, - "evaluator_model_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluator Model Id" - }, - "id": { - "title": "Id", - "type": "string" - }, - "include_step_output_in_evaluation": { - "title": "Include Step Output In Evaluation", - "type": "boolean" - }, - "json_template": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Json Template" - }, - "progress_current": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Progress Current" - }, - "progress_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Progress Message" - }, - "progress_total": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Progress Total" - }, - "prompt": { - "title": "Prompt", - "type": "string" - }, - "result_data": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Result Data" - }, - "selected_model_ids": { - "items": { - "type": "string" - }, - "title": "Selected Model Ids", - "type": "array" - }, - "selected_step_output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Selected Step Output" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Started At" - }, - "status": { - "title": "Status", - "type": "string" - }, - "system_prompt": { - "title": "System Prompt", - "type": "string" - } - }, - "required": [ - "id", - "status", - "created_at", - "selected_model_ids", - "evaluation_mode", - "evaluation_complexity", - "prompt", - "system_prompt", - "evaluator_model_id", - "include_step_output_in_evaluation", - "selected_step_output", - "json_template", - "started_at", - "completed_at", - "error_message", - "progress_current", - "progress_total", - "progress_message", - "result_data" - ], - "title": "ExperimentDetailResponse", - "type": "object" - }, - "ExperimentListResponse": { - "description": "``GET /models/playground/experiments`` legacy/default shape; 2026-07-27+\nclients get the canonical ``{data, pagination}`` envelope.", - "properties": { - "experiments": { - "items": { - "$ref": "#/components/schemas/ExperimentSummaryResponse" - }, - "title": "Experiments", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "experiments", - "total" - ], - "title": "ExperimentListResponse", - "type": "object" - }, - "ExperimentSummaryResponse": { - "properties": { - "created_at": { - "title": "Created At", - "type": "string" - }, - "evaluation_complexity": { - "title": "Evaluation Complexity", - "type": "string" - }, - "evaluation_mode": { - "title": "Evaluation Mode", - "type": "string" - }, - "id": { - "title": "Id", - "type": "string" - }, - "selected_model_ids": { - "items": { - "type": "string" - }, - "title": "Selected Model Ids", - "type": "array" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "required": [ - "id", - "status", - "created_at", - "selected_model_ids", - "evaluation_mode", - "evaluation_complexity" - ], - "title": "ExperimentSummaryResponse", - "type": "object" - }, - "ExportFormat": { - "description": "Supported export file formats.", - "enum": [ - "jsonl", - "csv", - "parquet", - "zip" - ], - "title": "ExportFormat", - "type": "string" - }, - "ExportListResponse": { - "description": "Paginated list of export jobs.", - "properties": { - "data": { - "items": {}, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "ExportListResponse", - "type": "object" - }, - "GenerateAgentStepsRequest": { - "properties": { - "agent_description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent description for additional AI context.", - "title": "Agent Description" - }, - "agent_steps": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Current agent step hierarchy for context when modifying.", - "title": "Agent Steps" - }, - "mode": { - "default": "generate_full", - "description": "'generate_full' to create from scratch, 'modify_workflow' to refine.", - "title": "Mode", - "type": "string" - }, - "trigger_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent trigger type for context (e.g. 'dynamic_input', 'content_added').", - "title": "Trigger Type" - }, - "user_input": { - "description": "Natural language description of the desired agent workflow.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "GenerateAgentStepsRequest", - "type": "object" - }, - "GenerateAgentStepsResponse": { - "properties": { - "agent_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Suggested agent-level configuration, if any.", - "title": "Agent Config" - }, - "conversation_id": { - "description": "Conversation turn ID for tracking.", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of this AI assistant for the given mode.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "intent_assessment": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "How the assistant interpreted the request: 'clear' when steps were generated, or an ask-path value (e.g. 'ambiguous_output', 'cannot_build') when it returned no steps and put a clarifying question or blocker in `note`. Mirrors the MCP surface so callers can distinguish a clarification pause from a hard failure.", - "title": "Intent Assessment" - }, - "note": { - "description": "AI explanation of the proposed workflow.", - "title": "Note", - "type": "string" - }, - "steps": { - "description": "Generated agent steps.", - "items": { - "additionalProperties": true, - "type": "object" - }, - "title": "Steps", - "type": "array" - }, - "success": { - "description": "Whether steps were successfully generated.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "steps", - "note", - "success" - ], - "title": "GenerateAgentStepsResponse", - "type": "object" - }, - "GenerateStepConfigRequest": { - "properties": { - "agent_steps": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Current agent step hierarchy for context.", - "title": "Agent Steps" - }, - "current_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Current step configuration to refine, if any.", - "title": "Current Config" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the specific step to refine. Omit for new steps.", - "title": "Step Id" - }, - "step_type": { - "description": "The step type to generate config for (e.g. 'regex_replace', 'gate', 'text', 'prompt_call', 'retrieval').", - "title": "Step Type", - "type": "string" - }, - "user_input": { - "description": "Natural language description of what the step should do.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "step_type", - "user_input" - ], - "title": "GenerateStepConfigRequest", - "type": "object" - }, - "GenerateStepConfigResponse": { - "properties": { - "conversation_id": { - "description": "Conversation turn ID for tracking.", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of this AI assistant for the given step type.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "note": { - "description": "AI explanation of the proposed configuration.", - "title": "Note", - "type": "string" - }, - "resulting_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "The proposed step configuration.", - "title": "Resulting Config" - }, - "step_type": { - "description": "The step type that was generated.", - "title": "Step Type", - "type": "string" - }, - "success": { - "description": "Whether a valid configuration was generated.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "step_type", - "note", - "success" - ], - "title": "GenerateStepConfigResponse", - "type": "object" - }, - "GenerationTierListResponse": { - "description": "``GET /models/generation-tiers`` legacy/default shape; 2026-07-27+ clients\nget the canonical ``{data, pagination}`` envelope.", - "properties": { - "tiers": { - "items": { - "$ref": "#/components/schemas/GenerationTierResponse" - }, - "title": "Tiers", - "type": "array" - } - }, - "required": [ - "tiers" - ], - "title": "GenerationTierListResponse", - "type": "object" - }, - "GenerationTierResponse": { - "properties": { - "credits_per_unit": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Credits Per Unit" - }, - "modality": { - "title": "Modality", - "type": "string" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "model_name": { - "title": "Model Name", - "type": "string" - }, - "price_label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Price Label" - }, - "tier": { - "title": "Tier", - "type": "string" - }, - "unit_label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Unit Label" - } - }, - "required": [ - "modality", - "tier", - "model_id", - "model_name", - "credits_per_unit", - "unit_label", - "price_label" - ], - "title": "GenerationTierResponse", - "type": "object" - }, - "GovernanceAiAcceptResponse": { - "description": "Response from accepting a governance AI assistant plan.", - "properties": { - "actions_applied": { - "description": "Results of each action that was executed.", - "items": { - "$ref": "#/components/schemas/AppliedActionResponse" - }, - "title": "Actions Applied", - "type": "array" - }, - "conversation_id": { - "description": "Conversation ID that was accepted.", - "title": "Conversation Id", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Overall error message if the plan failed, or null.", - "title": "Error" - }, - "success": { - "description": "Whether all actions were applied successfully.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "actions_applied", - "success" - ], - "title": "GovernanceAiAcceptResponse", - "type": "object" - }, - "GovernanceAiAssistantResponse": { - "description": "Response from the governance AI assistant generate endpoint.", - "properties": { - "conversation_id": { - "description": "Conversation ID to accept or decline this plan.", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of the governance AI assistant.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "note": { - "description": "AI-generated summary of the proposed changes.", - "title": "Note", - "type": "string" - }, - "prompt_call_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Prompt call ID for credit tracking, or null.", - "title": "Prompt Call Id" - }, - "proposed_actions": { - "description": "Ordered list of policy actions the AI proposes to execute.", - "items": { - "$ref": "#/components/schemas/ProposedPolicyActionResponse" - }, - "title": "Proposed Actions", - "type": "array" - }, - "success": { - "description": "Whether the plan was generated successfully.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "note", - "proposed_actions", - "success" - ], - "title": "GovernanceAiAssistantResponse", - "type": "object" - }, - "HTTPValidationError": { - "properties": { - "detail": { - "items": { - "$ref": "#/components/schemas/ValidationError" - }, - "title": "Detail", - "type": "array" - } - }, - "title": "HTTPValidationError", - "type": "object" - }, - "ImportFieldErrorModel": { - "description": "Single agent_definition validation error with source position.", - "properties": { - "column": { - "description": "1-indexed column in `source`.", - "title": "Column", - "type": "integer" - }, - "line": { - "description": "1-indexed line in `source`.", - "title": "Line", - "type": "integer" - }, - "message": { - "description": "Human-readable description of the problem.", - "title": "Message", - "type": "string" - }, - "path": { - "description": "Dotted path of the offending field, e.g. `agent.definition.child_steps[0].step_type`.", - "title": "Path", - "type": "string" - } - }, - "required": [ - "line", - "column", - "path", - "message" - ], - "title": "ImportFieldErrorModel", - "type": "object" - }, - "ImportSkipResponse": { - "description": "One item that was not applied during an agent import.\n\nUsed as the element type for ``import_warnings`` on every\nresponse model that accepts an ``agent_definition`` payload.\nSee ``services.agent_definition_import.AgentImportSkip`` for the\nfull category list.\n\nLives here (not on each router) so the authenticated and public\nAPI responses share one definition \u2014 keeping the shape that\nclients (UI modal, MCP, OpenAPI consumers) depend on aligned.", - "properties": { - "category": { - "description": "The kind of item that was skipped or substituted: 'schedule', 'evaluation_criteria', 'alert_config', 'alert_recipient', 'governance_policy', 'governance_kb_link', 'solution_link'.", - "title": "Category", - "type": "string" - }, - "details": { - "additionalProperties": true, - "description": "Category-specific identifiers for the skipped item (step_id, alert_type, kb_name, etc.). Stable keys per category; absent keys are simply not applicable.", - "title": "Details", - "type": "object" - }, - "message": { - "description": "Human-readable explanation of what was skipped and why.", - "title": "Message", - "type": "string" - } - }, - "required": [ - "category", - "message" - ], - "title": "ImportSkipResponse", - "type": "object" - }, - "InboundEmailRejectionResponse": { - "description": "An inbound email that was discarded without running an agent.", - "properties": { - "agent_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "message_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Message Id" - }, - "reason": { - "title": "Reason", - "type": "string" - }, - "recipient": { - "title": "Recipient", - "type": "string" - }, - "sender": { - "title": "Sender", - "type": "string" - }, - "sender_ip": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Sender Ip" - }, - "subject": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Subject" - } - }, - "required": [ - "id", - "created_at", - "recipient", - "sender", - "sender_ip", - "reason", - "message_id", - "agent_id", - "subject" - ], - "title": "InboundEmailRejectionResponse", - "type": "object" - }, - "InboundEmailStatusResponse": { - "properties": { - "paused": { - "title": "Paused", - "type": "boolean" - }, - "queued_backlog": { - "title": "Queued Backlog", - "type": "integer" - } - }, - "required": [ - "paused", - "queued_backlog" - ], - "title": "InboundEmailStatusResponse", - "type": "object" - }, - "InlineTextReplaceRequest": { - "description": "Request model for inline text content replacement.", - "properties": { - "content_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": "text/plain", - "description": "MIME type for the text content", - "title": "Content Type" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional metadata object", - "title": "Metadata" - }, - "text": { - "description": "Text content to upload", - "title": "Text", - "type": "string" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional title", - "title": "Title" - } - }, - "required": [ - "text" - ], - "title": "InlineTextReplaceRequest", - "type": "object" - }, - "InlineTextUploadRequest": { - "description": "Request model for inline text uploads.", - "properties": { - "content_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": "text/plain", - "description": "MIME type for the text content", - "title": "Content Type" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional metadata object", - "title": "Metadata" - }, - "text": { - "description": "Text content to upload", - "title": "Text", - "type": "string" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional title", - "title": "Title" - } - }, - "required": [ - "text" - ], - "title": "InlineTextUploadRequest", - "type": "object" - }, - "InsufficientCreditsDetail": { - "description": "``detail`` body for a 402 ``insufficient_credits`` response.", - "properties": { - "account_id": { - "description": "UUID of the account that ran out of credits.", - "title": "Account Id", - "type": "string" - }, - "error": { - "const": "insufficient_credits", - "description": "Stable machine-readable error code.", - "title": "Error", - "type": "string" - }, - "message": { - "description": "Human-readable explanation.", - "title": "Message", - "type": "string" - } - }, - "required": [ - "error", - "message", - "account_id" - ], - "title": "InsufficientCreditsDetail", - "type": "object" - }, - "InsufficientCreditsResponse": { - "description": "402 envelope returned when the account has exhausted its credits.", - "properties": { - "detail": { - "$ref": "#/components/schemas/InsufficientCreditsDetail" - } - }, - "required": [ - "detail" - ], - "title": "InsufficientCreditsResponse", - "type": "object" - }, - "JsonValue": {}, - "KnowledgeBaseListResponseModel": { - "description": "Paginated list of knowledge bases.", - "properties": { - "knowledge_bases": { - "description": "List of knowledge bases on this page.", - "items": { - "$ref": "#/components/schemas/KnowledgeBaseResponseModel" - }, - "title": "Knowledge Bases", - "type": "array" - }, - "limit": { - "description": "Items per page.", - "title": "Limit", - "type": "integer" - }, - "page": { - "description": "Current page number (1-based).", - "title": "Page", - "type": "integer" - }, - "total": { - "description": "Total number of knowledge bases.", - "title": "Total", - "type": "integer" - } - }, - "required": [ - "knowledge_bases", - "page", - "limit", - "total" - ], - "title": "KnowledgeBaseListResponseModel", - "type": "object" - }, - "KnowledgeBaseResponseModel": { - "description": "Response model for a single knowledge base.", - "properties": { - "created_at": { - "description": "ISO-8601 creation timestamp.", - "title": "Created At", - "type": "string" - }, - "default_score_threshold": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Default minimum rerank score.", - "title": "Default Score Threshold" - }, - "default_top_k": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Default results after reranking.", - "title": "Default Top K" - }, - "default_top_n": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Default number of results to return.", - "title": "Default Top N" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description.", - "title": "Description" - }, - "id": { - "description": "Unique knowledge base identifier.", - "title": "Id", - "type": "string" - }, - "name": { - "description": "Human-readable name.", - "title": "Name", - "type": "string" - }, - "readonly": { - "default": false, - "description": "Whether the knowledge base is read-only.", - "title": "Readonly", - "type": "boolean" - }, - "reranker_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Reranker model in use.", - "title": "Reranker Model" - }, - "sources": { - "description": "Linked source connections.", - "items": { - "$ref": "#/components/schemas/SourceConnectionResponseModel" - }, - "title": "Sources", - "type": "array" - }, - "updated_at": { - "description": "ISO-8601 last-update timestamp.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "created_at", - "updated_at" - ], - "title": "KnowledgeBase", - "type": "object" - }, - "LinkResourcesRequest": { - "properties": { - "ids": { - "description": "Resource IDs to link", - "items": { - "format": "uuid", - "type": "string" - }, - "minItems": 1, - "title": "Ids", - "type": "array" - } - }, - "required": [ - "ids" - ], - "title": "LinkResourcesRequest", - "type": "object" - }, - "MarkAiSuggestionRequest": { - "properties": { - "accepted": { - "description": "True to accept the suggestion, false to decline it.", - "title": "Accepted", - "type": "boolean" - } - }, - "required": [ - "accepted" - ], - "title": "MarkAiSuggestionRequest", - "type": "object" - }, - "MarkConversationTurnRequest": { - "properties": { - "accepted": { - "description": "Whether the suggestion was accepted", - "title": "Accepted", - "type": "boolean" - } - }, - "required": [ - "accepted" - ], - "title": "MarkConversationTurnRequest", - "type": "object" - }, - "MeResponse": { - "properties": { - "account_id": { - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "organizations": { - "items": { - "$ref": "#/components/schemas/OrganizationInfoResponse" - }, - "title": "Organizations", - "type": "array" - } - }, - "required": [ - "account_id", - "organizations" - ], - "title": "MeResponse", - "type": "object" - }, - "MemoryBankAiAssistantResponse": { - "description": "Response from the memory bank AI assistant.", - "properties": { - "config": { - "anyOf": [ - { - "$ref": "#/components/schemas/MemoryBankConfigResponse" - }, - { - "type": "null" - } - ], - "description": "Proposed configuration, or null." - }, - "conversation_id": { - "description": "Conversation ID for follow-up.", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of the memory bank AI assistant.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "note": { - "description": "AI-generated explanation.", - "title": "Note", - "type": "string" - }, - "prompt_call_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Prompt call ID for credit tracking.", - "title": "Prompt Call Id" - }, - "success": { - "default": false, - "description": "Whether generation succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "note" - ], - "title": "MemoryBankAiAssistantResponse", - "type": "object" - }, - "MemoryBankConfigResponse": { - "description": "Suggested memory bank configuration from the AI assistant.", - "properties": { - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Suggested compaction prompt.", - "title": "Compaction Prompt" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Suggested description.", - "title": "Description" - }, - "max_age_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max age in days.", - "title": "Max Age Days" - }, - "max_size_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max size in tokens.", - "title": "Max Size Tokens" - }, - "max_turns": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max conversation turns.", - "title": "Max Turns" - }, - "mode": { - "description": "Memory bank mode.", - "title": "Mode", - "type": "string" - }, - "name": { - "description": "Suggested name.", - "title": "Name", - "type": "string" - }, - "retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Retention in days.", - "title": "Retention Days" - }, - "type": { - "description": "Memory bank type: conversation or general.", - "title": "Type", - "type": "string" - } - }, - "required": [ - "name", - "type", - "mode" - ], - "title": "MemoryBankConfigResponse", - "type": "object" - }, - "MemoryBankListResponseModel": { - "description": "Paginated list of memory banks.", - "properties": { - "limit": { - "description": "Items per page.", - "title": "Limit", - "type": "integer" - }, - "memory_banks": { - "description": "List of memory banks on this page.", - "items": { - "$ref": "#/components/schemas/MemoryBankResponseModel" - }, - "title": "Memory Banks", - "type": "array" - }, - "page": { - "description": "Current page number (1-based).", - "title": "Page", - "type": "integer" - }, - "total": { - "description": "Total number of memory banks.", - "title": "Total", - "type": "integer" - } - }, - "required": [ - "memory_banks", - "page", - "limit", - "total" - ], - "title": "MemoryBankListResponseModel", - "type": "object" - }, - "MemoryBankResponseModel": { - "description": "Response model for a single memory bank.", - "properties": { - "chunk_overlap": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Character overlap between chunks.", - "title": "Chunk Overlap" - }, - "chunk_size": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Characters per chunk.", - "title": "Chunk Size" - }, - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted.", - "title": "Compaction Prompt" - }, - "created_at": { - "description": "ISO-8601 creation timestamp.", - "title": "Created At", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description of the memory bank's purpose.", - "title": "Description" - }, - "dimensions": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Vector embedding dimensions.", - "title": "Dimensions" - }, - "embedding_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Embedding model identifier.", - "title": "Embedding Model" - }, - "id": { - "description": "Unique memory bank identifier.", - "title": "Id", - "type": "string" - }, - "max_age_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max entry age in days before compaction. Checked both inline after each write and by the hourly background sweep.", - "title": "Max Age Days" - }, - "max_size_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max total tokens (per partition) before compaction. Checked both inline after each write and by the hourly background sweep.", - "title": "Max Size Tokens" - }, - "max_turns": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max conversation turns (per partition) before compaction. Checked both inline after each write and by the hourly background sweep.", - "title": "Max Turns" - }, - "mode": { - "description": "Embedding mode: fast_and_cheap, balanced, slow_and_thorough, or custom.", - "title": "Mode", - "type": "string" - }, - "name": { - "description": "Human-readable name.", - "title": "Name", - "type": "string" - }, - "retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Content retention period in days (null = indefinite).", - "title": "Retention Days" - }, - "source_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Linked content source ID (null if not yet provisioned).", - "title": "Source Connection Id" - }, - "type": { - "description": "Bank type: conversation (chat-turn with speaker) or general (flat entries).", - "title": "Type", - "type": "string" - }, - "updated_at": { - "description": "ISO-8601 last-update timestamp.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "type", - "mode", - "created_at", - "updated_at" - ], - "title": "MemoryBank", - "type": "object" - }, - "ModalityRateResponse": { - "description": "Per-modality rate for an LLM that prices image/audio/video output\n(or input) at a rate distinct from the default text rate.\n\nExample: Gemini 3.1 Flash Image charges $3/1M output tokens for\ntext but $60/1M output tokens for generated images. The image rate\nsurfaces here with ``modality=\"image\"`` and ``output_credits_per_1000_tokens``\nset; the default text rate stays on the parent model fields.", - "properties": { - "input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input Credits Per 1000 Tokens" - }, - "modality": { - "title": "Modality", - "type": "string" - }, - "output_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Output Credits Per 1000 Tokens" - } - }, - "required": [ - "modality" - ], - "title": "ModalityRateResponse", - "type": "object" - }, - "OkResponse": { - "description": "A minimal ``{\"ok\": true}`` acknowledgement for state-mutating actions\nthat have no richer resource to return (e.g. accept/decline a suggestion).", - "properties": { - "ok": { - "title": "Ok", - "type": "boolean" - } - }, - "required": [ - "ok" - ], - "title": "OkResponse", - "type": "object" - }, - "OrganizationAlertPreferenceListResponse": { - "properties": { - "preferences": { - "items": { - "$ref": "#/components/schemas/routers__api__alerts__OrganizationAlertPreferenceResponse" - }, - "title": "Preferences", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "preferences", - "total" - ], - "title": "OrganizationAlertPreferenceListResponse", - "type": "object" - }, - "OrganizationInfoResponse": { - "properties": { - "account_id": { - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name", - "account_id" - ], - "title": "OrganizationInfoResponse", - "type": "object" - }, - "PaginationResponse": { - "description": "Pagination information.", - "properties": { - "has_next": { - "title": "Has Next", - "type": "boolean" - }, - "has_prev": { - "title": "Has Prev", - "type": "boolean" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "pages": { - "title": "Pages", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "page", - "limit", - "total", - "pages", - "has_next", - "has_prev" - ], - "title": "PaginationResponse", - "type": "object" - }, - "PendingProcessingCompletedFailedStatus": { - "enum": [ - "pending", - "processing", - "completed", - "failed", - "queued", - "waiting_human", - "waiting_scheduled" - ], - "title": "PendingProcessingCompletedFailedStatus", - "type": "string" - }, - "PlaygroundCreateRequest": { - "description": "Create a model playground experiment via the public API.", - "properties": { - "evaluation_complexity": { - "default": "medium", - "description": "simple, medium, or complex", - "enum": [ - "simple", - "medium", - "complex" - ], - "title": "Evaluation Complexity", - "type": "string" - }, - "evaluation_mode": { - "default": "manual", - "description": "manual or prompt", - "enum": [ - "manual", - "prompt" - ], - "title": "Evaluation Mode", - "type": "string" - }, - "evaluator_model_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Evaluator model ID when evaluation_mode is prompt.", - "title": "Evaluator Model Id" - }, - "include_step_output_in_evaluation": { - "default": false, - "description": "Whether to include selected step output as evaluator context.", - "title": "Include Step Output In Evaluation", - "type": "boolean" - }, - "json_template": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional JSON template for advanced mode.", - "title": "Json Template" - }, - "model_ids": { - "description": "Selected model IDs (1-10).", - "items": { - "type": "string" - }, - "maxItems": 10, - "minItems": 1, - "title": "Model Ids", - "type": "array" - }, - "prompt": { - "description": "Prompt text for the experiment.", - "title": "Prompt", - "type": "string" - }, - "selected_step_output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional step output text for evaluator context.", - "title": "Selected Step Output" - }, - "system_prompt": { - "default": "", - "description": "Optional system prompt.", - "title": "System Prompt", - "type": "string" - } - }, - "required": [ - "model_ids", - "prompt" - ], - "title": "PlaygroundCreateRequest", - "type": "object" - }, - "PromptModelAutoUpgradeStrategy": { - "enum": [ - "none", - "early_adopter", - "middle_of_road", - "cautious_adopter" - ], - "title": "PromptModelAutoUpgradeStrategy", - "type": "string" - }, - "PromptToolResponse": { - "description": "Response model for a prompt tool.", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "documentation_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Documentation Url" - }, - "example": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Example" - }, - "headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Headers" - }, - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "notes": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Notes" - }, - "tool_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Tool Name" - }, - "tool_type": { - "title": "Tool Type", - "type": "string" - }, - "tool_type_pattern": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Tool Type Pattern" - } - }, - "required": [ - "id", - "tool_type", - "name" - ], - "title": "PromptToolResponse", - "type": "object" - }, - "ProposedActionResponse": { - "description": "A single proposed action.", - "properties": { - "action_type": { - "description": "Type of the proposed action.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description of the action.", - "title": "Description", - "type": "string" - }, - "is_destructive": { - "default": false, - "description": "Whether the action is destructive.", - "title": "Is Destructive", - "type": "boolean" - }, - "params": { - "additionalProperties": true, - "description": "Parameters for the action.", - "title": "Params", - "type": "object" - }, - "preview": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Planning-time dry-run preview attached by the solution AI assistant for create_agent / update_agent actions. Contains ``steps`` (the generated step tree), ``step_count``, ``warnings`` (a mix of heuristic structural issues \u2014 e.g. brittle JSONPath, pass-through ``regex_replace``, ``prompt_call`` missing a model \u2014 and deterministic resource-usage issues: every pre-bound knowledge base / memory bank must be referenced by at least one step, and no step may reference an unknown id), and ``skipped`` / ``skipped_reason`` when preview couldn't run (e.g. the action depends on resources created earlier in the same plan). ``None`` for non-agent actions or when generation failed.", - "title": "Preview" - } - }, - "required": [ - "action_type", - "params", - "description" - ], - "title": "ProposedActionResponse", - "type": "object" - }, - "ProposedPolicyActionResponse": { - "description": "A single proposed governance policy action.", - "properties": { - "action_type": { - "description": "Type of action: create, update, delete, enable, or disable.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description of what this action will do.", - "title": "Description", - "type": "string" - }, - "params": { - "additionalProperties": true, - "description": "Parameters for the action (e.g. policy_document_id, thresholds).", - "title": "Params", - "type": "object" - } - }, - "required": [ - "action_type", - "description", - "params" - ], - "title": "ProposedPolicyActionResponse", - "type": "object" - }, - "RemoveEmailDomainResponse": { - "properties": { - "cleanup_note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Cleanup Note" - }, - "removed": { - "default": true, - "title": "Removed", - "type": "boolean" - } - }, - "title": "RemoveEmailDomainResponse", - "type": "object" - }, - "ResumeInboundResponse": { - "properties": { - "resumed": { - "title": "Resumed", - "type": "boolean" - } - }, - "required": [ - "resumed" - ], - "title": "ResumeInboundResponse", - "type": "object" - }, - "SendTestEmailResponse": { - "properties": { - "sent": { - "default": true, - "title": "Sent", - "type": "boolean" - } - }, - "title": "SendTestEmailResponse", - "type": "object" - }, - "SetAutoBlockModeRequest": { - "description": "Set the account's governance auto-block mode (shared REST request).", - "properties": { - "mode": { - "title": "Mode", - "type": "string" - } - }, - "required": [ - "mode" - ], - "title": "SetAutoBlockModeRequest", - "type": "object" - }, - "SolutionSourceConnectionResponse": { - "properties": { - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name" - ], - "title": "SolutionSourceConnectionResponse", - "type": "object" - }, - "SolutionSummaryResponse": { - "description": "Response model for solution summary.", - "properties": { - "agent_count": { - "description": "Number of linked agents.", - "title": "Agent Count", - "type": "integer" - }, - "created_at": { - "description": "Timestamp when the solution was created.", - "title": "Created At", - "type": "string" - }, - "description": { - "description": "Description of the solution.", - "title": "Description", - "type": "string" - }, - "id": { - "description": "Unique identifier for the solution.", - "format": "uuid", - "title": "Id", - "type": "string" - }, - "knowledge_base_count": { - "description": "Number of linked knowledge bases.", - "title": "Knowledge Base Count", - "type": "integer" - }, - "memory_bank_count": { - "description": "Number of linked memory banks.", - "title": "Memory Bank Count", - "type": "integer" - }, - "name": { - "description": "Name of the solution.", - "title": "Name", - "type": "string" - }, - "source_connection_count": { - "description": "Number of linked source connections.", - "title": "Source Connection Count", - "type": "integer" - }, - "updated_at": { - "description": "Timestamp when the solution was last updated.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "description", - "agent_count", - "knowledge_base_count", - "source_connection_count", - "memory_bank_count", - "created_at", - "updated_at" - ], - "title": "SolutionSummaryResponse", - "type": "object" - }, - "SourceConnectionResponseModel": { - "description": "Nested source connection summary within a knowledge base response.", - "properties": { - "id": { - "description": "Source connection identifier.", - "title": "Id", - "type": "string" - }, - "name": { - "description": "Source connection name.", - "title": "Name", - "type": "string" - }, - "polling": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling configuration.", - "title": "Polling" - }, - "source_type": { - "description": "Type of source (rss, website, etc.).", - "title": "Source Type", - "type": "string" - }, - "url": { - "description": "Source URL.", - "title": "Url", - "type": "string" - } - }, - "required": [ - "id", - "name", - "url", - "source_type" - ], - "title": "SourceConnectionResponseModel", - "type": "object" - }, - "SourceEmbeddingMigrationResponse": { - "description": "Response model for source embedding migration status.", - "properties": { - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Completed At" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "failure_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Failure Message" - }, - "id": { - "title": "Id", - "type": "string" - }, - "notification_recipients": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Notification Recipients" - }, - "phase": { - "title": "Phase", - "type": "string" - }, - "progress_current": { - "title": "Progress Current", - "type": "integer" - }, - "progress_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Progress Message" - }, - "progress_total": { - "title": "Progress Total", - "type": "integer" - }, - "source_connection_id": { - "title": "Source Connection Id", - "type": "string" - }, - "source_id_new": { - "title": "Source Id New", - "type": "string" - }, - "source_id_old": { - "title": "Source Id Old", - "type": "string" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Started At" - }, - "status": { - "title": "Status", - "type": "string" - }, - "target_dimensions": { - "title": "Target Dimensions", - "type": "integer" - }, - "target_embedding_model": { - "title": "Target Embedding Model", - "type": "string" - }, - "task_execution_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Task Execution Id" - }, - "updated_at": { - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "source_connection_id", - "source_id_old", - "source_id_new", - "target_embedding_model", - "target_dimensions", - "status", - "phase", - "progress_current", - "progress_total", - "progress_message", - "failure_message", - "notification_recipients", - "task_execution_id", - "started_at", - "completed_at", - "created_at", - "updated_at" - ], - "title": "SourceEmbeddingMigrationResponse", - "type": "object" - }, - "SourceIndexMode": { - "description": "Embedding quality / cost trade-off preset for custom_index sources.\n\nEach preset controls the default embedding dimensions, chunk size, and\nchunk overlap. The embedding model is always the account-level default\n(currently ``AWS_BEDROCK_AMAZON_NOVA_2_MULTIMODAL``).\n\nPresets:\n FAST_AND_CHEAP: 256 dimensions, 3 000 char chunks, 500 char overlap.\n BALANCED: 384 dimensions, 1 500 char chunks, 300 char overlap.\n SLOW_AND_THOROUGH: 1 024 dimensions, 1 000 char chunks, 200 char overlap.\n CUSTOM: Caller supplies embedding model, dimensions, and chunk config.", - "enum": [ - "fast_and_cheap", - "balanced", - "slow_and_thorough", - "custom" - ], - "title": "SourceIndexMode", - "type": "string" - }, - "SourceResponse": { - "description": "Response model for source data.", - "properties": { - "account_id": { - "description": "Account ID associated with the source.", - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "avg_episodes_per_month": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Average number of episodes per month.", - "title": "Avg Episodes Per Month" - }, - "avg_words_per_episode": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Average number of words per episode.", - "title": "Avg Words Per Episode" - }, - "chunk_language": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Language used for chunking content.", - "title": "Chunk Language" - }, - "chunk_overlap": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk overlap for content processing.", - "title": "Chunk Overlap" - }, - "chunk_regex_separators": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Indicates if chunk separators are regex patterns.", - "title": "Chunk Regex Separators" - }, - "chunk_separators": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Chunk separators used for content processing.", - "title": "Chunk Separators" - }, - "chunk_size": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk size for content processing.", - "title": "Chunk Size" - }, - "content_count": { - "default": 0, - "description": "Number of content items associated with the source connection.", - "title": "Content Count", - "type": "integer" - }, - "content_filter": { - "description": "Content filter for the source connection.", - "title": "Content Filter", - "type": "string" - }, - "created_at": { - "description": "Timestamp when the source connection was created.", - "title": "Created At", - "type": "string" - }, - "dimensions": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Dimensions of the embedding model.", - "title": "Dimensions" - }, - "embedding_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Embedding model used for the source connection.", - "title": "Embedding Model" - }, - "embedding_model_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Type of the embedding model.", - "title": "Embedding Model Type" - }, - "free_retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Number of days content is stored for free before billing applies.", - "title": "Free Retention Days" - }, - "has_historical_data": { - "default": false, - "description": "Indicates if the source connection has historical data.", - "title": "Has Historical Data", - "type": "boolean" - }, - "id": { - "description": "Unique identifier for the source connection.", - "title": "Id", - "type": "string" - }, - "index_mode": { - "anyOf": [ - { - "$ref": "#/components/schemas/SourceIndexMode" - }, - { - "type": "null" - } - ], - "description": "Index mode for custom_index sources: fast_and_cheap, balanced, slow_and_thorough, or custom." - }, - "media_types": { - "description": "Media kinds extracted from indexed content and embedded as multi-modal KB chunks (subset of ['images', 'video']). Empty = text-only.", - "items": { - "type": "string" - }, - "title": "Media Types", - "type": "array" - }, - "name": { - "description": "Name of the source connection.", - "title": "Name", - "type": "string" - }, - "next_poll_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp for the next scheduled poll.", - "title": "Next Poll At" - }, - "polling": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling configuration for the source connection.", - "title": "Polling" - }, - "polling_action": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling action for the source connection.", - "title": "Polling Action" - }, - "polling_max_items": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Maximum items to poll for the source connection.", - "title": "Polling Max Items" - }, - "pulled_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when content was last pulled.", - "title": "Pulled At" - }, - "readonly": { - "default": false, - "description": "Indicates if the source connection is read-only.", - "title": "Readonly", - "type": "boolean" - }, - "retention": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Retention period for the source connection.", - "title": "Retention" - }, - "source_type": { - "description": "Type of the source connection.", - "title": "Source Type", - "type": "string" - }, - "system_managed": { - "default": false, - "description": "Indicates if this source is automatically managed by the system (e.g., agent traces).", - "title": "System Managed", - "type": "boolean" - }, - "updated_at": { - "description": "Timestamp when the source connection was last updated.", - "title": "Updated At", - "type": "string" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "URL of the source connection.", - "title": "Url" - } - }, - "required": [ - "id", - "account_id", - "name", - "url", - "source_type", - "polling", - "polling_action", - "polling_max_items", - "content_filter", - "retention", - "pulled_at", - "next_poll_at", - "created_at", - "updated_at" - ], - "title": "SourceResponse", - "type": "object" - }, - "StandaloneTestCompactionRequest": { - "description": "Request body for testing a compaction prompt *without* an existing bank.\n\nUsed on the create-memory-bank page where no bank ID exists yet.\n``compaction_prompt`` is required (no bank to fall back to).\nContent must come from ``sample_entries`` or ``generate_direction``\n(no existing entries to fetch).", - "properties": { - "bank_type": { - "default": "conversation", - "description": "Memory bank type ('conversation' or 'general') \u2014 controls the style of generated entries.", - "title": "Bank Type", - "type": "string" - }, - "compaction_prompt": { - "description": "Compaction prompt to test.", - "minLength": 1, - "title": "Compaction Prompt", - "type": "string" - }, - "entry_count": { - "default": 5, - "description": "Number of entries to generate when using generate_direction.", - "maximum": 20.0, - "minimum": 2.0, - "title": "Entry Count", - "type": "integer" - }, - "generate_direction": { - "anyOf": [ - { - "maxLength": 2000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Direction for the LLM to generate sample entries.", - "title": "Generate Direction" - }, - "sample_entries": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "maxItems": 20, - "minItems": 1, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Explicit sample entries to compact.", - "title": "Sample Entries" - } - }, - "required": [ - "compaction_prompt" - ], - "title": "StandaloneTestCompactionRequest", - "type": "object" - }, - "StartSourceEmbeddingMigrationRequest": { - "description": "Request payload to start a source embedding migration.", - "properties": { - "chunk_language": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Language-specific chunking language code", - "title": "Chunk Language" - }, - "chunk_overlap": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Override chunk overlap (characters)", - "title": "Chunk Overlap" - }, - "chunk_regex_separators": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether chunk separators are regex patterns", - "title": "Chunk Regex Separators" - }, - "chunk_separators": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom chunk separators (JSON-encoded list)", - "title": "Chunk Separators" - }, - "chunk_size": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Override chunk size (characters per chunk)", - "title": "Chunk Size" - }, - "notification_recipients": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Optional notification recipient emails", - "title": "Notification Recipients" - }, - "target_dimensions": { - "description": "Target embedding dimensions", - "exclusiveMinimum": 0.0, - "title": "Target Dimensions", - "type": "integer" - }, - "target_embedding_model": { - "description": "Target embedding model enum", - "title": "Target Embedding Model", - "type": "string" - } - }, - "required": [ - "target_embedding_model", - "target_dimensions" - ], - "title": "StartSourceEmbeddingMigrationRequest", - "type": "object" - }, - "TestCompactionRequest": { - "description": "Request body for testing a compaction prompt against an existing bank.\n\nThe user may supply a ``compaction_prompt`` to override (or provide when\nthe bank has none). Content can come from three sources:\n\n1. Existing entries in the bank (default when neither field is set).\n2. ``sample_entries`` \u2013 caller-provided list of strings.\n3. ``generate_direction`` \u2013 an instruction to the LLM to generate sample\n memory entries. Useful for trying a prompt before any real data\n exists.\n\nAt most one of ``sample_entries`` / ``generate_direction`` may be given.", - "properties": { - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Compaction prompt to test. Falls back to the bank's current prompt when omitted.", - "title": "Compaction Prompt" - }, - "entry_count": { - "default": 5, - "description": "Number of entries to generate when using generate_direction.", - "maximum": 20.0, - "minimum": 2.0, - "title": "Entry Count", - "type": "integer" - }, - "generate_direction": { - "anyOf": [ - { - "maxLength": 2000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Direction for the LLM to generate sample entries (e.g. 'Generate 5 entries about a customer support interaction').", - "title": "Generate Direction" - }, - "sample_entries": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "maxItems": 20, - "minItems": 1, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Explicit sample entries to compact.", - "title": "Sample Entries" - } - }, - "title": "TestCompactionRequest", - "type": "object" - }, - "TestDraftEvaluationRequest": { - "description": "Request body for ephemeral (non-persisted) evaluation testing.\n\nProvide either ``step_output`` (raw text) **or** ``agent_step_run_id``\n(to load output from storage). Exactly one must be supplied.", - "properties": { - "agent_input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The original agent run input for context. When agent_step_run_id is supplied this is loaded automatically from the parent run if omitted.", - "title": "Agent Input" - }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Load step output from this completed step run instead of supplying text.", - "title": "Agent Step Run Id" - }, - "evaluation_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "$ref": "#/components/schemas/AgentEvaluationTier" - }, - { - "type": "null" - } - ] - }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" - }, - "pass_threshold": { - "default": 0.5, - "maximum": 1.0, - "minimum": 0.0, - "title": "Pass Threshold", - "type": "number" - }, - "step_output": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The step output text to evaluate. Omit if agent_step_run_id is supplied.", - "title": "Step Output" - } - }, - "title": "TestDraftEvaluationRequest", - "type": "object" - }, - "TestDraftEvaluationResponse": { - "description": "Response for an ephemeral evaluation test.", - "properties": { - "explanation": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Explanation" - }, - "passed": { - "title": "Passed", - "type": "boolean" - }, - "score": { - "title": "Score", - "type": "number" - } - }, - "required": [ - "score", - "passed", - "explanation" - ], - "title": "TestDraftEvaluationResponse", - "type": "object" - }, - "UnlinkResourcesRequest": { - "properties": { - "ids": { - "description": "Resource IDs to unlink", - "items": { - "format": "uuid", - "type": "string" - }, - "minItems": 1, - "title": "Ids", - "type": "array" - } - }, - "required": [ - "ids" - ], - "title": "UnlinkResourcesRequest", - "type": "object" - }, - "UnreadCountResponse": { - "properties": { - "count": { - "title": "Count", - "type": "integer" - } - }, - "required": [ - "count" - ], - "title": "UnreadCountResponse", - "type": "object" - }, - "UpdateAgentDefinitionRequest": { - "properties": { - "definition": { - "additionalProperties": true, - "description": "The full agent definition (name, description, tags, steps). Steps form a tree workflow. Each step has a `step_type`, `id`, `name`, and type-specific config. Content enrichment steps (write_metadata, write_content_attachment, load_content_attachment, load_content) require content-triggered agents.", - "title": "Definition", - "type": "object" - }, - "expected_change_id": { - "description": "The change_id from the last GET, for optimistic locking.", - "title": "Expected Change Id", - "type": "string" - } - }, - "required": [ - "expected_change_id", - "definition" - ], - "title": "UpdateAgentDefinitionRequest", - "type": "object" - }, - "UpdateAlertConfigRequest": { - "properties": { - "cooldown_minutes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Cooldown period in minutes", - "title": "Cooldown Minutes" - }, - "distribution_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Distribution type", - "title": "Distribution Type" - }, - "enabled": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the alert config is enabled", - "title": "Enabled" - }, - "recipient_user_ids": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "User IDs for selected_members distribution", - "title": "Recipient User Ids" - }, - "threshold": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Threshold configuration", - "title": "Threshold" - } - }, - "title": "UpdateAlertConfigRequest", - "type": "object" - }, - "UpdateApiVersionRequest": { - "properties": { - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "A YYYY-MM-DD date to pin the account to, or null to clear the pin (revert to the default baseline).", - "title": "Version" - } - }, - "title": "UpdateApiVersionRequest", - "type": "object" - }, - "UpdateEvaluationCriteriaRequest": { - "description": "Request body for updating an evaluation criteria.\n\nRetry settings and sample frequency are set at the agent level.", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "enabled": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "title": "Enabled" - }, - "evaluation_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "$ref": "#/components/schemas/AgentEvaluationTier" - }, - { - "type": "null" - } - ] - }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" - }, - "pass_threshold": { - "anyOf": [ - { - "maximum": 1.0, - "minimum": 0.0, - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Pass Threshold" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step Id" - } - }, - "title": "UpdateEvaluationCriteriaRequest", - "type": "object" - }, - "UpdateKnowledgeBaseBody": { - "description": "Request body for updating a knowledge base.", - "properties": { - "default_score_threshold": { - "anyOf": [ - { - "maximum": 1.0, - "minimum": -1.0, - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Default score threshold (-1 to clear).", - "title": "Default Score Threshold" - }, - "default_top_k": { - "anyOf": [ - { - "maximum": 200.0, - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Default reranked results (0 to clear).", - "title": "Default Top K" - }, - "default_top_n": { - "anyOf": [ - { - "maximum": 200.0, - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Default results (0 to clear).", - "title": "Default Top N" - }, - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New description.", - "title": "Description" - }, - "name": { - "anyOf": [ - { - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New name.", - "title": "Name" - }, - "reranker_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Reranker model (empty string for no reranking).", - "title": "Reranker Model" - }, - "source_ids": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "New list of source connection IDs.", - "title": "Source Ids" - } - }, - "title": "UpdateKnowledgeBaseBody", - "type": "object" - }, - "UpdateMemoryBankBody": { - "description": "Request body for updating a memory bank.\n\nOmitted fields are left unchanged. To **clear** a field back to null,\nsend a zero-value sentinel: ``0`` for integers, ``\"\"`` for strings.", - "properties": { - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted. Send empty string \"\" to clear and disable summarisation.", - "title": "Compaction Prompt" - }, - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description. Send empty string \"\" to clear.", - "title": "Description" - }, - "max_age_days": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max entry age in days before compaction. Checked inline after each write and by the hourly background sweep. Send 0 to disable.", - "title": "Max Age Days" - }, - "max_size_tokens": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max total tokens (per partition) before compaction. Checked inline after each write and by the hourly background sweep. Send 0 to disable.", - "title": "Max Size Tokens" - }, - "max_turns": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max conversation turns (per partition) before compaction. Checked inline after each write and by the hourly background sweep. Send 0 to disable.", - "title": "Max Turns" - }, - "name": { - "anyOf": [ - { - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New name.", - "title": "Name" - }, - "retention_days": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Content source retention in days. Send 0 to clear (indefinite).", - "title": "Retention Days" - } - }, - "title": "UpdateMemoryBankBody", - "type": "object" - }, - "UpdateSolutionRequest": { - "description": "Request model for updating a solution", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Description of the solution", - "title": "Description" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Name of the solution", - "title": "Name" - } - }, - "title": "UpdateSolutionRequest", - "type": "object" - }, - "UpdateSourceBody": { - "description": "Request body for updating a content source.", - "properties": { - "media_types": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Media kinds to extract from indexed content and embed as multi-modal KB chunks. Subset of ['images', 'video']. Only kinds the source's embedder can index are honored; unsupported values are dropped. [] disables media extraction (text-only).", - "title": "Media Types" - }, - "name": { - "anyOf": [ - { - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New name.", - "title": "Name" - }, - "polling": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New polling interval.", - "title": "Polling" - }, - "retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": -1, - "description": "New retention period in days (null for unlimited).", - "title": "Retention Days" - } - }, - "title": "UpdateSourceBody", - "type": "object" - }, - "UploadAgentInputApiResponse": { - "properties": { - "content_type": { - "description": "Resolved MIME type.", - "title": "Content Type", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if status is failed.", - "title": "Error" - }, - "file_size": { - "description": "Size in bytes.", - "title": "File Size", - "type": "integer" - }, - "filename": { - "description": "Original filename.", - "title": "Filename", - "type": "string" - }, - "id": { - "description": "Unique identifier for the upload.", - "title": "Id", - "type": "string" - }, - "status": { - "description": "processing, ready, or failed.", - "title": "Status", - "type": "string" - } - }, - "required": [ - "id", - "status", - "filename", - "content_type", - "file_size" - ], - "title": "UploadAgentInputApiResponse", - "type": "object" - }, - "ValidationError": { - "properties": { - "loc": { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] - }, - "title": "Location", - "type": "array" - }, - "msg": { - "title": "Message", - "type": "string" - }, - "type": { - "title": "Error Type", - "type": "string" - } - }, - "required": [ - "loc", - "msg", - "type" - ], - "title": "ValidationError", - "type": "object" - }, - "VariantCategoryResponse": { - "description": "Response model for a variant category", - "properties": { - "category": { - "title": "Category", - "type": "string" - }, - "configurable": { - "title": "Configurable", - "type": "boolean" - }, - "description": { - "title": "Description", - "type": "string" - }, - "options": { - "items": { - "$ref": "#/components/schemas/VariantOptionResponse" - }, - "title": "Options", - "type": "array" - }, - "title": { - "title": "Title", - "type": "string" - } - }, - "required": [ - "category", - "title", - "description", - "configurable", - "options" - ], - "title": "VariantCategoryResponse", - "type": "object" - }, - "VariantOptionResponse": { - "description": "Response model for a variant option", - "properties": { - "default": { - "title": "Default", - "type": "boolean" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "input_1h_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input 1H Cache Write Credits Per 1000 Tokens" - }, - "input_5m_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input 5M Cache Write Credits Per 1000 Tokens" - }, - "input_cache_hit_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input Cache Hit Credits Per 1000 Tokens" - }, - "input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input Credits Per 1000 Tokens" - }, - "long_context_input_cache_hit_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Long Context Input Cache Hit Credits Per 1000 Tokens" - }, - "long_context_input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Long Context Input Credits Per 1000 Tokens" - }, - "long_context_output_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Long Context Output Credits Per 1000 Tokens" - }, - "long_context_threshold": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Long Context Threshold" - }, - "output_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Output Credits Per 1000 Tokens" - }, - "title": { - "title": "Title", - "type": "string" - }, - "value": { - "title": "Value", - "type": "string" - } - }, - "required": [ - "value", - "title", - "default" - ], - "title": "VariantOptionResponse", - "type": "object" - }, - "routers__api__agents__AgentImportPreviewRequest": { - "description": "Dry-run import request \u2014 same payload shape as the export endpoint.", - "properties": { - "agent_definition": { - "additionalProperties": true, - "description": "Payload in the same shape as GET /agents/{agent_id}/export.", - "title": "Agent Definition", - "type": "object" - } - }, - "required": [ - "agent_definition" - ], - "title": "AgentImportPreviewRequest", - "type": "object" - }, - "routers__api__agents__AgentImportPreviewResponse": { - "description": "Summary of a successfully validated import payload (no DB writes).\n\nCounts are derived from the validated payload as supplied \u2014 they\nreflect what was requested, not what would eventually be persisted\n(cross-account skips for recipients and KB names happen later, only\non commit).", - "properties": { - "agent_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Imported agent name, if any.", - "title": "Agent Name" - }, - "alert_configs": { - "description": "Number of alert configs in the payload.", - "title": "Alert Configs", - "type": "integer" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Imported agent description, if any.", - "title": "Description" - }, - "evaluation_criteria": { - "description": "Number of evaluation criteria in the payload.", - "title": "Evaluation Criteria", - "type": "integer" - }, - "governance_policies": { - "description": "Number of agent-scoped governance policies in the payload.", - "title": "Governance Policies", - "type": "integer" - }, - "ok": { - "description": "Always true on a 200 response; failures use HTTP 422.", - "title": "Ok", - "type": "boolean" - }, - "payload_export_version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Export-format version the payload claims (or ``null`` for legacy payloads). When this differs from ``supported_export_version``, fields may have been silently dropped or defaulted on import.", - "title": "Payload Export Version" - }, - "schedules": { - "description": "Number of trigger schedules in the payload.", - "title": "Schedules", - "type": "integer" - }, - "solutions": { - "default": 0, - "description": "Number of solutions the source agent belonged to. On import these are matched by name in the target account; unmatched names are silently skipped.", - "title": "Solutions", - "type": "integer" - }, - "step_count": { - "description": "Total number of steps in the workflow tree (recursive).", - "title": "Step Count", - "type": "integer" - }, - "supported_export_version": { - "default": "2", - "description": "Export-format version this server understands. Compare against ``payload_export_version`` to detect cross-version imports.", - "title": "Supported Export Version", - "type": "string" - }, - "unresolved_refs": { - "description": "Entity references in the imported workflow that don't exist in the target account. Each entry: {category, ref_id, ref_name?, locations:[step:], alternatives:[{id, name, description?}]}. Pass {source_uuid: target_uuid} as ``entity_remap`` on the create/update call to substitute these references before save.", - "items": { - "additionalProperties": true, - "type": "object" - }, - "title": "Unresolved Refs", - "type": "array" - } - }, - "required": [ - "ok", - "agent_name", - "description", - "step_count", - "schedules", - "alert_configs", - "evaluation_criteria", - "governance_policies" - ], - "title": "AgentImportPreviewResponse", - "type": "object" - }, - "routers__api__agents__AgentListResponse": { - "properties": { - "data": { - "description": "List of agents.", - "items": { - "$ref": "#/components/schemas/AgentSummaryResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "AgentListResponse", - "type": "object" - }, - "routers__api__agents__AgentRunListResponse": { - "properties": { - "data": { - "description": "List of agent runs.", - "items": { - "$ref": "#/components/schemas/AgentRunResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "AgentRunListResponse", - "type": "object" - }, - "routers__api__agents__AgentTraceSearchRequest": { - "properties": { - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by agent ID.", - "title": "Agent Id" - }, - "query": { - "description": "Search query text.", - "title": "Query", - "type": "string" - }, - "run_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by run status.", - "title": "Run Status" - }, - "step_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by step type.", - "title": "Step Type" - }, - "top_n": { - "default": 10, - "description": "Maximum number of results.", - "maximum": 100.0, - "minimum": 1.0, - "title": "Top N", - "type": "integer" - } - }, - "required": [ - "query" - ], - "title": "AgentTraceSearchRequest", - "type": "object" - }, - "routers__api__agents__CreateAgentRequest": { - "properties": { - "agent_definition": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional payload in the same format produced by GET /agents/{id}/export. When provided, replaces any template-derived workflow and pre-fills metadata/trigger fields the request does not specify explicitly. Validation errors include line/column references against a canonical pretty-printed echo of the supplied payload.", - "title": "Agent Definition" - }, - "agent_template": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Template to initialize the agent from. Values: blank, retrieval_example, simple_qa, summarizer, json_extractor, content_change_notifier, scheduled_report, webhook_pipeline.", - "title": "Agent Template" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description.", - "title": "Description" - }, - "entity_remap": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional UUID-substitution map applied to the imported workflow before save. Each key is a source-account UUID (as returned by /agents/preview-import's ``unresolved_refs``); each value is the target-account UUID to substitute. Used to relink knowledge bases, memory banks, source connections, and sub-agents on cross-account imports.", - "title": "Entity Remap" - }, - "name": { - "description": "Name for the new agent.", - "title": "Name", - "type": "string" - }, - "trigger_type": { - "default": "dynamic_input", - "description": "Trigger type: dynamic_input, template_input, schedule, new_content, email_received.", - "title": "Trigger Type", - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "CreateAgentRequest", - "type": "object" - }, - "routers__api__agents__GovernancePolicyRefResponse": { - "description": "Reference to a governance policy by id and name.", - "properties": { - "policy_id": { - "description": "Governance policy identifier.", - "title": "Policy Id", - "type": "string" - }, - "policy_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Display name of the policy at evaluation time. May be null when the policy has been deleted.", - "title": "Policy Name" - } - }, - "required": [ - "policy_id" - ], - "title": "GovernancePolicyRefResponse", - "type": "object" - }, - "routers__api__agents__SetEmailTriggerConfigRequest": { - "description": "Alias and/or sender allowlist for an EMAIL_RECEIVED trigger.\n\nA field omitted is left unchanged; passing ``null`` (or ``\"\"`` for\n``alias``) clears it.", - "properties": { - "alias": { - "anyOf": [ - { - "maxLength": 32, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom alias for the address `.@agent.seclai.com` (alphanumeric plus '+', '.', '-'; 1\u201332 chars; not starting/ending with '+', '.', '-'; not UUID-shaped). Pass null/empty to clear.", - "title": "Alias" - }, - "allowed_senders": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Allowlist of full sender addresses and/or bare domains (a bare domain also matches sub-domains). Empty/null accepts any sender.", - "title": "Allowed Senders" - }, - "ignore_auto_generated": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "When true (default for new triggers), machine-generated inbound mail (auto-replies, bulk/list mail, bounces) is dropped before a run to prevent auto-reply loops. Set false to process automated mail.", - "title": "Ignore Auto Generated" - }, - "queue_on_quota": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "When true (default false), inbound mail that exceeds the account's hourly email-trigger rate is parked in a QUEUED run and drained later by the catch-up sweep instead of being failed; when false, over-rate mail fails immediately.", - "title": "Queue On Quota" - }, - "require_sender_auth": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "When true (default for new triggers), the envelope sender must pass SPF or DMARC even on an open inbox (no allowlist); unauthenticated, spoofable mail is rejected. Set false to accept fully unauthenticated mail on an open inbox.", - "title": "Require Sender Auth" - } - }, - "title": "SetEmailTriggerConfigRequest", - "type": "object" - }, - "routers__api__agents__UpdateAgentRequest": { - "properties": { - "agent_definition": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional payload in the same format produced by GET /agents/{id}/export. When provided, agent metadata fields the request does not set explicitly are taken from the payload, and the agent's workflow is replaced from `agent.definition`. The previous version is preserved in history. Validation errors include line/column references against a canonical pretty-printed echo of the supplied payload.", - "title": "Agent Definition" - }, - "default_evaluation_tier": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Default evaluation tier: 'fast', 'balanced', or 'thorough'.", - "title": "Default Evaluation Tier" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New description for the agent.", - "title": "Description" - }, - "entity_remap": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional UUID-substitution map applied to the imported workflow before save (same shape as on POST /agents).", - "title": "Entity Remap" - }, - "evaluation_mode": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Evaluation mode: 'output_expectation', 'eval_and_retry', or 'sample_and_flag'.", - "title": "Evaluation Mode" - }, - "max_retries": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max retries for eval_and_retry mode (1-10).", - "title": "Max Retries" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New name for the agent.", - "title": "Name" - }, - "prompt_model_auto_rollback_enabled": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Enable or disable automatic rollback for upgraded models.", - "title": "Prompt Model Auto Rollback Enabled" - }, - "prompt_model_auto_rollback_triggers": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Failure signals that trigger rollback: agent_eval_fail, governance_flag, governance_block, agent_run_failed.", - "title": "Prompt Model Auto Rollback Triggers" - }, - "prompt_model_auto_upgrade_strategy": { - "anyOf": [ - { - "$ref": "#/components/schemas/PromptModelAutoUpgradeStrategy" - }, - { - "type": "null" - } - ], - "description": "Auto-upgrade strategy: none, early_adopter, middle_of_road, cautious_adopter." - }, - "retry_on_failure": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether to retry on evaluation failure.", - "title": "Retry On Failure" - }, - "sampling_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Sampling configuration for sample_and_flag mode. Format: {combinator: 'and'|'or', rules: [...]}.", - "title": "Sampling Config" - }, - "set_default_evaluation_tier": { - "default": false, - "description": "When true and default_evaluation_tier is omitted, clears the tier to null (system default).", - "title": "Set Default Evaluation Tier", - "type": "boolean" - }, - "set_prompt_model_auto_rollback_triggers": { - "default": false, - "description": "When true and prompt_model_auto_rollback_triggers is omitted, clears the list to null (revert to system defaults).", - "title": "Set Prompt Model Auto Rollback Triggers", - "type": "boolean" - }, - "set_sampling_config": { - "default": false, - "description": "When true and sampling_config is omitted, clears the config to null.", - "title": "Set Sampling Config", - "type": "boolean" - } - }, - "title": "UpdateAgentRequest", - "type": "object" - }, - "routers__api__ai_assistant__AiAssistantFeedbackRequest": { - "description": "Request body for submitting AI assistant feedback.", - "properties": { - "agent_conversation_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent conversation ID, if applicable.", - "title": "Agent Conversation Id" - }, - "comment": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional comment.", - "title": "Comment" - }, - "context": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Additional context.", - "title": "Context" - }, - "conversation_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Conversation ID for the interaction.", - "title": "Conversation Id" - }, - "feature": { - "description": "Feature name (e.g. 'source', 'solution').", - "title": "Feature", - "type": "string" - }, - "prompt_call_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Prompt call ID for credit tracking.", - "title": "Prompt Call Id" - }, - "rating": { - "description": "Rating: 'thumbs_up' or 'thumbs_down'.", - "title": "Rating", - "type": "string" - } - }, - "required": [ - "feature", - "rating" - ], - "title": "AiAssistantFeedbackRequest", - "type": "object" - }, - "routers__api__alerts__AddCommentRequest": { - "properties": { - "body": { - "description": "Comment text", - "title": "Body", - "type": "string" - } - }, - "required": [ - "body" - ], - "title": "AddCommentRequest", - "type": "object" - }, - "routers__api__alerts__AlertCommentResponse": { - "properties": { - "body": { - "title": "Body", - "type": "string" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "id": { - "title": "Id", - "type": "string" - }, - "user_id": { - "title": "User Id", - "type": "string" - }, - "user_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "User Name" - } - }, - "required": [ - "id", - "user_id", - "user_name", - "body", - "created_at" - ], - "title": "AlertCommentResponse", - "type": "object" - }, - "routers__api__alerts__AlertDetailResponse": { - "properties": { - "alert": { - "$ref": "#/components/schemas/routers__api__alerts__AlertResponse" - }, - "comments": { - "items": { - "$ref": "#/components/schemas/routers__api__alerts__AlertCommentResponse" - }, - "title": "Comments", - "type": "array" - }, - "history": { - "items": { - "$ref": "#/components/schemas/AlertHistoryEntryResponse" - }, - "title": "History", - "type": "array" - }, - "subscribers": { - "items": { - "$ref": "#/components/schemas/routers__api__alerts__AlertSubscriberResponse" - }, - "title": "Subscribers", - "type": "array" - } - }, - "required": [ - "alert", - "history", - "comments", - "subscribers" - ], - "title": "AlertDetailResponse", - "type": "object" - }, - "routers__api__alerts__AlertListResponse": { - "description": "``GET /alerts`` \u2014 always the canonical ``{data, pagination}`` envelope.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/routers__api__alerts__AlertResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "AlertListResponse", - "type": "object" - }, - "routers__api__alerts__AlertResponse": { - "properties": { - "account_id": { - "title": "Account Id", - "type": "string" - }, - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "agent_run_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Run Id" - }, - "alert_config_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Alert Config Id" - }, - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "comment_count": { - "title": "Comment Count", - "type": "integer" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "details": { - "title": "Details" - }, - "id": { - "title": "Id", - "type": "string" - }, - "is_subscribed": { - "title": "Is Subscribed", - "type": "boolean" - }, - "mcp_client_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Mcp Client Id" - }, - "source_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Connection Id" - }, - "source_connection_pull_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Connection Pull Id" - }, - "status": { - "title": "Status", - "type": "string" - }, - "subscriber_count": { - "title": "Subscriber Count", - "type": "integer" - }, - "title": { - "title": "Title", - "type": "string" - }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Updated At" - } - }, - "required": [ - "id", - "account_id", - "alert_config_id", - "alert_type", - "title", - "description", - "status", - "agent_id", - "agent_run_id", - "source_connection_id", - "source_connection_pull_id", - "mcp_client_id", - "subscriber_count", - "comment_count", - "is_subscribed", - "created_at", - "updated_at" - ], - "title": "AlertResponse", - "type": "object" - }, - "routers__api__alerts__AlertSubscriberResponse": { - "properties": { - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "id": { - "title": "Id", - "type": "string" - }, - "user_id": { - "title": "User Id", - "type": "string" - }, - "user_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "User Name" - } - }, - "required": [ - "id", - "user_id", - "user_name", - "created_at" - ], - "title": "AlertSubscriberResponse", - "type": "object" - }, - "routers__api__alerts__OrganizationAlertPreferenceResponse": { - "properties": { - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "is_override": { - "title": "Is Override", - "type": "boolean" - }, - "organization_id": { - "title": "Organization Id", - "type": "string" - }, - "subscribed": { - "title": "Subscribed", - "type": "boolean" - } - }, - "required": [ - "organization_id", - "alert_type", - "subscribed", - "is_override" - ], - "title": "OrganizationAlertPreferenceResponse", - "type": "object" - }, - "routers__api__alerts__UpdateOrganizationAlertPreferenceRequest": { - "properties": { - "subscribed": { - "description": "Whether the user should receive this alert for the organization", - "title": "Subscribed", - "type": "boolean" - } - }, - "required": [ - "subscribed" - ], - "title": "UpdateOrganizationAlertPreferenceRequest", - "type": "object" - }, - "routers__api__contents__ContentDetailResponse": { - "description": "Response model for content detail.", - "properties": { - "content_duration": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Duration of the content in seconds.", - "title": "Content Duration" - }, - "content_duration_display": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Display string for content duration.", - "title": "Content Duration Display" - }, - "content_status": { - "description": "Status of the content.", - "title": "Content Status", - "type": "string" - }, - "content_type": { - "description": "Type of the content.", - "title": "Content Type", - "type": "string" - }, - "content_type_display": { - "description": "Display name of the content type.", - "title": "Content Type Display", - "type": "string" - }, - "content_url": { - "description": "URL of the content.", - "title": "Content Url", - "type": "string" - }, - "content_word_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Word count of the content.", - "title": "Content Word Count" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Description of the content.", - "title": "Description" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message, if any.", - "title": "Error" - }, - "id": { - "description": "Unique identifier for the content version.", - "title": "Id", - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "items": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Metadata associated with the content.", - "title": "Metadata" - }, - "published_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the content was published.", - "title": "Published At" - }, - "pulled_at": { - "description": "Timestamp when the content was pulled.", - "title": "Pulled At", - "type": "string" - }, - "source_connection_content_version_id": { - "description": "ID of the source connection content version.", - "title": "Source Connection Content Version Id", - "type": "string" - }, - "source_connection_id": { - "description": "ID of the source connection.", - "title": "Source Connection Id", - "type": "string" - }, - "source_name": { - "description": "Name of the source.", - "title": "Source Name", - "type": "string" - }, - "source_type": { - "description": "Type of the source.", - "title": "Source Type", - "type": "string" - }, - "text_content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Text content.", - "title": "Text Content" - }, - "text_content_end": { - "description": "End position of the text content.", - "title": "Text Content End", - "type": "integer" - }, - "text_content_start": { - "description": "Start position of the text content.", - "title": "Text Content Start", - "type": "integer" - }, - "text_content_total_length": { - "description": "Total length of the text content.", - "title": "Text Content Total Length", - "type": "integer" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title of the content.", - "title": "Title" - } - }, - "required": [ - "id", - "source_connection_content_version_id", - "source_connection_id", - "source_name", - "source_type", - "title", - "content_url", - "content_type", - "content_type_display", - "content_status", - "content_word_count", - "content_duration", - "content_duration_display", - "pulled_at", - "published_at", - "description", - "text_content", - "text_content_start", - "text_content_end", - "text_content_total_length", - "metadata", - "error" - ], - "title": "ContentDetailResponse", - "type": "object" - }, - "routers__api__contents__ContentEmbeddingsListResponse": { - "description": "Response model for paginated content embeddings.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ContentEmbeddingResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "ContentEmbeddingsListResponse", - "type": "object" - }, - "routers__api__contents__FileUploadResponse": { - "description": "Response model for content file replacement upload.", - "properties": { - "content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the content version being replaced", - "title": "Content Version Id" - }, - "filename": { - "description": "Original filename", - "title": "Filename", - "type": "string" - }, - "source_connection_content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the source connection content version", - "title": "Source Connection Content Version Id" - }, - "status": { - "description": "Processing status", - "title": "Status", - "type": "string" - } - }, - "required": [ - "content_version_id", - "source_connection_content_version_id", - "filename", - "status" - ], - "title": "FileUploadResponse", - "type": "object" - }, - "routers__api__docs_search__DocsSearchResponse": { - "description": "Ranked results, NOT a paginated collection \u2014 the ``{results}`` shape is a\ndeliberate carve-out matching the MCP ``search_docs`` tool.", - "properties": { - "results": { - "items": { - "$ref": "#/components/schemas/DocsSearchResultResponse" - }, - "title": "Results", - "type": "array" - } - }, - "required": [ - "results" - ], - "title": "DocsSearchResponse", - "type": "object" - }, - "routers__api__governance__GovernanceAiAssistantRequest": { - "description": "Request body for the governance AI assistant.", - "properties": { - "user_input": { - "description": "Natural-language request for the governance AI assistant.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "GovernanceAiAssistantRequest", - "type": "object" - }, - "routers__api__governance__GovernanceConversationResponse": { - "description": "A governance AI assistant conversation entry.", - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "True if accepted, false if declined, null if pending.", - "title": "Accepted" - }, - "ai_response": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The AI assistant's response note, or null.", - "title": "Ai Response" - }, - "created_at": { - "description": "ISO 8601 creation timestamp.", - "title": "Created At", - "type": "string" - }, - "id": { - "description": "Conversation ID.", - "title": "Id", - "type": "string" - }, - "proposed_actions": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "JSON of proposed actions, or null.", - "title": "Proposed Actions" - }, - "user_input": { - "description": "The original user request.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "id", - "user_input", - "ai_response", - "proposed_actions", - "accepted", - "created_at" - ], - "title": "GovernanceConversationResponse", - "type": "object" - }, - "routers__api__memory_banks__MemoryBankAcceptRequest": { - "description": "Accept or decline a memory bank AI suggestion.", - "properties": { - "accepted": { - "description": "Whether the user accepted the proposed configuration.", - "title": "Accepted", - "type": "boolean" - } - }, - "required": [ - "accepted" - ], - "title": "MemoryBankAcceptRequest", - "type": "object" - }, - "routers__api__memory_banks__MemoryBankAiAssistantRequest": { - "description": "Request body for the memory bank AI assistant.", - "properties": { - "current_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Current configuration to refine, if any.", - "title": "Current Config" - }, - "history_since": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional ISO 8601 timestamp. When set, only conversation turns created at or after this timestamp are loaded as context, scoping history to the current session so the assistant remembers earlier turns in a multi-turn refinement.", - "title": "History Since" - }, - "user_input": { - "description": "Natural-language description of the memory bank.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "MemoryBankAiAssistantRequest", - "type": "object" - }, - "routers__api__memory_banks__MemoryBankConversationTurnResponse": { - "description": "A single turn of memory bank AI assistant conversation.", - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the user accepted this proposal.", - "title": "Accepted" - }, - "ai_note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI note from this turn.", - "title": "Ai Note" - }, - "conversation_id": { - "description": "Unique ID for this conversation turn.", - "title": "Conversation Id", - "type": "string" - }, - "resulting_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "The proposed configuration from this turn.", - "title": "Resulting Config" - }, - "user_input": { - "description": "User input for this turn.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input", - "conversation_id" - ], - "title": "MemoryBankConversationTurnResponse", - "type": "object" - }, - "routers__api__memory_banks__MemoryBankLastConversationResponse": { - "description": "Response for fetching memory bank conversation history.", - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the user accepted the last proposal.", - "title": "Accepted" - }, - "ai_note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI note from the most recent turn.", - "title": "Ai Note" - }, - "total": { - "default": 0, - "description": "Total conversation turns.", - "title": "Total", - "type": "integer" - }, - "turns": { - "description": "Recent conversation turns (oldest first).", - "items": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankConversationTurnResponse" - }, - "title": "Turns", - "type": "array" - }, - "user_input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Most recent user input.", - "title": "User Input" - } - }, - "title": "MemoryBankLastConversationResponse", - "type": "object" - }, - "routers__api__model_lifecycle__ModelAlertListResponse": { - "description": "``GET /models/alerts`` legacy/default shape; 2026-07-27+ clients get the\ncanonical ``{data, pagination}`` envelope (bypasses this ``response_model``).", - "properties": { - "alerts": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelAlertResponse" - }, - "title": "Alerts", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "alerts", - "total" - ], - "title": "ModelAlertListResponse", - "type": "object" - }, - "routers__api__model_lifecycle__ModelAlertResponse": { - "properties": { - "account_id": { - "title": "Account Id", - "type": "string" - }, - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "id": { - "title": "Id", - "type": "string" - }, - "message": { - "title": "Message", - "type": "string" - }, - "model_name": { - "title": "Model Name", - "type": "string" - }, - "prompt_model_id": { - "title": "Prompt Model Id", - "type": "string" - }, - "read_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Read At" - }, - "successor_model_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Successor Model Name" - } - }, - "required": [ - "id", - "account_id", - "agent_id", - "prompt_model_id", - "model_name", - "alert_type", - "message", - "read_at", - "successor_model_name", - "created_at" - ], - "title": "ModelAlertResponse", - "type": "object" - }, - "routers__api__model_lifecycle__ModelRecommendationResponse": { - "properties": { - "deprecated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Deprecated At" - }, - "description": { - "title": "Description", - "type": "string" - }, - "family": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Family" - }, - "family_generation": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Family Generation" - }, - "id": { - "title": "Id", - "type": "string" - }, - "max_context_tokens": { - "title": "Max Context Tokens", - "type": "integer" - }, - "max_output_tokens": { - "title": "Max Output Tokens", - "type": "integer" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "provider": { - "title": "Provider", - "type": "string" - }, - "reason": { - "title": "Reason", - "type": "string" - }, - "recommendation_type": { - "title": "Recommendation Type", - "type": "string" - }, - "released_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Released At" - }, - "sunset_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Sunset At" - }, - "supports_openai_arguments": { - "title": "Supports Openai Arguments", - "type": "boolean" - }, - "supports_streaming": { - "title": "Supports Streaming", - "type": "boolean" - }, - "supports_structured_output": { - "title": "Supports Structured Output", - "type": "boolean" - }, - "supports_thinking": { - "title": "Supports Thinking", - "type": "boolean" - }, - "supports_tool_use": { - "title": "Supports Tool Use", - "type": "boolean" - } - }, - "required": [ - "id", - "model_id", - "name", - "provider", - "description", - "max_context_tokens", - "max_output_tokens", - "supports_tool_use", - "supports_structured_output", - "supports_thinking", - "supports_openai_arguments", - "supports_streaming", - "recommendation_type", - "reason" - ], - "title": "ModelRecommendationResponse", - "type": "object" - }, - "routers__api__model_lifecycle__ModelRecommendationsResponse": { - "properties": { - "alternatives": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - "title": "Alternatives", - "type": "array" - }, - "current_model_id": { - "title": "Current Model Id", - "type": "string" - }, - "current_model_name": { - "title": "Current Model Name", - "type": "string" - }, - "same_provider": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - "title": "Same Provider", - "type": "array" - }, - "successor": { - "anyOf": [ - { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - { - "type": "null" - } - ] - }, - "upgrades": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - "title": "Upgrades", - "type": "array" - } - }, - "required": [ - "current_model_id", - "current_model_name", - "upgrades", - "same_provider", - "alternatives" - ], - "title": "ModelRecommendationsResponse", - "type": "object" - }, - "routers__api__search__SearchResponse": { - "description": "Ranked results, NOT a paginated collection \u2014 the ``{results}`` shape is a\ndeliberate carve-out matching the MCP ``search_resources`` tool.", - "properties": { - "results": { - "items": { - "$ref": "#/components/schemas/routers__api__search__SearchResultResponse" - }, - "title": "Results", - "type": "array" - } - }, - "required": [ - "results" - ], - "title": "SearchResponse", - "type": "object" - }, - "routers__api__search__SearchResultResponse": { - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "entity_type": { - "title": "Entity Type", - "type": "string" - }, - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "entity_type", - "name", - "description" - ], - "title": "SearchResultResponse", - "type": "object" - }, - "routers__api__solutions__AiAssistantAcceptRequest": { - "description": "Request body for accepting a proposed plan.", - "properties": { - "confirm_deletions": { - "default": false, - "description": "Must be true when the plan contains destructive actions", - "title": "Confirm Deletions", - "type": "boolean" - }, - "solution_description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "When running in standalone mode (no pre-existing solution), provide a description for the auto-created solution.", - "title": "Solution Description" - }, - "solution_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "When running in standalone mode (no pre-existing solution), provide a name to auto-create a solution and link resources.", - "title": "Solution Name" - } - }, - "title": "AiAssistantAcceptRequest", - "type": "object" - }, - "routers__api__solutions__AiAssistantGenerateRequest": { - "description": "Request body for AI assistant generate endpoints.", - "properties": { - "history_since": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional ISO 8601 timestamp. When set, only conversation turns created at or after this timestamp are loaded as context, scoping history to the current session so the assistant remembers earlier turns in a create flow.", - "title": "History Since" - }, - "user_input": { - "description": "User input describing what to do", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "AiAssistantGenerateRequest", - "type": "object" - }, - "routers__api__solutions__SolutionAgentResponse": { - "properties": { - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "knowledge_base_ids": { - "description": "Knowledge base IDs connected to this agent via triggers.", - "items": { - "format": "uuid", - "type": "string" - }, - "title": "Knowledge Base Ids", - "type": "array" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name" - ], - "title": "SolutionAgentResponse", - "type": "object" - }, - "routers__api__solutions__SolutionConversationResponse": { - "description": "Response model for a conversation turn.", - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the suggestion was accepted or declined.", - "title": "Accepted" - }, - "actions_taken": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Actions taken by the AI.", - "title": "Actions Taken" - }, - "ai_response": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI response text.", - "title": "Ai Response" - }, - "created_at": { - "description": "Timestamp when the conversation was created.", - "title": "Created At", - "type": "string" - }, - "id": { - "description": "Unique identifier for the conversation turn.", - "format": "uuid", - "title": "Id", - "type": "string" - }, - "user_input": { - "description": "User input text.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "id", - "user_input", - "ai_response", - "actions_taken", - "accepted", - "created_at" - ], - "title": "SolutionConversationResponse", - "type": "object" - }, - "routers__api__solutions__SolutionKnowledgeBaseResponse": { - "properties": { - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "source_connection_ids": { - "description": "Source connection IDs linked to this knowledge base.", - "items": { - "format": "uuid", - "type": "string" - }, - "title": "Source Connection Ids", - "type": "array" - } - }, - "required": [ - "id", - "name" - ], - "title": "SolutionKnowledgeBaseResponse", - "type": "object" - }, - "routers__api__solutions__SolutionListResponse": { - "description": "Response model for paginated solution list.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/SolutionSummaryResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "SolutionListResponse", - "type": "object" - }, - "routers__api__solutions__SolutionResponse": { - "description": "Response model for solution data.", - "properties": { - "agents": { - "description": "Agents linked to the solution.", - "items": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionAgentResponse" - }, - "title": "Agents", - "type": "array" - }, - "created_at": { - "description": "Timestamp when the solution was created.", - "title": "Created At", - "type": "string" - }, - "description": { - "description": "Description of the solution.", - "title": "Description", - "type": "string" - }, - "id": { - "description": "Unique identifier for the solution.", - "format": "uuid", - "title": "Id", - "type": "string" - }, - "knowledge_bases": { - "description": "Knowledge bases linked to the solution.", - "items": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionKnowledgeBaseResponse" - }, - "title": "Knowledge Bases", - "type": "array" - }, - "name": { - "description": "Name of the solution.", - "title": "Name", - "type": "string" - }, - "source_connections": { - "description": "Source connections linked to the solution.", - "items": { - "$ref": "#/components/schemas/SolutionSourceConnectionResponse" - }, - "title": "Source Connections", - "type": "array" - }, - "updated_at": { - "description": "Timestamp when the solution was last updated.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "description", - "agents", - "knowledge_bases", - "source_connections", - "created_at", - "updated_at" - ], - "title": "SolutionResponse", - "type": "object" - }, - "routers__api__source_exports__CreateExportRequest": { - "description": "Parameters for creating a new export job.", - "properties": { - "date_from": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Only include content created on or after this timestamp.", - "title": "Date From" - }, - "date_to": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Only include content created on or before this timestamp.", - "title": "Date To" - }, - "format": { - "$ref": "#/components/schemas/ExportFormat", - "description": "Output file format (jsonl, csv, parquet, zip)." - }, - "metadata_filter": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "JSONB containment filter applied to content metadata.", - "title": "Metadata Filter" - }, - "query_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title substring filter (case-insensitive ILIKE).", - "title": "Query Filter" - } - }, - "required": [ - "format" - ], - "title": "CreateExportRequest", - "type": "object" - }, - "routers__api__source_exports__EstimateExportRequest": { - "description": "Parameters for estimating export size.", - "properties": { - "date_from": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Only include content created on or after this timestamp.", - "title": "Date From" - }, - "date_to": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Only include content created on or before this timestamp.", - "title": "Date To" - }, - "format": { - "$ref": "#/components/schemas/ExportFormat", - "description": "Output file format." - }, - "metadata_filter": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "JSONB containment filter applied to content metadata.", - "title": "Metadata Filter" - }, - "query_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title substring filter (case-insensitive ILIKE).", - "title": "Query Filter" - } - }, - "required": [ - "format" - ], - "title": "EstimateExportRequest", - "type": "object" - }, - "routers__api__source_exports__EstimateExportResponse": { - "description": "Rough size estimate for a potential export.", - "properties": { - "estimated_size_bytes": { - "description": "Estimated export file size in bytes.", - "title": "Estimated Size Bytes", - "type": "integer" - }, - "source_connection_id": { - "description": "Source connection ID.", - "title": "Source Connection Id", - "type": "string" - } - }, - "required": [ - "estimated_size_bytes", - "source_connection_id" - ], - "title": "EstimateExportResponse", - "type": "object" - }, - "routers__api__source_exports__ExportResponse": { - "description": "Status and metadata for a content source export job.", - "properties": { - "account_id": { - "description": "Owning account ID.", - "title": "Account Id", - "type": "string" - }, - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Completion time.", - "title": "Completed At" - }, - "created_at": { - "description": "Creation time.", - "title": "Created At", - "type": "string" - }, - "date_from": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Date-from filter applied to this export.", - "title": "Date From" - }, - "date_to": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Date-to filter applied to this export.", - "title": "Date To" - }, - "destination": { - "description": "Storage destination.", - "title": "Destination", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if failed.", - "title": "Error" - }, - "estimated_size_bytes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Pre-run size estimate.", - "title": "Estimated Size Bytes" - }, - "expires_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Download expiry time.", - "title": "Expires At" - }, - "file_size_bytes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "File size in bytes.", - "title": "File Size Bytes" - }, - "format": { - "description": "Output format.", - "title": "Format", - "type": "string" - }, - "id": { - "description": "Export job ID.", - "title": "Id", - "type": "string" - }, - "item_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Items exported.", - "title": "Item Count" - }, - "metadata_filter": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Metadata filter applied to this export.", - "title": "Metadata Filter" - }, - "progress_current": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Items processed so far.", - "title": "Progress Current" - }, - "progress_total": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Total items to process.", - "title": "Progress Total" - }, - "query_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Query filter applied to this export.", - "title": "Query Filter" - }, - "requested_by_user_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the user who requested this export.", - "title": "Requested By User Id" - }, - "requested_by_user_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Name of the user who requested this export.", - "title": "Requested By User Name" - }, - "source_connection_id": { - "description": "Source connection ID.", - "title": "Source Connection Id", - "type": "string" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Processing start time.", - "title": "Started At" - }, - "status": { - "description": "Job status.", - "title": "Status", - "type": "string" - }, - "storage_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "S3 key of exported file.", - "title": "Storage Key" - }, - "updated_at": { - "description": "Last update time.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "source_connection_id", - "account_id", - "format", - "destination", - "status", - "created_at", - "updated_at" - ], - "title": "ExportResponse", - "type": "object" - }, - "routers__api__sources__FileUploadResponse": { - "description": "Response model for file upload", - "properties": { - "content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the created content version", - "title": "Content Version Id" - }, - "embedder_warning": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Set when the file is non-text but the source's embedder is text-only \u2014 indexing will rely on OCR / transcription and may produce a FAILED row if no text can be extracted.", - "title": "Embedder Warning" - }, - "filename": { - "description": "Original filename", - "title": "Filename", - "type": "string" - }, - "source_connection_content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the duplicate source connection content version", - "title": "Source Connection Content Version Id" - }, - "status": { - "description": "Processing status", - "title": "Status", - "type": "string" - } - }, - "required": [ - "content_version_id", - "source_connection_content_version_id", - "filename", - "status" - ], - "title": "FileUploadResponse", - "type": "object" - }, - "routers__api__sources__SourceListResponse": { - "description": "Response model for paginated source list", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/SourceResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "SourceListResponse", - "type": "object" - }, - "schemas__model_responses__PromptModelResponse": { - "description": "Response model for prompt model data", - "properties": { - "default": { - "title": "Default", - "type": "boolean" - }, - "deprecated_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Deprecated At" - }, - "description": { - "title": "Description", - "type": "string" - }, - "enabled": { - "title": "Enabled", - "type": "boolean" - }, - "family": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Family" - }, - "family_generation": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Family Generation" - }, - "generation_credits_per_unit": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Per-unit credit cost for a dedicated media-generation model, in the unit named by ``generation_params.pricing_unit`` (per image / per second / per character / per output token). Multiply by the produced unit count (images, seconds, characters) for the run cost. None for token-billed (non-generation) models.", - "title": "Generation Credits Per Unit" - }, - "generation_params": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Media-generation descriptor (modality, pricing_unit, and modality-specific constraints). NULL for text LLMs; present for image/audio/video generation models. See schemas.generation_params.", - "title": "Generation Params" - }, - "generation_unit_label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human suffix for the per-unit generation rate (e.g. ``/image``, ``/second``, ``/1k chars``, ``/1k tokens``) \u2014 single-sourced from the pricing unit so clients render cost without re-deriving the mapping. None for non-generation models. Char/token rates are shown per 1,000 (the ``/1k \u2026`` suffix), so scale ``generation_credits_per_unit`` accordingly for those units.", - "title": "Generation Unit Label" - }, - "id": { - "title": "Id", - "type": "string" - }, - "image_generation_tool_credits_per_image": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Per-image credit cost of using the built-in image_generation tool (it runs gpt-image-1). Set only for models that actually support the tool (tool-use capable); None otherwise.", - "title": "Image Generation Tool Credits Per Image" - }, - "input_1h_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input 1H Cache Write Credits Per 1000 Tokens" - }, - "input_5m_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input 5M Cache Write Credits Per 1000 Tokens" - }, - "input_cache_hit_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input Cache Hit Credits Per 1000 Tokens" - }, - "input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input Credits Per 1000 Tokens" - }, - "is_new": { - "default": false, - "title": "Is New", - "type": "boolean" - }, - "last_used": { - "default": false, - "title": "Last Used", - "type": "boolean" - }, - "max_context_tokens": { - "title": "Max Context Tokens", - "type": "integer" - }, - "max_conversation_length": { - "title": "Max Conversation Length", - "type": "integer" - }, - "max_output_tokens": { - "title": "Max Output Tokens", - "type": "integer" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "output_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Output Credits Per 1000 Tokens" - }, - "payload_schema": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Model-specific JSON schema for advanced prompt_call json_template payloads.", - "title": "Payload Schema" - }, - "payload_schema_source_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Source URL used to derive payload_schema guidance for this model.", - "title": "Payload Schema Source Url" - }, - "per_modality_rates": { - "items": { - "$ref": "#/components/schemas/ModalityRateResponse" - }, - "title": "Per Modality Rates", - "type": "array" - }, - "provider": { - "title": "Provider", - "type": "string" - }, - "released_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Released At" - }, - "schema_documentation_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model documentation URL with request/response payload details.", - "title": "Schema Documentation Url" - }, - "schema_notes": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human-readable notes about request payload compatibility.", - "title": "Schema Notes" - }, - "successor_model_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Successor Model Id" - }, - "sunset_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Sunset At" - }, - "supported_input_media": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Supported Input Media" - }, - "supported_languages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Supported Languages" - }, - "supported_output_media": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Supported Output Media" - }, - "supports_openai_arguments": { - "default": false, - "title": "Supports Openai Arguments", - "type": "boolean" - }, - "supports_streaming": { - "default": false, - "title": "Supports Streaming", - "type": "boolean" - }, - "supports_structured_output": { - "default": true, - "title": "Supports Structured Output", - "type": "boolean" - }, - "supports_thinking": { - "default": false, - "title": "Supports Thinking", - "type": "boolean" - }, - "supports_tool_use": { - "default": true, - "title": "Supports Tool Use", - "type": "boolean" - }, - "tools_disabled": { - "items": { - "$ref": "#/components/schemas/PromptToolResponse" - }, - "title": "Tools Disabled", - "type": "array" - }, - "tools_enabled": { - "items": { - "$ref": "#/components/schemas/PromptToolResponse" - }, - "title": "Tools Enabled", - "type": "array" - }, - "training_cutoff_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Training Cutoff At" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Url" - }, - "variants": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/VariantCategoryResponse" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Variants" - } - }, - "required": [ - "id", - "model_id", - "name", - "description", - "enabled", - "default", - "provider", - "max_context_tokens", - "max_output_tokens", - "max_conversation_length" - ], - "title": "PromptModelResponse", - "type": "object" - }, - "schemas__model_responses__ProviderGroupResponse": { - "description": "Response model for provider group with models", - "properties": { - "models": { - "items": { - "$ref": "#/components/schemas/schemas__model_responses__PromptModelResponse" - }, - "title": "Models", - "type": "array" - }, - "provider": { - "title": "Provider", - "type": "string" - } - }, - "required": [ - "provider", - "models" - ], - "title": "ProviderGroupResponse", - "type": "object" - }, - "schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse": { - "description": "Per-mode rollup for evaluation activity.", - "properties": { - "failed": { - "title": "Failed", - "type": "integer" - }, - "failure_rate": { - "title": "Failure Rate", - "type": "number" - }, - "flagged": { - "title": "Flagged", - "type": "integer" - }, - "mode": { - "title": "Mode", - "type": "string" - }, - "pass_rate": { - "title": "Pass Rate", - "type": "number" - }, - "passed": { - "title": "Passed", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "mode", - "total", - "passed", - "failed", - "flagged", - "pass_rate", - "failure_rate" - ], - "title": "NonManualEvaluationModeStatResponse", - "type": "object" - }, - "schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse": { - "description": "Account-level summary for evaluations.", - "properties": { - "by_mode": { - "items": { - "$ref": "#/components/schemas/schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse" - }, - "title": "By Mode", - "type": "array" - }, - "failed": { - "title": "Failed", - "type": "integer" - }, - "failure_rate": { - "title": "Failure Rate", - "type": "number" - }, - "flagged": { - "title": "Flagged", - "type": "integer" - }, - "pass_rate": { - "title": "Pass Rate", - "type": "number" - }, - "passed": { - "title": "Passed", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "total", - "passed", - "failed", - "flagged", - "pass_rate", - "failure_rate", - "by_mode" - ], - "title": "NonManualEvaluationSummaryResponse", - "type": "object" - } - }, - "securitySchemes": { - "ApiKeyAuth": { - "description": "API key issued from the Seclai dashboard.", - "in": "header", - "name": "X-API-Key", - "type": "apiKey" - }, - "BearerAuth": { - "bearerFormat": "JWT", - "description": "OAuth2 access token from AWS Cognito.", - "scheme": "bearer", - "type": "http" - } - } - }, - "info": { - "description": "Main API service for Seclai", - "title": "Seclai API", - "version": "local" - }, - "openapi": "3.1.0", - "paths": { - "/agents": { - "get": { - "description": "List agents for the account with pagination.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "list_agents_api_agents_get", - "parameters": [ - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List agents", - "tags": [ - "agents" - ] - }, - "post": { - "description": "Create a new agent.\n\nTrigger types:\n- `dynamic_input`: triggered via API with user-provided input\n- `template_input`: triggered via API with a predefined template\n- `schedule`: triggered on a schedule\n- `new_content`: triggered when new content arrives\n- `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`.\n\nTemplates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline`\n\nImporting an existing agent:\n- Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; items that don't resolve in this account are reported in the response's `import_warnings` array.\n- Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: target_uuid}` on this call to substitute them before save.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account.", - "operationId": "create_agent_api_agents_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__CreateAgentRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "402": { - "description": "Plan limit exceeded \u2014 the account has reached the maximum number of agents allowed by its subscription plan." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" - } - } - }, - "description": "The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`)." - } - }, - "summary": "Create an agent", - "tags": [ - "agents" - ] - } - }, - "/agents/agent-email-optouts": { - "get": { - "description": "List recipients who have opted out of this account's agent emails (filter to one agent via `agent_id`; account-wide opt-outs always apply). Paginated via `limit`/`offset`; returns the page plus the `total` count.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", - "operationId": "list_agent_email_optouts_api_api_agents_agent_email_optouts_get", - "parameters": [ - { - "description": "Filter to one agent (account-wide opt-outs still apply)", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to one agent (account-wide opt-outs still apply)", - "title": "Agent Id" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentEmailOptOutListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List agent-email opt-outs", - "tags": [ - "agents" - ] - } - }, - "/agents/agent-email-optouts/{optout_id}": { - "delete": { - "description": "Revoke an opt-out (opt the recipient back in to agent emails).\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the opt-out must belong to the key's account.", - "operationId": "remove_agent_email_optout_api_api_agents_agent_email_optouts__optout_id__delete", - "parameters": [ - { - "in": "path", - "name": "optout_id", - "required": true, - "schema": { - "title": "Optout Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Revoke an agent-email opt-out", - "tags": [ - "agents" - ] - } - }, - "/agents/blocked-email-senders": { - "get": { - "description": "List the account's blocked inbound email senders (newest first, paginated via `limit`/`offset`) plus the governance `auto_block_mode`.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", - "operationId": "list_blocked_email_senders_api_api_agents_blocked_email_senders_get", - "parameters": [ - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockedEmailSenderListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List blocked inbound email senders + the auto-block mode", - "tags": [ - "agents" - ] - }, - "post": { - "description": "Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is `address` (default) or `domain`).\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account.", - "operationId": "block_email_sender_api_api_agents_blocked_email_senders_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockEmailSenderRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockedEmailSenderResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Block an inbound email sender or domain", - "tags": [ - "agents" - ] - } - }, - "/agents/blocked-email-senders/mode": { - "put": { - "description": "Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the blocklist (`disabled`, `input`, or `input_and_output`); returns the updated list.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account.", - "operationId": "set_auto_block_mode_api_api_agents_blocked_email_senders_mode_put", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SetAutoBlockModeRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockedEmailSenderListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Set the governance auto-block mode", - "tags": [ - "agents" - ] - } - }, - "/agents/blocked-email-senders/{blocked_id}": { - "delete": { - "description": "Remove a blocked sender by id.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; the blocked sender must belong to the key's account.", - "operationId": "unblock_email_sender_api_api_agents_blocked_email_senders__blocked_id__delete", - "parameters": [ - { - "in": "path", - "name": "blocked_id", - "required": true, - "schema": { - "title": "Blocked Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Unblock an inbound email sender", - "tags": [ - "agents" - ] - } - }, - "/agents/evaluation-criteria/{criteria_id}": { - "delete": { - "description": "Delete an evaluation criteria and all associated evaluation results.\n\nThis action is permanent and cannot be undone. All historical result\nrecords tied to the criteria are removed as well.", - "operationId": "delete_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__delete", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Delete Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - }, - "get": { - "description": "Get a single evaluation criteria by ID.\n\nReturns the full criteria configuration including type-specific fields,\ncurrent enabled state, and a summary of recent evaluation results.", - "operationId": "get_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__get", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - }, - "patch": { - "description": "Update an evaluation criteria.\n\nAccepts a partial update \u2013 only the fields included in the request body\nare modified. Use this to toggle enabled/disabled, change the\nevaluation prompt, adjust retries, or rename the criteria.", - "operationId": "update_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__patch", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateEvaluationCriteriaRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Update Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/evaluation-criteria/{criteria_id}/compatible-runs": { - "get": { - "description": "List agent runs that have a completed step matching the criteria's target step.\n\nReturns runs whose step output can be used for testing or replaying the\nevaluation criteria. Results are ordered newest-first and paginated.", - "operationId": "list_compatible_runs_api_agents_evaluation_criteria__criteria_id__compatible_runs_get", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "in": "query", - "name": "started_after", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Started After" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompatibleRunListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List Compatible Runs", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/evaluation-criteria/{criteria_id}/results": { - "get": { - "description": "List evaluation results for a criteria with optional filtering.\n\nSupports filtering by status (pending, passed, failed, skipped, error),\nflagged-only mode, and an optional time range. Results are paginated\nwith configurable page size.", - "operationId": "list_evaluation_results_api_agents_evaluation_criteria__criteria_id__results_get", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Status" - } - }, - { - "in": "query", - "name": "flagged_only", - "required": false, - "schema": { - "default": false, - "title": "Flagged Only", - "type": "boolean" - } - }, - { - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time From" - } - }, - { - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time To" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationResultListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List Evaluation Results", - "tags": [ - "agent-evaluations" - ] - }, - "post": { - "description": "Record an evaluation result for a criteria.\n\nUse this endpoint to push results from external test harnesses, CI/CD\npipelines, or custom evaluation logic. Each result is linked to an\nagent run and optionally a specific step run.", - "operationId": "create_evaluation_result_api_agents_evaluation_criteria__criteria_id__results_post", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateEvaluationResultRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationResultResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Create Evaluation Result", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/evaluation-criteria/{criteria_id}/summary": { - "get": { - "description": "Get an aggregated summary of evaluation results for a criteria.\n\nReturns total, passed, failed, error, and flagged counts alongside the\naverage score, giving a quick overview of how the criteria is performing.", - "operationId": "get_evaluation_summary_api_agents_evaluation_criteria__criteria_id__summary_get", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationResultSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get Evaluation Summary", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/evaluation-results/non-manual-summary": { - "get": { - "description": "Get an evaluation summary for API key clients.\n\nReturns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, sample_and_flag).\n\nThe ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset\n(opt in via the ``Seclai-Version`` header). Clients on the legacy baseline\nalways receive the account-wide rollup; ``agent_id`` is ignored for them so\nthe endpoint's behavior is frozen. With ``2026-07-27`` or later, the summary\nis scoped to ``agent_id`` when supplied (and returns 404 if it doesn't exist).", - "operationId": "get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get", - "parameters": [ - { - "description": "Scope the summary to a single agent. Omit for account-wide.", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Scope the summary to a single agent. Omit for account-wide.", - "title": "Agent Id" - } - }, - { - "in": "query", - "name": "days", - "required": false, - "schema": { - "default": 30, - "maximum": 730, - "minimum": 1, - "title": "Days", - "type": "integer" - } - }, - { - "in": "query", - "name": "start_date", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Start Date" - } - }, - { - "in": "query", - "name": "end_date", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "End Date" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get Non Manual Evaluation Summary", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/inbound-email-rejections": { - "get": { - "description": "List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, unknown alias, spam/virus, flood-shed) for this account's agents.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", - "operationId": "list_inbound_email_rejections_api_api_agents_inbound_email_rejections_get", - "parameters": [ - { - "description": "Filter to a single agent's rejections", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to a single agent's rejections", - "title": "Agent Id" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/InboundEmailRejectionResponse" - }, - "title": "Response List Inbound Email Rejections Api Api Agents Inbound Email Rejections Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List discarded inbound emails", - "tags": [ - "agents" - ] - } - }, - "/agents/inbound-email-status": { - "get": { - "description": "Whether the account-wide overload circuit breaker has currently paused new inbound email (all inbound turned away until the queued backlog drains), plus the size of the QUEUED (over-quota parked) run backlog.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", - "operationId": "get_inbound_email_status_api_api_agents_inbound_email_status_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InboundEmailStatusResponse" - } - } - }, - "description": "Successful Response" - } - }, - "summary": "Account inbound-email overload status", - "tags": [ - "agents" - ] - } - }, - "/agents/inbound-email-status/cancel-queued": { - "post": { - "description": "Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run consumed no quota or credits at queue time, so this merely fails them. Returns the count cancelled.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account.", - "operationId": "cancel_queued_email_runs_api_api_agents_inbound_email_status_cancel_queued_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CancelQueuedRunsResponse" - } - } - }, - "description": "Successful Response" - } - }, - "summary": "Cancel all queued inbound-email runs", - "tags": [ - "agents" - ] - } - }, - "/agents/inbound-email-status/resume": { - "post": { - "description": "Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the breaker re-arms on the next evaluation \u2014 this is a one-shot override, not a permanent disable.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account.", - "operationId": "resume_inbound_email_api_api_agents_inbound_email_status_resume_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResumeInboundResponse" - } - } - }, - "description": "Successful Response" - } - }, - "summary": "Manually resume paused inbound email", - "tags": [ - "agents" - ] - } - }, - "/agents/preview-import": { - "post": { - "description": "Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) without creating or modifying any agent. On success returns a summary the client can show before commit (counts of steps, schedules, alert configs, evaluation criteria, governance policies). On failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can render line/column-anchored errors.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. No DB writes.", - "operationId": "preview_import_agent_api_agents_preview_import_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentImportPreviewRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentImportPreviewResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" - } - } - }, - "description": "The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`)." - } - }, - "summary": "Preview an agent_definition import", - "tags": [ - "agents" - ] - } - }, - "/agents/runs/search": { - "post": { - "description": "Search agent traces using semantic similarity.\n\nFinds step-run outputs that are most semantically similar to the query.\nResults include the matching text, agent/step metadata, and a similarity score.\n\nAgent traces are automatically indexed when runs complete. The first 7 days of storage are free; extended retention is billed.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Searches only within your account's traces.", - "operationId": "search_agent_runs_api_agents_runs_search_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentTraceSearchRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentTraceSearchResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Search agent traces", - "tags": [ - "agents" - ] - } - }, - "/agents/runs/{run_id}": { - "delete": { - "description": "Cancel an in-flight (`processing`) or queued (`queued`) agent run.\n\nA `queued` run is an inbound-email run parked by the per-plan rate quota that has not yet been dispatched; cancelling it consumes no quota or credits.\n\nIf the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only cancel runs belonging to your account.", - "operationId": "delete_agent_run_api_agents_runs__run_id__delete", - "parameters": [ - { - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "title": "Run Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Cancel an agent run", - "tags": [ - "agents" - ] - }, - "get": { - "description": "Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST /agents/{agent_id}/runs/stream`.\n\nThe response includes `status`, `error_count`, and `output` once the run completes. Use `include_step_outputs=true` to include per-step outputs, timing, durations, and credits.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access runs belonging to your account.", - "operationId": "get_agent_run_api_agents_runs__run_id__get", - "parameters": [ - { - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "title": "Run Id", - "type": "string" - } - }, - { - "description": "If true, include per-step outputs with timing, durations, and credits.", - "in": "query", - "name": "include_step_outputs", - "required": false, - "schema": { - "default": false, - "description": "If true, include per-step outputs with timing, durations, and credits.", - "title": "Include Step Outputs", - "type": "boolean" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get an agent run", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}": { - "delete": { - "description": "Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only delete agents belonging to your account.", - "operationId": "delete_agent_api_agents__agent_id__delete", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Delete an agent", - "tags": [ - "agents" - ] - }, - "get": { - "description": "Fetch an agent's metadata (name, description, trigger type, timestamps).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account.", - "operationId": "get_agent_metadata_api_agents__agent_id__get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get an agent", - "tags": [ - "agents" - ] - }, - "put": { - "description": "Update an agent's name, description, evaluation settings, and model lifecycle settings.\n\nEvaluation settings: `evaluation_mode` ('output_expectation', 'eval_and_retry', 'sample_and_flag'), `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `max_retries`, `retry_on_failure`, `sampling_config`.\n\nModel lifecycle settings: `prompt_model_auto_upgrade_strategy` ('none', 'early_adopter', 'middle_of_road', 'cautious_adopter'), `prompt_model_auto_rollback_enabled`, `prompt_model_auto_rollback_triggers` (list of 'agent_eval_fail', 'governance_flag', 'governance_block', 'agent_run_failed').\n\nReplacing the workflow from an export:\n- Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. Update only touches the workflow + agent metadata \u2014 alert_configs, evaluation_criteria, governance_policies, schedules, and solution links from the imported file are NOT applied (use the dedicated endpoints for those, or `POST /agents` to import as a new agent).\n- `entity_remap: {source_uuid: target_uuid}` substitutes workflow entity refs before save (same shape as `POST /agents`).\n\nAt least one field must be provided.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account.", - "operationId": "update_agent_api_agents__agent_id__put", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__UpdateAgentRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" - } - } - }, - "description": "The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`)." - } - }, - "summary": "Update agent metadata", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/ai-assistant/conversations": { - "get": { - "description": "Fetch the AI assistant conversation history for a specific step of an agent.\n\nReturns past conversation turns (user inputs, AI responses, accept/decline status) ordered oldest first. Use `step_type` to filter by step type, and optionally `step_id` to narrow to a specific step instance.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be queried.", - "operationId": "get_ai_conversation_history_api_agents__agent_id__ai_assistant_conversations_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "description": "Step type to look up.", - "in": "query", - "name": "step_type", - "required": true, - "schema": { - "description": "Step type to look up.", - "title": "Step Type", - "type": "string" - } - }, - { - "description": "Step ID to filter by.", - "in": "query", - "name": "step_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step ID to filter by.", - "title": "Step Id" - } - }, - { - "description": "Max turns to return.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 10, - "description": "Max turns to return.", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Number of recent turns to skip.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Number of recent turns to skip.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiConversationHistoryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get AI conversation history", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/ai-assistant/generate-steps": { - "post": { - "description": "Use the AI assistant to generate a full agent step workflow from a natural language description.\n\nProvide a description of what the agent should do, along with optional context (current steps, trigger type). The AI produces a complete set of agent steps.\nUse mode 'generate_full' for new workflows or 'modify_workflow' to refine existing ones.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be used.", - "operationId": "generate_agent_steps_api_agents__agent_id__ai_assistant_generate_steps_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateAgentStepsRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateAgentStepsResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Generate agent workflow", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/ai-assistant/step-config": { - "post": { - "description": "Use the AI assistant to generate or refine a single step's configuration.\n\nProvide the step type, a natural language instruction, and optionally the current configuration. The AI will produce a proposed configuration along with an explanation. The suggestion is stored as a conversation turn that can be accepted or declined separately via the mark endpoint.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be used.", - "operationId": "generate_step_config_api_agents__agent_id__ai_assistant_step_config_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateStepConfigRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateStepConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Generate step configuration", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/ai-assistant/{conversation_id}": { - "patch": { - "description": "Accept or decline a proposed AI assistant configuration for a conversation turn.\n\nThis only updates the tracking status on the conversation record. To actually apply the proposed configuration, use the agent definition update endpoint separately.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The conversation must belong to one of your agents.", - "operationId": "mark_ai_suggestion_api_agents__agent_id__ai_assistant__conversation_id__patch", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MarkAiSuggestionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OkResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Accept or decline suggestion", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/attachment-references": { - "get": { - "description": "Return the static attachment-reference contract for an agent \u2014 what files the agent's definition expects on a run.\n\nCall this BEFORE staging uploads so you know whether the agent accepts files at all (``requires_uploads``), and which specific filenames/indexes/patterns the templates reference. Mismatched batches are rejected at run time with HTTP 400.", - "operationId": "api_get_agent_attachment_references_api_agents__agent_id__attachment_references_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentAttachmentRefsApiResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get agent attachment-reference contract", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/callers": { - "get": { - "description": "List the live agents that call this agent via a `call_agent` step. They must be disabled before this agent can be paused.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the agent must belong to the key's account.", - "operationId": "get_agent_callers_api_api_agents__agent_id__callers_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/AgentCallerApiResponse" - }, - "title": "Response Get Agent Callers Api Api Agents Agent Id Callers Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List agents that call this agent", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/definition": { - "get": { - "description": "Fetch the current agent definition from the main branch.\n\nThe response includes `change_id` which must be provided when updating the definition (optimistic locking).\n\nThe definition contains the agent's step workflow. Available step types:\n- `prompt_call`: Call an LLM with a prompt template\n- `retrieval`: Search a knowledge base\n- `regex_replace`: Reshape text via ordered regex find/replace rules\n- `gate`: Evaluate conditions, stop or continue child execution\n- `retry`: Re-execute from a target ancestor step (for quality-control loops; pair with a `gate` step for conditional retrying. Fields: `target_step_id` (ancestor step ID), `max_retries` (1\u201310))\n- `evaluate_step`: Score a selected previous step output and emit JSON with `score`, `passed`, and `pass_threshold` (fields: `target_step_id`, `evaluation_prompt`, `pass_threshold`, optional `evaluation_tier`, optional `expectation_config`)\n- `extract_data`: Progressively read and analyze large input\n- `extract_content`: Extract structured data (JSON, HTML, XML)\n- `add_chat_turn` / `load_chat_history`: Record a turn or load running history from a conversation memory bank\n- `add_memory` / `search_memory` / `load_memory`: Write, semantic-search, or load entries on a general memory bank\n- `send_email`: Send email with step output\n- `webhook_call`: POST data to an external URL\n- `write_aws_s3_object`: Write output to S3\n- `call_agent`: Invoke another agent\n- `write_metadata`: Write a value to content metadata (for filtering/gates; content-triggered agents only. Fields: `metadata_key`, `content`)\n- `write_content_attachment`: Write a file-backed attachment to content (optionally indexed for retrieval; content-triggered agents only. Fields: `attachment_key`, `content`, `content_type`, `indexed`)\n- `load_content_attachment`: Load a previously written attachment (content-triggered agents only. Fields: `attachment_key`)\n- `load_content`: Load the full text body of a source document (typically used with content-triggered agents; can also load by explicit `content_version_id`. Fields: `content_version_id` optional)\n- `streaming_result`: Stream LLM tokens in real-time via SSE (must be a direct child of `prompt_call`; requires `dynamic_input` or `template_input` trigger; `priority: true` enables real-time streaming)\n- `display_result`: Show output to the user\n- `join`: Merge parallel branches\n- `merge`: Combine multiple inputs into a single templated output\n- `text`: Static text literal\n- `for_each`: Iterate a body over a list of items (body lives in `body[]`)\n- `if_else`: Conditional dispatch. Evaluates `conditions` (same shape as `gate`) and runs `then_steps` on match, otherwise the optional `else_steps`. The chosen branch's output flows to the if_else step's own `child_steps` (post-branch continuation chain). **`display_result` and `streaming_result` are not allowed inside `then_steps` / `else_steps`** \u2014 end each branch with a content-producing step (e.g. `text`, `prompt_call`) and place the single `display_result` in `child_steps`.\n- `switch`: Single-discriminator dispatch. Renders `discriminator` (default `{{input}}`) and routes to the first matching `cases[]` entry (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when nothing matches. The chosen case's output flows to the switch step's own `child_steps`. **`display_result` and `streaming_result` are not allowed inside `cases[].steps` or `else_steps`** \u2014 end each case with a content-producing step and place the single `display_result` in `child_steps`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account.", - "operationId": "get_agent_definition_api_agents__agent_id__definition_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get agent definition", - "tags": [ - "agents" - ] - }, - "put": { - "description": "Update the agent's definition on the main branch.\n\nUses **optimistic locking**: provide `expected_change_id` from the last `GET /agents/{agent_id}/definition`. Returns `409 Conflict` if the definition was modified since your last read.\n\nThe definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, `regex_replace`, `gate`, `retry`, `evaluate_step`, `extract_data`, `extract_content`, `add_chat_turn`, `load_chat_history`, `add_memory`, `search_memory`, `load_memory`, `streaming_result`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, `display_result`, `join`, `merge`, `text`, `for_each`, `if_else`, and `switch`. Non-composite step types (`display_result`, `join`, `retry`, `streaming_result`) cannot contain child steps.\n\n**Retry steps** re-execute from a target ancestor step for quality-control loops. Configure with `target_step_id` (ancestor step ID) and `max_retries` (1\u201310). Best practice: place a `gate` step before the retry to make retries conditional.\n\n**if_else** runs `then_steps` when its `conditions` (same shape as `gate`) match, otherwise its optional `else_steps`. Either branch's output flows to the if_else step's own `child_steps` (the post-branch continuation chain).\n\n**switch** dispatches on a `discriminator` template (default `{{input}}`) to the first matching case (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when no case matches. Cases own their own `steps` subtrees; the chosen branch's output flows to the switch step's own `child_steps`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account.", - "operationId": "update_agent_definition_api_agents__agent_id__definition_put", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateAgentDefinitionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Update agent definition", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/disable": { - "post": { - "description": "Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is turned away, scheduled/content triggers are skipped).\n\nReturns **409** with the blocking callers when other live agents still call this one via a `call_agent` step \u2014 disable those first.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user is recorded); the agent must belong to the key's account.", - "operationId": "disable_agent_api_api_agents__agent_id__disable_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Pause (disable) an agent", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/enable": { - "post": { - "description": "Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by the inbound-email overload safeguard).\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user is recorded); the agent must belong to the key's account.", - "operationId": "enable_agent_api_api_agents__agent_id__enable_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Resume (enable) a paused agent", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/evaluation-criteria": { - "get": { - "description": "List evaluation criteria configured for an agent.\n\nResponse shape is version-gated by the ``Seclai-Version`` header:\n\n- **Default / legacy** (no header, or a date before ``2026-07-27``): a bare\n JSON array of criteria (unpaginated \u2014 every criterion for the agent).\n- **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated\n envelope ``{data, pagination: {page, limit, total, pages, has_next,\n has_prev}}``.\n\nEach criterion carries its type, configuration, and a summary of results\n(pass / fail counts). Criteria can be filtered client-side by type or\nenabled status.", - "operationId": "list_evaluation_criteria_api_agents__agent_id__evaluation_criteria_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - }, - "title": "Response List Evaluation Criteria Api Agents Agent Id Evaluation Criteria Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - }, - "post": { - "description": "Create new step evaluation settings for an agent.\n\nThe evaluation mode, retry settings, and sample frequency are inherited\nfrom the agent and stored on the criteria row for historical reference.", - "operationId": "create_evaluation_criteria_api_agents__agent_id__evaluation_criteria_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateEvaluationCriteriaRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Create Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/evaluation-criteria/test-draft": { - "post": { - "description": "Run an ephemeral evaluation against provided step output without persisting results.\n\nUse this to interactively test evaluation prompts and expectation\nconfigurations while editing criteria. No credits are consumed because\nthe result is not recorded.", - "operationId": "test_draft_evaluation_api_agents__agent_id__evaluation_criteria_test_draft_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestDraftEvaluationRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestDraftEvaluationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Test Draft Evaluation", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/evaluation-results": { - "get": { - "description": "List evaluation results across all criteria configured on an agent.\n\nReturns a paginated list of evaluation results with optional filtering by status, criteria, and date range. Results include score, pass/fail status, and details.", - "operationId": "list_agent_evaluation_results_api_agents__agent_id__evaluation_results_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Status" - } - }, - { - "in": "query", - "name": "step", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step" - } - }, - { - "in": "query", - "name": "flagged_only", - "required": false, - "schema": { - "default": false, - "title": "Flagged Only", - "type": "boolean" - } - }, - { - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time From" - } - }, - { - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time To" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationResultWithCriteriaListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List Agent Evaluation Results", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/evaluation-runs": { - "get": { - "description": "List evaluation results grouped by agent run.\n\nReturns paginated per-run summaries with pass/fail counts and optional\nfiltering by evaluation outcome, step, or date range.", - "operationId": "list_evaluation_runs_api_agents__agent_id__evaluation_runs_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Status" - } - }, - { - "in": "query", - "name": "step", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step" - } - }, - { - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time From" - } - }, - { - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time To" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationRunSummaryListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List Evaluation Runs", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/export": { - "get": { - "description": "Export an agent definition as a portable JSON snapshot.\n\nThe response contains the full definition, trigger configuration with schedules, alert configs, evaluation criteria, agent-scoped governance policies, and a resolved dependency manifest that maps every referenced external entity UUID to its human-readable name.\n\nResponse shape:\n- `export_version`: schema version (currently `\"2\"`)\n- `exported_at`: ISO-8601 timestamp\n- `agent`: name, description, schema_version, definition, timestamps\n- `trigger`: trigger type, input template, schedules\n- `alert_configs`: alert type, thresholds, recipients\n- `evaluation_criteria`: evaluation settings per step\n- `governance_policies`: agent-scoped governance policies\n- `dependencies`: knowledge_bases, memory_banks, source_connections, agents, users\n\nQuery params:\n- `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the response as a file download.\n\nAuth & scoping:\n- Requires `X-API-Key`. You can only export agents belonging to your account.", - "operationId": "export_agent_api_agents__agent_id__export_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "description": "Return as file download", - "in": "query", - "name": "download", - "required": false, - "schema": { - "default": true, - "description": "Return as file download", - "title": "Download", - "type": "boolean" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentExportResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Export agent definition", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/input-uploads/{upload_id}": { - "get": { - "description": "Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`.\n\nPossible `status` values: `processing`, `ready`, `failed`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "api_get_agent_input_upload_status_api_agents__agent_id__input_uploads__upload_id__get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "upload_id", - "required": true, - "schema": { - "title": "Upload Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UploadAgentInputApiResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get upload status", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/runs": { - "get": { - "description": "List runs for a specific agent (most recent first), with pagination.\n\nTypical use cases:\n- Build a traces UI for an agent.\n- Debug recent executions and inspect terminal statuses.\n\nNotes:\n- This endpoint returns a summary list. Fetch full details with `GET /agents/runs/{run_id}`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only list runs for agents in your account.", - "operationId": "list_agent_runs_api_agents__agent_id__runs_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Filter runs by status", - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus" - }, - { - "type": "null" - } - ], - "description": "Filter runs by status", - "title": "Status" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentRunListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List agent runs", - "tags": [ - "agents" - ] - }, - "post": { - "description": "Start an agent run.\n\nAn *agent* is an automated workflow that can monitor content from your sources, process it with AI, and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve status and output.\n\nWhen to use:\n- Use this endpoint for request/response style integrations where polling is acceptable.\n- Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE.\n\nKey fields:\n- `input`: text input for agents with a `dynamic_input` trigger.\n- `input_upload_id`: alternatively, reference a file previously uploaded via `POST /agents/{agent_id}/upload-input` (mutually exclusive with `input`).\n- `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but without live token streaming.\n- `metadata`: a JSON object that becomes available to agent steps for string substitution.\n\nAfter starting:\n- Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`.\n- Use `include_step_outputs=true` to include per-step outputs, timing, and credits.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "run_agent_api_agents__agent_id__runs_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunResponse" - } - } - }, - "description": "Successful Response" - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InsufficientCreditsResponse" - } - } - }, - "description": "Insufficient credits \u2014 the account has exhausted its credits." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Run an agent", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/runs/stream": { - "post": { - "description": "Start a **priority** agent run and stream run events using Server-Sent Events (SSE).\n\nThis is the best option for interactive UIs where you want progress updates as the run executes.\n\nHow it works:\n- The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`.\n- Subsequent events are forwarded from the run event stream (status changes, step events, etc).\n- If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion.\n- The final `done` event contains the terminal snapshot (including `output` and `credits` when available).\n\nInput options (for `dynamic_input` triggers):\n- `input`: text input passed directly.\n- `input_upload_id`: reference a file uploaded via `POST /agents/{agent_id}/upload-input` (mutually exclusive with `input`).\n\nClient guidance:\n- Keep the connection open and handle keepalive comments.\n- On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET /agents/runs/{run_id}`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "run_streaming_agent_api_agents__agent_id__runs_stream_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunStreamRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": {} - }, - "text/event-stream": { - "example": ": keepalive\n\nevent: init\ndata: {\"run_id\":\"...\",\"status\":\"pending\",\"error_count\":0,\"credits\":0.0,\"priority\":true,\"input\":\"...\",\"output\":null,\"attempts\":[]}\n\nevent: done\ndata: {\"run_id\":\"...\",\"status\":\"completed\",\"error_count\":0,\"credits\":0.0,\"priority\":true,\"input\":\"...\",\"output\":\"...\",\"attempts\":[]}\n\n", - "schema": { - "type": "string" - } - } - }, - "description": "Streams agent run events via Server-Sent Events (SSE); run is always created as priority.\n\nSSE events:\n- `event: init` \u2014 `data` is an `AgentRunResponse` snapshot (includes `run_id`).\n- `event: done` \u2014 `data` is the final `AgentRunResponse` snapshot (includes `output`, `credits`, etc).\n- Other events (e.g. `status`, step events) are forwarded from the run event stream.\n- On `timeout` / `error`, the payload includes `run_id` so clients can fetch status via `GET /agents/runs/{run_id}`." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InsufficientCreditsResponse" - } - } - }, - "description": "Insufficient credits \u2014 the account has exhausted its credits." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Run an agent (stream events)", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/runs/{run_id}/evaluation-results": { - "get": { - "description": "List evaluation results recorded for a specific agent run.\n\nResponse shape is version-gated by the ``Seclai-Version`` header:\n\n- **Default / legacy** (no header, or a date before ``2026-07-27``): a bare\n JSON array of results (unpaginated \u2014 every result for the run).\n- **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated\n envelope ``{data, pagination: {page, limit, total, pages, has_next,\n has_prev}}``.\n\nResults span all evaluation criteria for the given run, useful for getting a\ncomplete quality snapshot of a single execution.", - "operationId": "list_run_evaluation_results_api_agents__agent_id__runs__run_id__evaluation_results_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "title": "Run Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/EvaluationResultWithCriteriaResponse" - }, - "title": "Response List Run Evaluation Results Api Agents Agent Id Runs Run Id Evaluation Results Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List Run Evaluation Results", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/triggers/{trigger_id}/email-config": { - "put": { - "description": "Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, `require_sender_auth`, `queue_on_quota`) on an agent's EMAIL_RECEIVED trigger, and return its computed email address(es). Omitted fields are left unchanged.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account.", - "operationId": "set_email_trigger_config_api_api_agents__agent_id__triggers__trigger_id__email_config_put", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "trigger_id", - "required": true, - "schema": { - "title": "Trigger Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__SetEmailTriggerConfigRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailTriggerConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Configure an EMAIL_RECEIVED trigger", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/upload-input": { - "post": { - "description": "Upload a file to use as input for a `dynamic_input` agent run.\n\nSupports the same file types as content source uploads: text, PDF, DOCX, audio, video, images, etc. Text and document files are processed synchronously; audio/video are submitted for asynchronous transcription.\n\n**Size limit:** 200 MB per file.\n\n**Supported extensions:** txt, html, md, csv, xml, json, pdf, msg, docx, doc, pptx, ppt, xlsx, xls, zip, epub, png, jpg, gif, bmp, tiff, webp, mp3, wav, m4a, flac, ogg, mp4, mov, avi.\n\nAfter uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, then pass `input_upload_id` to `POST /agents/{agent_id}/runs`.\n\n**Multi-modal routing:** non-text uploads (image, audio, video, PDF) are surfaced natively to multi-modal-capable prompt steps; text-only models fall back to the OCR / transcript text counterpart. Audio originals are preserved past transcription so audio-capable models (Gemini 2.5/3, GPT-5 audio) read them directly; the agent-input-binary janitor sweeps originals once they pass your account's agent-trace retention (the agent-traces source's retention period; free default 7 days).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "api_upload_agent_input_api_agents__agent_id__upload_input_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UploadAgentInputApiResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Upload file input", - "tags": [ - "agents" - ] - } - }, - "/ai-assistant/feedback": { - "post": { - "description": "Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is analyzed for concerning issues.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_feedback_api_ai_assistant_feedback_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__ai_assistant__AiAssistantFeedbackRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantFeedbackResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Submit AI assistant feedback", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/knowledge-base": { - "post": { - "description": "Generate a knowledge base creation/modification plan without requiring an existing solution. May also propose prerequisite source creation actions.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_knowledge_base_api_ai_assistant_knowledge_base_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Generate a knowledge base plan (standalone)", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/memory-bank": { - "post": { - "description": "Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, mode, compaction prompt, and retention settings.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_memory_bank_api_ai_assistant_memory_bank_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAiAssistantRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankAiAssistantResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Generate a memory bank configuration (standalone)", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/memory-bank/last-conversation": { - "get": { - "description": "Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. Returns turns in oldest-first order with a total count for pagination via limit/offset query parameters.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_memory_bank_history_api_ai_assistant_memory_bank_last_conversation_get", - "parameters": [ - { - "description": "Max turns.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 5, - "description": "Max turns.", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Skip count.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Skip count.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankLastConversationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Fetch memory bank AI conversation history", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/memory-bank/{conversation_id}": { - "patch": { - "description": "Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to true to accept the proposed configuration, or false to decline it. The accepted status is recorded for audit purposes.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_memory_bank_accept_api_ai_assistant_memory_bank__conversation_id__patch", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAcceptRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OkResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Accept or decline a memory bank AI suggestion", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/solution": { - "post": { - "description": "Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an existing solution. Supports SSE streaming when ``Accept: text/event-stream`` is set.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_solution_api_ai_assistant_solution_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Generate a solution plan (standalone)", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/source": { - "post": { - "description": "Generate a content source creation/modification plan without requiring an existing solution. The AI proposes actions for the user to review before any changes are made.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_source_api_ai_assistant_source_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Generate a source plan (standalone)", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/{conversation_id}/accept": { - "post": { - "description": "Accept and execute a previously proposed standalone plan. If the plan contains destructive actions (deletions), ``confirm_deletions`` must be set to true.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_accept_api_ai_assistant__conversation_id__accept_post", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantAcceptRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantAcceptResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Accept and execute a standalone plan", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/{conversation_id}/decline": { - "post": { - "description": "Decline a previously proposed standalone plan. No resources are modified. The conversation is marked as declined.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_decline_api_ai_assistant__conversation_id__decline_post", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Decline a standalone plan", - "tags": [ - "ai-assistant" - ] - } - }, - "/alerts": { - "get": { - "description": "List alerts for the account with optional filters.\n\nFilters:\n- `status`: triggered, acknowledged, resolved, dismissed\n- `agent_id`: filter by agent\n- `source_connection_id`: filter by source\n- `time_from` / `time_to`: ISO 8601 date range\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account.", - "operationId": "list_alerts_api_alerts_get", - "parameters": [ - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Filter by alert status", - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by alert status", - "title": "Status" - } - }, - { - "description": "Filter by agent ID", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by agent ID", - "title": "Agent Id" - } - }, - { - "description": "Filter by source connection ID", - "in": "query", - "name": "source_connection_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by source connection ID", - "title": "Source Connection Id" - } - }, - { - "description": "From (ISO 8601)", - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "From (ISO 8601)", - "title": "Time From" - } - }, - { - "description": "To (ISO 8601)", - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "To (ISO 8601)", - "title": "Time To" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List alerts", - "tags": [ - "alerts" - ] - } - }, - "/alerts/configs": { - "get": { - "description": "List alert configurations.\n\nFilters:\n- `agent_id`: list configs for a specific agent\n- `source_connection_id`: list configs for a specific source\n- Neither: list account-level agent alert configs\n- `scope=source`: list account-level source alert configs\n\nCredits alerts (`credits_low_threshold`, `credits_runout_prediction`, `credits_usage_spike`) are account-level alert configs. They are evaluated by the credits alert sweep and default-enabled configs may be auto-created for active accounts at runtime.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "list_alert_configs_api_alerts_configs_get", - "parameters": [ - { - "description": "Filter by agent ID", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by agent ID", - "title": "Agent Id" - } - }, - { - "description": "Filter by source connection ID", - "in": "query", - "name": "source_connection_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by source connection ID", - "title": "Source Connection Id" - } - }, - { - "description": "Set to 'source' to list account-level source alert configs", - "in": "query", - "name": "scope", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Set to 'source' to list account-level source alert configs", - "title": "Scope" - } - }, - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertConfigListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List alert configs", - "tags": [ - "alerts" - ] - }, - "post": { - "description": "Create a new alert configuration.\n\nAgent alert types: run_failed, consecutive_failures, error_rate_spike, run_burst, slow_run, credits_low_threshold, credits_runout_prediction, credits_usage_spike, non_manual_eval_failed, non_manual_eval_flagged, governance_flagged, governance_blocked, model_newer_available, model_deprecated, model_sunset.\nSource alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike.\n\nDistribution types: owner, owner_admins, selected_members. Organization accounts are normalized to owner_admins.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "create_alert_config_api_alerts_configs_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateAlertConfigRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Create alert config", - "tags": [ - "alerts" - ] - } - }, - "/alerts/configs/{config_id}": { - "delete": { - "description": "Delete an alert configuration. This permanently removes the config and stops any future alerts of this type from being triggered.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "delete_alert_config_api_alerts_configs__config_id__delete", - "parameters": [ - { - "in": "path", - "name": "config_id", - "required": true, - "schema": { - "title": "Config Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Delete alert config", - "tags": [ - "alerts" - ] - }, - "get": { - "description": "Get a specific alert configuration by ID.\n\nReturns all fields including type, enabled state, threshold, cooldown, distribution type, and recipient list.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_alert_config_api_alerts_configs__config_id__get", - "parameters": [ - { - "in": "path", - "name": "config_id", - "required": true, - "schema": { - "title": "Config Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get alert config", - "tags": [ - "alerts" - ] - }, - "patch": { - "description": "Update an alert configuration. Only provided fields are updated.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "update_alert_config_api_alerts_configs__config_id__patch", - "parameters": [ - { - "in": "path", - "name": "config_id", - "required": true, - "schema": { - "title": "Config Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateAlertConfigRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Update alert config", - "tags": [ - "alerts" - ] - } - }, - "/alerts/organization-preferences/list": { - "get": { - "description": "List per-organization alert delivery preferences for the authenticated user.\n\nBy default, only explicit override rows are returned. Set `include_defaults=true` to return the effective subscribed state for every alert type in every organization the user can manage.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- Only organizations where the user is an owner or administrator are included.", - "operationId": "list_organization_preferences_api_alerts_organization_preferences_list_get", - "parameters": [ - { - "description": "Optional organization filter", - "in": "query", - "name": "organization_id", - "required": false, - "schema": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional organization filter", - "title": "Organization Id" - } - }, - { - "description": "Include default subscribed entries for all alert types", - "in": "query", - "name": "include_defaults", - "required": false, - "schema": { - "default": false, - "description": "Include default subscribed entries for all alert types", - "title": "Include Defaults", - "type": "boolean" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OrganizationAlertPreferenceListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List organization alert delivery preferences", - "tags": [ - "alerts" - ] - } - }, - "/alerts/organization-preferences/{organization_id}/{alert_type}": { - "patch": { - "description": "Update the authenticated user's personal delivery preference for one alert type in one organization.\n\nSetting `subscribed=false` stores an explicit opt-out override. Setting `subscribed=true` removes the override and restores the default subscribed behavior.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- Only owners and administrators can update preferences for an organization.", - "operationId": "update_organization_preference_api_alerts_organization_preferences__organization_id___alert_type__patch", - "parameters": [ - { - "in": "path", - "name": "organization_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Organization Id", - "type": "string" - } - }, - { - "in": "path", - "name": "alert_type", - "required": true, - "schema": { - "title": "Alert Type", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__UpdateOrganizationAlertPreferenceRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__OrganizationAlertPreferenceResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Update organization alert delivery preference", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}": { - "get": { - "description": "Get full alert detail including history, comments, and subscribers.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_alert_detail_api_alerts__alert_id__get", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get alert detail", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}/comments": { - "post": { - "description": "Add a comment to an alert. Comments are visible to all subscribers and are included in the alert detail response.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "add_alert_comment_api_alerts__alert_id__comments_post", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AddCommentRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Add alert comment", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}/status": { - "post": { - "description": "Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "change_alert_status_api_alerts__alert_id__status_post", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChangeStatusRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Change alert status", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}/subscribe": { - "post": { - "description": "Subscribe the current user to an alert. Subscribed users receive email notifications when the alert status changes or new comments are added.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "subscribe_to_alert_api_alerts__alert_id__subscribe_post", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Subscribe to alert", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}/unsubscribe": { - "post": { - "description": "Unsubscribe the current user from an alert. The user will no longer receive email notifications for status changes or new comments on this alert.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "unsubscribe_from_alert_api_alerts__alert_id__unsubscribe_post", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Unsubscribe from alert", - "tags": [ - "alerts" - ] - } - }, - "/contents/{source_connection_content_version}": { - "delete": { - "description": "Delete a content item (a `SourceConnectionContentVersion`).\n\nUse this to remove an uploaded or indexed item from your account. Deleting content can affect agents and knowledge base workflows that reference this item.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your account.", - "operationId": "delete_content_api_contents__source_connection_content_version__delete", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Delete content", - "tags": [ - "contents" - ] - }, - "get": { - "description": "Get detailed information about a specific content item (a `SourceConnectionContentVersion`).\n\nThis is useful when you want to:\n- Inspect the extracted text for debugging or review.\n- Display content details in a UI.\n\nText range:\n- `start` and `end` control the character range returned in `text_content` so clients can page through large documents.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account.", - "operationId": "get_content_detail_api_contents__source_connection_content_version__get", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "in": "query", - "name": "start", - "required": false, - "schema": { - "default": 0, - "title": "Start", - "type": "integer" - } - }, - { - "in": "query", - "name": "end", - "required": false, - "schema": { - "default": 5000, - "title": "End", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__ContentDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get content details", - "tags": [ - "contents" - ] - }, - "put": { - "description": "Replace a content version using a small inline text payload.\n\n**Maximum payload size:** 8192 bytes (UTF-8).\n\n**Supported content types:**\n- `application/json`\n- `application/xml`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n\nNotes:\n- Use this endpoint for small text payloads; larger files should use `/upload`.\n- `title` is merged into `metadata.title` when not already present.", - "operationId": "replace_content_with_inline_text_api_contents__source_connection_content_version__put", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InlineTextReplaceRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__FileUploadResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Replace a content version with inline text", - "tags": [ - "contents" - ] - } - }, - "/contents/{source_connection_content_version}/embeddings": { - "get": { - "description": "List the embeddings (chunk vectors) for a content item, with pagination.\n\nEmbeddings are used for semantic search and retrieval in knowledge base workflows. This endpoint is primarily useful for debugging chunking, indexing, and vector contents.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access embeddings for content belonging to your account.", - "operationId": "list_content_embeddings_api_contents__source_connection_content_version__embeddings_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__ContentEmbeddingsListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List content embeddings", - "tags": [ - "contents" - ] - } - }, - "/contents/{source_connection_content_version}/upload": { - "post": { - "description": "Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`.\n\nThis behaves like a source file upload, but it targets an existing content version ID. This is useful when you want to correct or update an uploaded document while keeping references stable.\n\n**Maximum file size:** 209715200 bytes.\n\n**Supported MIME types:**\n- `application/epub+zip`\n- `application/json`\n- `application/pdf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/xml`\n- `application/zip`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/wav`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/svg+xml`\n- `image/tiff`\n- `image/webp`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n- `video/mp4`\n- `video/quicktime`\n- `video/x-msvideo`\n\nNotes:\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your account.", - "operationId": "upload_file_to_content_api_contents__source_connection_content_version__upload_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__FileUploadResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Replace a content version with a new upload", - "tags": [ - "contents" - ] - } - }, - "/docs-search": { - "get": { - "description": "Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page titles and summaries (fast, no AI cost); `mode=semantic` matches page body content by meaning (uses an embedding). Each result carries a `doc_slug` and an optional section `anchor` for building a `https://seclai.com/docs/[#]` link, a `score` (relevance; not comparable across modes), and \u2014 in semantic mode \u2014 a `highlight` (best matching verbatim sentence; `null` for keyword). Documentation is global, so results are not account-scoped.", - "operationId": "docs_search_api_docs_search_get", - "parameters": [ - { - "description": "Search query", - "in": "query", - "name": "q", - "required": true, - "schema": { - "description": "Search query", - "maxLength": 200, - "minLength": 1, - "title": "Q", - "type": "string" - } - }, - { - "description": "Search strategy", - "in": "query", - "name": "mode", - "required": false, - "schema": { - "default": "keyword", - "description": "Search strategy", - "enum": [ - "keyword", - "semantic" - ], - "title": "Mode", - "type": "string" - } - }, - { - "description": "Maximum results", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 8, - "description": "Maximum results", - "maximum": 20, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__docs_search__DocsSearchResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Search documentation", - "tags": [ - "search" - ] - } - }, - "/email-domains": { - "get": { - "description": "List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email domains with their verification status, the DNS records the customer must publish, and the plan capabilities (`can_add_vanity`/`can_add_custom`) plus whether one of each kind already exists (`has_vanity`/`has_custom` \u2014 the per-kind limit is 1).\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "list_email_domains_api_api_email_domains_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailDomainsListResponse" - } - } - }, - "description": "Successful Response" - } - }, - "summary": "List the account's email domains + plan capabilities", - "tags": [ - "email-domains" - ] - }, - "post": { - "description": "Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, `value=agent.mycompany.com`; optional `delegated=true` to let Seclai manage a dedicated Route53 zone). Stands up the SES identity + DNS and returns the records the customer must publish. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "add_email_domain_api_api_email_domains_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddEmailDomainRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailDomainResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Add + provision an email domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/use-shared-domain": { - "post": { - "description": "Clear the account's primary domain so agent email reverts to the shared `agent.seclai.com` sending/inbound scheme, WITHOUT removing the configured domain(s) \u2014 they stay verified and can be promoted again later. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "use_shared_domain_api_api_email_domains_use_shared_domain_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - } - }, - "summary": "Revert to the shared agent.seclai.com sending domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}": { - "delete": { - "description": "Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a `cleanup_note` when the removed domain was Seclai-managed (delegated), reminding the caller to delete the registrar NS delegation record (dangling-delegation / subdomain-takeover guard). Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "remove_email_domain_api_api_email_domains__domain_id__delete", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RemoveEmailDomainResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Remove an email domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}/dmarc": { - "get": { - "description": "Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the DMARC `rua` aggregate reports over the last `days` (clamped by the service). Populated for domains whose DNS zone Seclai controls (vanity + delegated custom); a self-managed custom domain keeps its own DMARC reporting and returns an all-zero summary.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "get_dmarc_summary_api_api_email_domains__domain_id__dmarc_get", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "in": "query", - "name": "days", - "required": false, - "schema": { - "default": 30, - "title": "Days", - "type": "integer" - } - }, - { - "in": "query", - "name": "top_sources", - "required": false, - "schema": { - "default": 10, - "title": "Top Sources", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DmarcSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "DMARC aggregate-report summary for a domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}/primary": { - "post": { - "description": "Promote a verified domain to the account's primary domain \u2014 agent email then sends FROM and receives ON this domain (`@`, `@`) instead of the shared `agent.seclai.com`. The domain must be verified. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "set_primary_email_domain_api_api_email_domains__domain_id__primary_post", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailDomainResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Make a verified domain the account's primary sending/inbound domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}/test-email": { - "post": { - "description": "Send a test message FROM the verified domain (`noreply@`) TO the account owner's email, to confirm end-to-end that the domain actually sends (SES verified, DKIM/SPF aligned). Never sends to any other address, so it can't be used as an open relay. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "send_test_email_api_api_email_domains__domain_id__test_email_post", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SendTestEmailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Send a test email from a verified domain to the account owner", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}/verify": { - "post": { - "description": "Re-poll SES + DNS for this domain right now instead of waiting for the background verification sweep, and return its updated status + DNS-record check results. Useful right after publishing the required records. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "verify_email_domain_api_api_email_domains__domain_id__verify_post", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailDomainResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Run a verification check immediately ('Check now')", - "tags": [ - "email-domains" - ] - } - }, - "/governance/ai-assistant": { - "post": { - "description": "Send a natural-language request to the governance AI assistant to generate a plan of policy changes. Returns a conversation with proposed actions that can be accepted or declined.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token with governance access.", - "operationId": "governance_ai_generate_api_governance_ai_assistant_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__governance__GovernanceAiAssistantRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GovernanceAiAssistantResponse" - } - } - }, - "description": "Successful Response" - }, - "400": { - "description": "AI assistant error." - }, - "403": { - "description": "Plan does not include governance access." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Generate a governance plan", - "tags": [ - "governance" - ] - } - }, - "/governance/ai-assistant/conversations": { - "get": { - "description": "Return recent governance AI assistant conversations for the account, ordered by most recent first.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token with governance access.", - "operationId": "list_governance_ai_conversations_api_governance_ai_assistant_conversations_get", - "parameters": [ - { - "description": "Number of conversations.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Number of conversations.", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/routers__api__governance__GovernanceConversationResponse" - }, - "title": "Response List Governance Ai Conversations Api Governance Ai Assistant Conversations Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "Plan does not include governance access." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List AI assistant conversations", - "tags": [ - "governance" - ] - } - }, - "/governance/ai-assistant/{conversation_id}/accept": { - "post": { - "description": "Execute the proposed policy changes from a governance AI assistant conversation. Each action is applied in order and results are returned.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token with governance access.", - "operationId": "governance_ai_accept_api_governance_ai_assistant__conversation_id__accept_post", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GovernanceAiAcceptResponse" - } - } - }, - "description": "Successful Response" - }, - "400": { - "description": "Plan already accepted/declined or AI error." - }, - "403": { - "description": "Plan does not include governance access." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Accept a governance plan", - "tags": [ - "governance" - ] - } - }, - "/governance/ai-assistant/{conversation_id}/decline": { - "post": { - "description": "Reject a previously proposed governance AI assistant plan without applying any changes. The conversation is marked as declined and no policy modifications are made.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token with governance access.", - "operationId": "governance_ai_decline_api_governance_ai_assistant__conversation_id__decline_post", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "400": { - "description": "Plan already accepted/declined or AI error." - }, - "403": { - "description": "Plan does not include governance access." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Decline a governance plan", - "tags": [ - "governance" - ] - } - }, - "/knowledge_bases": { - "get": { - "description": "List knowledge bases for the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "list_knowledge_bases_api_knowledge_bases_get", - "parameters": [ - { - "description": "Page number (1-based).", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number (1-based).", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page.", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field. One of: created_at, updated_at, name.", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field. One of: created_at, updated_at, name.", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort direction: asc or desc.", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort direction: asc or desc.", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnowledgeBaseListResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List Knowledge Bases", - "tags": [ - "knowledge_bases" - ] - }, - "post": { - "description": "Create a new knowledge base.\n\nAt least one `source_id` is required. The source connections must belong to the same account.", - "operationId": "create_knowledge_base_api_knowledge_bases_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateKnowledgeBaseBody" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnowledgeBaseResponseModel" - } - } - }, - "description": "Successful Response" - }, - "402": { - "description": "Insufficient credits or no active subscription \u2014 the account has exhausted its credits or does not have a valid subscription." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Create Knowledge Base", - "tags": [ - "knowledge_bases" - ] - } - }, - "/knowledge_bases/{knowledge_base_id}": { - "delete": { - "description": "Soft-delete a knowledge base. This action cannot be undone.\n\nFails if the knowledge base is referenced by any agent definitions. Remove the knowledge base from agents first.", - "operationId": "delete_knowledge_base_api_knowledge_bases__knowledge_base_id__delete", - "parameters": [ - { - "in": "path", - "name": "knowledge_base_id", - "required": true, - "schema": { - "title": "Knowledge Base Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Delete Knowledge Base", - "tags": [ - "knowledge_bases" - ] - }, - "get": { - "description": "Fetch a knowledge base by ID.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access knowledge bases belonging to your account.", - "operationId": "get_knowledge_base_api_knowledge_bases__knowledge_base_id__get", - "parameters": [ - { - "in": "path", - "name": "knowledge_base_id", - "required": true, - "schema": { - "title": "Knowledge Base Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnowledgeBaseResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get Knowledge Base", - "tags": [ - "knowledge_bases" - ] - }, - "put": { - "description": "Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update knowledge bases belonging to your account.", - "operationId": "update_knowledge_base_api_knowledge_bases__knowledge_base_id__put", - "parameters": [ - { - "in": "path", - "name": "knowledge_base_id", - "required": true, - "schema": { - "title": "Knowledge Base Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateKnowledgeBaseBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnowledgeBaseResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Update Knowledge Base", - "tags": [ - "knowledge_bases" - ] - } - }, - "/me": { - "get": { - "description": "Returns the authenticated user's personal account ID and a list of organisations they belong to. Each organisation entry includes the organisation's own id, display name, and account_id. Useful for CLI tooling that needs to let the user pick an org context.", - "operationId": "get_me_api_me_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MeResponse" - } - } - }, - "description": "Successful Response" - } - }, - "summary": "Get current user identity", - "tags": [ - "identity" - ] - } - }, - "/memory_banks": { - "get": { - "description": "List memory banks for the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "list_memory_banks_api_memory_banks_get", - "parameters": [ - { - "description": "Page number (1-based).", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number (1-based).", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page.", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field. One of: created_at, updated_at, name.", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field. One of: created_at, updated_at, name.", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort direction: asc or desc.", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort direction: asc or desc.", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "description": "Filter by bank type: conversation or general.", - "in": "query", - "name": "type", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by bank type: conversation or general.", - "title": "Type" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankListResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List Memory Banks", - "tags": [ - "memory_banks" - ] - }, - "post": { - "description": "Create a new memory bank.\n\nModes: `fast_and_cheap` (256-dim), `balanced` (512-dim), `slow_and_thorough` (1024-dim), or `custom` (supply your own embedding params).", - "operationId": "create_memory_bank_api_memory_banks_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateMemoryBankBody" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Create Memory Bank", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/ai-assistant": { - "post": { - "description": "Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, mode, compaction prompt, and retention settings based on the user's description.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "memory_bank_ai_generate_api_memory_banks_ai_assistant_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAiAssistantRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankAiAssistantResponse" - } - } - }, - "description": "Successful Response" - }, - "400": { - "description": "AI assistant error." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Generate a memory bank configuration", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/ai-assistant/last-conversation": { - "get": { - "description": "Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports pagination via limit/offset.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "memory_bank_ai_last_conversation_api_memory_banks_ai_assistant_last_conversation_get", - "parameters": [ - { - "description": "Max turns to return.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 5, - "description": "Max turns to return.", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Number of most-recent turns to skip.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Number of most-recent turns to skip.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankLastConversationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Fetch memory bank AI conversation history", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/ai-assistant/{conversation_id}": { - "patch": { - "description": "Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to true to accept the proposed configuration, or false to decline it. The accepted status is recorded for audit purposes.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "memory_bank_ai_accept_api_memory_banks_ai_assistant__conversation_id__patch", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAcceptRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OkResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Accept or decline a memory bank AI suggestion", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/templates": { - "get": { - "description": "Return pre-built template configurations for common memory bank use cases.\n\nEach template includes a name, description, suggested use case, and full default settings that can be used directly with the create endpoint.", - "operationId": "list_templates_api_memory_banks_templates_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "title": "Response List Templates Api Memory Banks Templates Get" - } - } - }, - "description": "Successful Response" - } - }, - "summary": "List Templates", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/test-compaction": { - "post": { - "description": "Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. Returns original entries, compaction summary, surviving entries, and a structured quality evaluation with verdict, score, and reasoning.", - "operationId": "test_compaction_prompt_standalone_api_memory_banks_test_compaction_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StandaloneTestCompactionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompactionTestResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Test Compaction Prompt Standalone", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}": { - "delete": { - "description": "Soft-delete a memory bank. This action is permanent and cannot be undone.\n\nThe linked content source and all stored conversation memory entries will also be removed.", - "operationId": "delete_memory_bank_api_memory_banks__memory_bank_id__delete", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Delete Memory Bank", - "tags": [ - "memory_banks" - ] - }, - "get": { - "description": "Fetch a memory bank by ID.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access memory banks belonging to your account.", - "operationId": "get_memory_bank_api_memory_banks__memory_bank_id__get", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get Memory Bank", - "tags": [ - "memory_banks" - ] - }, - "put": { - "description": "Update a memory bank's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nNote: the embedding `mode` cannot be changed after creation because it determines the vector dimensions used to store entries.", - "operationId": "update_memory_bank_api_memory_banks__memory_bank_id__put", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateMemoryBankBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Update Memory Bank", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/agents": { - "get": { - "description": "List agents whose current definition references this memory bank.\n\nReturns an array of `{agent_id, agent_name}` objects.", - "operationId": "get_agents_using_bank_api_memory_banks__memory_bank_id__agents_get", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "title": "Response Get Agents Using Bank Api Memory Banks Memory Bank Id Agents Get" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get Agents Using Bank", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/compact": { - "post": { - "description": "Trigger an on-demand compaction run for a memory bank.\n\nThe bank must have at least one compaction threshold configured (max_age_days, max_turns, or max_size_tokens). Compaction runs asynchronously \u2014 the response confirms scheduling, not completion.", - "operationId": "compact_memory_bank_api_memory_banks__memory_bank_id__compact_post", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompactionScheduledResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Compact Memory Bank", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/source": { - "delete": { - "description": "Delete the content source linked to a memory bank, removing all stored memory entries.\n\nA new content source is automatically created on the next write. Use this to reset a bank's data without deleting the bank itself.", - "operationId": "delete_memory_bank_source_api_memory_banks__memory_bank_id__source_delete", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Delete Memory Bank Source", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/stats": { - "get": { - "description": "Return aggregated entry statistics for a memory bank, including total counts, token/age/entries-per-key distributions (avg, p95, min, max), and top conversation keys, group keys, speakers, and tags. Supports time-range filtering via `days`, `start_date`, and `end_date` query parameters.", - "operationId": "get_memory_bank_entry_stats_api_memory_banks__memory_bank_id__stats_get", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "in": "query", - "name": "days", - "required": false, - "schema": { - "default": 30, - "maximum": 730, - "minimum": 1, - "title": "Days", - "type": "integer" - } - }, - { - "in": "query", - "name": "start_date", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Start Date" - } - }, - { - "in": "query", - "name": "end_date", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "End Date" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "additionalProperties": true, - "title": "Response Get Memory Bank Entry Stats Api Memory Banks Memory Bank Id Stats Get", - "type": "object" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get Memory Bank Entry Stats", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/test-compaction": { - "post": { - "description": "Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. Returns original entries, compaction summary, surviving entries, and a structured quality evaluation with verdict, score, and reasoning.", - "operationId": "test_compaction_prompt_api_memory_banks__memory_bank_id__test_compaction_post", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestCompactionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompactionTestResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Test Compaction Prompt", - "tags": [ - "memory_banks" - ] - } - }, - "/models": { - "get": { - "description": "List all enabled LLM models with full details.\n\nReturns models grouped by provider, including capabilities, credit pricing, tool support, variant tiers, and lifecycle status.\n\nOptional query parameters:\n- `provider`: filter by provider (e.g. 'anthropic', 'openai')\n- `supports_tool_use`: filter to models with tool calling support\n- `supports_thinking`: filter to models with extended thinking support\n- `supports_input_media`: filter to models accepting an input modality (`image`/`audio`/`video`/`pdf` or a full MIME)\n- `supports_output_media`: filter to models producing an output modality (`image`/`audio`/`video`) \u2014 e.g. to find generation models\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "list_models_api_models_get", - "parameters": [ - { - "description": "Filter by provider name", - "in": "query", - "name": "provider", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by provider name", - "title": "Provider" - } - }, - { - "description": "Filter to models that support tool use", - "in": "query", - "name": "supports_tool_use", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Filter to models that support tool use", - "title": "Supports Tool Use" - } - }, - { - "description": "Filter to models that support extended thinking", - "in": "query", - "name": "supports_thinking", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Filter to models that support extended thinking", - "title": "Supports Thinking" - } - }, - { - "description": "Filter to models that accept this input modality \u2014 a coarse kind (`image`, `audio`, `video`, `pdf`) or a full MIME.", - "in": "query", - "name": "supports_input_media", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to models that accept this input modality \u2014 a coarse kind (`image`, `audio`, `video`, `pdf`) or a full MIME.", - "title": "Supports Input Media" - } - }, - { - "description": "Filter to models that produce this output modality \u2014 a coarse kind (`image`, `audio`, `video`) or a full MIME. Use to find image/audio/video generation models.", - "in": "query", - "name": "supports_output_media", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to models that produce this output modality \u2014 a coarse kind (`image`, `audio`, `video`) or a full MIME. Use to find image/audio/video generation models.", - "title": "Supports Output Media" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/schemas__model_responses__ProviderGroupResponse" - }, - "title": "Response List Models Api Models Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List Models", - "tags": [ - "models" - ] - } - }, - "/models/alerts": { - "get": { - "description": "List model lifecycle alerts for the account.\n\nReturns in-app notifications about model deprecations, sunsets, and newer model availability. Supports filtering by agent, unread-only, and pagination.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Alerts are scoped to the caller's account.", - "operationId": "list_alerts_api_models_alerts_get", - "parameters": [ - { - "description": "Filter alerts to a specific agent UUID.", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter alerts to a specific agent UUID.", - "title": "Agent Id" - } - }, - { - "description": "When true, only return unread alerts.", - "in": "query", - "name": "unread_only", - "required": false, - "schema": { - "default": false, - "description": "When true, only return unread alerts.", - "title": "Unread Only", - "type": "boolean" - } - }, - { - "description": "Maximum number of alerts to return (1-100).", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "description": "Maximum number of alerts to return (1-100).", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Pagination offset.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Pagination offset.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelAlertListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List Alerts", - "tags": [ - "models" - ] - } - }, - "/models/alerts/mark-all-read": { - "post": { - "description": "Mark all model lifecycle alerts as read for the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Scoped to the caller's account.", - "operationId": "mark_all_read_api_models_alerts_mark_all_read_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - } - }, - "summary": "Mark All Read", - "tags": [ - "models" - ] - } - }, - "/models/alerts/unread-count": { - "get": { - "description": "Get the count of unread model lifecycle alerts.\n\nUseful for badge indicators in UIs and dashboards.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Count is scoped to the caller's account.", - "operationId": "get_alert_unread_count_api_models_alerts_unread_count_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnreadCountResponse" - } - } - }, - "description": "Successful Response" - } - }, - "summary": "Get Alert Unread Count", - "tags": [ - "models" - ] - } - }, - "/models/alerts/{alert_id}/read": { - "patch": { - "description": "Mark a single model lifecycle alert as read (dismissed).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The alert must belong to the caller's account.", - "operationId": "mark_read_api_models_alerts__alert_id__read_patch", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Mark Read", - "tags": [ - "models" - ] - } - }, - "/models/generation-tiers": { - "get": { - "description": "List the media-generation quality tiers and the model + cost each resolves to.\n\nOn a prompt_call's `media_generation` tool \u2014 and the dedicated generate_* steps via tier routing \u2014 the author/LLM chooses a *tier* (fast/balanced/thorough), never a model. This is the surface that maps each `(modality, tier)` to its concrete generator, raw `credits_per_unit`, `unit_label`, and a human-readable scaled `price_label`. Global routing/pricing (the same for every account); read-only. REST parity with the `list_generation_tiers` MCP tool.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_generation_tiers_api_models_generation_tiers_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationTierListResponse" - } - } - }, - "description": "Successful Response" - } - }, - "summary": "Get Generation Tiers", - "tags": [ - "models" - ] - } - }, - "/models/playground/experiments": { - "get": { - "description": "List model playground experiments for the account.\n\nReturns a paginated, time-filtered list of experiments ordered by creation date descending.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account.", - "operationId": "list_experiments_api_models_playground_experiments_get", - "parameters": [ - { - "description": "Look-back window in days.", - "in": "query", - "name": "days", - "required": false, - "schema": { - "default": 30, - "description": "Look-back window in days.", - "maximum": 730, - "minimum": 1, - "title": "Days", - "type": "integer" - } - }, - { - "description": "Explicit start date (overrides days).", - "in": "query", - "name": "start_date", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Explicit start date (overrides days).", - "title": "Start Date" - } - }, - { - "description": "Explicit end date (overrides days).", - "in": "query", - "name": "end_date", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Explicit end date (overrides days).", - "title": "End Date" - } - }, - { - "description": "Page size.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Page size.", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Pagination offset.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Pagination offset.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExperimentListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List Experiments", - "tags": [ - "models" - ] - }, - "post": { - "description": "Create and schedule a model playground experiment.\n\nRuns the given prompt against 1-10 models in parallel and optionally evaluates the outputs with an LLM judge.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "create_experiment_api_models_playground_experiments_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PlaygroundCreateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateExperimentResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Create Experiment", - "tags": [ - "models" - ] - } - }, - "/models/playground/experiments/{experiment_id}": { - "delete": { - "description": "Soft-delete a model playground experiment.\n\nRemoves the experiment from list/detail views while preserving audit history.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's account.", - "operationId": "delete_experiment_endpoint_api_models_playground_experiments__experiment_id__delete", - "parameters": [ - { - "in": "path", - "name": "experiment_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Experiment Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Delete Experiment Endpoint", - "tags": [ - "models" - ] - }, - "get": { - "description": "Get details and results for a specific model playground experiment.\n\nReturns the full experiment payload including prompt, model outputs, and evaluation results (if available).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account.", - "operationId": "get_experiment_api_models_playground_experiments__experiment_id__get", - "parameters": [ - { - "in": "path", - "name": "experiment_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Experiment Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExperimentDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get Experiment", - "tags": [ - "models" - ] - } - }, - "/models/playground/experiments/{experiment_id}/cancel": { - "post": { - "description": "Cancel a running or pending model playground experiment.\n\nSignals running model calls to abort and marks the experiment as canceled.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account.", - "operationId": "cancel_experiment_endpoint_api_models_playground_experiments__experiment_id__cancel_post", - "parameters": [ - { - "in": "path", - "name": "experiment_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Experiment Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CancelExperimentResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Cancel Experiment Endpoint", - "tags": [ - "models" - ] - } - }, - "/models/{model_id}/details": { - "get": { - "description": "Get detailed information about a specific model.\n\nReturns full model details including capabilities, credit pricing, tool support, variant tiers, and lifecycle status.\n\nThe `model_id` is the model enum identifier (e.g. 'anthropic_claude_opus_4_6').\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_model_api_models__model_id__details_get", - "parameters": [ - { - "in": "path", - "name": "model_id", - "required": true, - "schema": { - "title": "Model Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/schemas__model_responses__PromptModelResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get Model", - "tags": [ - "models" - ] - } - }, - "/models/{model_id}/recommendations": { - "get": { - "description": "Get replacement/upgrade recommendations for a model.\n\nReturns a designated successor (if any), same-family upgrades, and cross-provider/cross-family alternatives.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_recommendations_api_models__model_id__recommendations_get", - "parameters": [ - { - "in": "path", - "name": "model_id", - "required": true, - "schema": { - "title": "Model Id", - "type": "string" - } - }, - { - "description": "Only recommend models that support tool use.", - "in": "query", - "name": "require_tool_use", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Only recommend models that support tool use.", - "title": "Require Tool Use" - } - }, - { - "description": "Only recommend models that support structured output.", - "in": "query", - "name": "require_structured_output", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Only recommend models that support structured output.", - "title": "Require Structured Output" - } - }, - { - "description": "Only recommend models that support thinking/reasoning.", - "in": "query", - "name": "require_thinking", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Only recommend models that support thinking/reasoning.", - "title": "Require Thinking" - } - }, - { - "description": "Minimum context window size in tokens.", - "in": "query", - "name": "min_context_tokens", - "required": false, - "schema": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Minimum context window size in tokens.", - "title": "Min Context Tokens" - } - }, - { - "description": "Minimum output token limit.", - "in": "query", - "name": "min_output_tokens", - "required": false, - "schema": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Minimum output token limit.", - "title": "Min Output Tokens" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationsResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get Recommendations", - "tags": [ - "models" - ] - } - }, - "/search": { - "get": { - "description": "Search across all resource types in your account. Accepts a free-text keyword query or a UUID. UUIDs are matched exactly; keywords are matched by name and description (case-insensitive substring). Results are ranked: name-prefix > name-substring > description-substring. Searchable types: agent, knowledge_base, source_connection, solution, memory_bank, alert, api_key, governance_policy, mcp_client.", - "operationId": "search_api_search_get", - "parameters": [ - { - "description": "Search query", - "in": "query", - "name": "q", - "required": true, - "schema": { - "description": "Search query", - "maxLength": 200, - "minLength": 1, - "title": "Q", - "type": "string" - } - }, - { - "description": "Maximum results", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 10, - "description": "Maximum results", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Optional entity type filter (e.g. 'agent', 'knowledge_base')", - "in": "query", - "name": "entity_type", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional entity type filter (e.g. 'agent', 'knowledge_base')", - "title": "Entity Type" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__search__SearchResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Search resources", - "tags": [ - "search" - ] - } - }, - "/solutions": { - "get": { - "description": "List solutions for your account.\n\nA *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Use solutions to organise related resources and leverage AI assistants for automated setup.\n\nParameters:\n- Pagination: `page` and `limit`.\n- Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc).\n- Filtering: `search` to filter by solution name (case-insensitive partial match).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account.", - "operationId": "list_solutions_api_solutions_get", - "parameters": [ - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort order", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort order", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "description": "Filter by solution name (case-insensitive partial match)", - "in": "query", - "name": "search", - "required": false, - "schema": { - "anyOf": [ - { - "maxLength": 200, - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by solution name (case-insensitive partial match)", - "title": "Search" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List solutions", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Create a new solution for the caller's account.\n\nA *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Provide a `name` and optional `description` in the request body.", - "operationId": "create_solution_api_solutions_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateSolutionRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Create a solution", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}": { - "delete": { - "description": "Delete a solution by its ID.\n\nThis permanently removes the solution and all its resource associations (agent links, knowledge base links, source connection links). The underlying resources themselves are not deleted.", - "operationId": "delete_solution_api_solutions__solution_id__delete", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Delete a solution", - "tags": [ - "solutions" - ] - }, - "get": { - "description": "Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections.\n\nReturns the full solution detail with nested resource information.", - "operationId": "get_solution_api_solutions__solution_id__get", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get a solution", - "tags": [ - "solutions" - ] - }, - "patch": { - "description": "Update an existing solution's name or description.\n\nPass the fields you wish to change in the request body. Fields not included remain unchanged.", - "operationId": "update_solution_api_solutions__solution_id__patch", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateSolutionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Update a solution", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/agents": { - "delete": { - "description": "Unlink one or more agents from a solution by their IDs.\n\nPass a JSON body with an `ids` array of agent UUIDs to remove. Agents not currently linked are silently ignored. Returns the updated solution with remaining linked resources.", - "operationId": "unlink_agents_api_solutions__solution_id__agents_delete", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnlinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Unlink agents", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Link one or more agents to a solution by their IDs.\n\nPass a JSON body with an `ids` array of agent UUIDs. Already-linked agents are silently ignored. Returns the updated solution with all linked resources.", - "operationId": "link_agents_api_solutions__solution_id__agents_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Link agents", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/generate": { - "post": { - "description": "Generate a comprehensive solution management plan via the solution AI assistant.\n\nThis is the most powerful assistant \u2014 it can propose changes across sources, knowledge bases, and agents. Describe your goal in natural language and the assistant will create a multi-step plan. Review the proposed actions and use the accept or decline endpoint.\n\nSupports SSE streaming when `Accept: text/event-stream` is set.", - "operationId": "ai_assistant_generate_api_solutions__solution_id__ai_assistant_generate_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Generate solution plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/knowledge-base": { - "post": { - "description": "Generate a knowledge base plan via the KB AI assistant.\n\nDescribe what knowledge bases you need in natural language and the assistant will propose a plan with create, update, or delete actions. The assistant may also propose creating new sources if needed. Review the proposed actions and use the accept or decline endpoint.", - "operationId": "ai_assistant_knowledge_base_api_solutions__solution_id__ai_assistant_knowledge_base_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Generate knowledge base plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/source": { - "post": { - "description": "Generate a content source plan via the source AI assistant.\n\nDescribe what sources you need in natural language and the assistant will propose a plan with create, update, or delete actions. Review the proposed actions and use the accept or decline endpoint to execute or discard the plan.", - "operationId": "ai_assistant_source_api_solutions__solution_id__ai_assistant_source_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Generate source plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/{conversation_id}/accept": { - "post": { - "description": "Accept and execute a proposed plan generated by one of the AI assistant endpoints.\n\nExecutes all proposed actions in the plan and returns the results of each action. If the plan contains destructive actions (e.g. deletions), you must set `confirm_deletions` to `true` in the request body. Returns a summary of executed actions with success/failure status.", - "operationId": "ai_assistant_accept_api_solutions__solution_id__ai_assistant__conversation_id__accept_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantAcceptRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantAcceptResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Accept plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/{conversation_id}/decline": { - "post": { - "description": "Decline a proposed plan generated by one of the AI assistant endpoints.\n\nMarks the conversation as declined without executing any actions. The conversation history is preserved for reference. You can generate a new plan afterwards if needed.", - "operationId": "ai_assistant_decline_api_solutions__solution_id__ai_assistant__conversation_id__decline_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Decline plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/conversations": { - "get": { - "description": "List AI assistant conversation history for a solution.\n\nReturns all conversation turns for the given solution, including user inputs, AI responses, proposed actions, and acceptance status.", - "operationId": "list_conversations_api_solutions__solution_id__conversations_get", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionConversationResponse" - }, - "title": "Response List Conversations Api Solutions Solution Id Conversations Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List conversations", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Add a conversation turn to a solution's AI assistant history.\n\nRecords a user input and optional AI response and actions taken. This is typically called internally by AI assistant endpoints, but can also be used to manually log interactions.", - "operationId": "add_conversation_turn_api_solutions__solution_id__conversations_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddConversationTurnRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionConversationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Add conversation turn", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/conversations/{conversation_id}": { - "patch": { - "description": "Mark a conversation turn as accepted or declined.\n\nUpdates the `accepted` field on an existing conversation turn. Use this after reviewing a proposed plan to record whether it was accepted or declined by the user.", - "operationId": "mark_conversation_turn_api_solutions__solution_id__conversations__conversation_id__patch", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MarkConversationTurnRequest" - } - } - }, - "required": true - }, - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Mark conversation turn", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/knowledge-bases": { - "delete": { - "description": "Unlink one or more knowledge bases from a solution by their IDs.\n\nPass a JSON body with an `ids` array of knowledge base UUIDs to remove. Knowledge bases not currently linked are silently ignored. Returns the updated solution.", - "operationId": "unlink_knowledge_bases_api_solutions__solution_id__knowledge_bases_delete", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnlinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Unlink knowledge bases", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Link one or more knowledge bases to a solution by their IDs.\n\nPass a JSON body with an `ids` array of knowledge base UUIDs. Already-linked knowledge bases are silently ignored. Returns the updated solution with all linked resources.", - "operationId": "link_knowledge_bases_api_solutions__solution_id__knowledge_bases_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Link knowledge bases", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/source-connections": { - "delete": { - "description": "Unlink one or more source connections from a solution by their IDs.\n\nPass a JSON body with an `ids` array of source connection UUIDs to remove. Sources not currently linked are silently ignored. Returns the updated solution.", - "operationId": "unlink_source_connections_api_solutions__solution_id__source_connections_delete", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnlinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Unlink source connections", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Link one or more source connections to a solution by their IDs.\n\nPass a JSON body with an `ids` array of source connection UUIDs. Already-linked sources are silently ignored. Returns the updated solution with all linked resources.", - "operationId": "link_source_connections_api_solutions__solution_id__source_connections_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Link source connections", - "tags": [ - "solutions" - ] - } - }, - "/sources": { - "get": { - "description": "List content sources for your account.\n\nA *source* is where Seclai pulls or receives content from \u2014 RSS feeds, websites, or content stores (``custom_index``). Content stores support file uploads and API-driven content ingestion with configurable index modes (``fast_and_cheap``, ``balanced``, ``slow_and_thorough``, or ``custom``).\n\nParameters:\n- Pagination: `page` and `limit`.\n- Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account.\n- The optional `account_id` query param is only allowed when it matches the caller's account.", - "operationId": "list_sources_api_sources_get", - "parameters": [ - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort order", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort order", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "description": "List sources for the given account. Defaults to the caller's account.", - "in": "query", - "name": "account_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "List sources for the given account. Defaults to the caller's account.", - "title": "Account Id" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__sources__SourceListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List sources", - "tags": [ - "sources" - ] - }, - "post": { - "description": "Create a new content source.\n\nSource types: `rss`, `website`, `custom_index`.\n\nFor RSS and website sources, provide the URL. For custom index sources, the URL is created automatically.\n\nFor custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`.", - "operationId": "create_source_api_sources_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateSourceBody" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceResponse" - } - } - }, - "description": "Successful Response" - }, - "402": { - "description": "Insufficient credits or no active subscription \u2014 the account has exhausted its credits or does not have a valid subscription." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Create Source", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}": { - "delete": { - "description": "Soft-delete a content source. This action cannot be undone.\n\nSystem-managed sources (such as agent history or conversation memory) cannot be deleted through this endpoint.", - "operationId": "delete_source_api_sources__source_connection_id__delete", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Delete Source", - "tags": [ - "sources" - ] - }, - "get": { - "description": "Fetch a content source by ID.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access sources belonging to your account.", - "operationId": "get_source_api_sources__source_connection_id__get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get Source", - "tags": [ - "sources" - ] - }, - "post": { - "description": "Upload a small text payload to a content source (no multipart/form-data required).\n\n**Maximum payload size:** 8192 bytes (UTF-8).\n\n**Supported content types:**\n- `application/json`\n- `application/xml`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n\nNotes:\n- Use this endpoint for small text payloads; larger files should use `/upload`.\n- `title` is merged into `metadata.title` when not already present.", - "operationId": "upload_inline_text_to_source_api_sources__source_connection_id__post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InlineTextUploadRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__sources__FileUploadResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Upload inline text to a content source", - "tags": [ - "sources" - ] - }, - "put": { - "description": "Update a content source's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nSystem-managed sources only allow `retention_days` updates.", - "operationId": "update_source_api_sources__source_connection_id__put", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateSourceBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Update Source", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/embedding-migration": { - "get": { - "description": "Get the latest embedding migration status for a custom-index source.\n\nReturns `null` when no migration has ever been started for this source.", - "operationId": "get_source_embedding_migration_api_sources__source_connection_id__embedding_migration_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SourceEmbeddingMigrationResponse" - }, - { - "type": "null" - } - ], - "title": "Response Get Source Embedding Migration Api Sources Source Connection Id Embedding Migration Get" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get Source Embedding Migration", - "tags": [ - "sources" - ] - }, - "post": { - "description": "Start an embedding model migration for a custom-index source.\n\nThe migration runs asynchronously in the background. Poll `GET /sources/{id}/embedding-migration` to track progress.\n\nOptionally override chunking configuration (`chunk_size`, `chunk_overlap`, `chunk_language`, `chunk_separators`, `chunk_regex_separators`). When a chunking field is omitted (null), the current source's value is preserved.\n\nConstraints:\n- Only `custom_index` source types support migration.\n- A migration cannot be started while another is already active.\n- The target model + dimensions must differ from the source's current settings.", - "operationId": "start_source_embedding_migration_api_sources__source_connection_id__embedding_migration_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StartSourceEmbeddingMigrationRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceEmbeddingMigrationResponse" - } - } - }, - "description": "Successful Response" - }, - "409": { - "description": "A migration is already active for this source, or the target matches the current settings." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Start Source Embedding Migration", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/embedding-migration/cancel": { - "post": { - "description": "Cancel an active embedding migration for a custom-index source.\n\nOnly pending, running, or switching migrations can be cancelled.", - "operationId": "cancel_source_embedding_migration_api_sources__source_connection_id__embedding_migration_cancel_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceEmbeddingMigrationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Cancel Source Embedding Migration", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/exports": { - "get": { - "description": "List all export jobs for a source connection, ordered newest first. Supports pagination via ``page`` and ``limit`` query parameters. Returns status, progress, and file metadata for each export.", - "operationId": "list_source_exports_api_sources__source_connection_id__exports_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExportListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "List exports", - "tags": [ - "source-exports" - ] - }, - "post": { - "description": "Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, then use /download to retrieve the file.", - "operationId": "create_source_export_api_sources__source_connection_id__exports_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__CreateExportRequest" - } - } - }, - "required": true - }, - "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__ExportResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Create export", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/exports/estimate": { - "post": { - "description": "Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use this to show users how large the download will be before they commit to running the export.", - "operationId": "estimate_source_export_api_sources__source_connection_id__exports_estimate_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__EstimateExportRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__EstimateExportResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Estimate export size", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/exports/{export_id}": { - "delete": { - "description": "Delete an export job and remove the associated file from S3. This is a soft-delete: the database record is retained for audit purposes but the backing file is permanently removed.", - "operationId": "delete_source_export_api_sources__source_connection_id__exports__export_id__delete", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "export_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Export Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Delete export", - "tags": [ - "source-exports" - ] - }, - "get": { - "description": "Retrieve the current status and progress of an export job. Returns all metadata including progress counters, file size, item count, and expiration time once completed.", - "operationId": "get_source_export_api_sources__source_connection_id__exports__export_id__get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "export_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Export Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__ExportResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Get export status", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/exports/{export_id}/cancel": { - "post": { - "description": "Cancel a pending or running export. The background task will stop at the next chunk boundary. Completed, failed, expired, or already-cancelled exports cannot be cancelled.", - "operationId": "cancel_source_export_api_sources__source_connection_id__exports__export_id__cancel_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "export_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Export Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__ExportResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Cancel export", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/exports/{export_id}/download": { - "get": { - "description": "Stream the completed export file. Returns the file content with appropriate Content-Type and Content-Disposition headers. Returns 409 if the export is not yet completed and 410 if it has expired.", - "operationId": "download_source_export_api_sources__source_connection_id__exports__export_id__download_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "export_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Export Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": {} - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Download export", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/upload": { - "post": { - "description": "Upload a file to a content source.\n\n**Maximum file size:** 209715200 bytes.\n\n**Supported MIME types:**\n- `application/epub+zip`\n- `application/json`\n- `application/pdf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/xml`\n- `application/zip`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/wav`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/svg+xml`\n- `image/tiff`\n- `image/webp`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n- `video/mp4`\n- `video/quicktime`\n- `video/x-msvideo`\n\nNotes:\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"author\":\"Ada\",\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nResponse:\n- `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source.", - "operationId": "upload_file_to_source_api_sources__source_connection_id__upload_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_upload_file_to_source_api_sources__source_connection_id__upload_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__sources__FileUploadResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Upload a file to a content source", - "tags": [ - "sources" - ] - } - }, - "/v2/agent-runs/{run_id}/attachments/{attachment_id}": { - "get": { - "description": "Streams the bytes of an attachment emitted by a step in the given agent run. ``attachment_id`` is the URL-safe-base64-encoded ``storage_key`` (use the encoder shared by webhook + email payload builders).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- The calling account must own ``run_id``; lookup failures (missing run, cross-account run, soft-deleted agent, unreferenced storage_key) all collapse to a single 404 to prevent cross-tenant existence enumeration.\n\nMIME handling:\n- Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, application/vnd.seclai.manifest+json) are served with their declared type.\n- Everything else is served as ``application/octet-stream`` with an attachment disposition to prevent stored-XSS.", - "operationId": "serve_agent_run_attachment_api_v2_agent_runs__run_id__attachments__attachment_id__get", - "parameters": [ - { - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Run Id", - "type": "string" - } - }, - { - "in": "path", - "name": "attachment_id", - "required": true, - "schema": { - "title": "Attachment Id", - "type": "string" - } - }, - { - "in": "query", - "name": "download_name", - "required": false, - "schema": { - "anyOf": [ - { - "maxLength": 255, - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Download Name" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "application/pdf": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "application/vnd.seclai.manifest+json": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "audio/*": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "image/*": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "text/plain": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "video/*": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "description": "Attachment bytes streamed with the resolved MIME type (inline-safe types keep their declared type; everything else is ``application/octet-stream``)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Download an agent-run attachment", - "tags": [ - "agent_run_attachments" - ] - } - }, - "/version": { - "get": { - "description": "Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request resolved to, and the default/latest/known versions. Pin your account with `PUT /version` or override per request with the `Seclai-Version` header.", - "operationId": "get_api_version_api_version_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiVersionResponse" - } - } - }, - "description": "Successful Response" - } - }, - "summary": "Get the account's API version", - "tags": [ - "version" - ] - }, - "put": { - "description": "Sets the account's sticky `Seclai-Version` to the given `YYYY-MM-DD` date, or clears it with `null`. The new pin applies to subsequent header-less requests; a `Seclai-Version` request header still overrides it. Owner/admin only. `effective_version` in the response reflects the current request, not the new pin.", - "operationId": "update_api_version_api_version_put", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateApiVersionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiVersionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - } - }, - "summary": "Pin (or clear) the account's API version", - "tags": [ - "version" - ] - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "BearerAuth": [] - } - ], - "x-seclai-versions": { - "default": "2026-07-01", - "known": [ - "2026-07-01", - "2026-07-27" - ], - "latest": "2026-07-27" - } -} diff --git a/poetry.lock b/poetry.lock deleted file mode 100644 index c98596a..0000000 --- a/poetry.lock +++ /dev/null @@ -1,1035 +0,0 @@ -# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. - -[[package]] -name = "annotated-types" -version = "0.7.0" -description = "Reusable constraint types to use with typing.Annotated" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, - {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, -] - -[[package]] -name = "anyio" -version = "4.12.1" -description = "High-level concurrency and networking framework on top of asyncio or Trio" -optional = false -python-versions = ">=3.9" -groups = ["main", "dev"] -files = [ - {file = "anyio-4.12.1-py3-none-any.whl", hash = "sha256:d405828884fc140aa80a3c667b8beed277f1dfedec42ba031bd6ac3db606ab6c"}, - {file = "anyio-4.12.1.tar.gz", hash = "sha256:41cfcc3a4c85d3f05c932da7c26d0201ac36f72abd4435ba90d0464a3ffed703"}, -] - -[package.dependencies] -idna = ">=2.8" -typing_extensions = {version = ">=4.5", markers = "python_version < \"3.13\""} - -[package.extras] -trio = ["trio (>=0.31.0) ; python_version < \"3.10\"", "trio (>=0.32.0) ; python_version >= \"3.10\""] - -[[package]] -name = "attrs" -version = "25.4.0" -description = "Classes Without Boilerplate" -optional = false -python-versions = ">=3.9" -groups = ["dev"] -files = [ - {file = "attrs-25.4.0-py3-none-any.whl", hash = "sha256:adcf7e2a1fb3b36ac48d97835bb6d8ade15b8dcce26aba8bf1d14847b57a3373"}, - {file = "attrs-25.4.0.tar.gz", hash = "sha256:16d5969b87f0859ef33a48b35d55ac1be6e42ae49d5e853b597db70c35c57e11"}, -] - -[[package]] -name = "black" -version = "25.12.0" -description = "The uncompromising code formatter." -optional = false -python-versions = ">=3.10" -groups = ["dev"] -files = [ - {file = "black-25.12.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f85ba1ad15d446756b4ab5f3044731bf68b777f8f9ac9cdabd2425b97cd9c4e8"}, - {file = "black-25.12.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:546eecfe9a3a6b46f9d69d8a642585a6eaf348bcbbc4d87a19635570e02d9f4a"}, - {file = "black-25.12.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:17dcc893da8d73d8f74a596f64b7c98ef5239c2cd2b053c0f25912c4494bf9ea"}, - {file = "black-25.12.0-cp310-cp310-win_amd64.whl", hash = "sha256:09524b0e6af8ba7a3ffabdfc7a9922fb9adef60fed008c7cd2fc01f3048e6e6f"}, - {file = "black-25.12.0-cp310-cp310-win_arm64.whl", hash = "sha256:b162653ed89eb942758efeb29d5e333ca5bb90e5130216f8369857db5955a7da"}, - {file = "black-25.12.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d0cfa263e85caea2cff57d8f917f9f51adae8e20b610e2b23de35b5b11ce691a"}, - {file = "black-25.12.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1a2f578ae20c19c50a382286ba78bfbeafdf788579b053d8e4980afb079ab9be"}, - {file = "black-25.12.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d3e1b65634b0e471d07ff86ec338819e2ef860689859ef4501ab7ac290431f9b"}, - {file = "black-25.12.0-cp311-cp311-win_amd64.whl", hash = "sha256:a3fa71e3b8dd9f7c6ac4d818345237dfb4175ed3bf37cd5a581dbc4c034f1ec5"}, - {file = "black-25.12.0-cp311-cp311-win_arm64.whl", hash = "sha256:51e267458f7e650afed8445dc7edb3187143003d52a1b710c7321aef22aa9655"}, - {file = "black-25.12.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:31f96b7c98c1ddaeb07dc0f56c652e25bdedaac76d5b68a059d998b57c55594a"}, - {file = "black-25.12.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:05dd459a19e218078a1f98178c13f861fe6a9a5f88fc969ca4d9b49eb1809783"}, - {file = "black-25.12.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c1f68c5eff61f226934be6b5b80296cf6939e5d2f0c2f7d543ea08b204bfaf59"}, - {file = "black-25.12.0-cp312-cp312-win_amd64.whl", hash = "sha256:274f940c147ddab4442d316b27f9e332ca586d39c85ecf59ebdea82cc9ee8892"}, - {file = "black-25.12.0-cp312-cp312-win_arm64.whl", hash = "sha256:169506ba91ef21e2e0591563deda7f00030cb466e747c4b09cb0a9dae5db2f43"}, - {file = "black-25.12.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a05ddeb656534c3e27a05a29196c962877c83fa5503db89e68857d1161ad08a5"}, - {file = "black-25.12.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9ec77439ef3e34896995503865a85732c94396edcc739f302c5673a2315e1e7f"}, - {file = "black-25.12.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e509c858adf63aa61d908061b52e580c40eae0dfa72415fa47ac01b12e29baf"}, - {file = "black-25.12.0-cp313-cp313-win_amd64.whl", hash = "sha256:252678f07f5bac4ff0d0e9b261fbb029fa530cfa206d0a636a34ab445ef8ca9d"}, - {file = "black-25.12.0-cp313-cp313-win_arm64.whl", hash = "sha256:bc5b1c09fe3c931ddd20ee548511c64ebf964ada7e6f0763d443947fd1c603ce"}, - {file = "black-25.12.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:0a0953b134f9335c2434864a643c842c44fba562155c738a2a37a4d61f00cad5"}, - {file = "black-25.12.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:2355bbb6c3b76062870942d8cc450d4f8ac71f9c93c40122762c8784df49543f"}, - {file = "black-25.12.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9678bd991cc793e81d19aeeae57966ee02909877cb65838ccffef24c3ebac08f"}, - {file = "black-25.12.0-cp314-cp314-win_amd64.whl", hash = "sha256:97596189949a8aad13ad12fcbb4ae89330039b96ad6742e6f6b45e75ad5cfd83"}, - {file = "black-25.12.0-cp314-cp314-win_arm64.whl", hash = "sha256:778285d9ea197f34704e3791ea9404cd6d07595745907dd2ce3da7a13627b29b"}, - {file = "black-25.12.0-py3-none-any.whl", hash = "sha256:48ceb36c16dbc84062740049eef990bb2ce07598272e673c17d1a7720c71c828"}, - {file = "black-25.12.0.tar.gz", hash = "sha256:8d3dd9cea14bff7ddc0eb243c811cdb1a011ebb4800a5f0335a01a68654796a7"}, -] - -[package.dependencies] -click = ">=8.0.0" -mypy-extensions = ">=0.4.3" -packaging = ">=22.0" -pathspec = ">=0.9.0" -platformdirs = ">=2" -pytokens = ">=0.3.0" - -[package.extras] -colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.10)"] -jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -uvloop = ["uvloop (>=0.15.2)"] - -[[package]] -name = "certifi" -version = "2026.1.4" -description = "Python package for providing Mozilla's CA Bundle." -optional = false -python-versions = ">=3.7" -groups = ["main", "dev"] -files = [ - {file = "certifi-2026.1.4-py3-none-any.whl", hash = "sha256:9943707519e4add1115f44c2bc244f782c0249876bf51b6599fee1ffbedd685c"}, - {file = "certifi-2026.1.4.tar.gz", hash = "sha256:ac726dd470482006e014ad384921ed6438c457018f4b3d204aea4281258b2120"}, -] - -[[package]] -name = "click" -version = "8.3.1" -description = "Composable command line interface toolkit" -optional = false -python-versions = ">=3.10" -groups = ["dev"] -files = [ - {file = "click-8.3.1-py3-none-any.whl", hash = "sha256:981153a64e25f12d547d3426c367a4857371575ee7ad18df2a6183ab0545b2a6"}, - {file = "click-8.3.1.tar.gz", hash = "sha256:12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "platform_system == \"Windows\""} - -[[package]] -name = "colorama" -version = "0.4.6" -description = "Cross-platform colored terminal text." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -groups = ["dev"] -markers = "sys_platform == \"win32\" or platform_system == \"Windows\"" -files = [ - {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, - {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, -] - -[[package]] -name = "h11" -version = "0.16.0" -description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, - {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, -] - -[[package]] -name = "httpcore" -version = "1.0.9" -description = "A minimal low-level HTTP client." -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, - {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, -] - -[package.dependencies] -certifi = "*" -h11 = ">=0.16" - -[package.extras] -asyncio = ["anyio (>=4.0,<5.0)"] -http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] -trio = ["trio (>=0.22.0,<1.0)"] - -[[package]] -name = "httpx" -version = "0.28.1" -description = "The next generation HTTP client." -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, - {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, -] - -[package.dependencies] -anyio = "*" -certifi = "*" -httpcore = "==1.*" -idna = "*" - -[package.extras] -brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] -cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] -http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] -zstd = ["zstandard (>=0.18.0)"] - -[[package]] -name = "idna" -version = "3.11" -description = "Internationalized Domain Names in Applications (IDNA)" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, - {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, -] - -[package.extras] -all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] - -[[package]] -name = "iniconfig" -version = "2.3.0" -description = "brain-dead simple config-ini parsing" -optional = false -python-versions = ">=3.10" -groups = ["dev"] -files = [ - {file = "iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12"}, - {file = "iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730"}, -] - -[[package]] -name = "jinja2" -version = "3.1.6" -description = "A very fast and expressive template engine." -optional = false -python-versions = ">=3.7" -groups = ["dev"] -files = [ - {file = "jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67"}, - {file = "jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"}, -] - -[package.dependencies] -MarkupSafe = ">=2.0" - -[package.extras] -i18n = ["Babel (>=2.7)"] - -[[package]] -name = "librt" -version = "0.7.7" -description = "Mypyc runtime library" -optional = false -python-versions = ">=3.9" -groups = ["dev"] -markers = "platform_python_implementation != \"PyPy\"" -files = [ - {file = "librt-0.7.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e4836c5645f40fbdc275e5670819bde5ab5f2e882290d304e3c6ddab1576a6d0"}, - {file = "librt-0.7.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6ae8aec43117a645a31e5f60e9e3a0797492e747823b9bda6972d521b436b4e8"}, - {file = "librt-0.7.7-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:aea05f701ccd2a76b34f0daf47ca5068176ff553510b614770c90d76ac88df06"}, - {file = "librt-0.7.7-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7b16ccaeff0ed4355dfb76fe1ea7a5d6d03b5ad27f295f77ee0557bc20a72495"}, - {file = "librt-0.7.7-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c48c7e150c095d5e3cea7452347ba26094be905d6099d24f9319a8b475fcd3e0"}, - {file = "librt-0.7.7-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:4dcee2f921a8632636d1c37f1bbdb8841d15666d119aa61e5399c5268e7ce02e"}, - {file = "librt-0.7.7-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:14ef0f4ac3728ffd85bfc58e2f2f48fb4ef4fa871876f13a73a7381d10a9f77c"}, - {file = "librt-0.7.7-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e4ab69fa37f8090f2d971a5d2bc606c7401170dbdae083c393d6cbf439cb45b8"}, - {file = "librt-0.7.7-cp310-cp310-win32.whl", hash = "sha256:4bf3cc46d553693382d2abf5f5bd493d71bb0f50a7c0beab18aa13a5545c8900"}, - {file = "librt-0.7.7-cp310-cp310-win_amd64.whl", hash = "sha256:f0c8fe5aeadd8a0e5b0598f8a6ee3533135ca50fd3f20f130f9d72baf5c6ac58"}, - {file = "librt-0.7.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a487b71fbf8a9edb72a8c7a456dda0184642d99cd007bc819c0b7ab93676a8ee"}, - {file = "librt-0.7.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f4d4efb218264ecf0f8516196c9e2d1a0679d9fb3bb15df1155a35220062eba8"}, - {file = "librt-0.7.7-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:b8bb331aad734b059c4b450cd0a225652f16889e286b2345af5e2c3c625c3d85"}, - {file = "librt-0.7.7-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:467dbd7443bda08338fc8ad701ed38cef48194017554f4c798b0a237904b3f99"}, - {file = "librt-0.7.7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:50d1d1ee813d2d1a3baf2873634ba506b263032418d16287c92ec1cc9c1a00cb"}, - {file = "librt-0.7.7-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c7e5070cf3ec92d98f57574da0224f8c73faf1ddd6d8afa0b8c9f6e86997bc74"}, - {file = "librt-0.7.7-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:bdb9f3d865b2dafe7f9ad7f30ef563c80d0ddd2fdc8cc9b8e4f242f475e34d75"}, - {file = "librt-0.7.7-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:8185c8497d45164e256376f9da5aed2bb26ff636c798c9dabe313b90e9f25b28"}, - {file = "librt-0.7.7-cp311-cp311-win32.whl", hash = "sha256:44d63ce643f34a903f09ff7ca355aae019a3730c7afd6a3c037d569beeb5d151"}, - {file = "librt-0.7.7-cp311-cp311-win_amd64.whl", hash = "sha256:7d13cc340b3b82134f8038a2bfe7137093693dcad8ba5773da18f95ad6b77a8a"}, - {file = "librt-0.7.7-cp311-cp311-win_arm64.whl", hash = "sha256:983de36b5a83fe9222f4f7dcd071f9b1ac6f3f17c0af0238dadfb8229588f890"}, - {file = "librt-0.7.7-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2a85a1fc4ed11ea0eb0a632459ce004a2d14afc085a50ae3463cd3dfe1ce43fc"}, - {file = "librt-0.7.7-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c87654e29a35938baead1c4559858f346f4a2a7588574a14d784f300ffba0efd"}, - {file = "librt-0.7.7-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:c9faaebb1c6212c20afd8043cd6ed9de0a47d77f91a6b5b48f4e46ed470703fe"}, - {file = "librt-0.7.7-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1908c3e5a5ef86b23391448b47759298f87f997c3bd153a770828f58c2bb4630"}, - {file = "librt-0.7.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dbc4900e95a98fc0729523be9d93a8fedebb026f32ed9ffc08acd82e3e181503"}, - {file = "librt-0.7.7-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a7ea4e1fbd253e5c68ea0fe63d08577f9d288a73f17d82f652ebc61fa48d878d"}, - {file = "librt-0.7.7-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:ef7699b7a5a244b1119f85c5bbc13f152cd38240cbb2baa19b769433bae98e50"}, - {file = "librt-0.7.7-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:955c62571de0b181d9e9e0a0303c8bc90d47670a5eff54cf71bf5da61d1899cf"}, - {file = "librt-0.7.7-cp312-cp312-win32.whl", hash = "sha256:1bcd79be209313b270b0e1a51c67ae1af28adad0e0c7e84c3ad4b5cb57aaa75b"}, - {file = "librt-0.7.7-cp312-cp312-win_amd64.whl", hash = "sha256:4353ee891a1834567e0302d4bd5e60f531912179578c36f3d0430f8c5e16b456"}, - {file = "librt-0.7.7-cp312-cp312-win_arm64.whl", hash = "sha256:a76f1d679beccccdf8c1958e732a1dfcd6e749f8821ee59d7bec009ac308c029"}, - {file = "librt-0.7.7-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8f4a0b0a3c86ba9193a8e23bb18f100d647bf192390ae195d84dfa0a10fb6244"}, - {file = "librt-0.7.7-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5335890fea9f9e6c4fdf8683061b9ccdcbe47c6dc03ab8e9b68c10acf78be78d"}, - {file = "librt-0.7.7-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:9b4346b1225be26def3ccc6c965751c74868f0578cbcba293c8ae9168483d811"}, - {file = "librt-0.7.7-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a10b8eebdaca6e9fdbaf88b5aefc0e324b763a5f40b1266532590d5afb268a4c"}, - {file = "librt-0.7.7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:067be973d90d9e319e6eb4ee2a9b9307f0ecd648b8a9002fa237289a4a07a9e7"}, - {file = "librt-0.7.7-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:23d2299ed007812cccc1ecef018db7d922733382561230de1f3954db28433977"}, - {file = "librt-0.7.7-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:6b6f8ea465524aa4c7420c7cc4ca7d46fe00981de8debc67b1cc2e9957bb5b9d"}, - {file = "librt-0.7.7-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:f8df32a99cc46eb0ee90afd9ada113ae2cafe7e8d673686cf03ec53e49635439"}, - {file = "librt-0.7.7-cp313-cp313-win32.whl", hash = "sha256:86f86b3b785487c7760247bcdac0b11aa8bf13245a13ed05206286135877564b"}, - {file = "librt-0.7.7-cp313-cp313-win_amd64.whl", hash = "sha256:4862cb2c702b1f905c0503b72d9d4daf65a7fdf5a9e84560e563471e57a56949"}, - {file = "librt-0.7.7-cp313-cp313-win_arm64.whl", hash = "sha256:0996c83b1cb43c00e8c87835a284f9057bc647abd42b5871e5f941d30010c832"}, - {file = "librt-0.7.7-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:23daa1ab0512bafdd677eb1bfc9611d8ffbe2e328895671e64cb34166bc1b8c8"}, - {file = "librt-0.7.7-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:558a9e5a6f3cc1e20b3168fb1dc802d0d8fa40731f6e9932dcc52bbcfbd37111"}, - {file = "librt-0.7.7-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:2567cb48dc03e5b246927ab35cbb343376e24501260a9b5e30b8e255dca0d1d2"}, - {file = "librt-0.7.7-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6066c638cdf85ff92fc6f932d2d73c93a0e03492cdfa8778e6d58c489a3d7259"}, - {file = "librt-0.7.7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a609849aca463074c17de9cda173c276eb8fee9e441053529e7b9e249dc8b8ee"}, - {file = "librt-0.7.7-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:add4e0a000858fe9bb39ed55f31085506a5c38363e6eb4a1e5943a10c2bfc3d1"}, - {file = "librt-0.7.7-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:a3bfe73a32bd0bdb9a87d586b05a23c0a1729205d79df66dee65bb2e40d671ba"}, - {file = "librt-0.7.7-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:0ecce0544d3db91a40f8b57ae26928c02130a997b540f908cefd4d279d6c5848"}, - {file = "librt-0.7.7-cp314-cp314-win32.whl", hash = "sha256:8f7a74cf3a80f0c3b0ec75b0c650b2f0a894a2cec57ef75f6f72c1e82cdac61d"}, - {file = "librt-0.7.7-cp314-cp314-win_amd64.whl", hash = "sha256:3d1fe2e8df3268dd6734dba33ededae72ad5c3a859b9577bc00b715759c5aaab"}, - {file = "librt-0.7.7-cp314-cp314-win_arm64.whl", hash = "sha256:2987cf827011907d3dfd109f1be0d61e173d68b1270107bb0e89f2fca7f2ed6b"}, - {file = "librt-0.7.7-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:8e92c8de62b40bfce91d5e12c6e8b15434da268979b1af1a6589463549d491e6"}, - {file = "librt-0.7.7-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f683dcd49e2494a7535e30f779aa1ad6e3732a019d80abe1309ea91ccd3230e3"}, - {file = "librt-0.7.7-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:9b15e5d17812d4d629ff576699954f74e2cc24a02a4fc401882dd94f81daba45"}, - {file = "librt-0.7.7-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c084841b879c4d9b9fa34e5d5263994f21aea7fd9c6add29194dbb41a6210536"}, - {file = "librt-0.7.7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:10c8fb9966f84737115513fecbaf257f9553d067a7dd45a69c2c7e5339e6a8dc"}, - {file = "librt-0.7.7-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:9b5fb1ecb2c35362eab2dbd354fd1efa5a8440d3e73a68be11921042a0edc0ff"}, - {file = "librt-0.7.7-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:d1454899909d63cc9199a89fcc4f81bdd9004aef577d4ffc022e600c412d57f3"}, - {file = "librt-0.7.7-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:7ef28f2e7a016b29792fe0a2dd04dec75725b32a1264e390c366103f834a9c3a"}, - {file = "librt-0.7.7-cp314-cp314t-win32.whl", hash = "sha256:5e419e0db70991b6ba037b70c1d5bbe92b20ddf82f31ad01d77a347ed9781398"}, - {file = "librt-0.7.7-cp314-cp314t-win_amd64.whl", hash = "sha256:d6b7d93657332c817b8d674ef6bf1ab7796b4f7ce05e420fd45bd258a72ac804"}, - {file = "librt-0.7.7-cp314-cp314t-win_arm64.whl", hash = "sha256:142c2cd91794b79fd0ce113bd658993b7ede0fe93057668c2f98a45ca00b7e91"}, - {file = "librt-0.7.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c8ffe3431d98cc043a14e88b21288b5ec7ee12cb01260e94385887f285ef9389"}, - {file = "librt-0.7.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e40d20ae1722d6b8ea6acf4597e789604649dcd9c295eb7361a28225bc2e9e12"}, - {file = "librt-0.7.7-cp39-cp39-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:f2cb63c49bc96847c3bb8dca350970e4dcd19936f391cfdfd057dcb37c4fa97e"}, - {file = "librt-0.7.7-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8f2f8dcf5ab9f80fb970c6fd780b398efb2f50c1962485eb8d3ab07788595a48"}, - {file = "librt-0.7.7-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a1f5cc41a570269d1be7a676655875e3a53de4992a9fa38efb7983e97cf73d7c"}, - {file = "librt-0.7.7-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:ff1fb2dfef035549565a4124998fadcb7a3d4957131ddf004a56edeb029626b3"}, - {file = "librt-0.7.7-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:ab2a2a9cd7d044e1a11ca64a86ad3361d318176924bbe5152fbc69f99be20b8c"}, - {file = "librt-0.7.7-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:ad3fc2d859a709baf9dd9607bb72f599b1cfb8a39eafd41307d0c3c4766763cb"}, - {file = "librt-0.7.7-cp39-cp39-win32.whl", hash = "sha256:f83c971eb9d2358b6a18da51dc0ae00556ac7c73104dde16e9e14c15aaf685ca"}, - {file = "librt-0.7.7-cp39-cp39-win_amd64.whl", hash = "sha256:264720fc288c86039c091a4ad63419a5d7cabbf1c1c9933336a957ed2483e570"}, - {file = "librt-0.7.7.tar.gz", hash = "sha256:81d957b069fed1890953c3b9c3895c7689960f233eea9a1d9607f71ce7f00b2c"}, -] - -[[package]] -name = "markdown-it-py" -version = "4.0.0" -description = "Python port of markdown-it. Markdown parsing, done right!" -optional = false -python-versions = ">=3.10" -groups = ["dev"] -files = [ - {file = "markdown_it_py-4.0.0-py3-none-any.whl", hash = "sha256:87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147"}, - {file = "markdown_it_py-4.0.0.tar.gz", hash = "sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3"}, -] - -[package.dependencies] -mdurl = ">=0.1,<1.0" - -[package.extras] -benchmarking = ["psutil", "pytest", "pytest-benchmark"] -compare = ["commonmark (>=0.9,<1.0)", "markdown (>=3.4,<4.0)", "markdown-it-pyrs", "mistletoe (>=1.0,<2.0)", "mistune (>=3.0,<4.0)", "panflute (>=2.3,<3.0)"] -linkify = ["linkify-it-py (>=1,<3)"] -plugins = ["mdit-py-plugins (>=0.5.0)"] -profiling = ["gprof2dot"] -rtd = ["ipykernel", "jupyter_sphinx", "mdit-py-plugins (>=0.5.0)", "myst-parser", "pyyaml", "sphinx", "sphinx-book-theme (>=1.0,<2.0)", "sphinx-copybutton", "sphinx-design"] -testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions", "requests"] - -[[package]] -name = "markupsafe" -version = "3.0.3" -description = "Safely add untrusted strings to HTML/XML markup." -optional = false -python-versions = ">=3.9" -groups = ["dev"] -files = [ - {file = "markupsafe-3.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2f981d352f04553a7171b8e44369f2af4055f888dfb147d55e42d29e29e74559"}, - {file = "markupsafe-3.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e1c1493fb6e50ab01d20a22826e57520f1284df32f2d8601fdd90b6304601419"}, - {file = "markupsafe-3.0.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1ba88449deb3de88bd40044603fafffb7bc2b055d626a330323a9ed736661695"}, - {file = "markupsafe-3.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f42d0984e947b8adf7dd6dde396e720934d12c506ce84eea8476409563607591"}, - {file = "markupsafe-3.0.3-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c0c0b3ade1c0b13b936d7970b1d37a57acde9199dc2aecc4c336773e1d86049c"}, - {file = "markupsafe-3.0.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:0303439a41979d9e74d18ff5e2dd8c43ed6c6001fd40e5bf2e43f7bd9bbc523f"}, - {file = "markupsafe-3.0.3-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:d2ee202e79d8ed691ceebae8e0486bd9a2cd4794cec4824e1c99b6f5009502f6"}, - {file = "markupsafe-3.0.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:177b5253b2834fe3678cb4a5f0059808258584c559193998be2601324fdeafb1"}, - {file = "markupsafe-3.0.3-cp310-cp310-win32.whl", hash = "sha256:2a15a08b17dd94c53a1da0438822d70ebcd13f8c3a95abe3a9ef9f11a94830aa"}, - {file = "markupsafe-3.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:c4ffb7ebf07cfe8931028e3e4c85f0357459a3f9f9490886198848f4fa002ec8"}, - {file = "markupsafe-3.0.3-cp310-cp310-win_arm64.whl", hash = "sha256:e2103a929dfa2fcaf9bb4e7c091983a49c9ac3b19c9061b6d5427dd7d14d81a1"}, - {file = "markupsafe-3.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1cc7ea17a6824959616c525620e387f6dd30fec8cb44f649e31712db02123dad"}, - {file = "markupsafe-3.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bd4cd07944443f5a265608cc6aab442e4f74dff8088b0dfc8238647b8f6ae9a"}, - {file = "markupsafe-3.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b5420a1d9450023228968e7e6a9ce57f65d148ab56d2313fcd589eee96a7a50"}, - {file = "markupsafe-3.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0bf2a864d67e76e5c9a34dc26ec616a66b9888e25e7b9460e1c76d3293bd9dbf"}, - {file = "markupsafe-3.0.3-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:bc51efed119bc9cfdf792cdeaa4d67e8f6fcccab66ed4bfdd6bde3e59bfcbb2f"}, - {file = "markupsafe-3.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:068f375c472b3e7acbe2d5318dea141359e6900156b5b2ba06a30b169086b91a"}, - {file = "markupsafe-3.0.3-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:7be7b61bb172e1ed687f1754f8e7484f1c8019780f6f6b0786e76bb01c2ae115"}, - {file = "markupsafe-3.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a"}, - {file = "markupsafe-3.0.3-cp311-cp311-win32.whl", hash = "sha256:0db14f5dafddbb6d9208827849fad01f1a2609380add406671a26386cdf15a19"}, - {file = "markupsafe-3.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:de8a88e63464af587c950061a5e6a67d3632e36df62b986892331d4620a35c01"}, - {file = "markupsafe-3.0.3-cp311-cp311-win_arm64.whl", hash = "sha256:3b562dd9e9ea93f13d53989d23a7e775fdfd1066c33494ff43f5418bc8c58a5c"}, - {file = "markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e"}, - {file = "markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce"}, - {file = "markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d"}, - {file = "markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d"}, - {file = "markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a"}, - {file = "markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b"}, - {file = "markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f"}, - {file = "markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b"}, - {file = "markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d"}, - {file = "markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c"}, - {file = "markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f"}, - {file = "markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795"}, - {file = "markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219"}, - {file = "markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6"}, - {file = "markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676"}, - {file = "markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9"}, - {file = "markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1"}, - {file = "markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc"}, - {file = "markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12"}, - {file = "markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed"}, - {file = "markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5"}, - {file = "markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485"}, - {file = "markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73"}, - {file = "markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37"}, - {file = "markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19"}, - {file = "markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025"}, - {file = "markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6"}, - {file = "markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f"}, - {file = "markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb"}, - {file = "markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009"}, - {file = "markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354"}, - {file = "markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218"}, - {file = "markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287"}, - {file = "markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe"}, - {file = "markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026"}, - {file = "markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737"}, - {file = "markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97"}, - {file = "markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d"}, - {file = "markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda"}, - {file = "markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf"}, - {file = "markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe"}, - {file = "markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9"}, - {file = "markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581"}, - {file = "markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4"}, - {file = "markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab"}, - {file = "markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175"}, - {file = "markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634"}, - {file = "markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50"}, - {file = "markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e"}, - {file = "markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5"}, - {file = "markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523"}, - {file = "markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc"}, - {file = "markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d"}, - {file = "markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9"}, - {file = "markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa"}, - {file = "markupsafe-3.0.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:15d939a21d546304880945ca1ecb8a039db6b4dc49b2c5a400387cdae6a62e26"}, - {file = "markupsafe-3.0.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f71a396b3bf33ecaa1626c255855702aca4d3d9fea5e051b41ac59a9c1c41edc"}, - {file = "markupsafe-3.0.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f4b68347f8c5eab4a13419215bdfd7f8c9b19f2b25520968adfad23eb0ce60c"}, - {file = "markupsafe-3.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e8fc20152abba6b83724d7ff268c249fa196d8259ff481f3b1476383f8f24e42"}, - {file = "markupsafe-3.0.3-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:949b8d66bc381ee8b007cd945914c721d9aba8e27f71959d750a46f7c282b20b"}, - {file = "markupsafe-3.0.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:3537e01efc9d4dccdf77221fb1cb3b8e1a38d5428920e0657ce299b20324d758"}, - {file = "markupsafe-3.0.3-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:591ae9f2a647529ca990bc681daebdd52c8791ff06c2bfa05b65163e28102ef2"}, - {file = "markupsafe-3.0.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a320721ab5a1aba0a233739394eb907f8c8da5c98c9181d1161e77a0c8e36f2d"}, - {file = "markupsafe-3.0.3-cp39-cp39-win32.whl", hash = "sha256:df2449253ef108a379b8b5d6b43f4b1a8e81a061d6537becd5582fba5f9196d7"}, - {file = "markupsafe-3.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:7c3fb7d25180895632e5d3148dbdc29ea38ccb7fd210aa27acbd1201a1902c6e"}, - {file = "markupsafe-3.0.3-cp39-cp39-win_arm64.whl", hash = "sha256:38664109c14ffc9e7437e86b4dceb442b0096dfe3541d7864d9cbe1da4cf36c8"}, - {file = "markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698"}, -] - -[[package]] -name = "mdurl" -version = "0.1.2" -description = "Markdown URL utilities" -optional = false -python-versions = ">=3.7" -groups = ["dev"] -files = [ - {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, - {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, -] - -[[package]] -name = "mypy" -version = "1.19.1" -description = "Optional static typing for Python" -optional = false -python-versions = ">=3.9" -groups = ["dev"] -files = [ - {file = "mypy-1.19.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5f05aa3d375b385734388e844bc01733bd33c644ab48e9684faa54e5389775ec"}, - {file = "mypy-1.19.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:022ea7279374af1a5d78dfcab853fe6a536eebfda4b59deab53cd21f6cd9f00b"}, - {file = "mypy-1.19.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee4c11e460685c3e0c64a4c5de82ae143622410950d6be863303a1c4ba0e36d6"}, - {file = "mypy-1.19.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de759aafbae8763283b2ee5869c7255391fbc4de3ff171f8f030b5ec48381b74"}, - {file = "mypy-1.19.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:ab43590f9cd5108f41aacf9fca31841142c786827a74ab7cc8a2eacb634e09a1"}, - {file = "mypy-1.19.1-cp310-cp310-win_amd64.whl", hash = "sha256:2899753e2f61e571b3971747e302d5f420c3fd09650e1951e99f823bc3089dac"}, - {file = "mypy-1.19.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d8dfc6ab58ca7dda47d9237349157500468e404b17213d44fc1cb77bce532288"}, - {file = "mypy-1.19.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e3f276d8493c3c97930e354b2595a44a21348b320d859fb4a2b9f66da9ed27ab"}, - {file = "mypy-1.19.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2abb24cf3f17864770d18d673c85235ba52456b36a06b6afc1e07c1fdcd3d0e6"}, - {file = "mypy-1.19.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a009ffa5a621762d0c926a078c2d639104becab69e79538a494bcccb62cc0331"}, - {file = "mypy-1.19.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f7cee03c9a2e2ee26ec07479f38ea9c884e301d42c6d43a19d20fb014e3ba925"}, - {file = "mypy-1.19.1-cp311-cp311-win_amd64.whl", hash = "sha256:4b84a7a18f41e167f7995200a1d07a4a6810e89d29859df936f1c3923d263042"}, - {file = "mypy-1.19.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a8174a03289288c1f6c46d55cef02379b478bfbc8e358e02047487cad44c6ca1"}, - {file = "mypy-1.19.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ffcebe56eb09ff0c0885e750036a095e23793ba6c2e894e7e63f6d89ad51f22e"}, - {file = "mypy-1.19.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b64d987153888790bcdb03a6473d321820597ab8dd9243b27a92153c4fa50fd2"}, - {file = "mypy-1.19.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c35d298c2c4bba75feb2195655dfea8124d855dfd7343bf8b8c055421eaf0cf8"}, - {file = "mypy-1.19.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:34c81968774648ab5ac09c29a375fdede03ba253f8f8287847bd480782f73a6a"}, - {file = "mypy-1.19.1-cp312-cp312-win_amd64.whl", hash = "sha256:b10e7c2cd7870ba4ad9b2d8a6102eb5ffc1f16ca35e3de6bfa390c1113029d13"}, - {file = "mypy-1.19.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e3157c7594ff2ef1634ee058aafc56a82db665c9438fd41b390f3bde1ab12250"}, - {file = "mypy-1.19.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:bdb12f69bcc02700c2b47e070238f42cb87f18c0bc1fc4cdb4fb2bc5fd7a3b8b"}, - {file = "mypy-1.19.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f859fb09d9583a985be9a493d5cfc5515b56b08f7447759a0c5deaf68d80506e"}, - {file = "mypy-1.19.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c9a6538e0415310aad77cb94004ca6482330fece18036b5f360b62c45814c4ef"}, - {file = "mypy-1.19.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:da4869fc5e7f62a88f3fe0b5c919d1d9f7ea3cef92d3689de2823fd27e40aa75"}, - {file = "mypy-1.19.1-cp313-cp313-win_amd64.whl", hash = "sha256:016f2246209095e8eda7538944daa1d60e1e8134d98983b9fc1e92c1fc0cb8dd"}, - {file = "mypy-1.19.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:06e6170bd5836770e8104c8fdd58e5e725cfeb309f0a6c681a811f557e97eac1"}, - {file = "mypy-1.19.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:804bd67b8054a85447c8954215a906d6eff9cabeabe493fb6334b24f4bfff718"}, - {file = "mypy-1.19.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:21761006a7f497cb0d4de3d8ef4ca70532256688b0523eee02baf9eec895e27b"}, - {file = "mypy-1.19.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:28902ee51f12e0f19e1e16fbe2f8f06b6637f482c459dd393efddd0ec7f82045"}, - {file = "mypy-1.19.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:481daf36a4c443332e2ae9c137dfee878fcea781a2e3f895d54bd3002a900957"}, - {file = "mypy-1.19.1-cp314-cp314-win_amd64.whl", hash = "sha256:8bb5c6f6d043655e055be9b542aa5f3bdd30e4f3589163e85f93f3640060509f"}, - {file = "mypy-1.19.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7bcfc336a03a1aaa26dfce9fff3e287a3ba99872a157561cbfcebe67c13308e3"}, - {file = "mypy-1.19.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b7951a701c07ea584c4fe327834b92a30825514c868b1f69c30445093fdd9d5a"}, - {file = "mypy-1.19.1-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b13cfdd6c87fc3efb69ea4ec18ef79c74c3f98b4e5498ca9b85ab3b2c2329a67"}, - {file = "mypy-1.19.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f28f99c824ecebcdaa2e55d82953e38ff60ee5ec938476796636b86afa3956e"}, - {file = "mypy-1.19.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:c608937067d2fc5a4dd1a5ce92fd9e1398691b8c5d012d66e1ddd430e9244376"}, - {file = "mypy-1.19.1-cp39-cp39-win_amd64.whl", hash = "sha256:409088884802d511ee52ca067707b90c883426bd95514e8cfda8281dc2effe24"}, - {file = "mypy-1.19.1-py3-none-any.whl", hash = "sha256:f1235f5ea01b7db5468d53ece6aaddf1ad0b88d9e7462b86ef96fe04995d7247"}, - {file = "mypy-1.19.1.tar.gz", hash = "sha256:19d88bb05303fe63f71dd2c6270daca27cb9401c4ca8255fe50d1d920e0eb9ba"}, -] - -[package.dependencies] -librt = {version = ">=0.6.2", markers = "platform_python_implementation != \"PyPy\""} -mypy_extensions = ">=1.0.0" -pathspec = ">=0.9.0" -typing_extensions = ">=4.6.0" - -[package.extras] -dmypy = ["psutil (>=4.0)"] -faster-cache = ["orjson"] -install-types = ["pip"] -mypyc = ["setuptools (>=50)"] -reports = ["lxml"] - -[[package]] -name = "mypy-extensions" -version = "1.1.0" -description = "Type system extensions for programs checked with the mypy type checker." -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"}, - {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, -] - -[[package]] -name = "openapi-python-client" -version = "0.28.1" -description = "Generate modern Python clients from OpenAPI" -optional = false -python-versions = "<4.0,>=3.10" -groups = ["dev"] -files = [ - {file = "openapi_python_client-0.28.1-py3-none-any.whl", hash = "sha256:9cf2f139f3c718f376f6a6981ed8ae37671f0fb2dd0f1d9504b2f583af1f82f9"}, - {file = "openapi_python_client-0.28.1.tar.gz", hash = "sha256:f11afc63c33c0e0b19beff9a1424026f0738815063c2c8e773e1f71dc10d692c"}, -] - -[package.dependencies] -attrs = ">=22.2.0" -colorama = {version = ">=0.4.3", markers = "sys_platform == \"win32\""} -httpx = ">=0.23.0,<0.29.0" -jinja2 = ">=3.0.0,<4.0.0" -pydantic = ">=2.10,<3.0.0" -python-dateutil = ">=2.8.1,<3.0.0" -ruamel-yaml = ">=0.18.6,<0.20.0" -ruff = ">=0.2" -shellingham = ">=1.3.2,<2.0.0" -typer = ">0.16,<0.22" - -[[package]] -name = "packaging" -version = "25.0" -description = "Core utilities for Python packages" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, - {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, -] - -[[package]] -name = "pathspec" -version = "1.0.3" -description = "Utility library for gitignore style pattern matching of file paths." -optional = false -python-versions = ">=3.9" -groups = ["dev"] -files = [ - {file = "pathspec-1.0.3-py3-none-any.whl", hash = "sha256:e80767021c1cc524aa3fb14bedda9c34406591343cc42797b386ce7b9354fb6c"}, - {file = "pathspec-1.0.3.tar.gz", hash = "sha256:bac5cf97ae2c2876e2d25ebb15078eb04d76e4b98921ee31c6f85ade8b59444d"}, -] - -[package.extras] -hyperscan = ["hyperscan (>=0.7)"] -optional = ["typing-extensions (>=4)"] -re2 = ["google-re2 (>=1.1)"] -tests = ["pytest (>=9)", "typing-extensions (>=4.15)"] - -[[package]] -name = "pdoc" -version = "14.7.0" -description = "API Documentation for Python Projects" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "pdoc-14.7.0-py3-none-any.whl", hash = "sha256:72377a907efc6b2c5b3c56b717ef34f11d93621dced3b663f3aede0b844c0ad2"}, - {file = "pdoc-14.7.0.tar.gz", hash = "sha256:2d28af9c0acc39180744ad0543e4bbc3223ecba0d1302db315ec521c51f71f93"}, -] - -[package.dependencies] -Jinja2 = ">=2.11.0" -MarkupSafe = "*" -pygments = ">=2.12.0" - -[package.extras] -dev = ["hypothesis", "mypy", "pdoc-pyo3-sample-library (==1.0.11)", "pygments (>=2.14.0)", "pytest", "pytest-cov", "pytest-timeout", "ruff", "tox", "types-pygments"] - -[[package]] -name = "platformdirs" -version = "4.5.1" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." -optional = false -python-versions = ">=3.10" -groups = ["dev"] -files = [ - {file = "platformdirs-4.5.1-py3-none-any.whl", hash = "sha256:d03afa3963c806a9bed9d5125c8f4cb2fdaf74a55ab60e5d59b3fde758104d31"}, - {file = "platformdirs-4.5.1.tar.gz", hash = "sha256:61d5cdcc6065745cdd94f0f878977f8de9437be93de97c1c12f853c9c0cdcbda"}, -] - -[package.extras] -docs = ["furo (>=2025.9.25)", "proselint (>=0.14)", "sphinx (>=8.2.3)", "sphinx-autodoc-typehints (>=3.2)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.4.2)", "pytest-cov (>=7)", "pytest-mock (>=3.15.1)"] -type = ["mypy (>=1.18.2)"] - -[[package]] -name = "pluggy" -version = "1.6.0" -description = "plugin and hook calling mechanisms for python" -optional = false -python-versions = ">=3.9" -groups = ["dev"] -files = [ - {file = "pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746"}, - {file = "pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3"}, -] - -[package.extras] -dev = ["pre-commit", "tox"] -testing = ["coverage", "pytest", "pytest-benchmark"] - -[[package]] -name = "pydantic" -version = "2.12.5" -description = "Data validation using Python type hints" -optional = false -python-versions = ">=3.9" -groups = ["main", "dev"] -files = [ - {file = "pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d"}, - {file = "pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49"}, -] - -[package.dependencies] -annotated-types = ">=0.6.0" -pydantic-core = "2.41.5" -typing-extensions = ">=4.14.1" -typing-inspection = ">=0.4.2" - -[package.extras] -email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""] - -[[package]] -name = "pydantic-core" -version = "2.41.5" -description = "Core functionality for Pydantic validation and serialization" -optional = false -python-versions = ">=3.9" -groups = ["main", "dev"] -files = [ - {file = "pydantic_core-2.41.5-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:77b63866ca88d804225eaa4af3e664c5faf3568cea95360d21f4725ab6e07146"}, - {file = "pydantic_core-2.41.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:dfa8a0c812ac681395907e71e1274819dec685fec28273a28905df579ef137e2"}, - {file = "pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5921a4d3ca3aee735d9fd163808f5e8dd6c6972101e4adbda9a4667908849b97"}, - {file = "pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e25c479382d26a2a41b7ebea1043564a937db462816ea07afa8a44c0866d52f9"}, - {file = "pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f547144f2966e1e16ae626d8ce72b4cfa0caedc7fa28052001c94fb2fcaa1c52"}, - {file = "pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f52298fbd394f9ed112d56f3d11aabd0d5bd27beb3084cc3d8ad069483b8941"}, - {file = "pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:100baa204bb412b74fe285fb0f3a385256dad1d1879f0a5cb1499ed2e83d132a"}, - {file = "pydantic_core-2.41.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:05a2c8852530ad2812cb7914dc61a1125dc4e06252ee98e5638a12da6cc6fb6c"}, - {file = "pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:29452c56df2ed968d18d7e21f4ab0ac55e71dc59524872f6fc57dcf4a3249ed2"}, - {file = "pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:d5160812ea7a8a2ffbe233d8da666880cad0cbaf5d4de74ae15c313213d62556"}, - {file = "pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:df3959765b553b9440adfd3c795617c352154e497a4eaf3752555cfb5da8fc49"}, - {file = "pydantic_core-2.41.5-cp310-cp310-win32.whl", hash = "sha256:1f8d33a7f4d5a7889e60dc39856d76d09333d8a6ed0f5f1190635cbec70ec4ba"}, - {file = "pydantic_core-2.41.5-cp310-cp310-win_amd64.whl", hash = "sha256:62de39db01b8d593e45871af2af9e497295db8d73b085f6bfd0b18c83c70a8f9"}, - {file = "pydantic_core-2.41.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a3a52f6156e73e7ccb0f8cced536adccb7042be67cb45f9562e12b319c119da6"}, - {file = "pydantic_core-2.41.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7f3bf998340c6d4b0c9a2f02d6a400e51f123b59565d74dc60d252ce888c260b"}, - {file = "pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:378bec5c66998815d224c9ca994f1e14c0c21cb95d2f52b6021cc0b2a58f2a5a"}, - {file = "pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e7b576130c69225432866fe2f4a469a85a54ade141d96fd396dffcf607b558f8"}, - {file = "pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6cb58b9c66f7e4179a2d5e0f849c48eff5c1fca560994d6eb6543abf955a149e"}, - {file = "pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:88942d3a3dff3afc8288c21e565e476fc278902ae4d6d134f1eeda118cc830b1"}, - {file = "pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f31d95a179f8d64d90f6831d71fa93290893a33148d890ba15de25642c5d075b"}, - {file = "pydantic_core-2.41.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c1df3d34aced70add6f867a8cf413e299177e0c22660cc767218373d0779487b"}, - {file = "pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:4009935984bd36bd2c774e13f9a09563ce8de4abaa7226f5108262fa3e637284"}, - {file = "pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:34a64bc3441dc1213096a20fe27e8e128bd3ff89921706e83c0b1ac971276594"}, - {file = "pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c9e19dd6e28fdcaa5a1de679aec4141f691023916427ef9bae8584f9c2fb3b0e"}, - {file = "pydantic_core-2.41.5-cp311-cp311-win32.whl", hash = "sha256:2c010c6ded393148374c0f6f0bf89d206bf3217f201faa0635dcd56bd1520f6b"}, - {file = "pydantic_core-2.41.5-cp311-cp311-win_amd64.whl", hash = "sha256:76ee27c6e9c7f16f47db7a94157112a2f3a00e958bc626e2f4ee8bec5c328fbe"}, - {file = "pydantic_core-2.41.5-cp311-cp311-win_arm64.whl", hash = "sha256:4bc36bbc0b7584de96561184ad7f012478987882ebf9f9c389b23f432ea3d90f"}, - {file = "pydantic_core-2.41.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f41a7489d32336dbf2199c8c0a215390a751c5b014c2c1c5366e817202e9cdf7"}, - {file = "pydantic_core-2.41.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:070259a8818988b9a84a449a2a7337c7f430a22acc0859c6b110aa7212a6d9c0"}, - {file = "pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e96cea19e34778f8d59fe40775a7a574d95816eb150850a85a7a4c8f4b94ac69"}, - {file = "pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed2e99c456e3fadd05c991f8f437ef902e00eedf34320ba2b0842bd1c3ca3a75"}, - {file = "pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:65840751b72fbfd82c3c640cff9284545342a4f1eb1586ad0636955b261b0b05"}, - {file = "pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e536c98a7626a98feb2d3eaf75944ef6f3dbee447e1f841eae16f2f0a72d8ddc"}, - {file = "pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eceb81a8d74f9267ef4081e246ffd6d129da5d87e37a77c9bde550cb04870c1c"}, - {file = "pydantic_core-2.41.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d38548150c39b74aeeb0ce8ee1d8e82696f4a4e16ddc6de7b1d8823f7de4b9b5"}, - {file = "pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c23e27686783f60290e36827f9c626e63154b82b116d7fe9adba1fda36da706c"}, - {file = "pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:482c982f814460eabe1d3bb0adfdc583387bd4691ef00b90575ca0d2b6fe2294"}, - {file = "pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:bfea2a5f0b4d8d43adf9d7b8bf019fb46fdd10a2e5cde477fbcb9d1fa08c68e1"}, - {file = "pydantic_core-2.41.5-cp312-cp312-win32.whl", hash = "sha256:b74557b16e390ec12dca509bce9264c3bbd128f8a2c376eaa68003d7f327276d"}, - {file = "pydantic_core-2.41.5-cp312-cp312-win_amd64.whl", hash = "sha256:1962293292865bca8e54702b08a4f26da73adc83dd1fcf26fbc875b35d81c815"}, - {file = "pydantic_core-2.41.5-cp312-cp312-win_arm64.whl", hash = "sha256:1746d4a3d9a794cacae06a5eaaccb4b8643a131d45fbc9af23e353dc0a5ba5c3"}, - {file = "pydantic_core-2.41.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:941103c9be18ac8daf7b7adca8228f8ed6bb7a1849020f643b3a14d15b1924d9"}, - {file = "pydantic_core-2.41.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:112e305c3314f40c93998e567879e887a3160bb8689ef3d2c04b6cc62c33ac34"}, - {file = "pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbaad15cb0c90aa221d43c00e77bb33c93e8d36e0bf74760cd00e732d10a6a0"}, - {file = "pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:03ca43e12fab6023fc79d28ca6b39b05f794ad08ec2feccc59a339b02f2b3d33"}, - {file = "pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc799088c08fa04e43144b164feb0c13f9a0bc40503f8df3e9fde58a3c0c101e"}, - {file = "pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97aeba56665b4c3235a0e52b2c2f5ae9cd071b8a8310ad27bddb3f7fb30e9aa2"}, - {file = "pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:406bf18d345822d6c21366031003612b9c77b3e29ffdb0f612367352aab7d586"}, - {file = "pydantic_core-2.41.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b93590ae81f7010dbe380cdeab6f515902ebcbefe0b9327cc4804d74e93ae69d"}, - {file = "pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:01a3d0ab748ee531f4ea6c3e48ad9dac84ddba4b0d82291f87248f2f9de8d740"}, - {file = "pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:6561e94ba9dacc9c61bce40e2d6bdc3bfaa0259d3ff36ace3b1e6901936d2e3e"}, - {file = "pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:915c3d10f81bec3a74fbd4faebe8391013ba61e5a1a8d48c4455b923bdda7858"}, - {file = "pydantic_core-2.41.5-cp313-cp313-win32.whl", hash = "sha256:650ae77860b45cfa6e2cdafc42618ceafab3a2d9a3811fcfbd3bbf8ac3c40d36"}, - {file = "pydantic_core-2.41.5-cp313-cp313-win_amd64.whl", hash = "sha256:79ec52ec461e99e13791ec6508c722742ad745571f234ea6255bed38c6480f11"}, - {file = "pydantic_core-2.41.5-cp313-cp313-win_arm64.whl", hash = "sha256:3f84d5c1b4ab906093bdc1ff10484838aca54ef08de4afa9de0f5f14d69639cd"}, - {file = "pydantic_core-2.41.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:3f37a19d7ebcdd20b96485056ba9e8b304e27d9904d233d7b1015db320e51f0a"}, - {file = "pydantic_core-2.41.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d1d9764366c73f996edd17abb6d9d7649a7eb690006ab6adbda117717099b14"}, - {file = "pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25e1c2af0fce638d5f1988b686f3b3ea8cd7de5f244ca147c777769e798a9cd1"}, - {file = "pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:506d766a8727beef16b7adaeb8ee6217c64fc813646b424d0804d67c16eddb66"}, - {file = "pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4819fa52133c9aa3c387b3328f25c1facc356491e6135b459f1de698ff64d869"}, - {file = "pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b761d210c9ea91feda40d25b4efe82a1707da2ef62901466a42492c028553a2"}, - {file = "pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22f0fb8c1c583a3b6f24df2470833b40207e907b90c928cc8d3594b76f874375"}, - {file = "pydantic_core-2.41.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c870e99878c634505236d81e5443092fba820f0373997ff75f90f68cd553"}, - {file = "pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0177272f88ab8312479336e1d777f6b124537d47f2123f89cb37e0accea97f90"}, - {file = "pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:63510af5e38f8955b8ee5687740d6ebf7c2a0886d15a6d65c32814613681bc07"}, - {file = "pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:e56ba91f47764cc14f1daacd723e3e82d1a89d783f0f5afe9c364b8bb491ccdb"}, - {file = "pydantic_core-2.41.5-cp314-cp314-win32.whl", hash = "sha256:aec5cf2fd867b4ff45b9959f8b20ea3993fc93e63c7363fe6851424c8a7e7c23"}, - {file = "pydantic_core-2.41.5-cp314-cp314-win_amd64.whl", hash = "sha256:8e7c86f27c585ef37c35e56a96363ab8de4e549a95512445b85c96d3e2f7c1bf"}, - {file = "pydantic_core-2.41.5-cp314-cp314-win_arm64.whl", hash = "sha256:e672ba74fbc2dc8eea59fb6d4aed6845e6905fc2a8afe93175d94a83ba2a01a0"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8566def80554c3faa0e65ac30ab0932b9e3a5cd7f8323764303d468e5c37595a"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b80aa5095cd3109962a298ce14110ae16b8c1aece8b72f9dafe81cf597ad80b3"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3006c3dd9ba34b0c094c544c6006cc79e87d8612999f1a5d43b769b89181f23c"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72f6c8b11857a856bcfa48c86f5368439f74453563f951e473514579d44aa612"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cb1b2f9742240e4bb26b652a5aeb840aa4b417c7748b6f8387927bc6e45e40d"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd3d54f38609ff308209bd43acea66061494157703364ae40c951f83ba99a1a9"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ff4321e56e879ee8d2a879501c8e469414d948f4aba74a2d4593184eb326660"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d0d2568a8c11bf8225044aa94409e21da0cb09dcdafe9ecd10250b2baad531a9"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:a39455728aabd58ceabb03c90e12f71fd30fa69615760a075b9fec596456ccc3"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:239edca560d05757817c13dc17c50766136d21f7cd0fac50295499ae24f90fdf"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:2a5e06546e19f24c6a96a129142a75cee553cc018ffee48a460059b1185f4470"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c"}, - {file = "pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008"}, - {file = "pydantic_core-2.41.5-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:8bfeaf8735be79f225f3fefab7f941c712aaca36f1128c9d7e2352ee1aa87bdf"}, - {file = "pydantic_core-2.41.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:346285d28e4c8017da95144c7f3acd42740d637ff41946af5ce6e5e420502dd5"}, - {file = "pydantic_core-2.41.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a75dafbf87d6276ddc5b2bf6fae5254e3d0876b626eb24969a574fff9149ee5d"}, - {file = "pydantic_core-2.41.5-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7b93a4d08587e2b7e7882de461e82b6ed76d9026ce91ca7915e740ecc7855f60"}, - {file = "pydantic_core-2.41.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e8465ab91a4bd96d36dde3263f06caa6a8a6019e4113f24dc753d79a8b3a3f82"}, - {file = "pydantic_core-2.41.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:299e0a22e7ae2b85c1a57f104538b2656e8ab1873511fd718a1c1c6f149b77b5"}, - {file = "pydantic_core-2.41.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:707625ef0983fcfb461acfaf14de2067c5942c6bb0f3b4c99158bed6fedd3cf3"}, - {file = "pydantic_core-2.41.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f41eb9797986d6ebac5e8edff36d5cef9de40def462311b3eb3eeded1431e425"}, - {file = "pydantic_core-2.41.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0384e2e1021894b1ff5a786dbf94771e2986ebe2869533874d7e43bc79c6f504"}, - {file = "pydantic_core-2.41.5-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:f0cd744688278965817fd0839c4a4116add48d23890d468bc436f78beb28abf5"}, - {file = "pydantic_core-2.41.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:753e230374206729bf0a807954bcc6c150d3743928a73faffee51ac6557a03c3"}, - {file = "pydantic_core-2.41.5-cp39-cp39-win32.whl", hash = "sha256:873e0d5b4fb9b89ef7c2d2a963ea7d02879d9da0da8d9d4933dee8ee86a8b460"}, - {file = "pydantic_core-2.41.5-cp39-cp39-win_amd64.whl", hash = "sha256:e4f4a984405e91527a0d62649ee21138f8e3d0ef103be488c1dc11a80d7f184b"}, - {file = "pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:b96d5f26b05d03cc60f11a7761a5ded1741da411e7fe0909e27a5e6a0cb7b034"}, - {file = "pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:634e8609e89ceecea15e2d61bc9ac3718caaaa71963717bf3c8f38bfde64242c"}, - {file = "pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:93e8740d7503eb008aa2df04d3b9735f845d43ae845e6dcd2be0b55a2da43cd2"}, - {file = "pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f15489ba13d61f670dcc96772e733aad1a6f9c429cc27574c6cdaed82d0146ad"}, - {file = "pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:7da7087d756b19037bc2c06edc6c170eeef3c3bafcb8f532ff17d64dc427adfd"}, - {file = "pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:aabf5777b5c8ca26f7824cb4a120a740c9588ed58df9b2d196ce92fba42ff8dc"}, - {file = "pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c007fe8a43d43b3969e8469004e9845944f1a80e6acd47c150856bb87f230c56"}, - {file = "pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76d0819de158cd855d1cbb8fcafdf6f5cf1eb8e470abe056d5d161106e38062b"}, - {file = "pydantic_core-2.41.5-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b5819cd790dbf0c5eb9f82c73c16b39a65dd6dd4d1439dcdea7816ec9adddab8"}, - {file = "pydantic_core-2.41.5-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:5a4e67afbc95fa5c34cf27d9089bca7fcab4e51e57278d710320a70b956d1b9a"}, - {file = "pydantic_core-2.41.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ece5c59f0ce7d001e017643d8d24da587ea1f74f6993467d85ae8a5ef9d4f42b"}, - {file = "pydantic_core-2.41.5-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:16f80f7abe3351f8ea6858914ddc8c77e02578544a0ebc15b4c2e1a0e813b0b2"}, - {file = "pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:33cb885e759a705b426baada1fe68cbb0a2e68e34c5d0d0289a364cf01709093"}, - {file = "pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:c8d8b4eb992936023be7dee581270af5c6e0697a8559895f527f5b7105ecd36a"}, - {file = "pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:242a206cd0318f95cd21bdacff3fcc3aab23e79bba5cac3db5a841c9ef9c6963"}, - {file = "pydantic_core-2.41.5-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:d3a978c4f57a597908b7e697229d996d77a6d3c94901e9edee593adada95ce1a"}, - {file = "pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b2379fa7ed44ddecb5bfe4e48577d752db9fc10be00a6b7446e9663ba143de26"}, - {file = "pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:266fb4cbf5e3cbd0b53669a6d1b039c45e3ce651fd5442eff4d07c2cc8d66808"}, - {file = "pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58133647260ea01e4d0500089a8c4f07bd7aa6ce109682b1426394988d8aaacc"}, - {file = "pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:287dad91cfb551c363dc62899a80e9e14da1f0e2b6ebde82c806612ca2a13ef1"}, - {file = "pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:03b77d184b9eb40240ae9fd676ca364ce1085f203e1b1256f8ab9984dca80a84"}, - {file = "pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:a668ce24de96165bb239160b3d854943128f4334822900534f2fe947930e5770"}, - {file = "pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f14f8f046c14563f8eb3f45f499cc658ab8d10072961e07225e507adb700e93f"}, - {file = "pydantic_core-2.41.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:56121965f7a4dc965bff783d70b907ddf3d57f6eba29b6d2e5dabfaf07799c51"}, - {file = "pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e"}, -] - -[package.dependencies] -typing-extensions = ">=4.14.1" - -[[package]] -name = "pygments" -version = "2.19.2" -description = "Pygments is a syntax highlighting package written in Python." -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b"}, - {file = "pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887"}, -] - -[package.extras] -windows-terminal = ["colorama (>=0.4.6)"] - -[[package]] -name = "pytest" -version = "8.4.2" -description = "pytest: simple powerful testing with Python" -optional = false -python-versions = ">=3.9" -groups = ["dev"] -files = [ - {file = "pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79"}, - {file = "pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01"}, -] - -[package.dependencies] -colorama = {version = ">=0.4", markers = "sys_platform == \"win32\""} -iniconfig = ">=1" -packaging = ">=20" -pluggy = ">=1.5,<2" -pygments = ">=2.7.2" - -[package.extras] -dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "requests", "setuptools", "xmlschema"] - -[[package]] -name = "pytest-asyncio" -version = "0.26.0" -description = "Pytest support for asyncio" -optional = false -python-versions = ">=3.9" -groups = ["dev"] -files = [ - {file = "pytest_asyncio-0.26.0-py3-none-any.whl", hash = "sha256:7b51ed894f4fbea1340262bdae5135797ebbe21d8638978e35d31c6d19f72fb0"}, - {file = "pytest_asyncio-0.26.0.tar.gz", hash = "sha256:c4df2a697648241ff39e7f0e4a73050b03f123f760673956cf0d72a4990e312f"}, -] - -[package.dependencies] -pytest = ">=8.2,<9" - -[package.extras] -docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1)"] -testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] - -[[package]] -name = "python-dateutil" -version = "2.9.0.post0" -description = "Extensions to the standard Python datetime module" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -groups = ["main", "dev"] -files = [ - {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, - {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, -] - -[package.dependencies] -six = ">=1.5" - -[[package]] -name = "pytokens" -version = "0.3.0" -description = "A Fast, spec compliant Python 3.14+ tokenizer that runs on older Pythons." -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "pytokens-0.3.0-py3-none-any.whl", hash = "sha256:95b2b5eaf832e469d141a378872480ede3f251a5a5041b8ec6e581d3ac71bbf3"}, - {file = "pytokens-0.3.0.tar.gz", hash = "sha256:2f932b14ed08de5fcf0b391ace2642f858f1394c0857202959000b68ed7a458a"}, -] - -[package.extras] -dev = ["black", "build", "mypy", "pytest", "pytest-cov", "setuptools", "tox", "twine", "wheel"] - -[[package]] -name = "rich" -version = "14.2.0" -description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" -optional = false -python-versions = ">=3.8.0" -groups = ["dev"] -files = [ - {file = "rich-14.2.0-py3-none-any.whl", hash = "sha256:76bc51fe2e57d2b1be1f96c524b890b816e334ab4c1e45888799bfaab0021edd"}, - {file = "rich-14.2.0.tar.gz", hash = "sha256:73ff50c7c0c1c77c8243079283f4edb376f0f6442433aecb8ce7e6d0b92d1fe4"}, -] - -[package.dependencies] -markdown-it-py = ">=2.2.0" -pygments = ">=2.13.0,<3.0.0" - -[package.extras] -jupyter = ["ipywidgets (>=7.5.1,<9)"] - -[[package]] -name = "ruamel-yaml" -version = "0.19.1" -description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" -optional = false -python-versions = ">=3.9" -groups = ["dev"] -files = [ - {file = "ruamel_yaml-0.19.1-py3-none-any.whl", hash = "sha256:27592957fedf6e0b62f281e96effd28043345e0e66001f97683aa9a40c667c93"}, - {file = "ruamel_yaml-0.19.1.tar.gz", hash = "sha256:53eb66cd27849eff968ebf8f0bf61f46cdac2da1d1f3576dd4ccee9b25c31993"}, -] - -[package.extras] -docs = ["mercurial (>5.7)", "ryd"] -jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] -libyaml = ["ruamel.yaml.clibz (>=0.3.7) ; platform_python_implementation == \"CPython\""] -oldlibyaml = ["ruamel.yaml.clib ; platform_python_implementation == \"CPython\""] - -[[package]] -name = "ruff" -version = "0.14.11" -description = "An extremely fast Python linter and code formatter, written in Rust." -optional = false -python-versions = ">=3.7" -groups = ["dev"] -files = [ - {file = "ruff-0.14.11-py3-none-linux_armv6l.whl", hash = "sha256:f6ff2d95cbd335841a7217bdfd9c1d2e44eac2c584197ab1385579d55ff8830e"}, - {file = "ruff-0.14.11-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:6f6eb5c1c8033680f4172ea9c8d3706c156223010b8b97b05e82c59bdc774ee6"}, - {file = "ruff-0.14.11-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f2fc34cc896f90080fca01259f96c566f74069a04b25b6205d55379d12a6855e"}, - {file = "ruff-0.14.11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:53386375001773ae812b43205d6064dae49ff0968774e6befe16a994fc233caa"}, - {file = "ruff-0.14.11-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a697737dce1ca97a0a55b5ff0434ee7205943d4874d638fe3ae66166ff46edbe"}, - {file = "ruff-0.14.11-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6845ca1da8ab81ab1dce755a32ad13f1db72e7fba27c486d5d90d65e04d17b8f"}, - {file = "ruff-0.14.11-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:e36ce2fd31b54065ec6f76cb08d60159e1b32bdf08507862e32f47e6dde8bcbf"}, - {file = "ruff-0.14.11-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:590bcc0e2097ecf74e62a5c10a6b71f008ad82eb97b0a0079e85defe19fe74d9"}, - {file = "ruff-0.14.11-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:53fe71125fc158210d57fe4da26e622c9c294022988d08d9347ec1cf782adafe"}, - {file = "ruff-0.14.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a35c9da08562f1598ded8470fcfef2afb5cf881996e6c0a502ceb61f4bc9c8a3"}, - {file = "ruff-0.14.11-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:0f3727189a52179393ecf92ec7057c2210203e6af2676f08d92140d3e1ee72c1"}, - {file = "ruff-0.14.11-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:eb09f849bd37147a789b85995ff734a6c4a095bed5fd1608c4f56afc3634cde2"}, - {file = "ruff-0.14.11-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:c61782543c1231bf71041461c1f28c64b961d457d0f238ac388e2ab173d7ecb7"}, - {file = "ruff-0.14.11-py3-none-musllinux_1_2_i686.whl", hash = "sha256:82ff352ea68fb6766140381748e1f67f83c39860b6446966cff48a315c3e2491"}, - {file = "ruff-0.14.11-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:728e56879df4ca5b62a9dde2dd0eb0edda2a55160c0ea28c4025f18c03f86984"}, - {file = "ruff-0.14.11-py3-none-win32.whl", hash = "sha256:337c5dd11f16ee52ae217757d9b82a26400be7efac883e9e852646f1557ed841"}, - {file = "ruff-0.14.11-py3-none-win_amd64.whl", hash = "sha256:f981cea63d08456b2c070e64b79cb62f951aa1305282974d4d5216e6e0178ae6"}, - {file = "ruff-0.14.11-py3-none-win_arm64.whl", hash = "sha256:649fb6c9edd7f751db276ef42df1f3df41c38d67d199570ae2a7bd6cbc3590f0"}, - {file = "ruff-0.14.11.tar.gz", hash = "sha256:f6dc463bfa5c07a59b1ff2c3b9767373e541346ea105503b4c0369c520a66958"}, -] - -[[package]] -name = "shellingham" -version = "1.5.4" -description = "Tool to Detect Surrounding Shell" -optional = false -python-versions = ">=3.7" -groups = ["dev"] -files = [ - {file = "shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686"}, - {file = "shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"}, -] - -[[package]] -name = "six" -version = "1.17.0" -description = "Python 2 and 3 compatibility utilities" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -groups = ["main", "dev"] -files = [ - {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, - {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, -] - -[[package]] -name = "typer" -version = "0.21.1" -description = "Typer, build great CLIs. Easy to code. Based on Python type hints." -optional = false -python-versions = ">=3.9" -groups = ["dev"] -files = [ - {file = "typer-0.21.1-py3-none-any.whl", hash = "sha256:7985e89081c636b88d172c2ee0cfe33c253160994d47bdfdc302defd7d1f1d01"}, - {file = "typer-0.21.1.tar.gz", hash = "sha256:ea835607cd752343b6b2b7ce676893e5a0324082268b48f27aa058bdb7d2145d"}, -] - -[package.dependencies] -click = ">=8.0.0" -rich = ">=10.11.0" -shellingham = ">=1.3.0" -typing-extensions = ">=3.7.4.3" - -[[package]] -name = "types-python-dateutil" -version = "2.9.0.20260402" -description = "Typing stubs for python-dateutil" -optional = false -python-versions = ">=3.10" -groups = ["dev"] -files = [ - {file = "types_python_dateutil-2.9.0.20260402-py3-none-any.whl", hash = "sha256:7827e6a9c93587cc18e766944254d1351a2396262e4abe1510cbbd7601c5e01f"}, - {file = "types_python_dateutil-2.9.0.20260402.tar.gz", hash = "sha256:a980142b9966713acb382c467e35c5cc4208a2f91b10b8d785a0ae6765df6c0b"}, -] - -[[package]] -name = "typing-extensions" -version = "4.15.0" -description = "Backported and Experimental Type Hints for Python 3.9+" -optional = false -python-versions = ">=3.9" -groups = ["main", "dev"] -files = [ - {file = "typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548"}, - {file = "typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466"}, -] - -[[package]] -name = "typing-inspection" -version = "0.4.2" -description = "Runtime typing introspection tools" -optional = false -python-versions = ">=3.9" -groups = ["main", "dev"] -files = [ - {file = "typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7"}, - {file = "typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464"}, -] - -[package.dependencies] -typing-extensions = ">=4.12.0" - -[metadata] -lock-version = "2.1" -python-versions = ">=3.11,<4.0" -content-hash = "5e71739f6027288347b06b1c86843785e221a3290b9ba4dfa29c7efbb5ebab31" diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 2b8abce..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,164 +0,0 @@ -[project] -name = "seclai" -dynamic = ["version"] -description = "Seclai Python SDK" -readme = "README.md" -requires-python = ">=3.11,<4.0" -license = "MIT" -authors = [ - { name = "Seclai, Inc.", email = "support@seclai.com" } -] -keywords = ["Seclai", "ai", "agent", "vector", "knowledge base", "cloud"] -classifiers = [ - "License :: OSI Approved :: MIT License", - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Intended Audience :: Information Technology", - "Intended Audience :: Science/Research", - "Intended Audience :: System Administrators", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", - "Topic :: Database", - "Topic :: Software Development", - "Topic :: Software Development :: Libraries", - "Topic :: Software Development :: Libraries :: Application Frameworks", - "Topic :: Software Development :: Libraries :: Python Modules" -] - -[project.urls] -homepage = "https://seclai.com" -repository = "https://github.com/seclai/seclai-python" -documentation = "https://seclai.github.io/seclai-python/latest/" - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - -[tool.black] -target-version = ['py313'] -line-length = 88 -include = '\.pyi?$' -extend-exclude = ''' -/( - # directories - \.git - | \.mypy_cache - | \.venv - | \.claude -)/ -''' - -[tool.mypy] -python_version = "3.13" -check_untyped_defs = true -disallow_any_generics = true -disallow_incomplete_defs = true -disallow_untyped_defs = true -no_implicit_optional = true -warn_redundant_casts = true -warn_unused_ignores = true -warn_return_any = true -strict_equality = true -explicit_package_bases = true -mypy_path = ["."] -plugins = ["pydantic.mypy"] -exclude = [ - "tests/conftest.py", - "seclai/_generated/", - ".claude/", -] - -[[tool.mypy.overrides]] -module = ["tests.*"] -disallow_untyped_defs = false -disallow_incomplete_defs = false -check_untyped_defs = false -disable_error_code = ["annotation-unchecked"] - -[[tool.mypy.overrides]] -module = ["test_helpers"] -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module = ["tests.integration.test_usage_endpoints"] -ignore_errors = true - -[tool.pydantic-mypy] -init_forbid_extra = true -init_typed = true -warn_required_dynamic_aliases = true - -[tool.poetry] -package-mode = true -version = "1.0" -include = [ - "README.md", - "CHANGELOG.md", - "LICENSE", - "seclai/py.typed", -] - -[tool.poetry.dependencies] -pydantic = "^2.12.5" -httpx = "^0.28.1" -# Required at runtime by the generated models: openapi-python-client emits -# `dateutil.parser.isoparse` for datetime fields, so this must be a runtime -# dependency (types-python-dateutil below only covers typing stubs). -python-dateutil = "^2.8.1" - -[tool.poetry.group.dev.dependencies] -pytest = ">=8,<9" -pytest-asyncio = ">=0.23,<1" -mypy = ">=1,<2" -black = ">=24,<26" -openapi-python-client = ">=0.25,<1" -pdoc = ">=14,<15" -types-python-dateutil = "^2.9.0.20260402" - -[tool.pytest.ini_options] -addopts = [ - "--import-mode=importlib", - "--strict-markers", - "--asyncio-mode=auto", -] -asyncio_mode = "auto" -asyncio_default_fixture_loop_scope = "function" -pythonpath = [ - ".", "tests" -] -testpaths = ["tests"] -log_cli = "true" -log_level = "INFO" -filterwarnings = [ -] - -[tool.ruff] -target-version = "py313" -line-length = 88 -exclude = [ - # Vendored from seclai/sdk-tools via git subtree — formatting it here would - # create drift from the canonical copy on every lint run. - ".claude", -] - -[tool.ruff.lint] -select = [ - "E", # pycodestyle errors - "W", # pycodestyle warnings - "F", # pyflakes - "I", # isort - "B", # flake8-bugbear - "C4", # flake8-comprehensions - "UP", # pyupgrade -] -ignore = [ - "E501", # line too long, handled by black - "B008", # do not perform function calls in argument defaults - "C901", # too complex -] - -[tool.ruff.lint.per-file-ignores] -"__init__.py" = ["F401"] diff --git a/scripts/set-doc-url-version.py b/scripts/set-doc-url-version.py deleted file mode 100644 index 4eb65c6..0000000 --- a/scripts/set-doc-url-version.py +++ /dev/null @@ -1,52 +0,0 @@ -from __future__ import annotations - -import os -import shutil -import sys -from pathlib import Path - -DOCS_LATEST = 'documentation = "https://seclai.github.io/seclai-python/latest/"' - - -def main() -> int: - if len(sys.argv) != 2 or sys.argv[1] not in {"apply", "restore"}: - print( - "Usage: python scripts/set-doc-url-version.py ", - file=sys.stderr, - ) - return 2 - - mode = sys.argv[1] - - repo_root = Path(__file__).resolve().parent.parent - pyproject_path = repo_root / "pyproject.toml" - backup_path = repo_root / ".pyproject.toml.bak" - - if mode == "apply": - version = os.environ.get("VERSION") - if not version: - print("Missing VERSION env var.", file=sys.stderr) - return 2 - - if not backup_path.exists(): - shutil.copyfile(pyproject_path, backup_path) - - original = pyproject_path.read_text(encoding="utf-8") - versioned = ( - f'documentation = "https://seclai.github.io/seclai-python/{version}/"' - ) - - updated = original.replace(DOCS_LATEST, versioned) - pyproject_path.write_text(updated, encoding="utf-8") - return 0 - - # restore - if backup_path.exists(): - shutil.copyfile(backup_path, pyproject_path) - backup_path.unlink() - - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/scripts/set-readme-version.py b/scripts/set-readme-version.py deleted file mode 100644 index 5d8a1d4..0000000 --- a/scripts/set-readme-version.py +++ /dev/null @@ -1,52 +0,0 @@ -from __future__ import annotations - -import os -import shutil -import sys -from pathlib import Path - -DOCS_LATEST = "https://seclai.github.io/seclai-python/latest/" - - -def main() -> int: - if len(sys.argv) != 2 or sys.argv[1] not in {"apply", "restore"}: - print( - "Usage: python scripts/set-readme-version.py ", - file=sys.stderr, - ) - return 2 - - mode = sys.argv[1] - - repo_root = Path(__file__).resolve().parent.parent - readme_path = repo_root / "README.md" - backup_path = repo_root / ".README.md.bak" - - if mode == "apply": - version = os.environ.get("VERSION") - if not version: - print("Missing VERSION env var.", file=sys.stderr) - return 2 - - if not backup_path.exists(): - shutil.copyfile(readme_path, backup_path) - - original = readme_path.read_text(encoding="utf-8") - versioned = f"https://seclai.github.io/seclai-python/{version}/" - - # Replace only the canonical docs link. Keep other "latest" mentions untouched. - updated = original.replace(DOCS_LATEST, versioned) - - readme_path.write_text(updated, encoding="utf-8") - return 0 - - # restore - if backup_path.exists(): - shutil.copyfile(backup_path, readme_path) - backup_path.unlink() - - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/.claude/skills/seclai-sdk-sync/sdksync.py b/sdksync.py similarity index 88% rename from .claude/skills/seclai-sdk-sync/sdksync.py rename to sdksync.py index 7d3b7ca..6a9d205 100755 --- a/.claude/skills/seclai-sdk-sync/sdksync.py +++ b/sdksync.py @@ -47,6 +47,11 @@ # "this method sends no params" — a silent false pass. # helpers — positional helper calls that expand to a fixed, ordered key list. # Expansion is arity-aware: only as many keys as arguments supplied. +# Endpoint helpers, used by `params` and `returns` (see `request_blocks`): +# helper_re — a NON-public method declaration on the client, name captured. +# helper_call — how the client calls one of its own methods; `{name}` is filled +# in. Receiver-qualified so `_client.X(` and `t.c.x(` — a typed +# façade calling in from another class — are not followed. LANGS = { "python": { "sig_re": r"\n (?:async )?def ([a-z]\w*)\(([^)]*)\)\s*->\s*([^:]+):", @@ -62,6 +67,8 @@ "return_re": r"\s*->\s*([^:\n]+):", "dict_at": [r"params\s*=\s*(?:_strip_none\()?\s*"], "dict_key_re": r'"([a-zA-Z_][a-zA-Z0-9_]*)"\s*:', + "helper_re": r"^[ \t]+(?:async )?def (_[a-z0-9][a-z0-9_]*)\(", + "helper_call": r"\bself\.{name}\(", "skip": {"request", "request_raw", "stream", "paginate"}, }, "javascript": { @@ -82,6 +89,11 @@ "return_re": r"\s*:\s*([^{\n]+?)\s*\{", "dict_at": [r"query:\s*"], "dict_key_re": r'["\']?([a-zA-Z_][a-zA-Z0-9_]*)["\']?\s*:', + # `private`/`protected`/`#name` members only. An unmodified `_name(` is + # matched by method_re and already audited as a block of its own. + "helper_re": (r"^ (?:(?:private|protected) (?:static )?(?:async )?\*?|(?:async )?\*?#)" + r"([a-zA-Z_][a-zA-Z0-9_]*)\s*[(<]"), + "helper_call": r"\bthis\.#?{name}\s*[(<]", "skip": {"request", "requestRaw", "uploadFile", "paginate"}, }, "go": { @@ -105,6 +117,10 @@ "dict_at": [r"map\[string\]string"], "dict_key_re": r'"([a-zA-Z_][a-zA-Z0-9_]*)"\s*:', "helpers": {"listQuery(": ["page", "limit"]}, + "helper_re": r"^func \(c \*Client\) ([a-z][A-Za-z0-9]*)\(", + "helper_call": r"(?,?\[\]. ]+ ([A-Z][A-Za-z0-9]*)\s*\("), + "helper_call": r"(? tuple[str, str] | None: return v.group(1).upper(), path +def strip_docs(text: str) -> str: + """Drop docstrings, block comments and whole-line comments. + + Helper detection reads through this: a docstring's `"GET"` and `"/sources"` + example made seclai-python's `_raise_for_openapi_response` look like the + request behind twenty methods that never issue one. + """ + text = re.sub(r'"""[\s\S]*?"""|\'\'\'[\s\S]*?\'\'\'|/\*[\s\S]*?\*/', "", text) + return re.sub(r"(?m)^[ \t]*(?://|#).*$", "", text) + + +def endpoint_helpers(text: str, cfg: dict) -> dict[str, str]: + """Non-public client method name -> body, for those that DEFINE a request. + + Defining one means holding a verb and a path literal. Transport plumbing + (`doBytes`, `SendRawResponseAsync`) takes both as arguments and holds neither, + which is what keeps it out of this index. + """ + if "helper_re" not in cfg: + return {} + ends = sorted({m.start() + for pat in (cfg["helper_re"], cfg["method_re"], cfg.get("boundary_re")) if pat + for m in re.finditer(pat, text, re.M)}) + out: dict[str, str] = {} + for m in re.finditer(cfg["helper_re"], text, re.M): + name = m.group(1) + if name in cfg.get("skip", ()) or name in out: + continue + end = next((e for e in ends if e > m.start()), len(text)) + body = strip_docs(text[m.start():end]) + if block_call(body, cfg["verb_re"]): + out[name] = body + return out + + +def helper_called(body: str, cfg: dict, helpers: dict[str, str]) -> str | None: + """Name of the first endpoint helper a method body calls, if any.""" + code = strip_docs(body) # a comment naming a helper is not a call to it + first: tuple[int, str] | None = None + for name in helpers: + m = re.search(cfg["helper_call"].replace("{name}", re.escape(name)), code) + if m and (first is None or m.start() < first[0]): + first = (m.start(), name) + return first[1] if first else None + + +def request_blocks(texts: list[str], cfg: dict): + """Yield (name, body, call, request_body, helper) per public method with a request. + + A method with no request call of its own that calls a non-public method + defining one is read through that helper — ONE hop. `body` stays the public + method's, so its declared return type is what `returns` compares; + `request_body` is where query keys are read. `helper` is None for own requests. + """ + shared: dict[str, str] = {} + if cfg.get("helper_scope") == "package": + for text in texts: + for k, v in endpoint_helpers(text, cfg).items(): + shared.setdefault(k, v) + for text in texts: + helpers = shared or endpoint_helpers(text, cfg) + for mname, body in method_blocks(text, cfg["method_re"], cfg.get("boundary_re")): + if mname in cfg.get("skip", ()): + continue + call = block_call(body, cfg["verb_re"]) + if call: + yield mname, body, call, body, None + continue + helper = helper_called(body, cfg, helpers) + if helper: + hbody = helpers[helper] + yield mname, body, block_call(hbody, cfg["verb_re"]), body + "\n" + hbody, helper + + +def via_helper_line(n: int) -> str: + return (f" {n} of the methods read were resolved through a non-public helper" + f" holding the request (one hop)") + + def block_query_keys(body: str, cfg: dict) -> tuple[set[str], bool]: """(keys, parsed_ok). parsed_ok is False when a construction site was found but could not be read — reported as an error, never as "sends nothing".""" @@ -367,32 +465,30 @@ def cmd_params(args) -> int: undeclared, not_in_spec, unparsed, exposed = set(), set(), set(), {} missing_required: set[tuple[str, str, str]] = set() - for f in files: - text = f.read_text(errors="replace") - for mname, body in method_blocks(text, cfg["method_re"], cfg.get("boundary_re")): - if mname in cfg.get("skip", ()): - continue - call = block_call(body, cfg["verb_re"]) - if not call: - continue - keys, ok = block_query_keys(body, cfg) - if not ok: - unparsed.add((mname, f"{call[0]} {call[1]}")) - if call not in index: - not_in_spec.add((mname, f"{call[0]} {call[1]}")) - continue - raw, declared, required = index[call] - exposed.setdefault((call[0], raw), set()).update(keys) - if ok: - # Only trust this when the query construction parsed: an - # unreadable site would otherwise look like "sends nothing". - for k in sorted(required - keys): - missing_required.add((mname, f"{call[0]} {raw}", k)) - for k in sorted(keys - declared): - undeclared.add((mname, f"{call[0]} {raw}", k, tuple(sorted(declared)))) + via_helper = 0 + texts = [f.read_text(errors="replace") for f in files] + for mname, _body, call, request_body, helper in request_blocks(texts, cfg): + via_helper += helper is not None + keys, ok = block_query_keys(request_body, cfg) + if not ok: + unparsed.add((mname, f"{call[0]} {call[1]}")) + if call not in index: + not_in_spec.add((mname, f"{call[0]} {call[1]}")) + continue + raw, declared, required = index[call] + exposed.setdefault((call[0], raw), set()).update(keys) + if ok: + # Only trust this when the query construction parsed: an + # unreadable site would otherwise look like "sends nothing". + for k in sorted(required - keys): + missing_required.add((mname, f"{call[0]} {raw}", k)) + for k in sorted(keys - declared): + undeclared.add((mname, f"{call[0]} {raw}", k, tuple(sorted(declared)))) print(f"{name} [{lang}] — {len(files)} client file(s), " f"{len(index)} spec operations") + if via_helper: + print(via_helper_line(via_helper)) if undeclared: print(f"\nUNDECLARED ({len(undeclared)}) — sent but the endpoint does not accept it:") @@ -845,47 +941,46 @@ def cmd_returns(args) -> int: _schema_label(_json_schema(op, "response", code))) break - mismatched, renamed, untyped, n = [], [], [], 0 - for path in files: - text = path.read_text(encoding="utf-8", errors="replace") - for mname, body in method_blocks(text, cfg["method_re"], cfg.get("boundary_re")): - if mname in cfg.get("skip", set()): - continue - call = block_call(body, cfg["verb_re"]) - if not call or call not in want: - continue - declared = block_return(body, cfg) - if declared is None: - continue - n += 1 - got, expect = normalise_type(declared, lang), want[call] - if expect in ("object", "none", "unknown", "?"): - continue # the spec itself declares nothing to match - if got == expect or strip_generated_prefix(got) == expect: - continue - # Separate the two failure modes. A list where the API returns an - # envelope throws at deserialization; a type NAMED differently from - # its schema is only cosmetic, and the SDKs rename by convention — - # all four drop the spec's `Model` and `Api` affixes. Ranking those - # equally buried the one real finding under eleven harmless ones. - # A wholly untyped return (`JsonElement`, `unknown`, `JSONValue`) - # commits to no shape at all and deserializes anything, so it is a - # coverage warning, never a shape error. - if got == "?": - untyped.append((mname, call, expect, declared)) - # Shape next. `list[dict[str, Any]]` IS a commitment to a list and is - # also untyped; testing untyped-ness first classified seclai-python's - # list_evaluation_criteria as a soft warning and reported the repo - # clean, when it is exactly as broken as the Go and JS ones. - elif got.startswith("array<") != expect.startswith("array<"): - mismatched.append((mname, call, expect, declared)) - elif "?" in got: - untyped.append((mname, call, expect, declared)) - else: - renamed.append((mname, call, expect, declared)) + mismatched, renamed, untyped, n, via_helper = [], [], [], 0, 0 + texts = [path.read_text(encoding="utf-8", errors="replace") for path in files] + for mname, body, call, _request_body, helper in request_blocks(texts, cfg): + if call not in want: + continue + declared = block_return(body, cfg) + if declared is None: + continue + n += 1 + via_helper += helper is not None + got, expect = normalise_type(declared, lang), want[call] + if expect in ("object", "none", "unknown", "?"): + continue # the spec itself declares nothing to match + if got == expect or strip_generated_prefix(got) == expect: + continue + # Separate the two failure modes. A list where the API returns an + # envelope throws at deserialization; a type NAMED differently from + # its schema is only cosmetic, and the SDKs rename by convention — + # all four drop the spec's `Model` and `Api` affixes. Ranking those + # equally buried the one real finding under eleven harmless ones. + # A wholly untyped return (`JsonElement`, `unknown`, `JSONValue`) + # commits to no shape at all and deserializes anything, so it is a + # coverage warning, never a shape error. + if got == "?": + untyped.append((mname, call, expect, declared)) + # Shape next. `list[dict[str, Any]]` IS a commitment to a list and is + # also untyped; testing untyped-ness first classified seclai-python's + # list_evaluation_criteria as a soft warning and reported the repo + # clean, when it is exactly as broken as the Go and JS ones. + elif got.startswith("array<") != expect.startswith("array<"): + mismatched.append((mname, call, expect, declared)) + elif "?" in got: + untyped.append((mname, call, expect, declared)) + else: + renamed.append((mname, call, expect, declared)) print(f"{repo.name} [{lang}] — {n} method(s) with both a declared return type " f"and a named response schema") + if via_helper: + print(via_helper_line(via_helper)) if mismatched: print(f"\nSHAPE MISMATCH ({len(mismatched)}) — list vs object; this fails at deserialization:") diff --git a/seclai/__init__.py b/seclai/__init__.py deleted file mode 100644 index e256d5c..0000000 --- a/seclai/__init__.py +++ /dev/null @@ -1,65 +0,0 @@ -"""Seclai Python SDK. - -Provides synchronous and asynchronous clients for the Seclai API. - -Quick start:: - - from seclai import Seclai - - client = Seclai(api_key="...") - agents = client.list_agents() - -All public symbols are re-exported from this package: - -- :class:`Seclai` — synchronous client -- :class:`AsyncSeclai` — asynchronous client -- :class:`SeclaiError` — base exception -- :class:`SeclaiConfigurationError` — configuration errors -- :class:`SeclaiAPIStatusError` — non-2xx HTTP responses -- :class:`SeclaiAPIValidationError` — HTTP 422 validation errors -- :class:`SeclaiStreamingError` — SSE stream errors -- :class:`AgentRunStreamRequest` — typed request body for streaming runs -- :data:`JSONValue` — recursive JSON type alias -""" - -from .auth import ( - DEFAULT_SSO_CLIENT_ID, - DEFAULT_SSO_DOMAIN, - DEFAULT_SSO_REGION, - SsoCacheEntry, - SsoProfile, -) -from .seclai import ( - AgentRunStreamRequest, - AsyncSeclai, - JSONValue, - Seclai, - SeclaiAPIStatusError, - SeclaiAPIValidationError, - SeclaiConfigurationError, - SeclaiError, - SeclaiStreamingError, - unwrap_items, -) -from .versions import DEFAULT_API_VERSION, LATEST_API_VERSION, ApiVersion - -__all__ = [ - "AgentRunStreamRequest", - "AsyncSeclai", - "DEFAULT_SSO_CLIENT_ID", - "DEFAULT_SSO_DOMAIN", - "DEFAULT_SSO_REGION", - "JSONValue", - "unwrap_items", - "Seclai", - "SeclaiAPIStatusError", - "SeclaiAPIValidationError", - "SeclaiConfigurationError", - "SeclaiError", - "SeclaiStreamingError", - "SsoProfile", - "SsoCacheEntry", - "ApiVersion", - "DEFAULT_API_VERSION", - "LATEST_API_VERSION", -] diff --git a/seclai/_generated/.gitignore b/seclai/_generated/.gitignore deleted file mode 100644 index 79a2c3d..0000000 --- a/seclai/_generated/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -__pycache__/ -build/ -dist/ -*.egg-info/ -.pytest_cache/ - -# pyenv -.python-version - -# Environments -.env -.venv - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# JetBrains -.idea/ - -/coverage.xml -/.coverage diff --git a/seclai/_generated/.gitkeep b/seclai/_generated/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/seclai/_generated/README.md b/seclai/_generated/README.md deleted file mode 100644 index e82cb27..0000000 --- a/seclai/_generated/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# seclai-api-client -A client library for accessing Seclai API - -## Usage -First, create a client: - -```python -from seclai_api_client import Client - -client = Client(base_url="https://api.example.com") -``` - -If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead: - -```python -from seclai_api_client import AuthenticatedClient - -client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken") -``` - -Now call your endpoint and use your models: - -```python -from seclai_api_client.models import MyDataModel -from seclai_api_client.api.my_tag import get_my_data_model -from seclai_api_client.types import Response - -with client as client: - my_data: MyDataModel = get_my_data_model.sync(client=client) - # or if you need more info (e.g. status_code) - response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client) -``` - -Or do the same thing with an async version: - -```python -from seclai_api_client.models import MyDataModel -from seclai_api_client.api.my_tag import get_my_data_model -from seclai_api_client.types import Response - -async with client as client: - my_data: MyDataModel = await get_my_data_model.asyncio(client=client) - response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client) -``` - -By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle. - -```python -client = AuthenticatedClient( - base_url="https://internal_api.example.com", - token="SuperSecretToken", - verify_ssl="/path/to/certificate_bundle.pem", -) -``` - -You can also disable certificate validation altogether, but beware that **this is a security risk**. - -```python -client = AuthenticatedClient( - base_url="https://internal_api.example.com", - token="SuperSecretToken", - verify_ssl=False -) -``` - -Things to know: -1. Every path/method combo becomes a Python module with four functions: - 1. `sync`: Blocking request that returns parsed data (if successful) or `None` - 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful. - 1. `asyncio`: Like `sync` but async instead of blocking - 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking - -1. All path/query params, and bodies become method arguments. -1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above) -1. Any endpoint which did not have a tag will be in `seclai_api_client.api.default` - -## Advanced customizations - -There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case): - -```python -from seclai_api_client import Client - -def log_request(request): - print(f"Request event hook: {request.method} {request.url} - Waiting for response") - -def log_response(response): - request = response.request - print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}") - -client = Client( - base_url="https://api.example.com", - httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}}, -) - -# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client() -``` - -You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url): - -```python -import httpx -from seclai_api_client import Client - -client = Client( - base_url="https://api.example.com", -) -# Note that base_url needs to be re-set, as would any shared cookies, headers, etc. -client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030")) -``` - -## Building / publishing this package -This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics: -1. Update the metadata in pyproject.toml (e.g. authors, version) -1. If you're using a private repository, configure it with Poetry - 1. `poetry config repositories. ` - 1. `poetry config http-basic. ` -1. Publish the client with `poetry publish --build -r ` or, if for public PyPI, just `poetry publish --build` - -If you want to install this client into another project without publishing it (e.g. for development) then: -1. If that project **is using Poetry**, you can simply do `poetry add ` from that project -1. If that project is not using Poetry: - 1. Build a wheel with `poetry build -f wheel` - 1. Install that wheel from the other project `pip install ` diff --git a/seclai/_generated/__init__.py b/seclai/_generated/__init__.py deleted file mode 100644 index 25fe58c..0000000 --- a/seclai/_generated/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -"""A client library for accessing Seclai API""" - -from .client import AuthenticatedClient, Client - -__all__ = ( - "AuthenticatedClient", - "Client", -) diff --git a/seclai/_generated/api/__init__.py b/seclai/_generated/api/__init__.py deleted file mode 100644 index 81f9fa2..0000000 --- a/seclai/_generated/api/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains methods for accessing the API""" diff --git a/seclai/_generated/api/agent_evaluations/__init__.py b/seclai/_generated/api/agent_evaluations/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/agent_evaluations/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/agent_evaluations/create_evaluation_criteria_api_agents_agent_id_evaluation_criteria_post.py b/seclai/_generated/api/agent_evaluations/create_evaluation_criteria_api_agents_agent_id_evaluation_criteria_post.py deleted file mode 100644 index 637de7c..0000000 --- a/seclai/_generated/api/agent_evaluations/create_evaluation_criteria_api_agents_agent_id_evaluation_criteria_post.py +++ /dev/null @@ -1,246 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_evaluation_criteria_request import CreateEvaluationCriteriaRequest -from ...models.evaluation_criteria_response import EvaluationCriteriaResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - body: CreateEvaluationCriteriaRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/{agent_id}/evaluation-criteria".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationCriteriaResponse | HTTPValidationError | None: - if response.status_code == 201: - response_201 = EvaluationCriteriaResponse.from_dict(response.json()) - - return response_201 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationCriteriaResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: CreateEvaluationCriteriaRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: - """Create Evaluation Criteria - - Create new step evaluation settings for an agent. - - The evaluation mode, retry settings, and sample frequency are inherited - from the agent and stored on the criteria row for historical reference. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateEvaluationCriteriaRequest): Request body for creating an evaluation criteria. - - The evaluation mode, retry settings, and sample frequency are set at the - agent level, not per-criteria. - - 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[EvaluationCriteriaResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: CreateEvaluationCriteriaRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationCriteriaResponse | HTTPValidationError | None: - """Create Evaluation Criteria - - Create new step evaluation settings for an agent. - - The evaluation mode, retry settings, and sample frequency are inherited - from the agent and stored on the criteria row for historical reference. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateEvaluationCriteriaRequest): Request body for creating an evaluation criteria. - - The evaluation mode, retry settings, and sample frequency are set at the - agent level, not per-criteria. - - 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: - EvaluationCriteriaResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: CreateEvaluationCriteriaRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: - """Create Evaluation Criteria - - Create new step evaluation settings for an agent. - - The evaluation mode, retry settings, and sample frequency are inherited - from the agent and stored on the criteria row for historical reference. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateEvaluationCriteriaRequest): Request body for creating an evaluation criteria. - - The evaluation mode, retry settings, and sample frequency are set at the - agent level, not per-criteria. - - 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[EvaluationCriteriaResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: CreateEvaluationCriteriaRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationCriteriaResponse | HTTPValidationError | None: - """Create Evaluation Criteria - - Create new step evaluation settings for an agent. - - The evaluation mode, retry settings, and sample frequency are inherited - from the agent and stored on the criteria row for historical reference. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateEvaluationCriteriaRequest): Request body for creating an evaluation criteria. - - The evaluation mode, retry settings, and sample frequency are set at the - agent level, not per-criteria. - - 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: - EvaluationCriteriaResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/create_evaluation_result_api_agents_evaluation_criteria_criteria_id_results_post.py b/seclai/_generated/api/agent_evaluations/create_evaluation_result_api_agents_evaluation_criteria_criteria_id_results_post.py deleted file mode 100644 index 9aa25c5..0000000 --- a/seclai/_generated/api/agent_evaluations/create_evaluation_result_api_agents_evaluation_criteria_criteria_id_results_post.py +++ /dev/null @@ -1,238 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_evaluation_result_request import CreateEvaluationResultRequest -from ...models.evaluation_result_response import EvaluationResultResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - criteria_id: str, - *, - body: CreateEvaluationResultRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/evaluation-criteria/{criteria_id}/results".format( - criteria_id=quote(str(criteria_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationResultResponse | HTTPValidationError | None: - if response.status_code == 201: - response_201 = EvaluationResultResponse.from_dict(response.json()) - - return response_201 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationResultResponse | 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( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - body: CreateEvaluationResultRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultResponse | HTTPValidationError]: - """Create Evaluation Result - - Record an evaluation result for a criteria. - - Use this endpoint to push results from external test harnesses, CI/CD - pipelines, or custom evaluation logic. Each result is linked to an - agent run and optionally a specific step run. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateEvaluationResultRequest): Request body for recording an evaluation result. - - 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[EvaluationResultResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - criteria_id=criteria_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - body: CreateEvaluationResultRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationResultResponse | HTTPValidationError | None: - """Create Evaluation Result - - Record an evaluation result for a criteria. - - Use this endpoint to push results from external test harnesses, CI/CD - pipelines, or custom evaluation logic. Each result is linked to an - agent run and optionally a specific step run. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateEvaluationResultRequest): Request body for recording an evaluation result. - - 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: - EvaluationResultResponse | HTTPValidationError - """ - - return sync_detailed( - criteria_id=criteria_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - body: CreateEvaluationResultRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultResponse | HTTPValidationError]: - """Create Evaluation Result - - Record an evaluation result for a criteria. - - Use this endpoint to push results from external test harnesses, CI/CD - pipelines, or custom evaluation logic. Each result is linked to an - agent run and optionally a specific step run. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateEvaluationResultRequest): Request body for recording an evaluation result. - - 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[EvaluationResultResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - criteria_id=criteria_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - body: CreateEvaluationResultRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationResultResponse | HTTPValidationError | None: - """Create Evaluation Result - - Record an evaluation result for a criteria. - - Use this endpoint to push results from external test harnesses, CI/CD - pipelines, or custom evaluation logic. Each result is linked to an - agent run and optionally a specific step run. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateEvaluationResultRequest): Request body for recording an evaluation result. - - 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: - EvaluationResultResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - criteria_id=criteria_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/delete_evaluation_criteria_api_agents_evaluation_criteria_criteria_id_delete.py b/seclai/_generated/api/agent_evaluations/delete_evaluation_criteria_api_agents_evaluation_criteria_criteria_id_delete.py deleted file mode 100644 index cd2cf4c..0000000 --- a/seclai/_generated/api/agent_evaluations/delete_evaluation_criteria_api_agents_evaluation_criteria_criteria_id_delete.py +++ /dev/null @@ -1,214 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - criteria_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/agents/evaluation-criteria/{criteria_id}".format( - criteria_id=quote(str(criteria_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete Evaluation Criteria - - Delete an evaluation criteria and all associated evaluation results. - - This action is permanent and cannot be undone. All historical result - records tied to the criteria are removed as well. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - criteria_id=criteria_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete Evaluation Criteria - - Delete an evaluation criteria and all associated evaluation results. - - This action is permanent and cannot be undone. All historical result - records tied to the criteria are removed as well. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - criteria_id=criteria_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete Evaluation Criteria - - Delete an evaluation criteria and all associated evaluation results. - - This action is permanent and cannot be undone. All historical result - records tied to the criteria are removed as well. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - criteria_id=criteria_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete Evaluation Criteria - - Delete an evaluation criteria and all associated evaluation results. - - This action is permanent and cannot be undone. All historical result - records tied to the criteria are removed as well. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - criteria_id=criteria_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/get_evaluation_criteria_api_agents_evaluation_criteria_criteria_id_get.py b/seclai/_generated/api/agent_evaluations/get_evaluation_criteria_api_agents_evaluation_criteria_criteria_id_get.py deleted file mode 100644 index a2a92ba..0000000 --- a/seclai/_generated/api/agent_evaluations/get_evaluation_criteria_api_agents_evaluation_criteria_criteria_id_get.py +++ /dev/null @@ -1,216 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.evaluation_criteria_response import EvaluationCriteriaResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - criteria_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/evaluation-criteria/{criteria_id}".format( - criteria_id=quote(str(criteria_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationCriteriaResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = EvaluationCriteriaResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationCriteriaResponse | 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( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: - """Get Evaluation Criteria - - Get a single evaluation criteria by ID. - - Returns the full criteria configuration including type-specific fields, - current enabled state, and a summary of recent evaluation results. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EvaluationCriteriaResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - criteria_id=criteria_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationCriteriaResponse | HTTPValidationError | None: - """Get Evaluation Criteria - - Get a single evaluation criteria by ID. - - Returns the full criteria configuration including type-specific fields, - current enabled state, and a summary of recent evaluation results. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EvaluationCriteriaResponse | HTTPValidationError - """ - - return sync_detailed( - criteria_id=criteria_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: - """Get Evaluation Criteria - - Get a single evaluation criteria by ID. - - Returns the full criteria configuration including type-specific fields, - current enabled state, and a summary of recent evaluation results. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EvaluationCriteriaResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - criteria_id=criteria_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationCriteriaResponse | HTTPValidationError | None: - """Get Evaluation Criteria - - Get a single evaluation criteria by ID. - - Returns the full criteria configuration including type-specific fields, - current enabled state, and a summary of recent evaluation results. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EvaluationCriteriaResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - criteria_id=criteria_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/get_evaluation_summary_api_agents_evaluation_criteria_criteria_id_summary_get.py b/seclai/_generated/api/agent_evaluations/get_evaluation_summary_api_agents_evaluation_criteria_criteria_id_summary_get.py deleted file mode 100644 index 0c24f4c..0000000 --- a/seclai/_generated/api/agent_evaluations/get_evaluation_summary_api_agents_evaluation_criteria_criteria_id_summary_get.py +++ /dev/null @@ -1,216 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.evaluation_result_summary_response import EvaluationResultSummaryResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - criteria_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/evaluation-criteria/{criteria_id}/summary".format( - criteria_id=quote(str(criteria_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationResultSummaryResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = EvaluationResultSummaryResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationResultSummaryResponse | 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( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultSummaryResponse | HTTPValidationError]: - """Get Evaluation Summary - - Get an aggregated summary of evaluation results for a criteria. - - Returns total, passed, failed, error, and flagged counts alongside the - average score, giving a quick overview of how the criteria is performing. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EvaluationResultSummaryResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - criteria_id=criteria_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationResultSummaryResponse | HTTPValidationError | None: - """Get Evaluation Summary - - Get an aggregated summary of evaluation results for a criteria. - - Returns total, passed, failed, error, and flagged counts alongside the - average score, giving a quick overview of how the criteria is performing. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EvaluationResultSummaryResponse | HTTPValidationError - """ - - return sync_detailed( - criteria_id=criteria_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultSummaryResponse | HTTPValidationError]: - """Get Evaluation Summary - - Get an aggregated summary of evaluation results for a criteria. - - Returns total, passed, failed, error, and flagged counts alongside the - average score, giving a quick overview of how the criteria is performing. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EvaluationResultSummaryResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - criteria_id=criteria_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationResultSummaryResponse | HTTPValidationError | None: - """Get Evaluation Summary - - Get an aggregated summary of evaluation results for a criteria. - - Returns total, passed, failed, error, and flagged counts alongside the - average score, giving a quick overview of how the criteria is performing. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EvaluationResultSummaryResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - criteria_id=criteria_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get.py b/seclai/_generated/api/agent_evaluations/get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get.py deleted file mode 100644 index a6d81bd..0000000 --- a/seclai/_generated/api/agent_evaluations/get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get.py +++ /dev/null @@ -1,306 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.non_manual_evaluation_summary_response import ( - NonManualEvaluationSummaryResponse, -) -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - agent_id: None | str | Unset = UNSET, - days: int | Unset = 30, - start_date: None | str | Unset = UNSET, - end_date: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - json_agent_id: None | str | Unset - if isinstance(agent_id, Unset): - json_agent_id = UNSET - else: - json_agent_id = agent_id - params["agent_id"] = json_agent_id - - params["days"] = days - - json_start_date: None | str | Unset - if isinstance(start_date, Unset): - json_start_date = UNSET - else: - json_start_date = start_date - params["start_date"] = json_start_date - - json_end_date: None | str | Unset - if isinstance(end_date, Unset): - json_end_date = UNSET - else: - json_end_date = end_date - params["end_date"] = json_end_date - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/evaluation-results/non-manual-summary", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | NonManualEvaluationSummaryResponse | None: - if response.status_code == 200: - response_200 = NonManualEvaluationSummaryResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | NonManualEvaluationSummaryResponse]: - 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: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - days: int | Unset = 30, - start_date: None | str | Unset = UNSET, - end_date: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | NonManualEvaluationSummaryResponse]: - """Get Non Manual Evaluation Summary - - Get an evaluation summary for API key clients. - - Returns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, - sample_and_flag). - - The ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset - (opt in via the ``Seclai-Version`` header). Clients on the legacy baseline - always receive the account-wide rollup; ``agent_id`` is ignored for them so - the endpoint's behavior is frozen. With ``2026-07-27`` or later, the summary - is scoped to ``agent_id`` when supplied (and returns 404 if it doesn't exist). - - Args: - agent_id (None | str | Unset): Scope the summary to a single agent. Omit for account-wide. - days (int | Unset): Default: 30. - start_date (None | str | Unset): - end_date (None | str | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | NonManualEvaluationSummaryResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - days=days, - start_date=start_date, - end_date=end_date, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - days: int | Unset = 30, - start_date: None | str | Unset = UNSET, - end_date: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | NonManualEvaluationSummaryResponse | None: - """Get Non Manual Evaluation Summary - - Get an evaluation summary for API key clients. - - Returns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, - sample_and_flag). - - The ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset - (opt in via the ``Seclai-Version`` header). Clients on the legacy baseline - always receive the account-wide rollup; ``agent_id`` is ignored for them so - the endpoint's behavior is frozen. With ``2026-07-27`` or later, the summary - is scoped to ``agent_id`` when supplied (and returns 404 if it doesn't exist). - - Args: - agent_id (None | str | Unset): Scope the summary to a single agent. Omit for account-wide. - days (int | Unset): Default: 30. - start_date (None | str | Unset): - end_date (None | str | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | NonManualEvaluationSummaryResponse - """ - - return sync_detailed( - client=client, - agent_id=agent_id, - days=days, - start_date=start_date, - end_date=end_date, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - days: int | Unset = 30, - start_date: None | str | Unset = UNSET, - end_date: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | NonManualEvaluationSummaryResponse]: - """Get Non Manual Evaluation Summary - - Get an evaluation summary for API key clients. - - Returns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, - sample_and_flag). - - The ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset - (opt in via the ``Seclai-Version`` header). Clients on the legacy baseline - always receive the account-wide rollup; ``agent_id`` is ignored for them so - the endpoint's behavior is frozen. With ``2026-07-27`` or later, the summary - is scoped to ``agent_id`` when supplied (and returns 404 if it doesn't exist). - - Args: - agent_id (None | str | Unset): Scope the summary to a single agent. Omit for account-wide. - days (int | Unset): Default: 30. - start_date (None | str | Unset): - end_date (None | str | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | NonManualEvaluationSummaryResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - days=days, - start_date=start_date, - end_date=end_date, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - days: int | Unset = 30, - start_date: None | str | Unset = UNSET, - end_date: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | NonManualEvaluationSummaryResponse | None: - """Get Non Manual Evaluation Summary - - Get an evaluation summary for API key clients. - - Returns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, - sample_and_flag). - - The ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset - (opt in via the ``Seclai-Version`` header). Clients on the legacy baseline - always receive the account-wide rollup; ``agent_id`` is ignored for them so - the endpoint's behavior is frozen. With ``2026-07-27`` or later, the summary - is scoped to ``agent_id`` when supplied (and returns 404 if it doesn't exist). - - Args: - agent_id (None | str | Unset): Scope the summary to a single agent. Omit for account-wide. - days (int | Unset): Default: 30. - start_date (None | str | Unset): - end_date (None | str | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | NonManualEvaluationSummaryResponse - """ - - return ( - await asyncio_detailed( - client=client, - agent_id=agent_id, - days=days, - start_date=start_date, - end_date=end_date, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/list_agent_evaluation_results_api_agents_agent_id_evaluation_results_get.py b/seclai/_generated/api/agent_evaluations/list_agent_evaluation_results_api_agents_agent_id_evaluation_results_get.py deleted file mode 100644 index 2c5a561..0000000 --- a/seclai/_generated/api/agent_evaluations/list_agent_evaluation_results_api_agents_agent_id_evaluation_results_get.py +++ /dev/null @@ -1,350 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.evaluation_result_with_criteria_list_response import ( - EvaluationResultWithCriteriaListResponse, -) -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - status: None | str | Unset = UNSET, - step: None | str | Unset = UNSET, - flagged_only: bool | Unset = False, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - json_status: None | str | Unset - if isinstance(status, Unset): - json_status = UNSET - else: - json_status = status - params["status"] = json_status - - json_step: None | str | Unset - if isinstance(step, Unset): - json_step = UNSET - else: - json_step = step - params["step"] = json_step - - params["flagged_only"] = flagged_only - - json_time_from: None | str | Unset - if isinstance(time_from, Unset): - json_time_from = UNSET - else: - json_time_from = time_from - params["time_from"] = json_time_from - - json_time_to: None | str | Unset - if isinstance(time_to, Unset): - json_time_to = UNSET - else: - json_time_to = time_to - params["time_to"] = json_time_to - - params["page"] = page - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/evaluation-results".format( - agent_id=quote(str(agent_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationResultWithCriteriaListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = EvaluationResultWithCriteriaListResponse.from_dict( - response.json() - ) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationResultWithCriteriaListResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - status: None | str | Unset = UNSET, - step: None | str | Unset = UNSET, - flagged_only: bool | Unset = False, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultWithCriteriaListResponse | HTTPValidationError]: - """List Agent Evaluation Results - - List evaluation results across all criteria configured on an agent. - - Returns a paginated list of evaluation results with optional filtering by status, criteria, and date - range. Results include score, pass/fail status, and details. - - Args: - agent_id (str): - status (None | str | Unset): - step (None | str | Unset): - flagged_only (bool | Unset): Default: False. - time_from (None | str | Unset): - time_to (None | str | Unset): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EvaluationResultWithCriteriaListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - status=status, - step=step, - flagged_only=flagged_only, - time_from=time_from, - time_to=time_to, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - status: None | str | Unset = UNSET, - step: None | str | Unset = UNSET, - flagged_only: bool | Unset = False, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationResultWithCriteriaListResponse | HTTPValidationError | None: - """List Agent Evaluation Results - - List evaluation results across all criteria configured on an agent. - - Returns a paginated list of evaluation results with optional filtering by status, criteria, and date - range. Results include score, pass/fail status, and details. - - Args: - agent_id (str): - status (None | str | Unset): - step (None | str | Unset): - flagged_only (bool | Unset): Default: False. - time_from (None | str | Unset): - time_to (None | str | Unset): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EvaluationResultWithCriteriaListResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - status=status, - step=step, - flagged_only=flagged_only, - time_from=time_from, - time_to=time_to, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - status: None | str | Unset = UNSET, - step: None | str | Unset = UNSET, - flagged_only: bool | Unset = False, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultWithCriteriaListResponse | HTTPValidationError]: - """List Agent Evaluation Results - - List evaluation results across all criteria configured on an agent. - - Returns a paginated list of evaluation results with optional filtering by status, criteria, and date - range. Results include score, pass/fail status, and details. - - Args: - agent_id (str): - status (None | str | Unset): - step (None | str | Unset): - flagged_only (bool | Unset): Default: False. - time_from (None | str | Unset): - time_to (None | str | Unset): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EvaluationResultWithCriteriaListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - status=status, - step=step, - flagged_only=flagged_only, - time_from=time_from, - time_to=time_to, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - status: None | str | Unset = UNSET, - step: None | str | Unset = UNSET, - flagged_only: bool | Unset = False, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationResultWithCriteriaListResponse | HTTPValidationError | None: - """List Agent Evaluation Results - - List evaluation results across all criteria configured on an agent. - - Returns a paginated list of evaluation results with optional filtering by status, criteria, and date - range. Results include score, pass/fail status, and details. - - Args: - agent_id (str): - status (None | str | Unset): - step (None | str | Unset): - flagged_only (bool | Unset): Default: False. - time_from (None | str | Unset): - time_to (None | str | Unset): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EvaluationResultWithCriteriaListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - status=status, - step=step, - flagged_only=flagged_only, - time_from=time_from, - time_to=time_to, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/list_compatible_runs_api_agents_evaluation_criteria_criteria_id_compatible_runs_get.py b/seclai/_generated/api/agent_evaluations/list_compatible_runs_api_agents_evaluation_criteria_criteria_id_compatible_runs_get.py deleted file mode 100644 index c3bf3dc..0000000 --- a/seclai/_generated/api/agent_evaluations/list_compatible_runs_api_agents_evaluation_criteria_criteria_id_compatible_runs_get.py +++ /dev/null @@ -1,274 +0,0 @@ -import datetime -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.compatible_run_list_response import CompatibleRunListResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - criteria_id: str, - *, - page: int | Unset = 1, - limit: int | Unset = 20, - started_after: datetime.datetime | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - json_started_after: None | str | Unset - if isinstance(started_after, Unset): - json_started_after = UNSET - elif isinstance(started_after, datetime.datetime): - json_started_after = started_after.isoformat() - else: - json_started_after = started_after - params["started_after"] = json_started_after - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/evaluation-criteria/{criteria_id}/compatible-runs".format( - criteria_id=quote(str(criteria_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CompatibleRunListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = CompatibleRunListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CompatibleRunListResponse | 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( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - started_after: datetime.datetime | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CompatibleRunListResponse | HTTPValidationError]: - """List Compatible Runs - - List agent runs that have a completed step matching the criteria's target step. - - Returns runs whose step output can be used for testing or replaying the - evaluation criteria. Results are ordered newest-first and paginated. - - Args: - criteria_id (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - started_after (datetime.datetime | None | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[CompatibleRunListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - criteria_id=criteria_id, - page=page, - limit=limit, - started_after=started_after, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - started_after: datetime.datetime | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CompatibleRunListResponse | HTTPValidationError | None: - """List Compatible Runs - - List agent runs that have a completed step matching the criteria's target step. - - Returns runs whose step output can be used for testing or replaying the - evaluation criteria. Results are ordered newest-first and paginated. - - Args: - criteria_id (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - started_after (datetime.datetime | None | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - CompatibleRunListResponse | HTTPValidationError - """ - - return sync_detailed( - criteria_id=criteria_id, - client=client, - page=page, - limit=limit, - started_after=started_after, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - started_after: datetime.datetime | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CompatibleRunListResponse | HTTPValidationError]: - """List Compatible Runs - - List agent runs that have a completed step matching the criteria's target step. - - Returns runs whose step output can be used for testing or replaying the - evaluation criteria. Results are ordered newest-first and paginated. - - Args: - criteria_id (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - started_after (datetime.datetime | None | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[CompatibleRunListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - criteria_id=criteria_id, - page=page, - limit=limit, - started_after=started_after, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - started_after: datetime.datetime | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CompatibleRunListResponse | HTTPValidationError | None: - """List Compatible Runs - - List agent runs that have a completed step matching the criteria's target step. - - Returns runs whose step output can be used for testing or replaying the - evaluation criteria. Results are ordered newest-first and paginated. - - Args: - criteria_id (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - started_after (datetime.datetime | None | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - CompatibleRunListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - criteria_id=criteria_id, - client=client, - page=page, - limit=limit, - started_after=started_after, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/list_evaluation_criteria_api_agents_agent_id_evaluation_criteria_get.py b/seclai/_generated/api/agent_evaluations/list_evaluation_criteria_api_agents_agent_id_evaluation_criteria_get.py deleted file mode 100644 index 6b73a46..0000000 --- a/seclai/_generated/api/agent_evaluations/list_evaluation_criteria_api_agents_agent_id_evaluation_criteria_get.py +++ /dev/null @@ -1,294 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.evaluation_criteria_response import EvaluationCriteriaResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/evaluation-criteria".format( - agent_id=quote(str(agent_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | list[EvaluationCriteriaResponse] | None: - if response.status_code == 200: - response_200 = [] - _response_200 = response.json() - for response_200_item_data in _response_200: - response_200_item = EvaluationCriteriaResponse.from_dict( - response_200_item_data - ) - - response_200.append(response_200_item) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | list[EvaluationCriteriaResponse]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[EvaluationCriteriaResponse]]: - """List Evaluation Criteria - - List evaluation criteria configured for an agent. - - Response shape is version-gated by the ``Seclai-Version`` header: - - - **Default / legacy** (no header, or a date before ``2026-07-27``): a bare - JSON array of criteria (unpaginated — every criterion for the agent). - - **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated - envelope ``{data, pagination: {page, limit, total, pages, has_next, - has_prev}}``. - - Each criterion carries its type, configuration, and a summary of results - (pass / fail counts). Criteria can be filtered client-side by type or - enabled status. - - Args: - agent_id (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[EvaluationCriteriaResponse]] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[EvaluationCriteriaResponse] | None: - """List Evaluation Criteria - - List evaluation criteria configured for an agent. - - Response shape is version-gated by the ``Seclai-Version`` header: - - - **Default / legacy** (no header, or a date before ``2026-07-27``): a bare - JSON array of criteria (unpaginated — every criterion for the agent). - - **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated - envelope ``{data, pagination: {page, limit, total, pages, has_next, - has_prev}}``. - - Each criterion carries its type, configuration, and a summary of results - (pass / fail counts). Criteria can be filtered client-side by type or - enabled status. - - Args: - agent_id (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[EvaluationCriteriaResponse] - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[EvaluationCriteriaResponse]]: - """List Evaluation Criteria - - List evaluation criteria configured for an agent. - - Response shape is version-gated by the ``Seclai-Version`` header: - - - **Default / legacy** (no header, or a date before ``2026-07-27``): a bare - JSON array of criteria (unpaginated — every criterion for the agent). - - **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated - envelope ``{data, pagination: {page, limit, total, pages, has_next, - has_prev}}``. - - Each criterion carries its type, configuration, and a summary of results - (pass / fail counts). Criteria can be filtered client-side by type or - enabled status. - - Args: - agent_id (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[EvaluationCriteriaResponse]] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[EvaluationCriteriaResponse] | None: - """List Evaluation Criteria - - List evaluation criteria configured for an agent. - - Response shape is version-gated by the ``Seclai-Version`` header: - - - **Default / legacy** (no header, or a date before ``2026-07-27``): a bare - JSON array of criteria (unpaginated — every criterion for the agent). - - **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated - envelope ``{data, pagination: {page, limit, total, pages, has_next, - has_prev}}``. - - Each criterion carries its type, configuration, and a summary of results - (pass / fail counts). Criteria can be filtered client-side by type or - enabled status. - - Args: - agent_id (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[EvaluationCriteriaResponse] - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/list_evaluation_results_api_agents_evaluation_criteria_criteria_id_results_get.py b/seclai/_generated/api/agent_evaluations/list_evaluation_results_api_agents_evaluation_criteria_criteria_id_results_get.py deleted file mode 100644 index 18c8999..0000000 --- a/seclai/_generated/api/agent_evaluations/list_evaluation_results_api_agents_evaluation_criteria_criteria_id_results_get.py +++ /dev/null @@ -1,330 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.evaluation_result_list_response import EvaluationResultListResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - criteria_id: str, - *, - status: None | str | Unset = UNSET, - flagged_only: bool | Unset = False, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - json_status: None | str | Unset - if isinstance(status, Unset): - json_status = UNSET - else: - json_status = status - params["status"] = json_status - - params["flagged_only"] = flagged_only - - json_time_from: None | str | Unset - if isinstance(time_from, Unset): - json_time_from = UNSET - else: - json_time_from = time_from - params["time_from"] = json_time_from - - json_time_to: None | str | Unset - if isinstance(time_to, Unset): - json_time_to = UNSET - else: - json_time_to = time_to - params["time_to"] = json_time_to - - params["page"] = page - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/evaluation-criteria/{criteria_id}/results".format( - criteria_id=quote(str(criteria_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationResultListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = EvaluationResultListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationResultListResponse | 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( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - status: None | str | Unset = UNSET, - flagged_only: bool | Unset = False, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultListResponse | HTTPValidationError]: - """List Evaluation Results - - List evaluation results for a criteria with optional filtering. - - Supports filtering by status (pending, passed, failed, skipped, error), - flagged-only mode, and an optional time range. Results are paginated - with configurable page size. - - Args: - criteria_id (str): - status (None | str | Unset): - flagged_only (bool | Unset): Default: False. - time_from (None | str | Unset): - time_to (None | str | Unset): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EvaluationResultListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - criteria_id=criteria_id, - status=status, - flagged_only=flagged_only, - time_from=time_from, - time_to=time_to, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - status: None | str | Unset = UNSET, - flagged_only: bool | Unset = False, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationResultListResponse | HTTPValidationError | None: - """List Evaluation Results - - List evaluation results for a criteria with optional filtering. - - Supports filtering by status (pending, passed, failed, skipped, error), - flagged-only mode, and an optional time range. Results are paginated - with configurable page size. - - Args: - criteria_id (str): - status (None | str | Unset): - flagged_only (bool | Unset): Default: False. - time_from (None | str | Unset): - time_to (None | str | Unset): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EvaluationResultListResponse | HTTPValidationError - """ - - return sync_detailed( - criteria_id=criteria_id, - client=client, - status=status, - flagged_only=flagged_only, - time_from=time_from, - time_to=time_to, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - status: None | str | Unset = UNSET, - flagged_only: bool | Unset = False, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationResultListResponse | HTTPValidationError]: - """List Evaluation Results - - List evaluation results for a criteria with optional filtering. - - Supports filtering by status (pending, passed, failed, skipped, error), - flagged-only mode, and an optional time range. Results are paginated - with configurable page size. - - Args: - criteria_id (str): - status (None | str | Unset): - flagged_only (bool | Unset): Default: False. - time_from (None | str | Unset): - time_to (None | str | Unset): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EvaluationResultListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - criteria_id=criteria_id, - status=status, - flagged_only=flagged_only, - time_from=time_from, - time_to=time_to, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - status: None | str | Unset = UNSET, - flagged_only: bool | Unset = False, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationResultListResponse | HTTPValidationError | None: - """List Evaluation Results - - List evaluation results for a criteria with optional filtering. - - Supports filtering by status (pending, passed, failed, skipped, error), - flagged-only mode, and an optional time range. Results are paginated - with configurable page size. - - Args: - criteria_id (str): - status (None | str | Unset): - flagged_only (bool | Unset): Default: False. - time_from (None | str | Unset): - time_to (None | str | Unset): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EvaluationResultListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - criteria_id=criteria_id, - client=client, - status=status, - flagged_only=flagged_only, - time_from=time_from, - time_to=time_to, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/list_evaluation_runs_api_agents_agent_id_evaluation_runs_get.py b/seclai/_generated/api/agent_evaluations/list_evaluation_runs_api_agents_agent_id_evaluation_runs_get.py deleted file mode 100644 index 68f8ea3..0000000 --- a/seclai/_generated/api/agent_evaluations/list_evaluation_runs_api_agents_agent_id_evaluation_runs_get.py +++ /dev/null @@ -1,333 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.evaluation_run_summary_list_response import ( - EvaluationRunSummaryListResponse, -) -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - status: None | str | Unset = UNSET, - step: None | str | Unset = UNSET, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - json_status: None | str | Unset - if isinstance(status, Unset): - json_status = UNSET - else: - json_status = status - params["status"] = json_status - - json_step: None | str | Unset - if isinstance(step, Unset): - json_step = UNSET - else: - json_step = step - params["step"] = json_step - - json_time_from: None | str | Unset - if isinstance(time_from, Unset): - json_time_from = UNSET - else: - json_time_from = time_from - params["time_from"] = json_time_from - - json_time_to: None | str | Unset - if isinstance(time_to, Unset): - json_time_to = UNSET - else: - json_time_to = time_to - params["time_to"] = json_time_to - - params["page"] = page - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/evaluation-runs".format( - agent_id=quote(str(agent_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationRunSummaryListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = EvaluationRunSummaryListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationRunSummaryListResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - status: None | str | Unset = UNSET, - step: None | str | Unset = UNSET, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationRunSummaryListResponse | HTTPValidationError]: - """List Evaluation Runs - - List evaluation results grouped by agent run. - - Returns paginated per-run summaries with pass/fail counts and optional - filtering by evaluation outcome, step, or date range. - - Args: - agent_id (str): - status (None | str | Unset): - step (None | str | Unset): - time_from (None | str | Unset): - time_to (None | str | Unset): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EvaluationRunSummaryListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - status=status, - step=step, - time_from=time_from, - time_to=time_to, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - status: None | str | Unset = UNSET, - step: None | str | Unset = UNSET, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationRunSummaryListResponse | HTTPValidationError | None: - """List Evaluation Runs - - List evaluation results grouped by agent run. - - Returns paginated per-run summaries with pass/fail counts and optional - filtering by evaluation outcome, step, or date range. - - Args: - agent_id (str): - status (None | str | Unset): - step (None | str | Unset): - time_from (None | str | Unset): - time_to (None | str | Unset): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EvaluationRunSummaryListResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - status=status, - step=step, - time_from=time_from, - time_to=time_to, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - status: None | str | Unset = UNSET, - step: None | str | Unset = UNSET, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationRunSummaryListResponse | HTTPValidationError]: - """List Evaluation Runs - - List evaluation results grouped by agent run. - - Returns paginated per-run summaries with pass/fail counts and optional - filtering by evaluation outcome, step, or date range. - - Args: - agent_id (str): - status (None | str | Unset): - step (None | str | Unset): - time_from (None | str | Unset): - time_to (None | str | Unset): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EvaluationRunSummaryListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - status=status, - step=step, - time_from=time_from, - time_to=time_to, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - status: None | str | Unset = UNSET, - step: None | str | Unset = UNSET, - time_from: None | str | Unset = UNSET, - time_to: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationRunSummaryListResponse | HTTPValidationError | None: - """List Evaluation Runs - - List evaluation results grouped by agent run. - - Returns paginated per-run summaries with pass/fail counts and optional - filtering by evaluation outcome, step, or date range. - - Args: - agent_id (str): - status (None | str | Unset): - step (None | str | Unset): - time_from (None | str | Unset): - time_to (None | str | Unset): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EvaluationRunSummaryListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - status=status, - step=step, - time_from=time_from, - time_to=time_to, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/list_run_evaluation_results_api_agents_agent_id_runs_run_id_evaluation_results_get.py b/seclai/_generated/api/agent_evaluations/list_run_evaluation_results_api_agents_agent_id_runs_run_id_evaluation_results_get.py deleted file mode 100644 index 38485cc..0000000 --- a/seclai/_generated/api/agent_evaluations/list_run_evaluation_results_api_agents_agent_id_runs_run_id_evaluation_results_get.py +++ /dev/null @@ -1,306 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.evaluation_result_with_criteria_response import ( - EvaluationResultWithCriteriaResponse, -) -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - run_id: str, - *, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/runs/{run_id}/evaluation-results".format( - agent_id=quote(str(agent_id), safe=""), - run_id=quote(str(run_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | list[EvaluationResultWithCriteriaResponse] | None: - if response.status_code == 200: - response_200 = [] - _response_200 = response.json() - for response_200_item_data in _response_200: - response_200_item = EvaluationResultWithCriteriaResponse.from_dict( - response_200_item_data - ) - - response_200.append(response_200_item) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | list[EvaluationResultWithCriteriaResponse]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - agent_id: str, - run_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[EvaluationResultWithCriteriaResponse]]: - """List Run Evaluation Results - - List evaluation results recorded for a specific agent run. - - Response shape is version-gated by the ``Seclai-Version`` header: - - - **Default / legacy** (no header, or a date before ``2026-07-27``): a bare - JSON array of results (unpaginated — every result for the run). - - **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated - envelope ``{data, pagination: {page, limit, total, pages, has_next, - has_prev}}``. - - Results span all evaluation criteria for the given run, useful for getting a - complete quality snapshot of a single execution. - - Args: - agent_id (str): - run_id (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[EvaluationResultWithCriteriaResponse]] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - run_id=run_id, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - run_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[EvaluationResultWithCriteriaResponse] | None: - """List Run Evaluation Results - - List evaluation results recorded for a specific agent run. - - Response shape is version-gated by the ``Seclai-Version`` header: - - - **Default / legacy** (no header, or a date before ``2026-07-27``): a bare - JSON array of results (unpaginated — every result for the run). - - **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated - envelope ``{data, pagination: {page, limit, total, pages, has_next, - has_prev}}``. - - Results span all evaluation criteria for the given run, useful for getting a - complete quality snapshot of a single execution. - - Args: - agent_id (str): - run_id (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[EvaluationResultWithCriteriaResponse] - """ - - return sync_detailed( - agent_id=agent_id, - run_id=run_id, - client=client, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - run_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[EvaluationResultWithCriteriaResponse]]: - """List Run Evaluation Results - - List evaluation results recorded for a specific agent run. - - Response shape is version-gated by the ``Seclai-Version`` header: - - - **Default / legacy** (no header, or a date before ``2026-07-27``): a bare - JSON array of results (unpaginated — every result for the run). - - **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated - envelope ``{data, pagination: {page, limit, total, pages, has_next, - has_prev}}``. - - Results span all evaluation criteria for the given run, useful for getting a - complete quality snapshot of a single execution. - - Args: - agent_id (str): - run_id (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[EvaluationResultWithCriteriaResponse]] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - run_id=run_id, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - run_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[EvaluationResultWithCriteriaResponse] | None: - """List Run Evaluation Results - - List evaluation results recorded for a specific agent run. - - Response shape is version-gated by the ``Seclai-Version`` header: - - - **Default / legacy** (no header, or a date before ``2026-07-27``): a bare - JSON array of results (unpaginated — every result for the run). - - **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated - envelope ``{data, pagination: {page, limit, total, pages, has_next, - has_prev}}``. - - Results span all evaluation criteria for the given run, useful for getting a - complete quality snapshot of a single execution. - - Args: - agent_id (str): - run_id (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[EvaluationResultWithCriteriaResponse] - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - run_id=run_id, - client=client, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/test_draft_evaluation_api_agents_agent_id_evaluation_criteria_test_draft_post.py b/seclai/_generated/api/agent_evaluations/test_draft_evaluation_api_agents_agent_id_evaluation_criteria_test_draft_post.py deleted file mode 100644 index 085008e..0000000 --- a/seclai/_generated/api/agent_evaluations/test_draft_evaluation_api_agents_agent_id_evaluation_criteria_test_draft_post.py +++ /dev/null @@ -1,254 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.test_draft_evaluation_request import TestDraftEvaluationRequest -from ...models.test_draft_evaluation_response import TestDraftEvaluationResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - body: TestDraftEvaluationRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/{agent_id}/evaluation-criteria/test-draft".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | TestDraftEvaluationResponse | None: - if response.status_code == 200: - response_200 = TestDraftEvaluationResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | TestDraftEvaluationResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: TestDraftEvaluationRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | TestDraftEvaluationResponse]: - """Test Draft Evaluation - - Run an ephemeral evaluation against provided step output without persisting results. - - Use this to interactively test evaluation prompts and expectation - configurations while editing criteria. No credits are consumed because - the result is not recorded. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (TestDraftEvaluationRequest): Request body for ephemeral (non-persisted) evaluation - testing. - - Provide either ``step_output`` (raw text) **or** ``agent_step_run_id`` - (to load output from storage). Exactly one must be supplied. - - 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 | TestDraftEvaluationResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: TestDraftEvaluationRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | TestDraftEvaluationResponse | None: - """Test Draft Evaluation - - Run an ephemeral evaluation against provided step output without persisting results. - - Use this to interactively test evaluation prompts and expectation - configurations while editing criteria. No credits are consumed because - the result is not recorded. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (TestDraftEvaluationRequest): Request body for ephemeral (non-persisted) evaluation - testing. - - Provide either ``step_output`` (raw text) **or** ``agent_step_run_id`` - (to load output from storage). Exactly one must be supplied. - - 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 | TestDraftEvaluationResponse - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: TestDraftEvaluationRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | TestDraftEvaluationResponse]: - """Test Draft Evaluation - - Run an ephemeral evaluation against provided step output without persisting results. - - Use this to interactively test evaluation prompts and expectation - configurations while editing criteria. No credits are consumed because - the result is not recorded. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (TestDraftEvaluationRequest): Request body for ephemeral (non-persisted) evaluation - testing. - - Provide either ``step_output`` (raw text) **or** ``agent_step_run_id`` - (to load output from storage). Exactly one must be supplied. - - 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 | TestDraftEvaluationResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: TestDraftEvaluationRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | TestDraftEvaluationResponse | None: - """Test Draft Evaluation - - Run an ephemeral evaluation against provided step output without persisting results. - - Use this to interactively test evaluation prompts and expectation - configurations while editing criteria. No credits are consumed because - the result is not recorded. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (TestDraftEvaluationRequest): Request body for ephemeral (non-persisted) evaluation - testing. - - Provide either ``step_output`` (raw text) **or** ``agent_step_run_id`` - (to load output from storage). Exactly one must be supplied. - - 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 | TestDraftEvaluationResponse - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_evaluations/update_evaluation_criteria_api_agents_evaluation_criteria_criteria_id_patch.py b/seclai/_generated/api/agent_evaluations/update_evaluation_criteria_api_agents_evaluation_criteria_criteria_id_patch.py deleted file mode 100644 index 3d55150..0000000 --- a/seclai/_generated/api/agent_evaluations/update_evaluation_criteria_api_agents_evaluation_criteria_criteria_id_patch.py +++ /dev/null @@ -1,246 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.evaluation_criteria_response import EvaluationCriteriaResponse -from ...models.http_validation_error import HTTPValidationError -from ...models.update_evaluation_criteria_request import UpdateEvaluationCriteriaRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - criteria_id: str, - *, - body: UpdateEvaluationCriteriaRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/agents/evaluation-criteria/{criteria_id}".format( - criteria_id=quote(str(criteria_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EvaluationCriteriaResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = EvaluationCriteriaResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EvaluationCriteriaResponse | 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( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateEvaluationCriteriaRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: - """Update Evaluation Criteria - - Update an evaluation criteria. - - Accepts a partial update – only the fields included in the request body - are modified. Use this to toggle enabled/disabled, change the - evaluation prompt, adjust retries, or rename the criteria. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateEvaluationCriteriaRequest): Request body for updating an evaluation criteria. - - Retry settings and sample frequency are set at the agent level. - - 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[EvaluationCriteriaResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - criteria_id=criteria_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateEvaluationCriteriaRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationCriteriaResponse | HTTPValidationError | None: - """Update Evaluation Criteria - - Update an evaluation criteria. - - Accepts a partial update – only the fields included in the request body - are modified. Use this to toggle enabled/disabled, change the - evaluation prompt, adjust retries, or rename the criteria. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateEvaluationCriteriaRequest): Request body for updating an evaluation criteria. - - Retry settings and sample frequency are set at the agent level. - - 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: - EvaluationCriteriaResponse | HTTPValidationError - """ - - return sync_detailed( - criteria_id=criteria_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateEvaluationCriteriaRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EvaluationCriteriaResponse | HTTPValidationError]: - """Update Evaluation Criteria - - Update an evaluation criteria. - - Accepts a partial update – only the fields included in the request body - are modified. Use this to toggle enabled/disabled, change the - evaluation prompt, adjust retries, or rename the criteria. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateEvaluationCriteriaRequest): Request body for updating an evaluation criteria. - - Retry settings and sample frequency are set at the agent level. - - 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[EvaluationCriteriaResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - criteria_id=criteria_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - criteria_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateEvaluationCriteriaRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EvaluationCriteriaResponse | HTTPValidationError | None: - """Update Evaluation Criteria - - Update an evaluation criteria. - - Accepts a partial update – only the fields included in the request body - are modified. Use this to toggle enabled/disabled, change the - evaluation prompt, adjust retries, or rename the criteria. - - Args: - criteria_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateEvaluationCriteriaRequest): Request body for updating an evaluation criteria. - - Retry settings and sample frequency are set at the agent level. - - 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: - EvaluationCriteriaResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - criteria_id=criteria_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agent_run_attachments/__init__.py b/seclai/_generated/api/agent_run_attachments/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/agent_run_attachments/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/agent_run_attachments/serve_agent_run_attachment_api_v2_agent_runs_run_id_attachments_attachment_id_get.py b/seclai/_generated/api/agent_run_attachments/serve_agent_run_attachment_api_v2_agent_runs_run_id_attachments_attachment_id_get.py deleted file mode 100644 index e232195..0000000 --- a/seclai/_generated/api/agent_run_attachments/serve_agent_run_attachment_api_v2_agent_runs_run_id_attachments_attachment_id_get.py +++ /dev/null @@ -1,299 +0,0 @@ -from http import HTTPStatus -from io import BytesIO -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, File, Response, Unset - - -def _get_kwargs( - run_id: UUID, - attachment_id: str, - *, - download_name: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - json_download_name: None | str | Unset - if isinstance(download_name, Unset): - json_download_name = UNSET - else: - json_download_name = download_name - params["download_name"] = json_download_name - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/v2/agent-runs/{run_id}/attachments/{attachment_id}".format( - run_id=quote(str(run_id), safe=""), - attachment_id=quote(str(attachment_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> File | HTTPValidationError | None: - if response.status_code == 200: - response_200 = File(payload=BytesIO(response.content)) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[File | 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( - run_id: UUID, - attachment_id: str, - *, - client: AuthenticatedClient | Client, - download_name: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[File | HTTPValidationError]: - """Download an agent-run attachment - - Streams the bytes of an attachment emitted by a step in the given agent run. ``attachment_id`` is - the URL-safe-base64-encoded ``storage_key`` (use the encoder shared by webhook + email payload - builders). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - The calling account must own ``run_id``; lookup failures (missing run, cross-account run, soft- - deleted agent, unreferenced storage_key) all collapse to a single 404 to prevent cross-tenant - existence enumeration. - - MIME handling: - - Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, - application/vnd.seclai.manifest+json) are served with their declared type. - - Everything else is served as ``application/octet-stream`` with an attachment disposition to - prevent stored-XSS. - - Args: - run_id (UUID): - attachment_id (str): - download_name (None | str | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[File | HTTPValidationError] - """ - - kwargs = _get_kwargs( - run_id=run_id, - attachment_id=attachment_id, - download_name=download_name, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - run_id: UUID, - attachment_id: str, - *, - client: AuthenticatedClient | Client, - download_name: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> File | HTTPValidationError | None: - """Download an agent-run attachment - - Streams the bytes of an attachment emitted by a step in the given agent run. ``attachment_id`` is - the URL-safe-base64-encoded ``storage_key`` (use the encoder shared by webhook + email payload - builders). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - The calling account must own ``run_id``; lookup failures (missing run, cross-account run, soft- - deleted agent, unreferenced storage_key) all collapse to a single 404 to prevent cross-tenant - existence enumeration. - - MIME handling: - - Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, - application/vnd.seclai.manifest+json) are served with their declared type. - - Everything else is served as ``application/octet-stream`` with an attachment disposition to - prevent stored-XSS. - - Args: - run_id (UUID): - attachment_id (str): - download_name (None | str | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - File | HTTPValidationError - """ - - return sync_detailed( - run_id=run_id, - attachment_id=attachment_id, - client=client, - download_name=download_name, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - run_id: UUID, - attachment_id: str, - *, - client: AuthenticatedClient | Client, - download_name: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[File | HTTPValidationError]: - """Download an agent-run attachment - - Streams the bytes of an attachment emitted by a step in the given agent run. ``attachment_id`` is - the URL-safe-base64-encoded ``storage_key`` (use the encoder shared by webhook + email payload - builders). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - The calling account must own ``run_id``; lookup failures (missing run, cross-account run, soft- - deleted agent, unreferenced storage_key) all collapse to a single 404 to prevent cross-tenant - existence enumeration. - - MIME handling: - - Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, - application/vnd.seclai.manifest+json) are served with their declared type. - - Everything else is served as ``application/octet-stream`` with an attachment disposition to - prevent stored-XSS. - - Args: - run_id (UUID): - attachment_id (str): - download_name (None | str | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[File | HTTPValidationError] - """ - - kwargs = _get_kwargs( - run_id=run_id, - attachment_id=attachment_id, - download_name=download_name, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - run_id: UUID, - attachment_id: str, - *, - client: AuthenticatedClient | Client, - download_name: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> File | HTTPValidationError | None: - """Download an agent-run attachment - - Streams the bytes of an attachment emitted by a step in the given agent run. ``attachment_id`` is - the URL-safe-base64-encoded ``storage_key`` (use the encoder shared by webhook + email payload - builders). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - The calling account must own ``run_id``; lookup failures (missing run, cross-account run, soft- - deleted agent, unreferenced storage_key) all collapse to a single 404 to prevent cross-tenant - existence enumeration. - - MIME handling: - - Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, - application/vnd.seclai.manifest+json) are served with their declared type. - - Everything else is served as ``application/octet-stream`` with an attachment disposition to - prevent stored-XSS. - - Args: - run_id (UUID): - attachment_id (str): - download_name (None | str | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - File | HTTPValidationError - """ - - return ( - await asyncio_detailed( - run_id=run_id, - attachment_id=attachment_id, - client=client, - download_name=download_name, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/__init__.py b/seclai/_generated/api/agents/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/agents/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/agents/api_get_agent_attachment_references_api_agents_agent_id_attachment_references_get.py b/seclai/_generated/api/agents/api_get_agent_attachment_references_api_agents_agent_id_attachment_references_get.py deleted file mode 100644 index 80625a3..0000000 --- a/seclai/_generated/api/agents/api_get_agent_attachment_references_api_agents_agent_id_attachment_references_get.py +++ /dev/null @@ -1,224 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_attachment_refs_api_response import AgentAttachmentRefsApiResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/attachment-references".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentAttachmentRefsApiResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentAttachmentRefsApiResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentAttachmentRefsApiResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentAttachmentRefsApiResponse | HTTPValidationError]: - """Get agent attachment-reference contract - - Return the static attachment-reference contract for an agent — what files the agent's definition - expects on a run. - - Call this BEFORE staging uploads so you know whether the agent accepts files at all - (``requires_uploads``), and which specific filenames/indexes/patterns the templates reference. - Mismatched batches are rejected at run time with HTTP 400. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentAttachmentRefsApiResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentAttachmentRefsApiResponse | HTTPValidationError | None: - """Get agent attachment-reference contract - - Return the static attachment-reference contract for an agent — what files the agent's definition - expects on a run. - - Call this BEFORE staging uploads so you know whether the agent accepts files at all - (``requires_uploads``), and which specific filenames/indexes/patterns the templates reference. - Mismatched batches are rejected at run time with HTTP 400. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentAttachmentRefsApiResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentAttachmentRefsApiResponse | HTTPValidationError]: - """Get agent attachment-reference contract - - Return the static attachment-reference contract for an agent — what files the agent's definition - expects on a run. - - Call this BEFORE staging uploads so you know whether the agent accepts files at all - (``requires_uploads``), and which specific filenames/indexes/patterns the templates reference. - Mismatched batches are rejected at run time with HTTP 400. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentAttachmentRefsApiResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentAttachmentRefsApiResponse | HTTPValidationError | None: - """Get agent attachment-reference contract - - Return the static attachment-reference contract for an agent — what files the agent's definition - expects on a run. - - Call this BEFORE staging uploads so you know whether the agent accepts files at all - (``requires_uploads``), and which specific filenames/indexes/patterns the templates reference. - Mismatched batches are rejected at run time with HTTP 400. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentAttachmentRefsApiResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/api_get_agent_input_upload_status_api_agents_agent_id_input_uploads_upload_id_get.py b/seclai/_generated/api/agents/api_get_agent_input_upload_status_api_agents_agent_id_input_uploads_upload_id_get.py deleted file mode 100644 index fbc5296..0000000 --- a/seclai/_generated/api/agents/api_get_agent_input_upload_status_api_agents_agent_id_input_uploads_upload_id_get.py +++ /dev/null @@ -1,242 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.upload_agent_input_api_response import UploadAgentInputApiResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - upload_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/input-uploads/{upload_id}".format( - agent_id=quote(str(agent_id), safe=""), - upload_id=quote(str(upload_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | UploadAgentInputApiResponse | None: - if response.status_code == 200: - response_200 = UploadAgentInputApiResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | UploadAgentInputApiResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - agent_id: str, - upload_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | UploadAgentInputApiResponse]: - """Get upload status - - Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`. - - Possible `status` values: `processing`, `ready`, `failed`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - upload_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | UploadAgentInputApiResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - upload_id=upload_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - upload_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | UploadAgentInputApiResponse | None: - """Get upload status - - Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`. - - Possible `status` values: `processing`, `ready`, `failed`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - upload_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | UploadAgentInputApiResponse - """ - - return sync_detailed( - agent_id=agent_id, - upload_id=upload_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - upload_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | UploadAgentInputApiResponse]: - """Get upload status - - Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`. - - Possible `status` values: `processing`, `ready`, `failed`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - upload_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | UploadAgentInputApiResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - upload_id=upload_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - upload_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | UploadAgentInputApiResponse | None: - """Get upload status - - Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`. - - Possible `status` values: `processing`, `ready`, `failed`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - upload_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | UploadAgentInputApiResponse - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - upload_id=upload_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/api_upload_agent_input_api_agents_agent_id_upload_input_post.py b/seclai/_generated/api/agents/api_upload_agent_input_api_agents_agent_id_upload_input_post.py deleted file mode 100644 index 13d2be3..0000000 --- a/seclai/_generated/api/agents/api_upload_agent_input_api_agents_agent_id_upload_input_post.py +++ /dev/null @@ -1,292 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.upload_agent_input_api_response import UploadAgentInputApiResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/{agent_id}/upload-input".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | UploadAgentInputApiResponse | None: - if response.status_code == 202: - response_202 = UploadAgentInputApiResponse.from_dict(response.json()) - - return response_202 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | UploadAgentInputApiResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | UploadAgentInputApiResponse]: - """Upload file input - - Upload a file to use as input for a `dynamic_input` agent run. - - Supports the same file types as content source uploads: text, PDF, DOCX, audio, video, images, etc. - Text and document files are processed synchronously; audio/video are submitted for asynchronous - transcription. - - **Size limit:** 200 MB per file. - - **Supported extensions:** txt, html, md, csv, xml, json, pdf, msg, docx, doc, pptx, ppt, xlsx, xls, - zip, epub, png, jpg, gif, bmp, tiff, webp, mp3, wav, m4a, flac, ogg, mp4, mov, avi. - - After uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, - then pass `input_upload_id` to `POST /agents/{agent_id}/runs`. - - **Multi-modal routing:** non-text uploads (image, audio, video, PDF) are surfaced natively to multi- - modal-capable prompt steps; text-only models fall back to the OCR / transcript text counterpart. - Audio originals are preserved past transcription so audio-capable models (Gemini 2.5/3, GPT-5 audio) - read them directly; the agent-input-binary janitor sweeps originals once they pass your account's - agent-trace retention (the agent-traces source's retention period; free default 7 days). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | UploadAgentInputApiResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | UploadAgentInputApiResponse | None: - """Upload file input - - Upload a file to use as input for a `dynamic_input` agent run. - - Supports the same file types as content source uploads: text, PDF, DOCX, audio, video, images, etc. - Text and document files are processed synchronously; audio/video are submitted for asynchronous - transcription. - - **Size limit:** 200 MB per file. - - **Supported extensions:** txt, html, md, csv, xml, json, pdf, msg, docx, doc, pptx, ppt, xlsx, xls, - zip, epub, png, jpg, gif, bmp, tiff, webp, mp3, wav, m4a, flac, ogg, mp4, mov, avi. - - After uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, - then pass `input_upload_id` to `POST /agents/{agent_id}/runs`. - - **Multi-modal routing:** non-text uploads (image, audio, video, PDF) are surfaced natively to multi- - modal-capable prompt steps; text-only models fall back to the OCR / transcript text counterpart. - Audio originals are preserved past transcription so audio-capable models (Gemini 2.5/3, GPT-5 audio) - read them directly; the agent-input-binary janitor sweeps originals once they pass your account's - agent-trace retention (the agent-traces source's retention period; free default 7 days). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | UploadAgentInputApiResponse - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | UploadAgentInputApiResponse]: - """Upload file input - - Upload a file to use as input for a `dynamic_input` agent run. - - Supports the same file types as content source uploads: text, PDF, DOCX, audio, video, images, etc. - Text and document files are processed synchronously; audio/video are submitted for asynchronous - transcription. - - **Size limit:** 200 MB per file. - - **Supported extensions:** txt, html, md, csv, xml, json, pdf, msg, docx, doc, pptx, ppt, xlsx, xls, - zip, epub, png, jpg, gif, bmp, tiff, webp, mp3, wav, m4a, flac, ogg, mp4, mov, avi. - - After uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, - then pass `input_upload_id` to `POST /agents/{agent_id}/runs`. - - **Multi-modal routing:** non-text uploads (image, audio, video, PDF) are surfaced natively to multi- - modal-capable prompt steps; text-only models fall back to the OCR / transcript text counterpart. - Audio originals are preserved past transcription so audio-capable models (Gemini 2.5/3, GPT-5 audio) - read them directly; the agent-input-binary janitor sweeps originals once they pass your account's - agent-trace retention (the agent-traces source's retention period; free default 7 days). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | UploadAgentInputApiResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | UploadAgentInputApiResponse | None: - """Upload file input - - Upload a file to use as input for a `dynamic_input` agent run. - - Supports the same file types as content source uploads: text, PDF, DOCX, audio, video, images, etc. - Text and document files are processed synchronously; audio/video are submitted for asynchronous - transcription. - - **Size limit:** 200 MB per file. - - **Supported extensions:** txt, html, md, csv, xml, json, pdf, msg, docx, doc, pptx, ppt, xlsx, xls, - zip, epub, png, jpg, gif, bmp, tiff, webp, mp3, wav, m4a, flac, ogg, mp4, mov, avi. - - After uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, - then pass `input_upload_id` to `POST /agents/{agent_id}/runs`. - - **Multi-modal routing:** non-text uploads (image, audio, video, PDF) are surfaced natively to multi- - modal-capable prompt steps; text-only models fall back to the OCR / transcript text counterpart. - Audio originals are preserved past transcription so audio-capable models (Gemini 2.5/3, GPT-5 audio) - read them directly; the agent-input-binary janitor sweeps originals once they pass your account's - agent-trace retention (the agent-traces source's retention period; free default 7 days). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | UploadAgentInputApiResponse - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/block_email_sender_api_api_agents_blocked_email_senders_post.py b/seclai/_generated/api/agents/block_email_sender_api_api_agents_blocked_email_senders_post.py deleted file mode 100644 index ca6e931..0000000 --- a/seclai/_generated/api/agents/block_email_sender_api_api_agents_blocked_email_senders_post.py +++ /dev/null @@ -1,226 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.block_email_sender_request import BlockEmailSenderRequest -from ...models.blocked_email_sender_response import BlockedEmailSenderResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: BlockEmailSenderRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/blocked-email-senders", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BlockedEmailSenderResponse | HTTPValidationError | None: - if response.status_code == 201: - response_201 = BlockedEmailSenderResponse.from_dict(response.json()) - - return response_201 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BlockedEmailSenderResponse | 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: AuthenticatedClient | Client, - body: BlockEmailSenderRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[BlockedEmailSenderResponse | HTTPValidationError]: - """Block an inbound email sender or domain - - Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is - `address` (default) or `domain`). - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (BlockEmailSenderRequest): Add one sender/domain to the account blocklist (shared - REST request). - - 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[BlockedEmailSenderResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: BlockEmailSenderRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> BlockedEmailSenderResponse | HTTPValidationError | None: - """Block an inbound email sender or domain - - Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is - `address` (default) or `domain`). - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (BlockEmailSenderRequest): Add one sender/domain to the account blocklist (shared - REST request). - - 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: - BlockedEmailSenderResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: BlockEmailSenderRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[BlockedEmailSenderResponse | HTTPValidationError]: - """Block an inbound email sender or domain - - Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is - `address` (default) or `domain`). - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (BlockEmailSenderRequest): Add one sender/domain to the account blocklist (shared - REST request). - - 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[BlockedEmailSenderResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: BlockEmailSenderRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> BlockedEmailSenderResponse | HTTPValidationError | None: - """Block an inbound email sender or domain - - Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is - `address` (default) or `domain`). - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (BlockEmailSenderRequest): Add one sender/domain to the account blocklist (shared - REST request). - - 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: - BlockedEmailSenderResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/cancel_queued_email_runs_api_api_agents_inbound_email_status_cancel_queued_post.py b/seclai/_generated/api/agents/cancel_queued_email_runs_api_api_agents_inbound_email_status_cancel_queued_post.py deleted file mode 100644 index dcc7889..0000000 --- a/seclai/_generated/api/agents/cancel_queued_email_runs_api_api_agents_inbound_email_status_cancel_queued_post.py +++ /dev/null @@ -1,198 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.cancel_queued_runs_response import CancelQueuedRunsResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/inbound-email-status/cancel-queued", - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CancelQueuedRunsResponse | None: - if response.status_code == 200: - response_200 = CancelQueuedRunsResponse.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CancelQueuedRunsResponse]: - 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: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CancelQueuedRunsResponse]: - """Cancel all queued inbound-email runs - - Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run - consumed no quota or credits at queue time, so this merely fails them. Returns the count cancelled. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[CancelQueuedRunsResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CancelQueuedRunsResponse | None: - """Cancel all queued inbound-email runs - - Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run - consumed no quota or credits at queue time, so this merely fails them. Returns the count cancelled. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - CancelQueuedRunsResponse - """ - - return sync_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CancelQueuedRunsResponse]: - """Cancel all queued inbound-email runs - - Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run - consumed no quota or credits at queue time, so this merely fails them. Returns the count cancelled. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[CancelQueuedRunsResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CancelQueuedRunsResponse | None: - """Cancel all queued inbound-email runs - - Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run - consumed no quota or credits at queue time, so this merely fails them. Returns the count cancelled. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - CancelQueuedRunsResponse - """ - - return ( - await asyncio_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/create_agent_api_agents_post.py b/seclai/_generated/api/agents/create_agent_api_agents_post.py deleted file mode 100644 index a978912..0000000 --- a/seclai/_generated/api/agents/create_agent_api_agents_post.py +++ /dev/null @@ -1,300 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_definition_import_error_response import ( - AgentDefinitionImportErrorResponse, -) -from ...models.agent_summary_response import AgentSummaryResponse -from ...models.create_agent_request import CreateAgentRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: CreateAgentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any | None: - if response.status_code == 201: - response_201 = AgentSummaryResponse.from_dict(response.json()) - - return response_201 - - if response.status_code == 402: - response_402 = cast(Any, None) - return response_402 - - if response.status_code == 422: - response_422 = AgentDefinitionImportErrorResponse.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any]: - 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: AuthenticatedClient | Client, - body: CreateAgentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any]: - """Create an agent - - Create a new agent. - - Trigger types: - - `dynamic_input`: triggered via API with user-provided input - - `template_input`: triggered via API with a predefined template - - `schedule`: triggered on a schedule - - `new_content`: triggered when new content arrives - - `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure - the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`. - - Templates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, - `content_change_notifier`, `scheduled_report`, `webhook_pipeline` - - Importing an existing agent: - - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras - suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; - items that don't resolve in this account are reported in the response's `import_warnings` array. - - Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory - banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: - target_uuid}` on this call to substitute them before save. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateAgentRequest): - - 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[AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateAgentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any | None: - """Create an agent - - Create a new agent. - - Trigger types: - - `dynamic_input`: triggered via API with user-provided input - - `template_input`: triggered via API with a predefined template - - `schedule`: triggered on a schedule - - `new_content`: triggered when new content arrives - - `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure - the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`. - - Templates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, - `content_change_notifier`, `scheduled_report`, `webhook_pipeline` - - Importing an existing agent: - - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras - suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; - items that don't resolve in this account are reported in the response's `import_warnings` array. - - Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory - banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: - target_uuid}` on this call to substitute them before save. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateAgentRequest): - - 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: - AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateAgentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any]: - """Create an agent - - Create a new agent. - - Trigger types: - - `dynamic_input`: triggered via API with user-provided input - - `template_input`: triggered via API with a predefined template - - `schedule`: triggered on a schedule - - `new_content`: triggered when new content arrives - - `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure - the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`. - - Templates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, - `content_change_notifier`, `scheduled_report`, `webhook_pipeline` - - Importing an existing agent: - - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras - suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; - items that don't resolve in this account are reported in the response's `import_warnings` array. - - Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory - banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: - target_uuid}` on this call to substitute them before save. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateAgentRequest): - - 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[AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateAgentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any | None: - """Create an agent - - Create a new agent. - - Trigger types: - - `dynamic_input`: triggered via API with user-provided input - - `template_input`: triggered via API with a predefined template - - `schedule`: triggered on a schedule - - `new_content`: triggered when new content arrives - - `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure - the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`. - - Templates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, - `content_change_notifier`, `scheduled_report`, `webhook_pipeline` - - Importing an existing agent: - - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras - suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; - items that don't resolve in this account are reported in the response's `import_warnings` array. - - Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory - banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: - target_uuid}` on this call to substitute them before save. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateAgentRequest): - - 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: - AgentDefinitionImportErrorResponse | AgentSummaryResponse | Any - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/delete_agent_api_agents_agent_id_delete.py b/seclai/_generated/api/agents/delete_agent_api_agents_agent_id_delete.py deleted file mode 100644 index 9e82f92..0000000 --- a/seclai/_generated/api/agents/delete_agent_api_agents_agent_id_delete.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/agents/{agent_id}".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete an agent - - Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only delete agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete an agent - - Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only delete agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete an agent - - Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only delete agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete an agent - - Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only delete agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/delete_agent_run_api_agents_runs_run_id_delete.py b/seclai/_generated/api/agents/delete_agent_run_api_agents_runs_run_id_delete.py deleted file mode 100644 index 29e6391..0000000 --- a/seclai/_generated/api/agents/delete_agent_run_api_agents_runs_run_id_delete.py +++ /dev/null @@ -1,240 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_run_response import AgentRunResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - run_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/agents/runs/{run_id}".format( - run_id=quote(str(run_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRunResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentRunResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRunResponse | 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( - run_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentRunResponse | HTTPValidationError]: - """Cancel an agent run - - Cancel an in-flight (`processing`) or queued (`queued`) agent run. - - A `queued` run is an inbound-email run parked by the per-plan rate quota that has not yet been - dispatched; cancelling it consumes no quota or credits. - - If the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only cancel runs belonging to your - account. - - Args: - run_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentRunResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - run_id=run_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - run_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentRunResponse | HTTPValidationError | None: - """Cancel an agent run - - Cancel an in-flight (`processing`) or queued (`queued`) agent run. - - A `queued` run is an inbound-email run parked by the per-plan rate quota that has not yet been - dispatched; cancelling it consumes no quota or credits. - - If the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only cancel runs belonging to your - account. - - Args: - run_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentRunResponse | HTTPValidationError - """ - - return sync_detailed( - run_id=run_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - run_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentRunResponse | HTTPValidationError]: - """Cancel an agent run - - Cancel an in-flight (`processing`) or queued (`queued`) agent run. - - A `queued` run is an inbound-email run parked by the per-plan rate quota that has not yet been - dispatched; cancelling it consumes no quota or credits. - - If the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only cancel runs belonging to your - account. - - Args: - run_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentRunResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - run_id=run_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - run_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentRunResponse | HTTPValidationError | None: - """Cancel an agent run - - Cancel an in-flight (`processing`) or queued (`queued`) agent run. - - A `queued` run is an inbound-email run parked by the per-plan rate quota that has not yet been - dispatched; cancelling it consumes no quota or credits. - - If the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only cancel runs belonging to your - account. - - Args: - run_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentRunResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - run_id=run_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/disable_agent_api_api_agents_agent_id_disable_post.py b/seclai/_generated/api/agents/disable_agent_api_api_agents_agent_id_disable_post.py deleted file mode 100644 index eaa360b..0000000 --- a/seclai/_generated/api/agents/disable_agent_api_api_agents_agent_id_disable_post.py +++ /dev/null @@ -1,232 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_summary_response import AgentSummaryResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/{agent_id}/disable".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentSummaryResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentSummaryResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentSummaryResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentSummaryResponse | HTTPValidationError]: - """Pause (disable) an agent - - Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is - turned away, scheduled/content triggers are skipped). - - Returns **409** with the blocking callers when other live agents still call this one via a - `call_agent` step — disable those first. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user - is recorded); the agent must belong to the key's account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentSummaryResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentSummaryResponse | HTTPValidationError | None: - """Pause (disable) an agent - - Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is - turned away, scheduled/content triggers are skipped). - - Returns **409** with the blocking callers when other live agents still call this one via a - `call_agent` step — disable those first. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user - is recorded); the agent must belong to the key's account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentSummaryResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentSummaryResponse | HTTPValidationError]: - """Pause (disable) an agent - - Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is - turned away, scheduled/content triggers are skipped). - - Returns **409** with the blocking callers when other live agents still call this one via a - `call_agent` step — disable those first. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user - is recorded); the agent must belong to the key's account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentSummaryResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentSummaryResponse | HTTPValidationError | None: - """Pause (disable) an agent - - Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is - turned away, scheduled/content triggers are skipped). - - Returns **409** with the blocking callers when other live agents still call this one via a - `call_agent` step — disable those first. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user - is recorded); the agent must belong to the key's account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentSummaryResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/enable_agent_api_api_agents_agent_id_enable_post.py b/seclai/_generated/api/agents/enable_agent_api_api_agents_agent_id_enable_post.py deleted file mode 100644 index 1820aa6..0000000 --- a/seclai/_generated/api/agents/enable_agent_api_api_agents_agent_id_enable_post.py +++ /dev/null @@ -1,220 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_summary_response import AgentSummaryResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/{agent_id}/enable".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentSummaryResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentSummaryResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentSummaryResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentSummaryResponse | HTTPValidationError]: - """Resume (enable) a paused agent - - Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by - the inbound-email overload safeguard). - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user - is recorded); the agent must belong to the key's account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentSummaryResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentSummaryResponse | HTTPValidationError | None: - """Resume (enable) a paused agent - - Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by - the inbound-email overload safeguard). - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user - is recorded); the agent must belong to the key's account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentSummaryResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentSummaryResponse | HTTPValidationError]: - """Resume (enable) a paused agent - - Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by - the inbound-email overload safeguard). - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user - is recorded); the agent must belong to the key's account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentSummaryResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentSummaryResponse | HTTPValidationError | None: - """Resume (enable) a paused agent - - Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by - the inbound-email overload safeguard). - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user - is recorded); the agent must belong to the key's account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentSummaryResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/export_agent_api_agents_agent_id_export_get.py b/seclai/_generated/api/agents/export_agent_api_agents_agent_id_export_get.py deleted file mode 100644 index a42e34d..0000000 --- a/seclai/_generated/api/agents/export_agent_api_agents_agent_id_export_get.py +++ /dev/null @@ -1,308 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_export_response import AgentExportResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - download: bool | Unset = True, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["download"] = download - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/export".format( - agent_id=quote(str(agent_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentExportResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentExportResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentExportResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - download: bool | Unset = True, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentExportResponse | HTTPValidationError]: - r"""Export agent definition - - Export an agent definition as a portable JSON snapshot. - - The response contains the full definition, trigger configuration with schedules, alert configs, - evaluation criteria, agent-scoped governance policies, and a resolved dependency manifest that maps - every referenced external entity UUID to its human-readable name. - - Response shape: - - `export_version`: schema version (currently `\"2\"`) - - `exported_at`: ISO-8601 timestamp - - `agent`: name, description, schema_version, definition, timestamps - - `trigger`: trigger type, input template, schedules - - `alert_configs`: alert type, thresholds, recipients - - `evaluation_criteria`: evaluation settings per step - - `governance_policies`: agent-scoped governance policies - - `dependencies`: knowledge_bases, memory_banks, source_connections, agents, users - - Query params: - - `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the - response as a file download. - - Auth & scoping: - - Requires `X-API-Key`. You can only export agents belonging to your account. - - Args: - agent_id (str): - download (bool | Unset): Return as file download Default: True. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentExportResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - download=download, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - download: bool | Unset = True, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentExportResponse | HTTPValidationError | None: - r"""Export agent definition - - Export an agent definition as a portable JSON snapshot. - - The response contains the full definition, trigger configuration with schedules, alert configs, - evaluation criteria, agent-scoped governance policies, and a resolved dependency manifest that maps - every referenced external entity UUID to its human-readable name. - - Response shape: - - `export_version`: schema version (currently `\"2\"`) - - `exported_at`: ISO-8601 timestamp - - `agent`: name, description, schema_version, definition, timestamps - - `trigger`: trigger type, input template, schedules - - `alert_configs`: alert type, thresholds, recipients - - `evaluation_criteria`: evaluation settings per step - - `governance_policies`: agent-scoped governance policies - - `dependencies`: knowledge_bases, memory_banks, source_connections, agents, users - - Query params: - - `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the - response as a file download. - - Auth & scoping: - - Requires `X-API-Key`. You can only export agents belonging to your account. - - Args: - agent_id (str): - download (bool | Unset): Return as file download Default: True. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentExportResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - download=download, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - download: bool | Unset = True, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentExportResponse | HTTPValidationError]: - r"""Export agent definition - - Export an agent definition as a portable JSON snapshot. - - The response contains the full definition, trigger configuration with schedules, alert configs, - evaluation criteria, agent-scoped governance policies, and a resolved dependency manifest that maps - every referenced external entity UUID to its human-readable name. - - Response shape: - - `export_version`: schema version (currently `\"2\"`) - - `exported_at`: ISO-8601 timestamp - - `agent`: name, description, schema_version, definition, timestamps - - `trigger`: trigger type, input template, schedules - - `alert_configs`: alert type, thresholds, recipients - - `evaluation_criteria`: evaluation settings per step - - `governance_policies`: agent-scoped governance policies - - `dependencies`: knowledge_bases, memory_banks, source_connections, agents, users - - Query params: - - `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the - response as a file download. - - Auth & scoping: - - Requires `X-API-Key`. You can only export agents belonging to your account. - - Args: - agent_id (str): - download (bool | Unset): Return as file download Default: True. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentExportResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - download=download, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - download: bool | Unset = True, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentExportResponse | HTTPValidationError | None: - r"""Export agent definition - - Export an agent definition as a portable JSON snapshot. - - The response contains the full definition, trigger configuration with schedules, alert configs, - evaluation criteria, agent-scoped governance policies, and a resolved dependency manifest that maps - every referenced external entity UUID to its human-readable name. - - Response shape: - - `export_version`: schema version (currently `\"2\"`) - - `exported_at`: ISO-8601 timestamp - - `agent`: name, description, schema_version, definition, timestamps - - `trigger`: trigger type, input template, schedules - - `alert_configs`: alert type, thresholds, recipients - - `evaluation_criteria`: evaluation settings per step - - `governance_policies`: agent-scoped governance policies - - `dependencies`: knowledge_bases, memory_banks, source_connections, agents, users - - Query params: - - `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the - response as a file download. - - Auth & scoping: - - Requires `X-API-Key`. You can only export agents belonging to your account. - - Args: - agent_id (str): - download (bool | Unset): Return as file download Default: True. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentExportResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - download=download, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/generate_agent_steps_api_agents_agent_id_ai_assistant_generate_steps_post.py b/seclai/_generated/api/agents/generate_agent_steps_api_agents_agent_id_ai_assistant_generate_steps_post.py deleted file mode 100644 index ca2dfa0..0000000 --- a/seclai/_generated/api/agents/generate_agent_steps_api_agents_agent_id_ai_assistant_generate_steps_post.py +++ /dev/null @@ -1,254 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.generate_agent_steps_request import GenerateAgentStepsRequest -from ...models.generate_agent_steps_response import GenerateAgentStepsResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - body: GenerateAgentStepsRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/{agent_id}/ai-assistant/generate-steps".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GenerateAgentStepsResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = GenerateAgentStepsResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GenerateAgentStepsResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: GenerateAgentStepsRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[GenerateAgentStepsResponse | HTTPValidationError]: - """Generate agent workflow - - Use the AI assistant to generate a full agent step workflow from a natural language description. - - Provide a description of what the agent should do, along with optional context (current steps, - trigger type). The AI produces a complete set of agent steps. - Use mode 'generate_full' for new workflows or 'modify_workflow' to refine existing ones. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be - used. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (GenerateAgentStepsRequest): - - 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[GenerateAgentStepsResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: GenerateAgentStepsRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> GenerateAgentStepsResponse | HTTPValidationError | None: - """Generate agent workflow - - Use the AI assistant to generate a full agent step workflow from a natural language description. - - Provide a description of what the agent should do, along with optional context (current steps, - trigger type). The AI produces a complete set of agent steps. - Use mode 'generate_full' for new workflows or 'modify_workflow' to refine existing ones. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be - used. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (GenerateAgentStepsRequest): - - 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: - GenerateAgentStepsResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: GenerateAgentStepsRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[GenerateAgentStepsResponse | HTTPValidationError]: - """Generate agent workflow - - Use the AI assistant to generate a full agent step workflow from a natural language description. - - Provide a description of what the agent should do, along with optional context (current steps, - trigger type). The AI produces a complete set of agent steps. - Use mode 'generate_full' for new workflows or 'modify_workflow' to refine existing ones. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be - used. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (GenerateAgentStepsRequest): - - 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[GenerateAgentStepsResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: GenerateAgentStepsRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> GenerateAgentStepsResponse | HTTPValidationError | None: - """Generate agent workflow - - Use the AI assistant to generate a full agent step workflow from a natural language description. - - Provide a description of what the agent should do, along with optional context (current steps, - trigger type). The AI produces a complete set of agent steps. - Use mode 'generate_full' for new workflows or 'modify_workflow' to refine existing ones. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be - used. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (GenerateAgentStepsRequest): - - 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: - GenerateAgentStepsResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/generate_step_config_api_agents_agent_id_ai_assistant_step_config_post.py b/seclai/_generated/api/agents/generate_step_config_api_agents_agent_id_ai_assistant_step_config_post.py deleted file mode 100644 index 50165af..0000000 --- a/seclai/_generated/api/agents/generate_step_config_api_agents_agent_id_ai_assistant_step_config_post.py +++ /dev/null @@ -1,254 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.generate_step_config_request import GenerateStepConfigRequest -from ...models.generate_step_config_response import GenerateStepConfigResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - body: GenerateStepConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/{agent_id}/ai-assistant/step-config".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GenerateStepConfigResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = GenerateStepConfigResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GenerateStepConfigResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: GenerateStepConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[GenerateStepConfigResponse | HTTPValidationError]: - """Generate step configuration - - Use the AI assistant to generate or refine a single step's configuration. - - Provide the step type, a natural language instruction, and optionally the current configuration. The - AI will produce a proposed configuration along with an explanation. The suggestion is stored as a - conversation turn that can be accepted or declined separately via the mark endpoint. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be - used. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (GenerateStepConfigRequest): - - 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[GenerateStepConfigResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: GenerateStepConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> GenerateStepConfigResponse | HTTPValidationError | None: - """Generate step configuration - - Use the AI assistant to generate or refine a single step's configuration. - - Provide the step type, a natural language instruction, and optionally the current configuration. The - AI will produce a proposed configuration along with an explanation. The suggestion is stored as a - conversation turn that can be accepted or declined separately via the mark endpoint. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be - used. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (GenerateStepConfigRequest): - - 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: - GenerateStepConfigResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: GenerateStepConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[GenerateStepConfigResponse | HTTPValidationError]: - """Generate step configuration - - Use the AI assistant to generate or refine a single step's configuration. - - Provide the step type, a natural language instruction, and optionally the current configuration. The - AI will produce a proposed configuration along with an explanation. The suggestion is stored as a - conversation turn that can be accepted or declined separately via the mark endpoint. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be - used. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (GenerateStepConfigRequest): - - 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[GenerateStepConfigResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: GenerateStepConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> GenerateStepConfigResponse | HTTPValidationError | None: - """Generate step configuration - - Use the AI assistant to generate or refine a single step's configuration. - - Provide the step type, a natural language instruction, and optionally the current configuration. The - AI will produce a proposed configuration along with an explanation. The suggestion is stored as a - conversation turn that can be accepted or declined separately via the mark endpoint. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be - used. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (GenerateStepConfigRequest): - - 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: - GenerateStepConfigResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/get_agent_callers_api_api_agents_agent_id_callers_get.py b/seclai/_generated/api/agents/get_agent_callers_api_api_agents_agent_id_callers_get.py deleted file mode 100644 index a92d5ca..0000000 --- a/seclai/_generated/api/agents/get_agent_callers_api_api_agents_agent_id_callers_get.py +++ /dev/null @@ -1,225 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_caller_api_response import AgentCallerApiResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/callers".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | list[AgentCallerApiResponse] | None: - if response.status_code == 200: - response_200 = [] - _response_200 = response.json() - for response_200_item_data in _response_200: - response_200_item = AgentCallerApiResponse.from_dict(response_200_item_data) - - response_200.append(response_200_item) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | list[AgentCallerApiResponse]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[AgentCallerApiResponse]]: - """List agents that call this agent - - List the live agents that call this agent via a `call_agent` step. They must be disabled before this - agent can be paused. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the agent must belong to the - key's account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[AgentCallerApiResponse]] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[AgentCallerApiResponse] | None: - """List agents that call this agent - - List the live agents that call this agent via a `call_agent` step. They must be disabled before this - agent can be paused. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the agent must belong to the - key's account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[AgentCallerApiResponse] - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[AgentCallerApiResponse]]: - """List agents that call this agent - - List the live agents that call this agent via a `call_agent` step. They must be disabled before this - agent can be paused. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the agent must belong to the - key's account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[AgentCallerApiResponse]] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[AgentCallerApiResponse] | None: - """List agents that call this agent - - List the live agents that call this agent via a `call_agent` step. They must be disabled before this - agent can be paused. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the agent must belong to the - key's account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[AgentCallerApiResponse] - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/get_agent_definition_api_agents_agent_id_definition_get.py b/seclai/_generated/api/agents/get_agent_definition_api_agents_agent_id_definition_get.py deleted file mode 100644 index e521176..0000000 --- a/seclai/_generated/api/agents/get_agent_definition_api_agents_agent_id_definition_get.py +++ /dev/null @@ -1,436 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_definition_response import AgentDefinitionResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/definition".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentDefinitionResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentDefinitionResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentDefinitionResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionResponse | HTTPValidationError]: - """Get agent definition - - Fetch the current agent definition from the main branch. - - The response includes `change_id` which must be provided when updating the definition (optimistic - locking). - - The definition contains the agent's step workflow. Available step types: - - `prompt_call`: Call an LLM with a prompt template - - `retrieval`: Search a knowledge base - - `regex_replace`: Reshape text via ordered regex find/replace rules - - `gate`: Evaluate conditions, stop or continue child execution - - `retry`: Re-execute from a target ancestor step (for quality-control loops; pair with a `gate` - step for conditional retrying. Fields: `target_step_id` (ancestor step ID), `max_retries` (1–10)) - - `evaluate_step`: Score a selected previous step output and emit JSON with `score`, `passed`, and - `pass_threshold` (fields: `target_step_id`, `evaluation_prompt`, `pass_threshold`, optional - `evaluation_tier`, optional `expectation_config`) - - `extract_data`: Progressively read and analyze large input - - `extract_content`: Extract structured data (JSON, HTML, XML) - - `add_chat_turn` / `load_chat_history`: Record a turn or load running history from a conversation - memory bank - - `add_memory` / `search_memory` / `load_memory`: Write, semantic-search, or load entries on a - general memory bank - - `send_email`: Send email with step output - - `webhook_call`: POST data to an external URL - - `write_aws_s3_object`: Write output to S3 - - `call_agent`: Invoke another agent - - `write_metadata`: Write a value to content metadata (for filtering/gates; content-triggered agents - only. Fields: `metadata_key`, `content`) - - `write_content_attachment`: Write a file-backed attachment to content (optionally indexed for - retrieval; content-triggered agents only. Fields: `attachment_key`, `content`, `content_type`, - `indexed`) - - `load_content_attachment`: Load a previously written attachment (content-triggered agents only. - Fields: `attachment_key`) - - `load_content`: Load the full text body of a source document (typically used with content- - triggered agents; can also load by explicit `content_version_id`. Fields: `content_version_id` - optional) - - `streaming_result`: Stream LLM tokens in real-time via SSE (must be a direct child of - `prompt_call`; requires `dynamic_input` or `template_input` trigger; `priority: true` enables real- - time streaming) - - `display_result`: Show output to the user - - `join`: Merge parallel branches - - `merge`: Combine multiple inputs into a single templated output - - `text`: Static text literal - - `for_each`: Iterate a body over a list of items (body lives in `body[]`) - - `if_else`: Conditional dispatch. Evaluates `conditions` (same shape as `gate`) and runs - `then_steps` on match, otherwise the optional `else_steps`. The chosen branch's output flows to the - if_else step's own `child_steps` (post-branch continuation chain). **`display_result` and - `streaming_result` are not allowed inside `then_steps` / `else_steps`** — end each branch with a - content-producing step (e.g. `text`, `prompt_call`) and place the single `display_result` in - `child_steps`. - - `switch`: Single-discriminator dispatch. Renders `discriminator` (default `{{input}}`) and routes - to the first matching `cases[]` entry (equality by default; pass a list in `match` for `$in` - semantics) or to `else_steps` when nothing matches. The chosen case's output flows to the switch - step's own `child_steps`. **`display_result` and `streaming_result` are not allowed inside - `cases[].steps` or `else_steps`** — end each case with a content-producing step and place the single - `display_result` in `child_steps`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentDefinitionResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentDefinitionResponse | HTTPValidationError | None: - """Get agent definition - - Fetch the current agent definition from the main branch. - - The response includes `change_id` which must be provided when updating the definition (optimistic - locking). - - The definition contains the agent's step workflow. Available step types: - - `prompt_call`: Call an LLM with a prompt template - - `retrieval`: Search a knowledge base - - `regex_replace`: Reshape text via ordered regex find/replace rules - - `gate`: Evaluate conditions, stop or continue child execution - - `retry`: Re-execute from a target ancestor step (for quality-control loops; pair with a `gate` - step for conditional retrying. Fields: `target_step_id` (ancestor step ID), `max_retries` (1–10)) - - `evaluate_step`: Score a selected previous step output and emit JSON with `score`, `passed`, and - `pass_threshold` (fields: `target_step_id`, `evaluation_prompt`, `pass_threshold`, optional - `evaluation_tier`, optional `expectation_config`) - - `extract_data`: Progressively read and analyze large input - - `extract_content`: Extract structured data (JSON, HTML, XML) - - `add_chat_turn` / `load_chat_history`: Record a turn or load running history from a conversation - memory bank - - `add_memory` / `search_memory` / `load_memory`: Write, semantic-search, or load entries on a - general memory bank - - `send_email`: Send email with step output - - `webhook_call`: POST data to an external URL - - `write_aws_s3_object`: Write output to S3 - - `call_agent`: Invoke another agent - - `write_metadata`: Write a value to content metadata (for filtering/gates; content-triggered agents - only. Fields: `metadata_key`, `content`) - - `write_content_attachment`: Write a file-backed attachment to content (optionally indexed for - retrieval; content-triggered agents only. Fields: `attachment_key`, `content`, `content_type`, - `indexed`) - - `load_content_attachment`: Load a previously written attachment (content-triggered agents only. - Fields: `attachment_key`) - - `load_content`: Load the full text body of a source document (typically used with content- - triggered agents; can also load by explicit `content_version_id`. Fields: `content_version_id` - optional) - - `streaming_result`: Stream LLM tokens in real-time via SSE (must be a direct child of - `prompt_call`; requires `dynamic_input` or `template_input` trigger; `priority: true` enables real- - time streaming) - - `display_result`: Show output to the user - - `join`: Merge parallel branches - - `merge`: Combine multiple inputs into a single templated output - - `text`: Static text literal - - `for_each`: Iterate a body over a list of items (body lives in `body[]`) - - `if_else`: Conditional dispatch. Evaluates `conditions` (same shape as `gate`) and runs - `then_steps` on match, otherwise the optional `else_steps`. The chosen branch's output flows to the - if_else step's own `child_steps` (post-branch continuation chain). **`display_result` and - `streaming_result` are not allowed inside `then_steps` / `else_steps`** — end each branch with a - content-producing step (e.g. `text`, `prompt_call`) and place the single `display_result` in - `child_steps`. - - `switch`: Single-discriminator dispatch. Renders `discriminator` (default `{{input}}`) and routes - to the first matching `cases[]` entry (equality by default; pass a list in `match` for `$in` - semantics) or to `else_steps` when nothing matches. The chosen case's output flows to the switch - step's own `child_steps`. **`display_result` and `streaming_result` are not allowed inside - `cases[].steps` or `else_steps`** — end each case with a content-producing step and place the single - `display_result` in `child_steps`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentDefinitionResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionResponse | HTTPValidationError]: - """Get agent definition - - Fetch the current agent definition from the main branch. - - The response includes `change_id` which must be provided when updating the definition (optimistic - locking). - - The definition contains the agent's step workflow. Available step types: - - `prompt_call`: Call an LLM with a prompt template - - `retrieval`: Search a knowledge base - - `regex_replace`: Reshape text via ordered regex find/replace rules - - `gate`: Evaluate conditions, stop or continue child execution - - `retry`: Re-execute from a target ancestor step (for quality-control loops; pair with a `gate` - step for conditional retrying. Fields: `target_step_id` (ancestor step ID), `max_retries` (1–10)) - - `evaluate_step`: Score a selected previous step output and emit JSON with `score`, `passed`, and - `pass_threshold` (fields: `target_step_id`, `evaluation_prompt`, `pass_threshold`, optional - `evaluation_tier`, optional `expectation_config`) - - `extract_data`: Progressively read and analyze large input - - `extract_content`: Extract structured data (JSON, HTML, XML) - - `add_chat_turn` / `load_chat_history`: Record a turn or load running history from a conversation - memory bank - - `add_memory` / `search_memory` / `load_memory`: Write, semantic-search, or load entries on a - general memory bank - - `send_email`: Send email with step output - - `webhook_call`: POST data to an external URL - - `write_aws_s3_object`: Write output to S3 - - `call_agent`: Invoke another agent - - `write_metadata`: Write a value to content metadata (for filtering/gates; content-triggered agents - only. Fields: `metadata_key`, `content`) - - `write_content_attachment`: Write a file-backed attachment to content (optionally indexed for - retrieval; content-triggered agents only. Fields: `attachment_key`, `content`, `content_type`, - `indexed`) - - `load_content_attachment`: Load a previously written attachment (content-triggered agents only. - Fields: `attachment_key`) - - `load_content`: Load the full text body of a source document (typically used with content- - triggered agents; can also load by explicit `content_version_id`. Fields: `content_version_id` - optional) - - `streaming_result`: Stream LLM tokens in real-time via SSE (must be a direct child of - `prompt_call`; requires `dynamic_input` or `template_input` trigger; `priority: true` enables real- - time streaming) - - `display_result`: Show output to the user - - `join`: Merge parallel branches - - `merge`: Combine multiple inputs into a single templated output - - `text`: Static text literal - - `for_each`: Iterate a body over a list of items (body lives in `body[]`) - - `if_else`: Conditional dispatch. Evaluates `conditions` (same shape as `gate`) and runs - `then_steps` on match, otherwise the optional `else_steps`. The chosen branch's output flows to the - if_else step's own `child_steps` (post-branch continuation chain). **`display_result` and - `streaming_result` are not allowed inside `then_steps` / `else_steps`** — end each branch with a - content-producing step (e.g. `text`, `prompt_call`) and place the single `display_result` in - `child_steps`. - - `switch`: Single-discriminator dispatch. Renders `discriminator` (default `{{input}}`) and routes - to the first matching `cases[]` entry (equality by default; pass a list in `match` for `$in` - semantics) or to `else_steps` when nothing matches. The chosen case's output flows to the switch - step's own `child_steps`. **`display_result` and `streaming_result` are not allowed inside - `cases[].steps` or `else_steps`** — end each case with a content-producing step and place the single - `display_result` in `child_steps`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentDefinitionResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentDefinitionResponse | HTTPValidationError | None: - """Get agent definition - - Fetch the current agent definition from the main branch. - - The response includes `change_id` which must be provided when updating the definition (optimistic - locking). - - The definition contains the agent's step workflow. Available step types: - - `prompt_call`: Call an LLM with a prompt template - - `retrieval`: Search a knowledge base - - `regex_replace`: Reshape text via ordered regex find/replace rules - - `gate`: Evaluate conditions, stop or continue child execution - - `retry`: Re-execute from a target ancestor step (for quality-control loops; pair with a `gate` - step for conditional retrying. Fields: `target_step_id` (ancestor step ID), `max_retries` (1–10)) - - `evaluate_step`: Score a selected previous step output and emit JSON with `score`, `passed`, and - `pass_threshold` (fields: `target_step_id`, `evaluation_prompt`, `pass_threshold`, optional - `evaluation_tier`, optional `expectation_config`) - - `extract_data`: Progressively read and analyze large input - - `extract_content`: Extract structured data (JSON, HTML, XML) - - `add_chat_turn` / `load_chat_history`: Record a turn or load running history from a conversation - memory bank - - `add_memory` / `search_memory` / `load_memory`: Write, semantic-search, or load entries on a - general memory bank - - `send_email`: Send email with step output - - `webhook_call`: POST data to an external URL - - `write_aws_s3_object`: Write output to S3 - - `call_agent`: Invoke another agent - - `write_metadata`: Write a value to content metadata (for filtering/gates; content-triggered agents - only. Fields: `metadata_key`, `content`) - - `write_content_attachment`: Write a file-backed attachment to content (optionally indexed for - retrieval; content-triggered agents only. Fields: `attachment_key`, `content`, `content_type`, - `indexed`) - - `load_content_attachment`: Load a previously written attachment (content-triggered agents only. - Fields: `attachment_key`) - - `load_content`: Load the full text body of a source document (typically used with content- - triggered agents; can also load by explicit `content_version_id`. Fields: `content_version_id` - optional) - - `streaming_result`: Stream LLM tokens in real-time via SSE (must be a direct child of - `prompt_call`; requires `dynamic_input` or `template_input` trigger; `priority: true` enables real- - time streaming) - - `display_result`: Show output to the user - - `join`: Merge parallel branches - - `merge`: Combine multiple inputs into a single templated output - - `text`: Static text literal - - `for_each`: Iterate a body over a list of items (body lives in `body[]`) - - `if_else`: Conditional dispatch. Evaluates `conditions` (same shape as `gate`) and runs - `then_steps` on match, otherwise the optional `else_steps`. The chosen branch's output flows to the - if_else step's own `child_steps` (post-branch continuation chain). **`display_result` and - `streaming_result` are not allowed inside `then_steps` / `else_steps`** — end each branch with a - content-producing step (e.g. `text`, `prompt_call`) and place the single `display_result` in - `child_steps`. - - `switch`: Single-discriminator dispatch. Renders `discriminator` (default `{{input}}`) and routes - to the first matching `cases[]` entry (equality by default; pass a list in `match` for `$in` - semantics) or to `else_steps` when nothing matches. The chosen case's output flows to the switch - step's own `child_steps`. **`display_result` and `streaming_result` are not allowed inside - `cases[].steps` or `else_steps`** — end each case with a content-producing step and place the single - `display_result` in `child_steps`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentDefinitionResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/get_agent_metadata_api_agents_agent_id_get.py b/seclai/_generated/api/agents/get_agent_metadata_api_agents_agent_id_get.py deleted file mode 100644 index d482020..0000000 --- a/seclai/_generated/api/agents/get_agent_metadata_api_agents_agent_id_get.py +++ /dev/null @@ -1,220 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_summary_response import AgentSummaryResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentSummaryResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentSummaryResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentSummaryResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentSummaryResponse | HTTPValidationError]: - """Get an agent - - Fetch an agent's metadata (name, description, trigger type, timestamps). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentSummaryResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentSummaryResponse | HTTPValidationError | None: - """Get an agent - - Fetch an agent's metadata (name, description, trigger type, timestamps). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentSummaryResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentSummaryResponse | HTTPValidationError]: - """Get an agent - - Fetch an agent's metadata (name, description, trigger type, timestamps). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentSummaryResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentSummaryResponse | HTTPValidationError | None: - """Get an agent - - Fetch an agent's metadata (name, description, trigger type, timestamps). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentSummaryResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/get_agent_run_api_agents_runs_run_id_get.py b/seclai/_generated/api/agents/get_agent_run_api_agents_runs_run_id_get.py deleted file mode 100644 index 2dc985c..0000000 --- a/seclai/_generated/api/agents/get_agent_run_api_agents_runs_run_id_get.py +++ /dev/null @@ -1,260 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_run_response import AgentRunResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - run_id: str, - *, - include_step_outputs: bool | Unset = False, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["include_step_outputs"] = include_step_outputs - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/runs/{run_id}".format( - run_id=quote(str(run_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRunResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentRunResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRunResponse | 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( - run_id: str, - *, - client: AuthenticatedClient | Client, - include_step_outputs: bool | Unset = False, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentRunResponse | HTTPValidationError]: - """Get an agent run - - Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST - /agents/{agent_id}/runs/stream`. - - The response includes `status`, `error_count`, and `output` once the run completes. Use - `include_step_outputs=true` to include per-step outputs, timing, durations, and credits. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access runs belonging to your - account. - - Args: - run_id (str): - include_step_outputs (bool | Unset): If true, include per-step outputs with timing, - durations, and credits. Default: False. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentRunResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - run_id=run_id, - include_step_outputs=include_step_outputs, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - run_id: str, - *, - client: AuthenticatedClient | Client, - include_step_outputs: bool | Unset = False, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentRunResponse | HTTPValidationError | None: - """Get an agent run - - Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST - /agents/{agent_id}/runs/stream`. - - The response includes `status`, `error_count`, and `output` once the run completes. Use - `include_step_outputs=true` to include per-step outputs, timing, durations, and credits. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access runs belonging to your - account. - - Args: - run_id (str): - include_step_outputs (bool | Unset): If true, include per-step outputs with timing, - durations, and credits. Default: False. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentRunResponse | HTTPValidationError - """ - - return sync_detailed( - run_id=run_id, - client=client, - include_step_outputs=include_step_outputs, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - run_id: str, - *, - client: AuthenticatedClient | Client, - include_step_outputs: bool | Unset = False, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentRunResponse | HTTPValidationError]: - """Get an agent run - - Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST - /agents/{agent_id}/runs/stream`. - - The response includes `status`, `error_count`, and `output` once the run completes. Use - `include_step_outputs=true` to include per-step outputs, timing, durations, and credits. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access runs belonging to your - account. - - Args: - run_id (str): - include_step_outputs (bool | Unset): If true, include per-step outputs with timing, - durations, and credits. Default: False. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentRunResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - run_id=run_id, - include_step_outputs=include_step_outputs, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - run_id: str, - *, - client: AuthenticatedClient | Client, - include_step_outputs: bool | Unset = False, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentRunResponse | HTTPValidationError | None: - """Get an agent run - - Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST - /agents/{agent_id}/runs/stream`. - - The response includes `status`, `error_count`, and `output` once the run completes. Use - `include_step_outputs=true` to include per-step outputs, timing, durations, and credits. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access runs belonging to your - account. - - Args: - run_id (str): - include_step_outputs (bool | Unset): If true, include per-step outputs with timing, - durations, and credits. Default: False. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentRunResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - run_id=run_id, - client=client, - include_step_outputs=include_step_outputs, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/get_ai_conversation_history_api_agents_agent_id_ai_assistant_conversations_get.py b/seclai/_generated/api/agents/get_ai_conversation_history_api_agents_agent_id_ai_assistant_conversations_get.py deleted file mode 100644 index 32bddca..0000000 --- a/seclai/_generated/api/agents/get_ai_conversation_history_api_agents_agent_id_ai_assistant_conversations_get.py +++ /dev/null @@ -1,306 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.ai_conversation_history_response import AiConversationHistoryResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - step_type: str, - step_id: None | str | Unset = UNSET, - limit: int | Unset = 10, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["step_type"] = step_type - - json_step_id: None | str | Unset - if isinstance(step_id, Unset): - json_step_id = UNSET - else: - json_step_id = step_id - params["step_id"] = json_step_id - - params["limit"] = limit - - params["offset"] = offset - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/ai-assistant/conversations".format( - agent_id=quote(str(agent_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiConversationHistoryResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AiConversationHistoryResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiConversationHistoryResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - step_type: str, - step_id: None | str | Unset = UNSET, - limit: int | Unset = 10, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiConversationHistoryResponse | HTTPValidationError]: - """Get AI conversation history - - Fetch the AI assistant conversation history for a specific step of an agent. - - Returns past conversation turns (user inputs, AI responses, accept/decline status) ordered oldest - first. Use `step_type` to filter by step type, and optionally `step_id` to narrow to a specific step - instance. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be - queried. - - Args: - agent_id (str): - step_type (str): Step type to look up. - step_id (None | str | Unset): Step ID to filter by. - limit (int | Unset): Max turns to return. Default: 10. - offset (int | Unset): Number of recent turns to skip. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AiConversationHistoryResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - step_type=step_type, - step_id=step_id, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - step_type: str, - step_id: None | str | Unset = UNSET, - limit: int | Unset = 10, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiConversationHistoryResponse | HTTPValidationError | None: - """Get AI conversation history - - Fetch the AI assistant conversation history for a specific step of an agent. - - Returns past conversation turns (user inputs, AI responses, accept/decline status) ordered oldest - first. Use `step_type` to filter by step type, and optionally `step_id` to narrow to a specific step - instance. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be - queried. - - Args: - agent_id (str): - step_type (str): Step type to look up. - step_id (None | str | Unset): Step ID to filter by. - limit (int | Unset): Max turns to return. Default: 10. - offset (int | Unset): Number of recent turns to skip. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AiConversationHistoryResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - step_type=step_type, - step_id=step_id, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - step_type: str, - step_id: None | str | Unset = UNSET, - limit: int | Unset = 10, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiConversationHistoryResponse | HTTPValidationError]: - """Get AI conversation history - - Fetch the AI assistant conversation history for a specific step of an agent. - - Returns past conversation turns (user inputs, AI responses, accept/decline status) ordered oldest - first. Use `step_type` to filter by step type, and optionally `step_id` to narrow to a specific step - instance. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be - queried. - - Args: - agent_id (str): - step_type (str): Step type to look up. - step_id (None | str | Unset): Step ID to filter by. - limit (int | Unset): Max turns to return. Default: 10. - offset (int | Unset): Number of recent turns to skip. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AiConversationHistoryResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - step_type=step_type, - step_id=step_id, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - step_type: str, - step_id: None | str | Unset = UNSET, - limit: int | Unset = 10, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiConversationHistoryResponse | HTTPValidationError | None: - """Get AI conversation history - - Fetch the AI assistant conversation history for a specific step of an agent. - - Returns past conversation turns (user inputs, AI responses, accept/decline status) ordered oldest - first. Use `step_type` to filter by step type, and optionally `step_id` to narrow to a specific step - instance. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be - queried. - - Args: - agent_id (str): - step_type (str): Step type to look up. - step_id (None | str | Unset): Step ID to filter by. - limit (int | Unset): Max turns to return. Default: 10. - offset (int | Unset): Number of recent turns to skip. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AiConversationHistoryResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - step_type=step_type, - step_id=step_id, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/get_inbound_email_status_api_api_agents_inbound_email_status_get.py b/seclai/_generated/api/agents/get_inbound_email_status_api_api_agents_inbound_email_status_get.py deleted file mode 100644 index cb167ff..0000000 --- a/seclai/_generated/api/agents/get_inbound_email_status_api_api_agents_inbound_email_status_get.py +++ /dev/null @@ -1,202 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.inbound_email_status_response import InboundEmailStatusResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/inbound-email-status", - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> InboundEmailStatusResponse | None: - if response.status_code == 200: - response_200 = InboundEmailStatusResponse.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[InboundEmailStatusResponse]: - 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: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[InboundEmailStatusResponse]: - """Account inbound-email overload status - - Whether the account-wide overload circuit breaker has currently paused new inbound email (all - inbound turned away until the queued backlog drains), plus the size of the QUEUED (over-quota - parked) run backlog. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[InboundEmailStatusResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> InboundEmailStatusResponse | None: - """Account inbound-email overload status - - Whether the account-wide overload circuit breaker has currently paused new inbound email (all - inbound turned away until the queued backlog drains), plus the size of the QUEUED (over-quota - parked) run backlog. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - InboundEmailStatusResponse - """ - - return sync_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[InboundEmailStatusResponse]: - """Account inbound-email overload status - - Whether the account-wide overload circuit breaker has currently paused new inbound email (all - inbound turned away until the queued backlog drains), plus the size of the QUEUED (over-quota - parked) run backlog. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[InboundEmailStatusResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> InboundEmailStatusResponse | None: - """Account inbound-email overload status - - Whether the account-wide overload circuit breaker has currently paused new inbound email (all - inbound turned away until the queued backlog drains), plus the size of the QUEUED (over-quota - parked) run backlog. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - InboundEmailStatusResponse - """ - - return ( - await asyncio_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/list_agent_email_optouts_api_api_agents_agent_email_optouts_get.py b/seclai/_generated/api/agents/list_agent_email_optouts_api_api_agents_agent_email_optouts_get.py deleted file mode 100644 index b6ba477..0000000 --- a/seclai/_generated/api/agents/list_agent_email_optouts_api_api_agents_agent_email_optouts_get.py +++ /dev/null @@ -1,263 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_email_opt_out_list_response import AgentEmailOptOutListResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - agent_id: None | str | Unset = UNSET, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - json_agent_id: None | str | Unset - if isinstance(agent_id, Unset): - json_agent_id = UNSET - else: - json_agent_id = agent_id - params["agent_id"] = json_agent_id - - params["limit"] = limit - - params["offset"] = offset - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/agent-email-optouts", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentEmailOptOutListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentEmailOptOutListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentEmailOptOutListResponse | 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: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentEmailOptOutListResponse | HTTPValidationError]: - """List agent-email opt-outs - - List recipients who have opted out of this account's agent emails (filter to one agent via - `agent_id`; account-wide opt-outs always apply). Paginated via `limit`/`offset`; returns the page - plus the `total` count. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - agent_id (None | str | Unset): Filter to one agent (account-wide opt-outs still apply) - limit (int | Unset): Default: 50. - offset (int | Unset): Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentEmailOptOutListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentEmailOptOutListResponse | HTTPValidationError | None: - """List agent-email opt-outs - - List recipients who have opted out of this account's agent emails (filter to one agent via - `agent_id`; account-wide opt-outs always apply). Paginated via `limit`/`offset`; returns the page - plus the `total` count. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - agent_id (None | str | Unset): Filter to one agent (account-wide opt-outs still apply) - limit (int | Unset): Default: 50. - offset (int | Unset): Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentEmailOptOutListResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - agent_id=agent_id, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentEmailOptOutListResponse | HTTPValidationError]: - """List agent-email opt-outs - - List recipients who have opted out of this account's agent emails (filter to one agent via - `agent_id`; account-wide opt-outs always apply). Paginated via `limit`/`offset`; returns the page - plus the `total` count. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - agent_id (None | str | Unset): Filter to one agent (account-wide opt-outs still apply) - limit (int | Unset): Default: 50. - offset (int | Unset): Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentEmailOptOutListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentEmailOptOutListResponse | HTTPValidationError | None: - """List agent-email opt-outs - - List recipients who have opted out of this account's agent emails (filter to one agent via - `agent_id`; account-wide opt-outs always apply). Paginated via `limit`/`offset`; returns the page - plus the `total` count. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - agent_id (None | str | Unset): Filter to one agent (account-wide opt-outs still apply) - limit (int | Unset): Default: 50. - offset (int | Unset): Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentEmailOptOutListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - agent_id=agent_id, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/list_agent_runs_api_agents_agent_id_runs_get.py b/seclai/_generated/api/agents/list_agent_runs_api_agents_agent_id_runs_get.py deleted file mode 100644 index d5d9f0d..0000000 --- a/seclai/_generated/api/agents/list_agent_runs_api_agents_agent_id_runs_get.py +++ /dev/null @@ -1,308 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_run_list_response import AgentRunListResponse -from ...models.http_validation_error import HTTPValidationError -from ...models.pending_processing_completed_failed_status import ( - PendingProcessingCompletedFailedStatus, -) -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - page: int | Unset = 1, - limit: int | Unset = 50, - status: None | PendingProcessingCompletedFailedStatus | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - json_status: None | str | Unset - if isinstance(status, Unset): - json_status = UNSET - elif isinstance(status, PendingProcessingCompletedFailedStatus): - json_status = status.value - else: - json_status = status - params["status"] = json_status - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/runs".format( - agent_id=quote(str(agent_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRunListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentRunListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRunListResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 50, - status: None | PendingProcessingCompletedFailedStatus | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentRunListResponse | HTTPValidationError]: - """List agent runs - - List runs for a specific agent (most recent first), with pagination. - - Typical use cases: - - Build a traces UI for an agent. - - Debug recent executions and inspect terminal statuses. - - Notes: - - This endpoint returns a summary list. Fetch full details with `GET /agents/runs/{run_id}`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only list runs for agents in your - account. - - Args: - agent_id (str): - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 50. - status (None | PendingProcessingCompletedFailedStatus | Unset): Filter runs by status - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentRunListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - page=page, - limit=limit, - status=status, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 50, - status: None | PendingProcessingCompletedFailedStatus | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentRunListResponse | HTTPValidationError | None: - """List agent runs - - List runs for a specific agent (most recent first), with pagination. - - Typical use cases: - - Build a traces UI for an agent. - - Debug recent executions and inspect terminal statuses. - - Notes: - - This endpoint returns a summary list. Fetch full details with `GET /agents/runs/{run_id}`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only list runs for agents in your - account. - - Args: - agent_id (str): - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 50. - status (None | PendingProcessingCompletedFailedStatus | Unset): Filter runs by status - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentRunListResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - page=page, - limit=limit, - status=status, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 50, - status: None | PendingProcessingCompletedFailedStatus | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentRunListResponse | HTTPValidationError]: - """List agent runs - - List runs for a specific agent (most recent first), with pagination. - - Typical use cases: - - Build a traces UI for an agent. - - Debug recent executions and inspect terminal statuses. - - Notes: - - This endpoint returns a summary list. Fetch full details with `GET /agents/runs/{run_id}`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only list runs for agents in your - account. - - Args: - agent_id (str): - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 50. - status (None | PendingProcessingCompletedFailedStatus | Unset): Filter runs by status - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentRunListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - page=page, - limit=limit, - status=status, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 50, - status: None | PendingProcessingCompletedFailedStatus | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentRunListResponse | HTTPValidationError | None: - """List agent runs - - List runs for a specific agent (most recent first), with pagination. - - Typical use cases: - - Build a traces UI for an agent. - - Debug recent executions and inspect terminal statuses. - - Notes: - - This endpoint returns a summary list. Fetch full details with `GET /agents/runs/{run_id}`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only list runs for agents in your - account. - - Args: - agent_id (str): - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 50. - status (None | PendingProcessingCompletedFailedStatus | Unset): Filter runs by status - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentRunListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - page=page, - limit=limit, - status=status, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/list_agents_api_agents_get.py b/seclai/_generated/api/agents/list_agents_api_agents_get.py deleted file mode 100644 index e82202e..0000000 --- a/seclai/_generated/api/agents/list_agents_api_agents_get.py +++ /dev/null @@ -1,239 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_list_response import AgentListResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentListResponse | 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: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentListResponse | HTTPValidationError]: - """List agents - - List agents for the account with pagination. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentListResponse | HTTPValidationError | None: - """List agents - - List agents for the account with pagination. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentListResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentListResponse | HTTPValidationError]: - """List agents - - List agents for the account with pagination. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AgentListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentListResponse | HTTPValidationError | None: - """List agents - - List agents for the account with pagination. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AgentListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/list_blocked_email_senders_api_api_agents_blocked_email_senders_get.py b/seclai/_generated/api/agents/list_blocked_email_senders_api_api_agents_blocked_email_senders_get.py deleted file mode 100644 index 8b82c95..0000000 --- a/seclai/_generated/api/agents/list_blocked_email_senders_api_api_agents_blocked_email_senders_get.py +++ /dev/null @@ -1,239 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.blocked_email_sender_list_response import BlockedEmailSenderListResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["limit"] = limit - - params["offset"] = offset - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/blocked-email-senders", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BlockedEmailSenderListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = BlockedEmailSenderListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BlockedEmailSenderListResponse | 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: AuthenticatedClient | Client, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[BlockedEmailSenderListResponse | HTTPValidationError]: - """List blocked inbound email senders + the auto-block mode - - List the account's blocked inbound email senders (newest first, paginated via `limit`/`offset`) plus - the governance `auto_block_mode`. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - limit (int | Unset): Default: 50. - offset (int | Unset): Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[BlockedEmailSenderListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> BlockedEmailSenderListResponse | HTTPValidationError | None: - """List blocked inbound email senders + the auto-block mode - - List the account's blocked inbound email senders (newest first, paginated via `limit`/`offset`) plus - the governance `auto_block_mode`. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - limit (int | Unset): Default: 50. - offset (int | Unset): Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - BlockedEmailSenderListResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[BlockedEmailSenderListResponse | HTTPValidationError]: - """List blocked inbound email senders + the auto-block mode - - List the account's blocked inbound email senders (newest first, paginated via `limit`/`offset`) plus - the governance `auto_block_mode`. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - limit (int | Unset): Default: 50. - offset (int | Unset): Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[BlockedEmailSenderListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> BlockedEmailSenderListResponse | HTTPValidationError | None: - """List blocked inbound email senders + the auto-block mode - - List the account's blocked inbound email senders (newest first, paginated via `limit`/`offset`) plus - the governance `auto_block_mode`. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - limit (int | Unset): Default: 50. - offset (int | Unset): Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - BlockedEmailSenderListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/list_inbound_email_rejections_api_api_agents_inbound_email_rejections_get.py b/seclai/_generated/api/agents/list_inbound_email_rejections_api_api_agents_inbound_email_rejections_get.py deleted file mode 100644 index 877629a..0000000 --- a/seclai/_generated/api/agents/list_inbound_email_rejections_api_api_agents_inbound_email_rejections_get.py +++ /dev/null @@ -1,251 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.inbound_email_rejection_response import InboundEmailRejectionResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - agent_id: None | str | Unset = UNSET, - limit: int | Unset = 50, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - json_agent_id: None | str | Unset - if isinstance(agent_id, Unset): - json_agent_id = UNSET - else: - json_agent_id = agent_id - params["agent_id"] = json_agent_id - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/inbound-email-rejections", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | list[InboundEmailRejectionResponse] | None: - if response.status_code == 200: - response_200 = [] - _response_200 = response.json() - for response_200_item_data in _response_200: - response_200_item = InboundEmailRejectionResponse.from_dict( - response_200_item_data - ) - - response_200.append(response_200_item) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | list[InboundEmailRejectionResponse]]: - 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: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - limit: int | Unset = 50, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[InboundEmailRejectionResponse]]: - """List discarded inbound emails - - List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, - unknown alias, spam/virus, flood-shed) for this account's agents. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - agent_id (None | str | Unset): Filter to a single agent's rejections - limit (int | Unset): Default: 50. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[InboundEmailRejectionResponse]] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - limit: int | Unset = 50, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[InboundEmailRejectionResponse] | None: - """List discarded inbound emails - - List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, - unknown alias, spam/virus, flood-shed) for this account's agents. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - agent_id (None | str | Unset): Filter to a single agent's rejections - limit (int | Unset): Default: 50. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[InboundEmailRejectionResponse] - """ - - return sync_detailed( - client=client, - agent_id=agent_id, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - limit: int | Unset = 50, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[InboundEmailRejectionResponse]]: - """List discarded inbound emails - - List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, - unknown alias, spam/virus, flood-shed) for this account's agents. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - agent_id (None | str | Unset): Filter to a single agent's rejections - limit (int | Unset): Default: 50. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[InboundEmailRejectionResponse]] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - limit: int | Unset = 50, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[InboundEmailRejectionResponse] | None: - """List discarded inbound emails - - List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, - unknown alias, spam/virus, flood-shed) for this account's agents. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's - account. - - Args: - agent_id (None | str | Unset): Filter to a single agent's rejections - limit (int | Unset): Default: 50. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[InboundEmailRejectionResponse] - """ - - return ( - await asyncio_detailed( - client=client, - agent_id=agent_id, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/mark_ai_suggestion_api_agents_agent_id_ai_assistant_conversation_id_patch.py b/seclai/_generated/api/agents/mark_ai_suggestion_api_agents_agent_id_ai_assistant_conversation_id_patch.py deleted file mode 100644 index 5ae944b..0000000 --- a/seclai/_generated/api/agents/mark_ai_suggestion_api_agents_agent_id_ai_assistant_conversation_id_patch.py +++ /dev/null @@ -1,264 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.mark_ai_suggestion_request import MarkAiSuggestionRequest -from ...models.ok_response import OkResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - conversation_id: str, - *, - body: MarkAiSuggestionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/agents/{agent_id}/ai-assistant/{conversation_id}".format( - agent_id=quote(str(agent_id), safe=""), - conversation_id=quote(str(conversation_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | OkResponse | None: - if response.status_code == 200: - response_200 = OkResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | OkResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - agent_id: str, - conversation_id: str, - *, - client: AuthenticatedClient | Client, - body: MarkAiSuggestionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OkResponse]: - """Accept or decline suggestion - - Accept or decline a proposed AI assistant configuration for a conversation turn. - - This only updates the tracking status on the conversation record. To actually apply the proposed - configuration, use the agent definition update endpoint separately. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The conversation must belong to one of your - agents. - - Args: - agent_id (str): - conversation_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MarkAiSuggestionRequest): - - 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 | OkResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - conversation_id=conversation_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - conversation_id: str, - *, - client: AuthenticatedClient | Client, - body: MarkAiSuggestionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OkResponse | None: - """Accept or decline suggestion - - Accept or decline a proposed AI assistant configuration for a conversation turn. - - This only updates the tracking status on the conversation record. To actually apply the proposed - configuration, use the agent definition update endpoint separately. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The conversation must belong to one of your - agents. - - Args: - agent_id (str): - conversation_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MarkAiSuggestionRequest): - - 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 | OkResponse - """ - - return sync_detailed( - agent_id=agent_id, - conversation_id=conversation_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - conversation_id: str, - *, - client: AuthenticatedClient | Client, - body: MarkAiSuggestionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OkResponse]: - """Accept or decline suggestion - - Accept or decline a proposed AI assistant configuration for a conversation turn. - - This only updates the tracking status on the conversation record. To actually apply the proposed - configuration, use the agent definition update endpoint separately. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The conversation must belong to one of your - agents. - - Args: - agent_id (str): - conversation_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MarkAiSuggestionRequest): - - 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 | OkResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - conversation_id=conversation_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - conversation_id: str, - *, - client: AuthenticatedClient | Client, - body: MarkAiSuggestionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OkResponse | None: - """Accept or decline suggestion - - Accept or decline a proposed AI assistant configuration for a conversation turn. - - This only updates the tracking status on the conversation record. To actually apply the proposed - configuration, use the agent definition update endpoint separately. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The conversation must belong to one of your - agents. - - Args: - agent_id (str): - conversation_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MarkAiSuggestionRequest): - - 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 | OkResponse - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - conversation_id=conversation_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/preview_import_agent_api_agents_preview_import_post.py b/seclai/_generated/api/agents/preview_import_agent_api_agents_preview_import_post.py deleted file mode 100644 index 3e15d4e..0000000 --- a/seclai/_generated/api/agents/preview_import_agent_api_agents_preview_import_post.py +++ /dev/null @@ -1,240 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_definition_import_error_response import ( - AgentDefinitionImportErrorResponse, -) -from ...models.agent_import_preview_request import AgentImportPreviewRequest -from ...models.agent_import_preview_response import AgentImportPreviewResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: AgentImportPreviewRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/preview-import", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentDefinitionImportErrorResponse | AgentImportPreviewResponse | None: - if response.status_code == 200: - response_200 = AgentImportPreviewResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = AgentDefinitionImportErrorResponse.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentDefinitionImportErrorResponse | AgentImportPreviewResponse]: - 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: AuthenticatedClient | Client, - body: AgentImportPreviewRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionImportErrorResponse | AgentImportPreviewResponse]: - """Preview an agent_definition import - - Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) - without creating or modifying any agent. On success returns a summary the client can show before - commit (counts of steps, schedules, alert configs, evaluation criteria, governance policies). On - failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can - render line/column-anchored errors. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. No DB writes. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentImportPreviewRequest): Dry-run import request — same payload shape as the - export endpoint. - - 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[AgentDefinitionImportErrorResponse | AgentImportPreviewResponse] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: AgentImportPreviewRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentDefinitionImportErrorResponse | AgentImportPreviewResponse | None: - """Preview an agent_definition import - - Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) - without creating or modifying any agent. On success returns a summary the client can show before - commit (counts of steps, schedules, alert configs, evaluation criteria, governance policies). On - failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can - render line/column-anchored errors. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. No DB writes. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentImportPreviewRequest): Dry-run import request — same payload shape as the - export endpoint. - - 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: - AgentDefinitionImportErrorResponse | AgentImportPreviewResponse - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: AgentImportPreviewRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionImportErrorResponse | AgentImportPreviewResponse]: - """Preview an agent_definition import - - Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) - without creating or modifying any agent. On success returns a summary the client can show before - commit (counts of steps, schedules, alert configs, evaluation criteria, governance policies). On - failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can - render line/column-anchored errors. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. No DB writes. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentImportPreviewRequest): Dry-run import request — same payload shape as the - export endpoint. - - 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[AgentDefinitionImportErrorResponse | AgentImportPreviewResponse] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: AgentImportPreviewRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentDefinitionImportErrorResponse | AgentImportPreviewResponse | None: - """Preview an agent_definition import - - Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) - without creating or modifying any agent. On success returns a summary the client can show before - commit (counts of steps, schedules, alert configs, evaluation criteria, governance policies). On - failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can - render line/column-anchored errors. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. No DB writes. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentImportPreviewRequest): Dry-run import request — same payload shape as the - export endpoint. - - 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: - AgentDefinitionImportErrorResponse | AgentImportPreviewResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/remove_agent_email_optout_api_api_agents_agent_email_optouts_optout_id_delete.py b/seclai/_generated/api/agents/remove_agent_email_optout_api_api_agents_agent_email_optouts_optout_id_delete.py deleted file mode 100644 index 0cd5f06..0000000 --- a/seclai/_generated/api/agents/remove_agent_email_optout_api_api_agents_agent_email_optouts_optout_id_delete.py +++ /dev/null @@ -1,214 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - optout_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/agents/agent-email-optouts/{optout_id}".format( - optout_id=quote(str(optout_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - optout_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Revoke an agent-email opt-out - - Revoke an opt-out (opt the recipient back in to agent emails). - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the opt-out must belong to the - key's account. - - Args: - optout_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - optout_id=optout_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - optout_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Revoke an agent-email opt-out - - Revoke an opt-out (opt the recipient back in to agent emails). - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the opt-out must belong to the - key's account. - - Args: - optout_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - optout_id=optout_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - optout_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Revoke an agent-email opt-out - - Revoke an opt-out (opt the recipient back in to agent emails). - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the opt-out must belong to the - key's account. - - Args: - optout_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - optout_id=optout_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - optout_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Revoke an agent-email opt-out - - Revoke an opt-out (opt the recipient back in to agent emails). - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the opt-out must belong to the - key's account. - - Args: - optout_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - optout_id=optout_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/resume_inbound_email_api_api_agents_inbound_email_status_resume_post.py b/seclai/_generated/api/agents/resume_inbound_email_api_api_agents_inbound_email_status_resume_post.py deleted file mode 100644 index d31e861..0000000 --- a/seclai/_generated/api/agents/resume_inbound_email_api_api_agents_inbound_email_status_resume_post.py +++ /dev/null @@ -1,198 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.resume_inbound_response import ResumeInboundResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/inbound-email-status/resume", - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ResumeInboundResponse | None: - if response.status_code == 200: - response_200 = ResumeInboundResponse.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ResumeInboundResponse]: - 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: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ResumeInboundResponse]: - """Manually resume paused inbound email - - Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the - breaker re-arms on the next evaluation — this is a one-shot override, not a permanent disable. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ResumeInboundResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ResumeInboundResponse | None: - """Manually resume paused inbound email - - Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the - breaker re-arms on the next evaluation — this is a one-shot override, not a permanent disable. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ResumeInboundResponse - """ - - return sync_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ResumeInboundResponse]: - """Manually resume paused inbound email - - Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the - breaker re-arms on the next evaluation — this is a one-shot override, not a permanent disable. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ResumeInboundResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ResumeInboundResponse | None: - """Manually resume paused inbound email - - Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the - breaker re-arms on the next evaluation — this is a one-shot override, not a permanent disable. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ResumeInboundResponse - """ - - return ( - await asyncio_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/run_agent_api_agents_agent_id_runs_post.py b/seclai/_generated/api/agents/run_agent_api_agents_agent_id_runs_post.py deleted file mode 100644 index 720b5c0..0000000 --- a/seclai/_generated/api/agents/run_agent_api_agents_agent_id_runs_post.py +++ /dev/null @@ -1,328 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_run_request import AgentRunRequest -from ...models.agent_run_response import AgentRunResponse -from ...models.http_validation_error import HTTPValidationError -from ...models.insufficient_credits_response import InsufficientCreditsResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - body: AgentRunRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/{agent_id}/runs".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse | None: - if response.status_code == 200: - response_200 = AgentRunResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 402: - response_402 = InsufficientCreditsResponse.from_dict(response.json()) - - return response_402 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: AgentRunRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse]: - """Run an agent - - Start an agent run. - - An *agent* is an automated workflow that can monitor content from your sources, process it with AI, - and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve - status and output. - - When to use: - - Use this endpoint for request/response style integrations where polling is acceptable. - - Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE. - - Key fields: - - `input`: text input for agents with a `dynamic_input` trigger. - - `input_upload_id`: alternatively, reference a file previously uploaded via `POST - /agents/{agent_id}/upload-input` (mutually exclusive with `input`). - - `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` - step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but - without live token streaming. - - `metadata`: a JSON object that becomes available to agent steps for string substitution. - - After starting: - - Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`. - - Use `include_step_outputs=true` to include per-step outputs, timing, and credits. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentRunRequest): - - 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[AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: AgentRunRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse | None: - """Run an agent - - Start an agent run. - - An *agent* is an automated workflow that can monitor content from your sources, process it with AI, - and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve - status and output. - - When to use: - - Use this endpoint for request/response style integrations where polling is acceptable. - - Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE. - - Key fields: - - `input`: text input for agents with a `dynamic_input` trigger. - - `input_upload_id`: alternatively, reference a file previously uploaded via `POST - /agents/{agent_id}/upload-input` (mutually exclusive with `input`). - - `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` - step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but - without live token streaming. - - `metadata`: a JSON object that becomes available to agent steps for string substitution. - - After starting: - - Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`. - - Use `include_step_outputs=true` to include per-step outputs, timing, and credits. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentRunRequest): - - 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: - AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: AgentRunRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse]: - """Run an agent - - Start an agent run. - - An *agent* is an automated workflow that can monitor content from your sources, process it with AI, - and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve - status and output. - - When to use: - - Use this endpoint for request/response style integrations where polling is acceptable. - - Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE. - - Key fields: - - `input`: text input for agents with a `dynamic_input` trigger. - - `input_upload_id`: alternatively, reference a file previously uploaded via `POST - /agents/{agent_id}/upload-input` (mutually exclusive with `input`). - - `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` - step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but - without live token streaming. - - `metadata`: a JSON object that becomes available to agent steps for string substitution. - - After starting: - - Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`. - - Use `include_step_outputs=true` to include per-step outputs, timing, and credits. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentRunRequest): - - 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[AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: AgentRunRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse | None: - """Run an agent - - Start an agent run. - - An *agent* is an automated workflow that can monitor content from your sources, process it with AI, - and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve - status and output. - - When to use: - - Use this endpoint for request/response style integrations where polling is acceptable. - - Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE. - - Key fields: - - `input`: text input for agents with a `dynamic_input` trigger. - - `input_upload_id`: alternatively, reference a file previously uploaded via `POST - /agents/{agent_id}/upload-input` (mutually exclusive with `input`). - - `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` - step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but - without live token streaming. - - `metadata`: a JSON object that becomes available to agent steps for string substitution. - - After starting: - - Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`. - - Use `include_step_outputs=true` to include per-step outputs, timing, and credits. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentRunRequest): - - 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: - AgentRunResponse | HTTPValidationError | InsufficientCreditsResponse - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/run_streaming_agent_api_agents_agent_id_runs_stream_post.py b/seclai/_generated/api/agents/run_streaming_agent_api_agents_agent_id_runs_stream_post.py deleted file mode 100644 index 73f7476..0000000 --- a/seclai/_generated/api/agents/run_streaming_agent_api_agents_agent_id_runs_stream_post.py +++ /dev/null @@ -1,322 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_run_stream_request import AgentRunStreamRequest -from ...models.http_validation_error import HTTPValidationError -from ...models.insufficient_credits_response import InsufficientCreditsResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - body: AgentRunStreamRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/{agent_id}/runs/stream".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | InsufficientCreditsResponse | None: - if response.status_code == 200: - response_200 = response.json() - return response_200 - - if response.status_code == 402: - response_402 = InsufficientCreditsResponse.from_dict(response.json()) - - return response_402 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | InsufficientCreditsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: AgentRunStreamRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | InsufficientCreditsResponse]: - """Run an agent (stream events) - - Start a **priority** agent run and stream run events using Server-Sent Events (SSE). - - This is the best option for interactive UIs where you want progress updates as the run executes. - - How it works: - - The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`. - - Subsequent events are forwarded from the run event stream (status changes, step events, etc). - - If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM - tokens (with a `token` field) and a `stream_end` event signals completion. - - The final `done` event contains the terminal snapshot (including `output` and `credits` when - available). - - Input options (for `dynamic_input` triggers): - - `input`: text input passed directly. - - `input_upload_id`: reference a file uploaded via `POST /agents/{agent_id}/upload-input` (mutually - exclusive with `input`). - - Client guidance: - - Keep the connection open and handle keepalive comments. - - On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET - /agents/runs/{run_id}`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentRunStreamRequest): - - 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 | InsufficientCreditsResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: AgentRunStreamRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | InsufficientCreditsResponse | None: - """Run an agent (stream events) - - Start a **priority** agent run and stream run events using Server-Sent Events (SSE). - - This is the best option for interactive UIs where you want progress updates as the run executes. - - How it works: - - The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`. - - Subsequent events are forwarded from the run event stream (status changes, step events, etc). - - If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM - tokens (with a `token` field) and a `stream_end` event signals completion. - - The final `done` event contains the terminal snapshot (including `output` and `credits` when - available). - - Input options (for `dynamic_input` triggers): - - `input`: text input passed directly. - - `input_upload_id`: reference a file uploaded via `POST /agents/{agent_id}/upload-input` (mutually - exclusive with `input`). - - Client guidance: - - Keep the connection open and handle keepalive comments. - - On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET - /agents/runs/{run_id}`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentRunStreamRequest): - - 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 | InsufficientCreditsResponse - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: AgentRunStreamRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | InsufficientCreditsResponse]: - """Run an agent (stream events) - - Start a **priority** agent run and stream run events using Server-Sent Events (SSE). - - This is the best option for interactive UIs where you want progress updates as the run executes. - - How it works: - - The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`. - - Subsequent events are forwarded from the run event stream (status changes, step events, etc). - - If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM - tokens (with a `token` field) and a `stream_end` event signals completion. - - The final `done` event contains the terminal snapshot (including `output` and `credits` when - available). - - Input options (for `dynamic_input` triggers): - - `input`: text input passed directly. - - `input_upload_id`: reference a file uploaded via `POST /agents/{agent_id}/upload-input` (mutually - exclusive with `input`). - - Client guidance: - - Keep the connection open and handle keepalive comments. - - On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET - /agents/runs/{run_id}`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentRunStreamRequest): - - 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 | InsufficientCreditsResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: AgentRunStreamRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | InsufficientCreditsResponse | None: - """Run an agent (stream events) - - Start a **priority** agent run and stream run events using Server-Sent Events (SSE). - - This is the best option for interactive UIs where you want progress updates as the run executes. - - How it works: - - The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`. - - Subsequent events are forwarded from the run event stream (status changes, step events, etc). - - If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM - tokens (with a `token` field) and a `stream_end` event signals completion. - - The final `done` event contains the terminal snapshot (including `output` and `credits` when - available). - - Input options (for `dynamic_input` triggers): - - `input`: text input passed directly. - - `input_upload_id`: reference a file uploaded via `POST /agents/{agent_id}/upload-input` (mutually - exclusive with `input`). - - Client guidance: - - Keep the connection open and handle keepalive comments. - - On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET - /agents/runs/{run_id}`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentRunStreamRequest): - - 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 | InsufficientCreditsResponse - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/search_agent_runs_api_agents_runs_search_post.py b/seclai/_generated/api/agents/search_agent_runs_api_agents_runs_search_post.py deleted file mode 100644 index 8b03e67..0000000 --- a/seclai/_generated/api/agents/search_agent_runs_api_agents_runs_search_post.py +++ /dev/null @@ -1,242 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_trace_search_request import AgentTraceSearchRequest -from ...models.agent_trace_search_response import AgentTraceSearchResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: AgentTraceSearchRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/runs/search", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentTraceSearchResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentTraceSearchResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentTraceSearchResponse | 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: AuthenticatedClient | Client, - body: AgentTraceSearchRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentTraceSearchResponse | HTTPValidationError]: - """Search agent traces - - Search agent traces using semantic similarity. - - Finds step-run outputs that are most semantically similar to the query. - Results include the matching text, agent/step metadata, and a similarity score. - - Agent traces are automatically indexed when runs complete. The first 7 days of storage are free; - extended retention is billed. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Searches only within your account's traces. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentTraceSearchRequest): - - 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[AgentTraceSearchResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: AgentTraceSearchRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentTraceSearchResponse | HTTPValidationError | None: - """Search agent traces - - Search agent traces using semantic similarity. - - Finds step-run outputs that are most semantically similar to the query. - Results include the matching text, agent/step metadata, and a similarity score. - - Agent traces are automatically indexed when runs complete. The first 7 days of storage are free; - extended retention is billed. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Searches only within your account's traces. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentTraceSearchRequest): - - 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: - AgentTraceSearchResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: AgentTraceSearchRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentTraceSearchResponse | HTTPValidationError]: - """Search agent traces - - Search agent traces using semantic similarity. - - Finds step-run outputs that are most semantically similar to the query. - Results include the matching text, agent/step metadata, and a similarity score. - - Agent traces are automatically indexed when runs complete. The first 7 days of storage are free; - extended retention is billed. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Searches only within your account's traces. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentTraceSearchRequest): - - 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[AgentTraceSearchResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: AgentTraceSearchRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentTraceSearchResponse | HTTPValidationError | None: - """Search agent traces - - Search agent traces using semantic similarity. - - Finds step-run outputs that are most semantically similar to the query. - Results include the matching text, agent/step metadata, and a similarity score. - - Agent traces are automatically indexed when runs complete. The first 7 days of storage are free; - extended retention is billed. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Searches only within your account's traces. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AgentTraceSearchRequest): - - 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: - AgentTraceSearchResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/set_auto_block_mode_api_api_agents_blocked_email_senders_mode_put.py b/seclai/_generated/api/agents/set_auto_block_mode_api_api_agents_blocked_email_senders_mode_put.py deleted file mode 100644 index bd86896..0000000 --- a/seclai/_generated/api/agents/set_auto_block_mode_api_api_agents_blocked_email_senders_mode_put.py +++ /dev/null @@ -1,226 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.blocked_email_sender_list_response import BlockedEmailSenderListResponse -from ...models.http_validation_error import HTTPValidationError -from ...models.set_auto_block_mode_request import SetAutoBlockModeRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: SetAutoBlockModeRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/agents/blocked-email-senders/mode", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BlockedEmailSenderListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = BlockedEmailSenderListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BlockedEmailSenderListResponse | 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: AuthenticatedClient | Client, - body: SetAutoBlockModeRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[BlockedEmailSenderListResponse | HTTPValidationError]: - """Set the governance auto-block mode - - Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the - blocklist (`disabled`, `input`, or `input_and_output`); returns the updated list. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (SetAutoBlockModeRequest): Set the account's governance auto-block mode (shared REST - request). - - 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[BlockedEmailSenderListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: SetAutoBlockModeRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> BlockedEmailSenderListResponse | HTTPValidationError | None: - """Set the governance auto-block mode - - Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the - blocklist (`disabled`, `input`, or `input_and_output`); returns the updated list. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (SetAutoBlockModeRequest): Set the account's governance auto-block mode (shared REST - request). - - 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: - BlockedEmailSenderListResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: SetAutoBlockModeRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[BlockedEmailSenderListResponse | HTTPValidationError]: - """Set the governance auto-block mode - - Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the - blocklist (`disabled`, `input`, or `input_and_output`); returns the updated list. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (SetAutoBlockModeRequest): Set the account's governance auto-block mode (shared REST - request). - - 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[BlockedEmailSenderListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: SetAutoBlockModeRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> BlockedEmailSenderListResponse | HTTPValidationError | None: - """Set the governance auto-block mode - - Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the - blocklist (`disabled`, `input`, or `input_and_output`); returns the updated list. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped - to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (SetAutoBlockModeRequest): Set the account's governance auto-block mode (shared REST - request). - - 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: - BlockedEmailSenderListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/set_email_trigger_config_api_api_agents_agent_id_triggers_trigger_id_email_config_put.py b/seclai/_generated/api/agents/set_email_trigger_config_api_api_agents_agent_id_triggers_trigger_id_email_config_put.py deleted file mode 100644 index 159f2de..0000000 --- a/seclai/_generated/api/agents/set_email_trigger_config_api_api_agents_agent_id_triggers_trigger_id_email_config_put.py +++ /dev/null @@ -1,272 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.email_trigger_config_response import EmailTriggerConfigResponse -from ...models.http_validation_error import HTTPValidationError -from ...models.set_email_trigger_config_request import SetEmailTriggerConfigRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - trigger_id: str, - *, - body: SetEmailTriggerConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/agents/{agent_id}/triggers/{trigger_id}/email-config".format( - agent_id=quote(str(agent_id), safe=""), - trigger_id=quote(str(trigger_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EmailTriggerConfigResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = EmailTriggerConfigResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EmailTriggerConfigResponse | 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( - agent_id: str, - trigger_id: str, - *, - client: AuthenticatedClient | Client, - body: SetEmailTriggerConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EmailTriggerConfigResponse | HTTPValidationError]: - """Configure an EMAIL_RECEIVED trigger - - Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, - `require_sender_auth`, `queue_on_quota`) on an agent's EMAIL_RECEIVED trigger, and return its - computed email address(es). Omitted fields are left unchanged. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an - agent in the key's account. - - Args: - agent_id (str): - trigger_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (SetEmailTriggerConfigRequest): Alias and/or sender allowlist for an EMAIL_RECEIVED - trigger. - - A field omitted is left unchanged; passing ``null`` (or ``""`` for - ``alias``) clears it. - - 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[EmailTriggerConfigResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - trigger_id=trigger_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - trigger_id: str, - *, - client: AuthenticatedClient | Client, - body: SetEmailTriggerConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EmailTriggerConfigResponse | HTTPValidationError | None: - """Configure an EMAIL_RECEIVED trigger - - Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, - `require_sender_auth`, `queue_on_quota`) on an agent's EMAIL_RECEIVED trigger, and return its - computed email address(es). Omitted fields are left unchanged. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an - agent in the key's account. - - Args: - agent_id (str): - trigger_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (SetEmailTriggerConfigRequest): Alias and/or sender allowlist for an EMAIL_RECEIVED - trigger. - - A field omitted is left unchanged; passing ``null`` (or ``""`` for - ``alias``) clears it. - - 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: - EmailTriggerConfigResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - trigger_id=trigger_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - trigger_id: str, - *, - client: AuthenticatedClient | Client, - body: SetEmailTriggerConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EmailTriggerConfigResponse | HTTPValidationError]: - """Configure an EMAIL_RECEIVED trigger - - Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, - `require_sender_auth`, `queue_on_quota`) on an agent's EMAIL_RECEIVED trigger, and return its - computed email address(es). Omitted fields are left unchanged. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an - agent in the key's account. - - Args: - agent_id (str): - trigger_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (SetEmailTriggerConfigRequest): Alias and/or sender allowlist for an EMAIL_RECEIVED - trigger. - - A field omitted is left unchanged; passing ``null`` (or ``""`` for - ``alias``) clears it. - - 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[EmailTriggerConfigResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - trigger_id=trigger_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - trigger_id: str, - *, - client: AuthenticatedClient | Client, - body: SetEmailTriggerConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EmailTriggerConfigResponse | HTTPValidationError | None: - """Configure an EMAIL_RECEIVED trigger - - Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, - `require_sender_auth`, `queue_on_quota`) on an agent's EMAIL_RECEIVED trigger, and return its - computed email address(es). Omitted fields are left unchanged. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an - agent in the key's account. - - Args: - agent_id (str): - trigger_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (SetEmailTriggerConfigRequest): Alias and/or sender allowlist for an EMAIL_RECEIVED - trigger. - - A field omitted is left unchanged; passing ``null`` (or ``""`` for - ``alias``) clears it. - - 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: - EmailTriggerConfigResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - trigger_id=trigger_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/unblock_email_sender_api_api_agents_blocked_email_senders_blocked_id_delete.py b/seclai/_generated/api/agents/unblock_email_sender_api_api_agents_blocked_email_senders_blocked_id_delete.py deleted file mode 100644 index b75fd09..0000000 --- a/seclai/_generated/api/agents/unblock_email_sender_api_api_agents_blocked_email_senders_blocked_id_delete.py +++ /dev/null @@ -1,214 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - blocked_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/agents/blocked-email-senders/{blocked_id}".format( - blocked_id=quote(str(blocked_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - blocked_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Unblock an inbound email sender - - Remove a blocked sender by id. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; the - blocked sender must belong to the key's account. - - Args: - blocked_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - blocked_id=blocked_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - blocked_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Unblock an inbound email sender - - Remove a blocked sender by id. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; the - blocked sender must belong to the key's account. - - Args: - blocked_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - blocked_id=blocked_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - blocked_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Unblock an inbound email sender - - Remove a blocked sender by id. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; the - blocked sender must belong to the key's account. - - Args: - blocked_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - blocked_id=blocked_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - blocked_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Unblock an inbound email sender - - Remove a blocked sender by id. - - Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; the - blocked sender must belong to the key's account. - - Args: - blocked_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - blocked_id=blocked_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/update_agent_api_agents_agent_id_put.py b/seclai/_generated/api/agents/update_agent_api_agents_agent_id_put.py deleted file mode 100644 index c290bf9..0000000 --- a/seclai/_generated/api/agents/update_agent_api_agents_agent_id_put.py +++ /dev/null @@ -1,316 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_definition_import_error_response import ( - AgentDefinitionImportErrorResponse, -) -from ...models.agent_summary_response import AgentSummaryResponse -from ...models.update_agent_request import UpdateAgentRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - body: UpdateAgentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/agents/{agent_id}".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentDefinitionImportErrorResponse | AgentSummaryResponse | None: - if response.status_code == 200: - response_200 = AgentSummaryResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = AgentDefinitionImportErrorResponse.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateAgentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse]: - """Update agent metadata - - Update an agent's name, description, evaluation settings, and model lifecycle settings. - - Evaluation settings: `evaluation_mode` ('output_expectation', 'eval_and_retry', 'sample_and_flag'), - `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `max_retries`, `retry_on_failure`, - `sampling_config`. - - Model lifecycle settings: `prompt_model_auto_upgrade_strategy` ('none', 'early_adopter', - 'middle_of_road', 'cautious_adopter'), `prompt_model_auto_rollback_enabled`, - `prompt_model_auto_rollback_triggers` (list of 'agent_eval_fail', 'governance_flag', - 'governance_block', 'agent_run_failed'). - - Replacing the workflow from an export: - - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. Update only - touches the workflow + agent metadata — alert_configs, evaluation_criteria, governance_policies, - schedules, and solution links from the imported file are NOT applied (use the dedicated endpoints - for those, or `POST /agents` to import as a new agent). - - `entity_remap: {source_uuid: target_uuid}` substitutes workflow entity refs before save (same - shape as `POST /agents`). - - At least one field must be provided. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateAgentRequest): - - 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[AgentDefinitionImportErrorResponse | AgentSummaryResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateAgentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentDefinitionImportErrorResponse | AgentSummaryResponse | None: - """Update agent metadata - - Update an agent's name, description, evaluation settings, and model lifecycle settings. - - Evaluation settings: `evaluation_mode` ('output_expectation', 'eval_and_retry', 'sample_and_flag'), - `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `max_retries`, `retry_on_failure`, - `sampling_config`. - - Model lifecycle settings: `prompt_model_auto_upgrade_strategy` ('none', 'early_adopter', - 'middle_of_road', 'cautious_adopter'), `prompt_model_auto_rollback_enabled`, - `prompt_model_auto_rollback_triggers` (list of 'agent_eval_fail', 'governance_flag', - 'governance_block', 'agent_run_failed'). - - Replacing the workflow from an export: - - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. Update only - touches the workflow + agent metadata — alert_configs, evaluation_criteria, governance_policies, - schedules, and solution links from the imported file are NOT applied (use the dedicated endpoints - for those, or `POST /agents` to import as a new agent). - - `entity_remap: {source_uuid: target_uuid}` substitutes workflow entity refs before save (same - shape as `POST /agents`). - - At least one field must be provided. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateAgentRequest): - - 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: - AgentDefinitionImportErrorResponse | AgentSummaryResponse - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateAgentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionImportErrorResponse | AgentSummaryResponse]: - """Update agent metadata - - Update an agent's name, description, evaluation settings, and model lifecycle settings. - - Evaluation settings: `evaluation_mode` ('output_expectation', 'eval_and_retry', 'sample_and_flag'), - `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `max_retries`, `retry_on_failure`, - `sampling_config`. - - Model lifecycle settings: `prompt_model_auto_upgrade_strategy` ('none', 'early_adopter', - 'middle_of_road', 'cautious_adopter'), `prompt_model_auto_rollback_enabled`, - `prompt_model_auto_rollback_triggers` (list of 'agent_eval_fail', 'governance_flag', - 'governance_block', 'agent_run_failed'). - - Replacing the workflow from an export: - - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. Update only - touches the workflow + agent metadata — alert_configs, evaluation_criteria, governance_policies, - schedules, and solution links from the imported file are NOT applied (use the dedicated endpoints - for those, or `POST /agents` to import as a new agent). - - `entity_remap: {source_uuid: target_uuid}` substitutes workflow entity refs before save (same - shape as `POST /agents`). - - At least one field must be provided. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateAgentRequest): - - 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[AgentDefinitionImportErrorResponse | AgentSummaryResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateAgentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentDefinitionImportErrorResponse | AgentSummaryResponse | None: - """Update agent metadata - - Update an agent's name, description, evaluation settings, and model lifecycle settings. - - Evaluation settings: `evaluation_mode` ('output_expectation', 'eval_and_retry', 'sample_and_flag'), - `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `max_retries`, `retry_on_failure`, - `sampling_config`. - - Model lifecycle settings: `prompt_model_auto_upgrade_strategy` ('none', 'early_adopter', - 'middle_of_road', 'cautious_adopter'), `prompt_model_auto_rollback_enabled`, - `prompt_model_auto_rollback_triggers` (list of 'agent_eval_fail', 'governance_flag', - 'governance_block', 'agent_run_failed'). - - Replacing the workflow from an export: - - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. Update only - touches the workflow + agent metadata — alert_configs, evaluation_criteria, governance_policies, - schedules, and solution links from the imported file are NOT applied (use the dedicated endpoints - for those, or `POST /agents` to import as a new agent). - - `entity_remap: {source_uuid: target_uuid}` substitutes workflow entity refs before save (same - shape as `POST /agents`). - - At least one field must be provided. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateAgentRequest): - - 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: - AgentDefinitionImportErrorResponse | AgentSummaryResponse - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/agents/update_agent_definition_api_agents_agent_id_definition_put.py b/seclai/_generated/api/agents/update_agent_definition_api_agents_agent_id_definition_put.py deleted file mode 100644 index 9eb265f..0000000 --- a/seclai/_generated/api/agents/update_agent_definition_api_agents_agent_id_definition_put.py +++ /dev/null @@ -1,338 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_definition_response import AgentDefinitionResponse -from ...models.http_validation_error import HTTPValidationError -from ...models.update_agent_definition_request import UpdateAgentDefinitionRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - body: UpdateAgentDefinitionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/agents/{agent_id}/definition".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentDefinitionResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentDefinitionResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentDefinitionResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateAgentDefinitionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionResponse | HTTPValidationError]: - """Update agent definition - - Update the agent's definition on the main branch. - - Uses **optimistic locking**: provide `expected_change_id` from the last `GET - /agents/{agent_id}/definition`. Returns `409 Conflict` if the definition was modified since your - last read. - - The definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, - `regex_replace`, `gate`, `retry`, `evaluate_step`, `extract_data`, `extract_content`, - `add_chat_turn`, `load_chat_history`, `add_memory`, `search_memory`, `load_memory`, - `streaming_result`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, - `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, - `display_result`, `join`, `merge`, `text`, `for_each`, `if_else`, and `switch`. Non-composite step - types (`display_result`, `join`, `retry`, `streaming_result`) cannot contain child steps. - - **Retry steps** re-execute from a target ancestor step for quality-control loops. Configure with - `target_step_id` (ancestor step ID) and `max_retries` (1–10). Best practice: place a `gate` step - before the retry to make retries conditional. - - **if_else** runs `then_steps` when its `conditions` (same shape as `gate`) match, otherwise its - optional `else_steps`. Either branch's output flows to the if_else step's own `child_steps` (the - post-branch continuation chain). - - **switch** dispatches on a `discriminator` template (default `{{input}}`) to the first matching case - (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when no case - matches. Cases own their own `steps` subtrees; the chosen branch's output flows to the switch step's - own `child_steps`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateAgentDefinitionRequest): - - 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[AgentDefinitionResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateAgentDefinitionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentDefinitionResponse | HTTPValidationError | None: - """Update agent definition - - Update the agent's definition on the main branch. - - Uses **optimistic locking**: provide `expected_change_id` from the last `GET - /agents/{agent_id}/definition`. Returns `409 Conflict` if the definition was modified since your - last read. - - The definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, - `regex_replace`, `gate`, `retry`, `evaluate_step`, `extract_data`, `extract_content`, - `add_chat_turn`, `load_chat_history`, `add_memory`, `search_memory`, `load_memory`, - `streaming_result`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, - `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, - `display_result`, `join`, `merge`, `text`, `for_each`, `if_else`, and `switch`. Non-composite step - types (`display_result`, `join`, `retry`, `streaming_result`) cannot contain child steps. - - **Retry steps** re-execute from a target ancestor step for quality-control loops. Configure with - `target_step_id` (ancestor step ID) and `max_retries` (1–10). Best practice: place a `gate` step - before the retry to make retries conditional. - - **if_else** runs `then_steps` when its `conditions` (same shape as `gate`) match, otherwise its - optional `else_steps`. Either branch's output flows to the if_else step's own `child_steps` (the - post-branch continuation chain). - - **switch** dispatches on a `discriminator` template (default `{{input}}`) to the first matching case - (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when no case - matches. Cases own their own `steps` subtrees; the chosen branch's output flows to the switch step's - own `child_steps`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateAgentDefinitionRequest): - - 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: - AgentDefinitionResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateAgentDefinitionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AgentDefinitionResponse | HTTPValidationError]: - """Update agent definition - - Update the agent's definition on the main branch. - - Uses **optimistic locking**: provide `expected_change_id` from the last `GET - /agents/{agent_id}/definition`. Returns `409 Conflict` if the definition was modified since your - last read. - - The definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, - `regex_replace`, `gate`, `retry`, `evaluate_step`, `extract_data`, `extract_content`, - `add_chat_turn`, `load_chat_history`, `add_memory`, `search_memory`, `load_memory`, - `streaming_result`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, - `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, - `display_result`, `join`, `merge`, `text`, `for_each`, `if_else`, and `switch`. Non-composite step - types (`display_result`, `join`, `retry`, `streaming_result`) cannot contain child steps. - - **Retry steps** re-execute from a target ancestor step for quality-control loops. Configure with - `target_step_id` (ancestor step ID) and `max_retries` (1–10). Best practice: place a `gate` step - before the retry to make retries conditional. - - **if_else** runs `then_steps` when its `conditions` (same shape as `gate`) match, otherwise its - optional `else_steps`. Either branch's output flows to the if_else step's own `child_steps` (the - post-branch continuation chain). - - **switch** dispatches on a `discriminator` template (default `{{input}}`) to the first matching case - (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when no case - matches. Cases own their own `steps` subtrees; the chosen branch's output flows to the switch step's - own `child_steps`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateAgentDefinitionRequest): - - 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[AgentDefinitionResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateAgentDefinitionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AgentDefinitionResponse | HTTPValidationError | None: - """Update agent definition - - Update the agent's definition on the main branch. - - Uses **optimistic locking**: provide `expected_change_id` from the last `GET - /agents/{agent_id}/definition`. Returns `409 Conflict` if the definition was modified since your - last read. - - The definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, - `regex_replace`, `gate`, `retry`, `evaluate_step`, `extract_data`, `extract_content`, - `add_chat_turn`, `load_chat_history`, `add_memory`, `search_memory`, `load_memory`, - `streaming_result`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, - `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, - `display_result`, `join`, `merge`, `text`, `for_each`, `if_else`, and `switch`. Non-composite step - types (`display_result`, `join`, `retry`, `streaming_result`) cannot contain child steps. - - **Retry steps** re-execute from a target ancestor step for quality-control loops. Configure with - `target_step_id` (ancestor step ID) and `max_retries` (1–10). Best practice: place a `gate` step - before the retry to make retries conditional. - - **if_else** runs `then_steps` when its `conditions` (same shape as `gate`) match, otherwise its - optional `else_steps`. Either branch's output flows to the if_else step's own `child_steps` (the - post-branch continuation chain). - - **switch** dispatches on a `discriminator` template (default `{{input}}`) to the first matching case - (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when no case - matches. Cases own their own `steps` subtrees; the chosen branch's output flows to the switch step's - own `child_steps`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your - account. - - Args: - agent_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateAgentDefinitionRequest): - - 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: - AgentDefinitionResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/ai_assistant/__init__.py b/seclai/_generated/api/ai_assistant/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/ai_assistant/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/ai_assistant/api_ai_accept_api_ai_assistant_conversation_id_accept_post.py b/seclai/_generated/api/ai_assistant/api_ai_accept_api_ai_assistant_conversation_id_accept_post.py deleted file mode 100644 index 752f224..0000000 --- a/seclai/_generated/api/ai_assistant/api_ai_accept_api_ai_assistant_conversation_id_accept_post.py +++ /dev/null @@ -1,234 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.ai_assistant_accept_request import AiAssistantAcceptRequest -from ...models.ai_assistant_accept_response import AiAssistantAcceptResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - conversation_id: UUID, - *, - body: AiAssistantAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/ai-assistant/{conversation_id}/accept".format( - conversation_id=quote(str(conversation_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantAcceptResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AiAssistantAcceptResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantAcceptResponse | 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( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantAcceptResponse | HTTPValidationError]: - """Accept and execute a standalone plan - - Accept and execute a previously proposed standalone plan. If the plan contains destructive actions - (deletions), ``confirm_deletions`` must be set to true. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantAcceptRequest): Request body for accepting a proposed plan. - - 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[AiAssistantAcceptResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - conversation_id=conversation_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantAcceptResponse | HTTPValidationError | None: - """Accept and execute a standalone plan - - Accept and execute a previously proposed standalone plan. If the plan contains destructive actions - (deletions), ``confirm_deletions`` must be set to true. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantAcceptRequest): Request body for accepting a proposed plan. - - 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: - AiAssistantAcceptResponse | HTTPValidationError - """ - - return sync_detailed( - conversation_id=conversation_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantAcceptResponse | HTTPValidationError]: - """Accept and execute a standalone plan - - Accept and execute a previously proposed standalone plan. If the plan contains destructive actions - (deletions), ``confirm_deletions`` must be set to true. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantAcceptRequest): Request body for accepting a proposed plan. - - 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[AiAssistantAcceptResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - conversation_id=conversation_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantAcceptResponse | HTTPValidationError | None: - """Accept and execute a standalone plan - - Accept and execute a previously proposed standalone plan. If the plan contains destructive actions - (deletions), ``confirm_deletions`` must be set to true. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantAcceptRequest): Request body for accepting a proposed plan. - - 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: - AiAssistantAcceptResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - conversation_id=conversation_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/ai_assistant/api_ai_decline_api_ai_assistant_conversation_id_decline_post.py b/seclai/_generated/api/ai_assistant/api_ai_decline_api_ai_assistant_conversation_id_decline_post.py deleted file mode 100644 index f366512..0000000 --- a/seclai/_generated/api/ai_assistant/api_ai_decline_api_ai_assistant_conversation_id_decline_post.py +++ /dev/null @@ -1,214 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - conversation_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/ai-assistant/{conversation_id}/decline".format( - conversation_id=quote(str(conversation_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Decline a standalone plan - - Decline a previously proposed standalone plan. No resources are modified. The conversation is marked - as declined. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - conversation_id=conversation_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Decline a standalone plan - - Decline a previously proposed standalone plan. No resources are modified. The conversation is marked - as declined. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - conversation_id=conversation_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Decline a standalone plan - - Decline a previously proposed standalone plan. No resources are modified. The conversation is marked - as declined. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - conversation_id=conversation_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Decline a standalone plan - - Decline a previously proposed standalone plan. No resources are modified. The conversation is marked - as declined. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - conversation_id=conversation_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/ai_assistant/api_ai_feedback_api_ai_assistant_feedback_post.py b/seclai/_generated/api/ai_assistant/api_ai_feedback_api_ai_assistant_feedback_post.py deleted file mode 100644 index 1dcb576..0000000 --- a/seclai/_generated/api/ai_assistant/api_ai_feedback_api_ai_assistant_feedback_post.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.ai_assistant_feedback_request import AiAssistantFeedbackRequest -from ...models.ai_assistant_feedback_response import AiAssistantFeedbackResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: AiAssistantFeedbackRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/ai-assistant/feedback", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantFeedbackResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AiAssistantFeedbackResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantFeedbackResponse | 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: AuthenticatedClient | Client, - body: AiAssistantFeedbackRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantFeedbackResponse | HTTPValidationError]: - """Submit AI assistant feedback - - Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is - analyzed for concerning issues. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantFeedbackRequest): Request body for submitting AI assistant feedback. - - 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[AiAssistantFeedbackResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: AiAssistantFeedbackRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantFeedbackResponse | HTTPValidationError | None: - """Submit AI assistant feedback - - Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is - analyzed for concerning issues. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantFeedbackRequest): Request body for submitting AI assistant feedback. - - 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: - AiAssistantFeedbackResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: AiAssistantFeedbackRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantFeedbackResponse | HTTPValidationError]: - """Submit AI assistant feedback - - Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is - analyzed for concerning issues. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantFeedbackRequest): Request body for submitting AI assistant feedback. - - 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[AiAssistantFeedbackResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: AiAssistantFeedbackRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantFeedbackResponse | HTTPValidationError | None: - """Submit AI assistant feedback - - Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is - analyzed for concerning issues. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantFeedbackRequest): Request body for submitting AI assistant feedback. - - 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: - AiAssistantFeedbackResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/ai_assistant/api_ai_knowledge_base_api_ai_assistant_knowledge_base_post.py b/seclai/_generated/api/ai_assistant/api_ai_knowledge_base_api_ai_assistant_knowledge_base_post.py deleted file mode 100644 index 3e391c6..0000000 --- a/seclai/_generated/api/ai_assistant/api_ai_knowledge_base_api_ai_assistant_knowledge_base_post.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.ai_assistant_generate_request import AiAssistantGenerateRequest -from ...models.ai_assistant_generate_response import AiAssistantGenerateResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/ai-assistant/knowledge-base", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AiAssistantGenerateResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantGenerateResponse | 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: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: - """Generate a knowledge base plan (standalone) - - Generate a knowledge base creation/modification plan without requiring an existing solution. May - also propose prerequisite source creation actions. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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[AiAssistantGenerateResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - """Generate a knowledge base plan (standalone) - - Generate a knowledge base creation/modification plan without requiring an existing solution. May - also propose prerequisite source creation actions. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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: - AiAssistantGenerateResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: - """Generate a knowledge base plan (standalone) - - Generate a knowledge base creation/modification plan without requiring an existing solution. May - also propose prerequisite source creation actions. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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[AiAssistantGenerateResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - """Generate a knowledge base plan (standalone) - - Generate a knowledge base creation/modification plan without requiring an existing solution. May - also propose prerequisite source creation actions. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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: - AiAssistantGenerateResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/ai_assistant/api_ai_memory_bank_accept_api_ai_assistant_memory_bank_conversation_id_patch.py b/seclai/_generated/api/ai_assistant/api_ai_memory_bank_accept_api_ai_assistant_memory_bank_conversation_id_patch.py deleted file mode 100644 index cc3674f..0000000 --- a/seclai/_generated/api/ai_assistant/api_ai_memory_bank_accept_api_ai_assistant_memory_bank_conversation_id_patch.py +++ /dev/null @@ -1,238 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.memory_bank_accept_request import MemoryBankAcceptRequest -from ...models.ok_response import OkResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - conversation_id: UUID, - *, - body: MemoryBankAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/ai-assistant/memory-bank/{conversation_id}".format( - conversation_id=quote(str(conversation_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | OkResponse | None: - if response.status_code == 200: - response_200 = OkResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | OkResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: MemoryBankAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OkResponse]: - """Accept or decline a memory bank AI suggestion - - Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to - true to accept the proposed configuration, or false to decline it. The accepted status is recorded - for audit purposes. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAcceptRequest): Accept or decline a memory bank AI suggestion. - - 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 | OkResponse] - """ - - kwargs = _get_kwargs( - conversation_id=conversation_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: MemoryBankAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OkResponse | None: - """Accept or decline a memory bank AI suggestion - - Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to - true to accept the proposed configuration, or false to decline it. The accepted status is recorded - for audit purposes. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAcceptRequest): Accept or decline a memory bank AI suggestion. - - 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 | OkResponse - """ - - return sync_detailed( - conversation_id=conversation_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: MemoryBankAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OkResponse]: - """Accept or decline a memory bank AI suggestion - - Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to - true to accept the proposed configuration, or false to decline it. The accepted status is recorded - for audit purposes. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAcceptRequest): Accept or decline a memory bank AI suggestion. - - 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 | OkResponse] - """ - - kwargs = _get_kwargs( - conversation_id=conversation_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: MemoryBankAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OkResponse | None: - """Accept or decline a memory bank AI suggestion - - Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to - true to accept the proposed configuration, or false to decline it. The accepted status is recorded - for audit purposes. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAcceptRequest): Accept or decline a memory bank AI suggestion. - - 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 | OkResponse - """ - - return ( - await asyncio_detailed( - conversation_id=conversation_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/ai_assistant/api_ai_memory_bank_api_ai_assistant_memory_bank_post.py b/seclai/_generated/api/ai_assistant/api_ai_memory_bank_api_ai_assistant_memory_bank_post.py deleted file mode 100644 index 1d9e8c1..0000000 --- a/seclai/_generated/api/ai_assistant/api_ai_memory_bank_api_ai_assistant_memory_bank_post.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.memory_bank_ai_assistant_request import MemoryBankAiAssistantRequest -from ...models.memory_bank_ai_assistant_response import MemoryBankAiAssistantResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: MemoryBankAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/ai-assistant/memory-bank", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBankAiAssistantResponse | None: - if response.status_code == 200: - response_200 = MemoryBankAiAssistantResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBankAiAssistantResponse]: - 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: AuthenticatedClient | Client, - body: MemoryBankAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankAiAssistantResponse]: - """Generate a memory bank configuration (standalone) - - Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, - mode, compaction prompt, and retention settings. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAiAssistantRequest): Request body for the memory bank AI assistant. - - 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 | MemoryBankAiAssistantResponse] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: MemoryBankAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankAiAssistantResponse | None: - """Generate a memory bank configuration (standalone) - - Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, - mode, compaction prompt, and retention settings. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAiAssistantRequest): Request body for the memory bank AI assistant. - - 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 | MemoryBankAiAssistantResponse - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: MemoryBankAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankAiAssistantResponse]: - """Generate a memory bank configuration (standalone) - - Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, - mode, compaction prompt, and retention settings. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAiAssistantRequest): Request body for the memory bank AI assistant. - - 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 | MemoryBankAiAssistantResponse] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: MemoryBankAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankAiAssistantResponse | None: - """Generate a memory bank configuration (standalone) - - Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, - mode, compaction prompt, and retention settings. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAiAssistantRequest): Request body for the memory bank AI assistant. - - 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 | MemoryBankAiAssistantResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/ai_assistant/api_ai_memory_bank_history_api_ai_assistant_memory_bank_last_conversation_get.py b/seclai/_generated/api/ai_assistant/api_ai_memory_bank_history_api_ai_assistant_memory_bank_last_conversation_get.py deleted file mode 100644 index eadc152..0000000 --- a/seclai/_generated/api/ai_assistant/api_ai_memory_bank_history_api_ai_assistant_memory_bank_last_conversation_get.py +++ /dev/null @@ -1,241 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.memory_bank_last_conversation_response import ( - MemoryBankLastConversationResponse, -) -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - limit: int | Unset = 5, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["limit"] = limit - - params["offset"] = offset - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/ai-assistant/memory-bank/last-conversation", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBankLastConversationResponse | None: - if response.status_code == 200: - response_200 = MemoryBankLastConversationResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBankLastConversationResponse]: - 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: AuthenticatedClient | Client, - limit: int | Unset = 5, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankLastConversationResponse]: - """Fetch memory bank AI conversation history - - Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. - Returns turns in oldest-first order with a total count for pagination via limit/offset query - parameters. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - limit (int | Unset): Max turns. Default: 5. - offset (int | Unset): Skip count. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBankLastConversationResponse] - """ - - kwargs = _get_kwargs( - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - limit: int | Unset = 5, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankLastConversationResponse | None: - """Fetch memory bank AI conversation history - - Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. - Returns turns in oldest-first order with a total count for pagination via limit/offset query - parameters. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - limit (int | Unset): Max turns. Default: 5. - offset (int | Unset): Skip count. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBankLastConversationResponse - """ - - return sync_detailed( - client=client, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - limit: int | Unset = 5, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankLastConversationResponse]: - """Fetch memory bank AI conversation history - - Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. - Returns turns in oldest-first order with a total count for pagination via limit/offset query - parameters. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - limit (int | Unset): Max turns. Default: 5. - offset (int | Unset): Skip count. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBankLastConversationResponse] - """ - - kwargs = _get_kwargs( - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - limit: int | Unset = 5, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankLastConversationResponse | None: - """Fetch memory bank AI conversation history - - Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. - Returns turns in oldest-first order with a total count for pagination via limit/offset query - parameters. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - limit (int | Unset): Max turns. Default: 5. - offset (int | Unset): Skip count. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBankLastConversationResponse - """ - - return ( - await asyncio_detailed( - client=client, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/ai_assistant/api_ai_solution_api_ai_assistant_solution_post.py b/seclai/_generated/api/ai_assistant/api_ai_solution_api_ai_assistant_solution_post.py deleted file mode 100644 index f82288e..0000000 --- a/seclai/_generated/api/ai_assistant/api_ai_solution_api_ai_assistant_solution_post.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.ai_assistant_generate_request import AiAssistantGenerateRequest -from ...models.ai_assistant_generate_response import AiAssistantGenerateResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/ai-assistant/solution", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AiAssistantGenerateResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantGenerateResponse | 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: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: - """Generate a solution plan (standalone) - - Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an - existing solution. Supports SSE streaming when ``Accept: text/event-stream`` is set. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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[AiAssistantGenerateResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - """Generate a solution plan (standalone) - - Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an - existing solution. Supports SSE streaming when ``Accept: text/event-stream`` is set. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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: - AiAssistantGenerateResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: - """Generate a solution plan (standalone) - - Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an - existing solution. Supports SSE streaming when ``Accept: text/event-stream`` is set. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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[AiAssistantGenerateResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - """Generate a solution plan (standalone) - - Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an - existing solution. Supports SSE streaming when ``Accept: text/event-stream`` is set. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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: - AiAssistantGenerateResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/ai_assistant/api_ai_source_api_ai_assistant_source_post.py b/seclai/_generated/api/ai_assistant/api_ai_source_api_ai_assistant_source_post.py deleted file mode 100644 index b26f986..0000000 --- a/seclai/_generated/api/ai_assistant/api_ai_source_api_ai_assistant_source_post.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.ai_assistant_generate_request import AiAssistantGenerateRequest -from ...models.ai_assistant_generate_response import AiAssistantGenerateResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/ai-assistant/source", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AiAssistantGenerateResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantGenerateResponse | 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: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: - """Generate a source plan (standalone) - - Generate a content source creation/modification plan without requiring an existing solution. The AI - proposes actions for the user to review before any changes are made. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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[AiAssistantGenerateResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - """Generate a source plan (standalone) - - Generate a content source creation/modification plan without requiring an existing solution. The AI - proposes actions for the user to review before any changes are made. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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: - AiAssistantGenerateResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: - """Generate a source plan (standalone) - - Generate a content source creation/modification plan without requiring an existing solution. The AI - proposes actions for the user to review before any changes are made. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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[AiAssistantGenerateResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - """Generate a source plan (standalone) - - Generate a content source creation/modification plan without requiring an existing solution. The AI - proposes actions for the user to review before any changes are made. - - Auth: requires ``X-API-Key`` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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: - AiAssistantGenerateResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/__init__.py b/seclai/_generated/api/alerts/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/alerts/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/alerts/add_alert_comment_api_alerts_alert_id_comments_post.py b/seclai/_generated/api/alerts/add_alert_comment_api_alerts_alert_id_comments_post.py deleted file mode 100644 index a4ea912..0000000 --- a/seclai/_generated/api/alerts/add_alert_comment_api_alerts_alert_id_comments_post.py +++ /dev/null @@ -1,238 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.add_comment_request import AddCommentRequest -from ...models.alert_detail_response import AlertDetailResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - alert_id: str, - *, - body: AddCommentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/alerts/{alert_id}/comments".format( - alert_id=quote(str(alert_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertDetailResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AlertDetailResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertDetailResponse | 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( - alert_id: str, - *, - client: AuthenticatedClient | Client, - body: AddCommentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: - """Add alert comment - - Add a comment to an alert. Comments are visible to all subscribers and are included in the alert - detail response. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AddCommentRequest): - - 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[AlertDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - alert_id=alert_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - alert_id: str, - *, - client: AuthenticatedClient | Client, - body: AddCommentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: - """Add alert comment - - Add a comment to an alert. Comments are visible to all subscribers and are included in the alert - detail response. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AddCommentRequest): - - 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: - AlertDetailResponse | HTTPValidationError - """ - - return sync_detailed( - alert_id=alert_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - alert_id: str, - *, - client: AuthenticatedClient | Client, - body: AddCommentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: - """Add alert comment - - Add a comment to an alert. Comments are visible to all subscribers and are included in the alert - detail response. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AddCommentRequest): - - 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[AlertDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - alert_id=alert_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - alert_id: str, - *, - client: AuthenticatedClient | Client, - body: AddCommentRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: - """Add alert comment - - Add a comment to an alert. Comments are visible to all subscribers and are included in the alert - detail response. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AddCommentRequest): - - 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: - AlertDetailResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - alert_id=alert_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/change_alert_status_api_alerts_alert_id_status_post.py b/seclai/_generated/api/alerts/change_alert_status_api_alerts_alert_id_status_post.py deleted file mode 100644 index d779479..0000000 --- a/seclai/_generated/api/alerts/change_alert_status_api_alerts_alert_id_status_post.py +++ /dev/null @@ -1,234 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.alert_detail_response import AlertDetailResponse -from ...models.change_status_request import ChangeStatusRequest -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - alert_id: str, - *, - body: ChangeStatusRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/alerts/{alert_id}/status".format( - alert_id=quote(str(alert_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertDetailResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AlertDetailResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertDetailResponse | 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( - alert_id: str, - *, - client: AuthenticatedClient | Client, - body: ChangeStatusRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: - """Change alert status - - Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (ChangeStatusRequest): - - 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[AlertDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - alert_id=alert_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - alert_id: str, - *, - client: AuthenticatedClient | Client, - body: ChangeStatusRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: - """Change alert status - - Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (ChangeStatusRequest): - - 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: - AlertDetailResponse | HTTPValidationError - """ - - return sync_detailed( - alert_id=alert_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - alert_id: str, - *, - client: AuthenticatedClient | Client, - body: ChangeStatusRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: - """Change alert status - - Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (ChangeStatusRequest): - - 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[AlertDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - alert_id=alert_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - alert_id: str, - *, - client: AuthenticatedClient | Client, - body: ChangeStatusRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: - """Change alert status - - Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (ChangeStatusRequest): - - 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: - AlertDetailResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - alert_id=alert_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/create_alert_config_api_alerts_configs_post.py b/seclai/_generated/api/alerts/create_alert_config_api_alerts_configs_post.py deleted file mode 100644 index c441edf..0000000 --- a/seclai/_generated/api/alerts/create_alert_config_api_alerts_configs_post.py +++ /dev/null @@ -1,254 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.alert_config_response import AlertConfigResponse -from ...models.create_alert_config_request import CreateAlertConfigRequest -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: CreateAlertConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/alerts/configs", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertConfigResponse | HTTPValidationError | None: - if response.status_code == 201: - response_201 = AlertConfigResponse.from_dict(response.json()) - - return response_201 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertConfigResponse | 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: AuthenticatedClient | Client, - body: CreateAlertConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigResponse | HTTPValidationError]: - """Create alert config - - Create a new alert configuration. - - Agent alert types: run_failed, consecutive_failures, error_rate_spike, run_burst, slow_run, - credits_low_threshold, credits_runout_prediction, credits_usage_spike, non_manual_eval_failed, - non_manual_eval_flagged, governance_flagged, governance_blocked, model_newer_available, - model_deprecated, model_sunset. - Source alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike. - - Distribution types: owner, owner_admins, selected_members. Organization accounts are normalized to - owner_admins. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateAlertConfigRequest): - - 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[AlertConfigResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateAlertConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertConfigResponse | HTTPValidationError | None: - """Create alert config - - Create a new alert configuration. - - Agent alert types: run_failed, consecutive_failures, error_rate_spike, run_burst, slow_run, - credits_low_threshold, credits_runout_prediction, credits_usage_spike, non_manual_eval_failed, - non_manual_eval_flagged, governance_flagged, governance_blocked, model_newer_available, - model_deprecated, model_sunset. - Source alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike. - - Distribution types: owner, owner_admins, selected_members. Organization accounts are normalized to - owner_admins. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateAlertConfigRequest): - - 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: - AlertConfigResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateAlertConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigResponse | HTTPValidationError]: - """Create alert config - - Create a new alert configuration. - - Agent alert types: run_failed, consecutive_failures, error_rate_spike, run_burst, slow_run, - credits_low_threshold, credits_runout_prediction, credits_usage_spike, non_manual_eval_failed, - non_manual_eval_flagged, governance_flagged, governance_blocked, model_newer_available, - model_deprecated, model_sunset. - Source alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike. - - Distribution types: owner, owner_admins, selected_members. Organization accounts are normalized to - owner_admins. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateAlertConfigRequest): - - 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[AlertConfigResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateAlertConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertConfigResponse | HTTPValidationError | None: - """Create alert config - - Create a new alert configuration. - - Agent alert types: run_failed, consecutive_failures, error_rate_spike, run_burst, slow_run, - credits_low_threshold, credits_runout_prediction, credits_usage_spike, non_manual_eval_failed, - non_manual_eval_flagged, governance_flagged, governance_blocked, model_newer_available, - model_deprecated, model_sunset. - Source alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike. - - Distribution types: owner, owner_admins, selected_members. Organization accounts are normalized to - owner_admins. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateAlertConfigRequest): - - 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: - AlertConfigResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/delete_alert_config_api_alerts_configs_config_id_delete.py b/seclai/_generated/api/alerts/delete_alert_config_api_alerts_configs_config_id_delete.py deleted file mode 100644 index 43820e9..0000000 --- a/seclai/_generated/api/alerts/delete_alert_config_api_alerts_configs_config_id_delete.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - config_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/alerts/configs/{config_id}".format( - config_id=quote(str(config_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - config_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete alert config - - Delete an alert configuration. This permanently removes the config and stops any future alerts of - this type from being triggered. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - config_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - config_id=config_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - config_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete alert config - - Delete an alert configuration. This permanently removes the config and stops any future alerts of - this type from being triggered. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - config_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - config_id=config_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - config_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete alert config - - Delete an alert configuration. This permanently removes the config and stops any future alerts of - this type from being triggered. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - config_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - config_id=config_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - config_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete alert config - - Delete an alert configuration. This permanently removes the config and stops any future alerts of - this type from being triggered. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - config_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - config_id=config_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/get_alert_config_api_alerts_configs_config_id_get.py b/seclai/_generated/api/alerts/get_alert_config_api_alerts_configs_config_id_get.py deleted file mode 100644 index 98af202..0000000 --- a/seclai/_generated/api/alerts/get_alert_config_api_alerts_configs_config_id_get.py +++ /dev/null @@ -1,228 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.alert_config_response import AlertConfigResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - config_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/alerts/configs/{config_id}".format( - config_id=quote(str(config_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertConfigResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AlertConfigResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertConfigResponse | 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( - config_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigResponse | HTTPValidationError]: - """Get alert config - - Get a specific alert configuration by ID. - - Returns all fields including type, enabled state, threshold, cooldown, distribution type, and - recipient list. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - config_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AlertConfigResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - config_id=config_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - config_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertConfigResponse | HTTPValidationError | None: - """Get alert config - - Get a specific alert configuration by ID. - - Returns all fields including type, enabled state, threshold, cooldown, distribution type, and - recipient list. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - config_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AlertConfigResponse | HTTPValidationError - """ - - return sync_detailed( - config_id=config_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - config_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigResponse | HTTPValidationError]: - """Get alert config - - Get a specific alert configuration by ID. - - Returns all fields including type, enabled state, threshold, cooldown, distribution type, and - recipient list. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - config_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AlertConfigResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - config_id=config_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - config_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertConfigResponse | HTTPValidationError | None: - """Get alert config - - Get a specific alert configuration by ID. - - Returns all fields including type, enabled state, threshold, cooldown, distribution type, and - recipient list. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - config_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AlertConfigResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - config_id=config_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/get_alert_detail_api_alerts_alert_id_get.py b/seclai/_generated/api/alerts/get_alert_detail_api_alerts_alert_id_get.py deleted file mode 100644 index 0420d4e..0000000 --- a/seclai/_generated/api/alerts/get_alert_detail_api_alerts_alert_id_get.py +++ /dev/null @@ -1,216 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.alert_detail_response import AlertDetailResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - alert_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/alerts/{alert_id}".format( - alert_id=quote(str(alert_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertDetailResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AlertDetailResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertDetailResponse | 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( - alert_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: - """Get alert detail - - Get full alert detail including history, comments, and subscribers. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AlertDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - alert_id=alert_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - alert_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: - """Get alert detail - - Get full alert detail including history, comments, and subscribers. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AlertDetailResponse | HTTPValidationError - """ - - return sync_detailed( - alert_id=alert_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - alert_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: - """Get alert detail - - Get full alert detail including history, comments, and subscribers. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AlertDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - alert_id=alert_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - alert_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: - """Get alert detail - - Get full alert detail including history, comments, and subscribers. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AlertDetailResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - alert_id=alert_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/list_alert_configs_api_alerts_configs_get.py b/seclai/_generated/api/alerts/list_alert_configs_api_alerts_configs_get.py deleted file mode 100644 index f09013c..0000000 --- a/seclai/_generated/api/alerts/list_alert_configs_api_alerts_configs_get.py +++ /dev/null @@ -1,335 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.alert_config_list_response import AlertConfigListResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - agent_id: None | str | Unset = UNSET, - source_connection_id: None | str | Unset = UNSET, - scope: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 50, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - json_agent_id: None | str | Unset - if isinstance(agent_id, Unset): - json_agent_id = UNSET - else: - json_agent_id = agent_id - params["agent_id"] = json_agent_id - - json_source_connection_id: None | str | Unset - if isinstance(source_connection_id, Unset): - json_source_connection_id = UNSET - else: - json_source_connection_id = source_connection_id - params["source_connection_id"] = json_source_connection_id - - json_scope: None | str | Unset - if isinstance(scope, Unset): - json_scope = UNSET - else: - json_scope = scope - params["scope"] = json_scope - - params["page"] = page - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/alerts/configs", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertConfigListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AlertConfigListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertConfigListResponse | 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: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - source_connection_id: None | str | Unset = UNSET, - scope: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 50, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigListResponse | HTTPValidationError]: - """List alert configs - - List alert configurations. - - Filters: - - `agent_id`: list configs for a specific agent - - `source_connection_id`: list configs for a specific source - - Neither: list account-level agent alert configs - - `scope=source`: list account-level source alert configs - - Credits alerts (`credits_low_threshold`, `credits_runout_prediction`, `credits_usage_spike`) are - account-level alert configs. They are evaluated by the credits alert sweep and default-enabled - configs may be auto-created for active accounts at runtime. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - agent_id (None | str | Unset): Filter by agent ID - source_connection_id (None | str | Unset): Filter by source connection ID - scope (None | str | Unset): Set to 'source' to list account-level source alert configs - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 50. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AlertConfigListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - source_connection_id=source_connection_id, - scope=scope, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - source_connection_id: None | str | Unset = UNSET, - scope: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 50, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertConfigListResponse | HTTPValidationError | None: - """List alert configs - - List alert configurations. - - Filters: - - `agent_id`: list configs for a specific agent - - `source_connection_id`: list configs for a specific source - - Neither: list account-level agent alert configs - - `scope=source`: list account-level source alert configs - - Credits alerts (`credits_low_threshold`, `credits_runout_prediction`, `credits_usage_spike`) are - account-level alert configs. They are evaluated by the credits alert sweep and default-enabled - configs may be auto-created for active accounts at runtime. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - agent_id (None | str | Unset): Filter by agent ID - source_connection_id (None | str | Unset): Filter by source connection ID - scope (None | str | Unset): Set to 'source' to list account-level source alert configs - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 50. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AlertConfigListResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - agent_id=agent_id, - source_connection_id=source_connection_id, - scope=scope, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - source_connection_id: None | str | Unset = UNSET, - scope: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 50, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigListResponse | HTTPValidationError]: - """List alert configs - - List alert configurations. - - Filters: - - `agent_id`: list configs for a specific agent - - `source_connection_id`: list configs for a specific source - - Neither: list account-level agent alert configs - - `scope=source`: list account-level source alert configs - - Credits alerts (`credits_low_threshold`, `credits_runout_prediction`, `credits_usage_spike`) are - account-level alert configs. They are evaluated by the credits alert sweep and default-enabled - configs may be auto-created for active accounts at runtime. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - agent_id (None | str | Unset): Filter by agent ID - source_connection_id (None | str | Unset): Filter by source connection ID - scope (None | str | Unset): Set to 'source' to list account-level source alert configs - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 50. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AlertConfigListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - source_connection_id=source_connection_id, - scope=scope, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - source_connection_id: None | str | Unset = UNSET, - scope: None | str | Unset = UNSET, - page: int | Unset = 1, - limit: int | Unset = 50, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertConfigListResponse | HTTPValidationError | None: - """List alert configs - - List alert configurations. - - Filters: - - `agent_id`: list configs for a specific agent - - `source_connection_id`: list configs for a specific source - - Neither: list account-level agent alert configs - - `scope=source`: list account-level source alert configs - - Credits alerts (`credits_low_threshold`, `credits_runout_prediction`, `credits_usage_spike`) are - account-level alert configs. They are evaluated by the credits alert sweep and default-enabled - configs may be auto-created for active accounts at runtime. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - agent_id (None | str | Unset): Filter by agent ID - source_connection_id (None | str | Unset): Filter by source connection ID - scope (None | str | Unset): Set to 'source' to list account-level source alert configs - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 50. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AlertConfigListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - agent_id=agent_id, - source_connection_id=source_connection_id, - scope=scope, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/list_alerts_api_alerts_get.py b/seclai/_generated/api/alerts/list_alerts_api_alerts_get.py deleted file mode 100644 index 915e3c9..0000000 --- a/seclai/_generated/api/alerts/list_alerts_api_alerts_get.py +++ /dev/null @@ -1,364 +0,0 @@ -import datetime -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.alert_list_response import AlertListResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - limit: int | Unset = 20, - status: None | str | Unset = UNSET, - agent_id: None | str | Unset = UNSET, - source_connection_id: None | str | Unset = UNSET, - time_from: datetime.datetime | None | Unset = UNSET, - time_to: datetime.datetime | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - json_status: None | str | Unset - if isinstance(status, Unset): - json_status = UNSET - else: - json_status = status - params["status"] = json_status - - json_agent_id: None | str | Unset - if isinstance(agent_id, Unset): - json_agent_id = UNSET - else: - json_agent_id = agent_id - params["agent_id"] = json_agent_id - - json_source_connection_id: None | str | Unset - if isinstance(source_connection_id, Unset): - json_source_connection_id = UNSET - else: - json_source_connection_id = source_connection_id - params["source_connection_id"] = json_source_connection_id - - json_time_from: None | str | Unset - if isinstance(time_from, Unset): - json_time_from = UNSET - elif isinstance(time_from, datetime.datetime): - json_time_from = time_from.isoformat() - else: - json_time_from = time_from - params["time_from"] = json_time_from - - json_time_to: None | str | Unset - if isinstance(time_to, Unset): - json_time_to = UNSET - elif isinstance(time_to, datetime.datetime): - json_time_to = time_to.isoformat() - else: - json_time_to = time_to - params["time_to"] = json_time_to - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/alerts", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AlertListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertListResponse | 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: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - status: None | str | Unset = UNSET, - agent_id: None | str | Unset = UNSET, - source_connection_id: None | str | Unset = UNSET, - time_from: datetime.datetime | None | Unset = UNSET, - time_to: datetime.datetime | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertListResponse | HTTPValidationError]: - """List alerts - - List alerts for the account with optional filters. - - Filters: - - `status`: triggered, acknowledged, resolved, dismissed - - `agent_id`: filter by agent - - `source_connection_id`: filter by source - - `time_from` / `time_to`: ISO 8601 date range - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - status (None | str | Unset): Filter by alert status - agent_id (None | str | Unset): Filter by agent ID - source_connection_id (None | str | Unset): Filter by source connection ID - time_from (datetime.datetime | None | Unset): From (ISO 8601) - time_to (datetime.datetime | None | Unset): To (ISO 8601) - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AlertListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - status=status, - agent_id=agent_id, - source_connection_id=source_connection_id, - time_from=time_from, - time_to=time_to, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - status: None | str | Unset = UNSET, - agent_id: None | str | Unset = UNSET, - source_connection_id: None | str | Unset = UNSET, - time_from: datetime.datetime | None | Unset = UNSET, - time_to: datetime.datetime | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertListResponse | HTTPValidationError | None: - """List alerts - - List alerts for the account with optional filters. - - Filters: - - `status`: triggered, acknowledged, resolved, dismissed - - `agent_id`: filter by agent - - `source_connection_id`: filter by source - - `time_from` / `time_to`: ISO 8601 date range - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - status (None | str | Unset): Filter by alert status - agent_id (None | str | Unset): Filter by agent ID - source_connection_id (None | str | Unset): Filter by source connection ID - time_from (datetime.datetime | None | Unset): From (ISO 8601) - time_to (datetime.datetime | None | Unset): To (ISO 8601) - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AlertListResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - page=page, - limit=limit, - status=status, - agent_id=agent_id, - source_connection_id=source_connection_id, - time_from=time_from, - time_to=time_to, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - status: None | str | Unset = UNSET, - agent_id: None | str | Unset = UNSET, - source_connection_id: None | str | Unset = UNSET, - time_from: datetime.datetime | None | Unset = UNSET, - time_to: datetime.datetime | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertListResponse | HTTPValidationError]: - """List alerts - - List alerts for the account with optional filters. - - Filters: - - `status`: triggered, acknowledged, resolved, dismissed - - `agent_id`: filter by agent - - `source_connection_id`: filter by source - - `time_from` / `time_to`: ISO 8601 date range - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - status (None | str | Unset): Filter by alert status - agent_id (None | str | Unset): Filter by agent ID - source_connection_id (None | str | Unset): Filter by source connection ID - time_from (datetime.datetime | None | Unset): From (ISO 8601) - time_to (datetime.datetime | None | Unset): To (ISO 8601) - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AlertListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - status=status, - agent_id=agent_id, - source_connection_id=source_connection_id, - time_from=time_from, - time_to=time_to, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - status: None | str | Unset = UNSET, - agent_id: None | str | Unset = UNSET, - source_connection_id: None | str | Unset = UNSET, - time_from: datetime.datetime | None | Unset = UNSET, - time_to: datetime.datetime | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertListResponse | HTTPValidationError | None: - """List alerts - - List alerts for the account with optional filters. - - Filters: - - `status`: triggered, acknowledged, resolved, dismissed - - `agent_id`: filter by agent - - `source_connection_id`: filter by source - - `time_from` / `time_to`: ISO 8601 date range - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - status (None | str | Unset): Filter by alert status - agent_id (None | str | Unset): Filter by agent ID - source_connection_id (None | str | Unset): Filter by source connection ID - time_from (datetime.datetime | None | Unset): From (ISO 8601) - time_to (datetime.datetime | None | Unset): To (ISO 8601) - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AlertListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - limit=limit, - status=status, - agent_id=agent_id, - source_connection_id=source_connection_id, - time_from=time_from, - time_to=time_to, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/list_organization_preferences_api_alerts_organization_preferences_list_get.py b/seclai/_generated/api/alerts/list_organization_preferences_api_alerts_organization_preferences_list_get.py deleted file mode 100644 index 98cb70d..0000000 --- a/seclai/_generated/api/alerts/list_organization_preferences_api_alerts_organization_preferences_list_get.py +++ /dev/null @@ -1,266 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.organization_alert_preference_list_response import ( - OrganizationAlertPreferenceListResponse, -) -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - organization_id: None | Unset | UUID = UNSET, - include_defaults: bool | Unset = False, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - json_organization_id: None | str | Unset - if isinstance(organization_id, Unset): - json_organization_id = UNSET - elif isinstance(organization_id, UUID): - json_organization_id = str(organization_id) - else: - json_organization_id = organization_id - params["organization_id"] = json_organization_id - - params["include_defaults"] = include_defaults - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/alerts/organization-preferences/list", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | OrganizationAlertPreferenceListResponse | None: - if response.status_code == 200: - response_200 = OrganizationAlertPreferenceListResponse.from_dict( - response.json() - ) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | OrganizationAlertPreferenceListResponse]: - 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: AuthenticatedClient | Client, - organization_id: None | Unset | UUID = UNSET, - include_defaults: bool | Unset = False, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OrganizationAlertPreferenceListResponse]: - """List organization alert delivery preferences - - List per-organization alert delivery preferences for the authenticated user. - - By default, only explicit override rows are returned. Set `include_defaults=true` to return the - effective subscribed state for every alert type in every organization the user can manage. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Only organizations where the user is an owner or administrator are included. - - Args: - organization_id (None | Unset | UUID): Optional organization filter - include_defaults (bool | Unset): Include default subscribed entries for all alert types - Default: False. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | OrganizationAlertPreferenceListResponse] - """ - - kwargs = _get_kwargs( - organization_id=organization_id, - include_defaults=include_defaults, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - organization_id: None | Unset | UUID = UNSET, - include_defaults: bool | Unset = False, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OrganizationAlertPreferenceListResponse | None: - """List organization alert delivery preferences - - List per-organization alert delivery preferences for the authenticated user. - - By default, only explicit override rows are returned. Set `include_defaults=true` to return the - effective subscribed state for every alert type in every organization the user can manage. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Only organizations where the user is an owner or administrator are included. - - Args: - organization_id (None | Unset | UUID): Optional organization filter - include_defaults (bool | Unset): Include default subscribed entries for all alert types - Default: False. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | OrganizationAlertPreferenceListResponse - """ - - return sync_detailed( - client=client, - organization_id=organization_id, - include_defaults=include_defaults, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - organization_id: None | Unset | UUID = UNSET, - include_defaults: bool | Unset = False, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OrganizationAlertPreferenceListResponse]: - """List organization alert delivery preferences - - List per-organization alert delivery preferences for the authenticated user. - - By default, only explicit override rows are returned. Set `include_defaults=true` to return the - effective subscribed state for every alert type in every organization the user can manage. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Only organizations where the user is an owner or administrator are included. - - Args: - organization_id (None | Unset | UUID): Optional organization filter - include_defaults (bool | Unset): Include default subscribed entries for all alert types - Default: False. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | OrganizationAlertPreferenceListResponse] - """ - - kwargs = _get_kwargs( - organization_id=organization_id, - include_defaults=include_defaults, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - organization_id: None | Unset | UUID = UNSET, - include_defaults: bool | Unset = False, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OrganizationAlertPreferenceListResponse | None: - """List organization alert delivery preferences - - List per-organization alert delivery preferences for the authenticated user. - - By default, only explicit override rows are returned. Set `include_defaults=true` to return the - effective subscribed state for every alert type in every organization the user can manage. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Only organizations where the user is an owner or administrator are included. - - Args: - organization_id (None | Unset | UUID): Optional organization filter - include_defaults (bool | Unset): Include default subscribed entries for all alert types - Default: False. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | OrganizationAlertPreferenceListResponse - """ - - return ( - await asyncio_detailed( - client=client, - organization_id=organization_id, - include_defaults=include_defaults, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/subscribe_to_alert_api_alerts_alert_id_subscribe_post.py b/seclai/_generated/api/alerts/subscribe_to_alert_api_alerts_alert_id_subscribe_post.py deleted file mode 100644 index cc78bcf..0000000 --- a/seclai/_generated/api/alerts/subscribe_to_alert_api_alerts_alert_id_subscribe_post.py +++ /dev/null @@ -1,220 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.alert_detail_response import AlertDetailResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - alert_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/alerts/{alert_id}/subscribe".format( - alert_id=quote(str(alert_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertDetailResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AlertDetailResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertDetailResponse | 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( - alert_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: - """Subscribe to alert - - Subscribe the current user to an alert. Subscribed users receive email notifications when the alert - status changes or new comments are added. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AlertDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - alert_id=alert_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - alert_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: - """Subscribe to alert - - Subscribe the current user to an alert. Subscribed users receive email notifications when the alert - status changes or new comments are added. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AlertDetailResponse | HTTPValidationError - """ - - return sync_detailed( - alert_id=alert_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - alert_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: - """Subscribe to alert - - Subscribe the current user to an alert. Subscribed users receive email notifications when the alert - status changes or new comments are added. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AlertDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - alert_id=alert_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - alert_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: - """Subscribe to alert - - Subscribe the current user to an alert. Subscribed users receive email notifications when the alert - status changes or new comments are added. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AlertDetailResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - alert_id=alert_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/unsubscribe_from_alert_api_alerts_alert_id_unsubscribe_post.py b/seclai/_generated/api/alerts/unsubscribe_from_alert_api_alerts_alert_id_unsubscribe_post.py deleted file mode 100644 index b0e9646..0000000 --- a/seclai/_generated/api/alerts/unsubscribe_from_alert_api_alerts_alert_id_unsubscribe_post.py +++ /dev/null @@ -1,220 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.alert_detail_response import AlertDetailResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - alert_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/alerts/{alert_id}/unsubscribe".format( - alert_id=quote(str(alert_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertDetailResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AlertDetailResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertDetailResponse | 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( - alert_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: - """Unsubscribe from alert - - Unsubscribe the current user from an alert. The user will no longer receive email notifications for - status changes or new comments on this alert. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AlertDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - alert_id=alert_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - alert_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: - """Unsubscribe from alert - - Unsubscribe the current user from an alert. The user will no longer receive email notifications for - status changes or new comments on this alert. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AlertDetailResponse | HTTPValidationError - """ - - return sync_detailed( - alert_id=alert_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - alert_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertDetailResponse | HTTPValidationError]: - """Unsubscribe from alert - - Unsubscribe the current user from an alert. The user will no longer receive email notifications for - status changes or new comments on this alert. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[AlertDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - alert_id=alert_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - alert_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertDetailResponse | HTTPValidationError | None: - """Unsubscribe from alert - - Unsubscribe the current user from an alert. The user will no longer receive email notifications for - status changes or new comments on this alert. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - alert_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - AlertDetailResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - alert_id=alert_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/update_alert_config_api_alerts_configs_config_id_patch.py b/seclai/_generated/api/alerts/update_alert_config_api_alerts_configs_config_id_patch.py deleted file mode 100644 index 77e9c45..0000000 --- a/seclai/_generated/api/alerts/update_alert_config_api_alerts_configs_config_id_patch.py +++ /dev/null @@ -1,234 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.alert_config_response import AlertConfigResponse -from ...models.http_validation_error import HTTPValidationError -from ...models.update_alert_config_request import UpdateAlertConfigRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - config_id: str, - *, - body: UpdateAlertConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/alerts/configs/{config_id}".format( - config_id=quote(str(config_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertConfigResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AlertConfigResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertConfigResponse | 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( - config_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateAlertConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigResponse | HTTPValidationError]: - """Update alert config - - Update an alert configuration. Only provided fields are updated. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - config_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateAlertConfigRequest): - - 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[AlertConfigResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - config_id=config_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - config_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateAlertConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertConfigResponse | HTTPValidationError | None: - """Update alert config - - Update an alert configuration. Only provided fields are updated. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - config_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateAlertConfigRequest): - - 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: - AlertConfigResponse | HTTPValidationError - """ - - return sync_detailed( - config_id=config_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - config_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateAlertConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AlertConfigResponse | HTTPValidationError]: - """Update alert config - - Update an alert configuration. Only provided fields are updated. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - config_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateAlertConfigRequest): - - 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[AlertConfigResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - config_id=config_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - config_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateAlertConfigRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AlertConfigResponse | HTTPValidationError | None: - """Update alert config - - Update an alert configuration. Only provided fields are updated. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - config_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateAlertConfigRequest): - - 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: - AlertConfigResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - config_id=config_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/alerts/update_organization_preference_api_alerts_organization_preferences_organization_id_alert_type_patch.py b/seclai/_generated/api/alerts/update_organization_preference_api_alerts_organization_preferences_organization_id_alert_type_patch.py deleted file mode 100644 index 05906ef..0000000 --- a/seclai/_generated/api/alerts/update_organization_preference_api_alerts_organization_preferences_organization_id_alert_type_patch.py +++ /dev/null @@ -1,268 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.organization_alert_preference_response import ( - OrganizationAlertPreferenceResponse, -) -from ...models.update_organization_alert_preference_request import ( - UpdateOrganizationAlertPreferenceRequest, -) -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - organization_id: UUID, - alert_type: str, - *, - body: UpdateOrganizationAlertPreferenceRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/alerts/organization-preferences/{organization_id}/{alert_type}".format( - organization_id=quote(str(organization_id), safe=""), - alert_type=quote(str(alert_type), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | OrganizationAlertPreferenceResponse | None: - if response.status_code == 200: - response_200 = OrganizationAlertPreferenceResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | OrganizationAlertPreferenceResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - organization_id: UUID, - alert_type: str, - *, - client: AuthenticatedClient | Client, - body: UpdateOrganizationAlertPreferenceRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OrganizationAlertPreferenceResponse]: - """Update organization alert delivery preference - - Update the authenticated user's personal delivery preference for one alert type in one organization. - - Setting `subscribed=false` stores an explicit opt-out override. Setting `subscribed=true` removes - the override and restores the default subscribed behavior. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Only owners and administrators can update preferences for an organization. - - Args: - organization_id (UUID): - alert_type (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateOrganizationAlertPreferenceRequest): - - 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 | OrganizationAlertPreferenceResponse] - """ - - kwargs = _get_kwargs( - organization_id=organization_id, - alert_type=alert_type, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - organization_id: UUID, - alert_type: str, - *, - client: AuthenticatedClient | Client, - body: UpdateOrganizationAlertPreferenceRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OrganizationAlertPreferenceResponse | None: - """Update organization alert delivery preference - - Update the authenticated user's personal delivery preference for one alert type in one organization. - - Setting `subscribed=false` stores an explicit opt-out override. Setting `subscribed=true` removes - the override and restores the default subscribed behavior. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Only owners and administrators can update preferences for an organization. - - Args: - organization_id (UUID): - alert_type (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateOrganizationAlertPreferenceRequest): - - 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 | OrganizationAlertPreferenceResponse - """ - - return sync_detailed( - organization_id=organization_id, - alert_type=alert_type, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - organization_id: UUID, - alert_type: str, - *, - client: AuthenticatedClient | Client, - body: UpdateOrganizationAlertPreferenceRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OrganizationAlertPreferenceResponse]: - """Update organization alert delivery preference - - Update the authenticated user's personal delivery preference for one alert type in one organization. - - Setting `subscribed=false` stores an explicit opt-out override. Setting `subscribed=true` removes - the override and restores the default subscribed behavior. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Only owners and administrators can update preferences for an organization. - - Args: - organization_id (UUID): - alert_type (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateOrganizationAlertPreferenceRequest): - - 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 | OrganizationAlertPreferenceResponse] - """ - - kwargs = _get_kwargs( - organization_id=organization_id, - alert_type=alert_type, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - organization_id: UUID, - alert_type: str, - *, - client: AuthenticatedClient | Client, - body: UpdateOrganizationAlertPreferenceRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OrganizationAlertPreferenceResponse | None: - """Update organization alert delivery preference - - Update the authenticated user's personal delivery preference for one alert type in one organization. - - Setting `subscribed=false` stores an explicit opt-out override. Setting `subscribed=true` removes - the override and restores the default subscribed behavior. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Only owners and administrators can update preferences for an organization. - - Args: - organization_id (UUID): - alert_type (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateOrganizationAlertPreferenceRequest): - - 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 | OrganizationAlertPreferenceResponse - """ - - return ( - await asyncio_detailed( - organization_id=organization_id, - alert_type=alert_type, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/contents/__init__.py b/seclai/_generated/api/contents/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/contents/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/contents/delete_content_api_contents_source_connection_content_version_delete.py b/seclai/_generated/api/contents/delete_content_api_contents_source_connection_content_version_delete.py deleted file mode 100644 index d9d83fc..0000000 --- a/seclai/_generated/api/contents/delete_content_api_contents_source_connection_content_version_delete.py +++ /dev/null @@ -1,232 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_content_version: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/contents/{source_connection_content_version}".format( - source_connection_content_version=quote( - str(source_connection_content_version), safe="" - ), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete content - - Delete a content item (a `SourceConnectionContentVersion`). - - Use this to remove an uploaded or indexed item from your account. Deleting content can affect agents - and knowledge base workflows that reference this item. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your - account. - - Args: - source_connection_content_version (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_content_version=source_connection_content_version, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete content - - Delete a content item (a `SourceConnectionContentVersion`). - - Use this to remove an uploaded or indexed item from your account. Deleting content can affect agents - and knowledge base workflows that reference this item. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your - account. - - Args: - source_connection_content_version (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_content_version=source_connection_content_version, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete content - - Delete a content item (a `SourceConnectionContentVersion`). - - Use this to remove an uploaded or indexed item from your account. Deleting content can affect agents - and knowledge base workflows that reference this item. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your - account. - - Args: - source_connection_content_version (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_content_version=source_connection_content_version, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete content - - Delete a content item (a `SourceConnectionContentVersion`). - - Use this to remove an uploaded or indexed item from your account. Deleting content can affect agents - and knowledge base workflows that reference this item. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your - account. - - Args: - source_connection_content_version (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_content_version=source_connection_content_version, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/contents/get_content_detail_api_contents_source_connection_content_version_get.py b/seclai/_generated/api/contents/get_content_detail_api_contents_source_connection_content_version_get.py deleted file mode 100644 index 77a085a..0000000 --- a/seclai/_generated/api/contents/get_content_detail_api_contents_source_connection_content_version_get.py +++ /dev/null @@ -1,289 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.content_detail_response import ContentDetailResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_content_version: str, - *, - start: int | Unset = 0, - end: int | Unset = 5000, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["start"] = start - - params["end"] = end - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/contents/{source_connection_content_version}".format( - source_connection_content_version=quote( - str(source_connection_content_version), safe="" - ), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ContentDetailResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = ContentDetailResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ContentDetailResponse | 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( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - start: int | Unset = 0, - end: int | Unset = 5000, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ContentDetailResponse | HTTPValidationError]: - """Get content details - - Get detailed information about a specific content item (a `SourceConnectionContentVersion`). - - This is useful when you want to: - - Inspect the extracted text for debugging or review. - - Display content details in a UI. - - Text range: - - `start` and `end` control the character range returned in `text_content` so clients can page - through large documents. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your - account. - - Args: - source_connection_content_version (str): - start (int | Unset): Default: 0. - end (int | Unset): Default: 5000. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ContentDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - start=start, - end=end, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - start: int | Unset = 0, - end: int | Unset = 5000, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ContentDetailResponse | HTTPValidationError | None: - """Get content details - - Get detailed information about a specific content item (a `SourceConnectionContentVersion`). - - This is useful when you want to: - - Inspect the extracted text for debugging or review. - - Display content details in a UI. - - Text range: - - `start` and `end` control the character range returned in `text_content` so clients can page - through large documents. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your - account. - - Args: - source_connection_content_version (str): - start (int | Unset): Default: 0. - end (int | Unset): Default: 5000. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ContentDetailResponse | HTTPValidationError - """ - - return sync_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - start=start, - end=end, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - start: int | Unset = 0, - end: int | Unset = 5000, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ContentDetailResponse | HTTPValidationError]: - """Get content details - - Get detailed information about a specific content item (a `SourceConnectionContentVersion`). - - This is useful when you want to: - - Inspect the extracted text for debugging or review. - - Display content details in a UI. - - Text range: - - `start` and `end` control the character range returned in `text_content` so clients can page - through large documents. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your - account. - - Args: - source_connection_content_version (str): - start (int | Unset): Default: 0. - end (int | Unset): Default: 5000. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ContentDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - start=start, - end=end, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - start: int | Unset = 0, - end: int | Unset = 5000, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ContentDetailResponse | HTTPValidationError | None: - """Get content details - - Get detailed information about a specific content item (a `SourceConnectionContentVersion`). - - This is useful when you want to: - - Inspect the extracted text for debugging or review. - - Display content details in a UI. - - Text range: - - `start` and `end` control the character range returned in `text_content` so clients can page - through large documents. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your - account. - - Args: - source_connection_content_version (str): - start (int | Unset): Default: 0. - end (int | Unset): Default: 5000. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ContentDetailResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - start=start, - end=end, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/contents/list_content_embeddings_api_contents_source_connection_content_version_embeddings_get.py b/seclai/_generated/api/contents/list_content_embeddings_api_contents_source_connection_content_version_embeddings_get.py deleted file mode 100644 index 51993a1..0000000 --- a/seclai/_generated/api/contents/list_content_embeddings_api_contents_source_connection_content_version_embeddings_get.py +++ /dev/null @@ -1,269 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.content_embeddings_list_response import ContentEmbeddingsListResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_content_version: str, - *, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/contents/{source_connection_content_version}/embeddings".format( - source_connection_content_version=quote( - str(source_connection_content_version), safe="" - ), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ContentEmbeddingsListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = ContentEmbeddingsListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ContentEmbeddingsListResponse | 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( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ContentEmbeddingsListResponse | HTTPValidationError]: - """List content embeddings - - List the embeddings (chunk vectors) for a content item, with pagination. - - Embeddings are used for semantic search and retrieval in knowledge base workflows. This endpoint is - primarily useful for debugging chunking, indexing, and vector contents. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access embeddings for content - belonging to your account. - - Args: - source_connection_content_version (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ContentEmbeddingsListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ContentEmbeddingsListResponse | HTTPValidationError | None: - """List content embeddings - - List the embeddings (chunk vectors) for a content item, with pagination. - - Embeddings are used for semantic search and retrieval in knowledge base workflows. This endpoint is - primarily useful for debugging chunking, indexing, and vector contents. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access embeddings for content - belonging to your account. - - Args: - source_connection_content_version (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ContentEmbeddingsListResponse | HTTPValidationError - """ - - return sync_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ContentEmbeddingsListResponse | HTTPValidationError]: - """List content embeddings - - List the embeddings (chunk vectors) for a content item, with pagination. - - Embeddings are used for semantic search and retrieval in knowledge base workflows. This endpoint is - primarily useful for debugging chunking, indexing, and vector contents. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access embeddings for content - belonging to your account. - - Args: - source_connection_content_version (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ContentEmbeddingsListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ContentEmbeddingsListResponse | HTTPValidationError | None: - """List content embeddings - - List the embeddings (chunk vectors) for a content item, with pagination. - - Embeddings are used for semantic search and retrieval in knowledge base workflows. This endpoint is - primarily useful for debugging chunking, indexing, and vector contents. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access embeddings for content - belonging to your account. - - Args: - source_connection_content_version (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ContentEmbeddingsListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/contents/replace_content_with_inline_text_api_contents_source_connection_content_version_put.py b/seclai/_generated/api/contents/replace_content_with_inline_text_api_contents_source_connection_content_version_put.py deleted file mode 100644 index 6ae15de..0000000 --- a/seclai/_generated/api/contents/replace_content_with_inline_text_api_contents_source_connection_content_version_put.py +++ /dev/null @@ -1,288 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.file_upload_response import FileUploadResponse -from ...models.http_validation_error import HTTPValidationError -from ...models.inline_text_replace_request import InlineTextReplaceRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_content_version: str, - *, - body: InlineTextReplaceRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/contents/{source_connection_content_version}".format( - source_connection_content_version=quote( - str(source_connection_content_version), safe="" - ), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> FileUploadResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = FileUploadResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[FileUploadResponse | 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( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - body: InlineTextReplaceRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[FileUploadResponse | HTTPValidationError]: - """Replace a content version with inline text - - Replace a content version using a small inline text payload. - - **Maximum payload size:** 8192 bytes (UTF-8). - - **Supported content types:** - - `application/json` - - `application/xml` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - Notes: - - Use this endpoint for small text payloads; larger files should use `/upload`. - - `title` is merged into `metadata.title` when not already present. - - Args: - source_connection_content_version (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (InlineTextReplaceRequest): Request model for inline text content replacement. - - 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[FileUploadResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - body: InlineTextReplaceRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> FileUploadResponse | HTTPValidationError | None: - """Replace a content version with inline text - - Replace a content version using a small inline text payload. - - **Maximum payload size:** 8192 bytes (UTF-8). - - **Supported content types:** - - `application/json` - - `application/xml` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - Notes: - - Use this endpoint for small text payloads; larger files should use `/upload`. - - `title` is merged into `metadata.title` when not already present. - - Args: - source_connection_content_version (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (InlineTextReplaceRequest): Request model for inline text content replacement. - - 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: - FileUploadResponse | HTTPValidationError - """ - - return sync_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - body: InlineTextReplaceRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[FileUploadResponse | HTTPValidationError]: - """Replace a content version with inline text - - Replace a content version using a small inline text payload. - - **Maximum payload size:** 8192 bytes (UTF-8). - - **Supported content types:** - - `application/json` - - `application/xml` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - Notes: - - Use this endpoint for small text payloads; larger files should use `/upload`. - - `title` is merged into `metadata.title` when not already present. - - Args: - source_connection_content_version (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (InlineTextReplaceRequest): Request model for inline text content replacement. - - 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[FileUploadResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - body: InlineTextReplaceRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> FileUploadResponse | HTTPValidationError | None: - """Replace a content version with inline text - - Replace a content version using a small inline text payload. - - **Maximum payload size:** 8192 bytes (UTF-8). - - **Supported content types:** - - `application/json` - - `application/xml` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - Notes: - - Use this endpoint for small text payloads; larger files should use `/upload`. - - `title` is merged into `metadata.title` when not already present. - - Args: - source_connection_content_version (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (InlineTextReplaceRequest): Request model for inline text content replacement. - - 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: - FileUploadResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/contents/upload_file_to_content_api_contents_source_connection_content_version_upload_post.py b/seclai/_generated/api/contents/upload_file_to_content_api_contents_source_connection_content_version_upload_post.py deleted file mode 100644 index b88a98c..0000000 --- a/seclai/_generated/api/contents/upload_file_to_content_api_contents_source_connection_content_version_upload_post.py +++ /dev/null @@ -1,436 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.body_upload_file_to_content_api_contents_source_connection_content_version_upload_post import ( - BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, -) -from ...models.file_upload_response import FileUploadResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_content_version: str, - *, - body: BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/contents/{source_connection_content_version}/upload".format( - source_connection_content_version=quote( - str(source_connection_content_version), safe="" - ), - ), - } - - _kwargs["files"] = body.to_multipart() - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> FileUploadResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = FileUploadResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[FileUploadResponse | 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( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - body: BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[FileUploadResponse | HTTPValidationError]: - r"""Replace a content version with a new upload - - Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`. - - This behaves like a source file upload, but it targets an existing content version ID. This is - useful when you want to correct or update an uploaded document while keeping references stable. - - **Maximum file size:** 209715200 bytes. - - **Supported MIME types:** - - `application/epub+zip` - - `application/json` - - `application/pdf` - - `application/vnd.ms-excel` - - `application/vnd.ms-outlook` - - `application/vnd.ms-powerpoint` - - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - - `application/xml` - - `application/zip` - - `audio/flac` - - `audio/mp4` - - `audio/mpeg` - - `audio/ogg` - - `audio/wav` - - `image/bmp` - - `image/gif` - - `image/jpeg` - - `image/png` - - `image/svg+xml` - - `image/tiff` - - `image/webp` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - `video/mp4` - - `video/quicktime` - - `video/x-msvideo` - - Notes: - - If the uploaded file's content type is `application/octet-stream`, the server attempts to infer - the type from the file extension. - - Use `metadata` to attach an arbitrary JSON object of metadata (for example - `metadata={\"category\":\"docs\"}`). - - `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not - override an existing `metadata.title`). - - For backwards compatibility, you can also pass form fields named `metadata_` (for example - `metadata_author=...`). These override keys from `metadata`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your - account. - - Args: - source_connection_content_version (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost): - - 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[FileUploadResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - body: BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> FileUploadResponse | HTTPValidationError | None: - r"""Replace a content version with a new upload - - Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`. - - This behaves like a source file upload, but it targets an existing content version ID. This is - useful when you want to correct or update an uploaded document while keeping references stable. - - **Maximum file size:** 209715200 bytes. - - **Supported MIME types:** - - `application/epub+zip` - - `application/json` - - `application/pdf` - - `application/vnd.ms-excel` - - `application/vnd.ms-outlook` - - `application/vnd.ms-powerpoint` - - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - - `application/xml` - - `application/zip` - - `audio/flac` - - `audio/mp4` - - `audio/mpeg` - - `audio/ogg` - - `audio/wav` - - `image/bmp` - - `image/gif` - - `image/jpeg` - - `image/png` - - `image/svg+xml` - - `image/tiff` - - `image/webp` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - `video/mp4` - - `video/quicktime` - - `video/x-msvideo` - - Notes: - - If the uploaded file's content type is `application/octet-stream`, the server attempts to infer - the type from the file extension. - - Use `metadata` to attach an arbitrary JSON object of metadata (for example - `metadata={\"category\":\"docs\"}`). - - `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not - override an existing `metadata.title`). - - For backwards compatibility, you can also pass form fields named `metadata_` (for example - `metadata_author=...`). These override keys from `metadata`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your - account. - - Args: - source_connection_content_version (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost): - - 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: - FileUploadResponse | HTTPValidationError - """ - - return sync_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - body: BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[FileUploadResponse | HTTPValidationError]: - r"""Replace a content version with a new upload - - Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`. - - This behaves like a source file upload, but it targets an existing content version ID. This is - useful when you want to correct or update an uploaded document while keeping references stable. - - **Maximum file size:** 209715200 bytes. - - **Supported MIME types:** - - `application/epub+zip` - - `application/json` - - `application/pdf` - - `application/vnd.ms-excel` - - `application/vnd.ms-outlook` - - `application/vnd.ms-powerpoint` - - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - - `application/xml` - - `application/zip` - - `audio/flac` - - `audio/mp4` - - `audio/mpeg` - - `audio/ogg` - - `audio/wav` - - `image/bmp` - - `image/gif` - - `image/jpeg` - - `image/png` - - `image/svg+xml` - - `image/tiff` - - `image/webp` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - `video/mp4` - - `video/quicktime` - - `video/x-msvideo` - - Notes: - - If the uploaded file's content type is `application/octet-stream`, the server attempts to infer - the type from the file extension. - - Use `metadata` to attach an arbitrary JSON object of metadata (for example - `metadata={\"category\":\"docs\"}`). - - `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not - override an existing `metadata.title`). - - For backwards compatibility, you can also pass form fields named `metadata_` (for example - `metadata_author=...`). These override keys from `metadata`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your - account. - - Args: - source_connection_content_version (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost): - - 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[FileUploadResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - body: BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> FileUploadResponse | HTTPValidationError | None: - r"""Replace a content version with a new upload - - Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`. - - This behaves like a source file upload, but it targets an existing content version ID. This is - useful when you want to correct or update an uploaded document while keeping references stable. - - **Maximum file size:** 209715200 bytes. - - **Supported MIME types:** - - `application/epub+zip` - - `application/json` - - `application/pdf` - - `application/vnd.ms-excel` - - `application/vnd.ms-outlook` - - `application/vnd.ms-powerpoint` - - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - - `application/xml` - - `application/zip` - - `audio/flac` - - `audio/mp4` - - `audio/mpeg` - - `audio/ogg` - - `audio/wav` - - `image/bmp` - - `image/gif` - - `image/jpeg` - - `image/png` - - `image/svg+xml` - - `image/tiff` - - `image/webp` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - `video/mp4` - - `video/quicktime` - - `video/x-msvideo` - - Notes: - - If the uploaded file's content type is `application/octet-stream`, the server attempts to infer - the type from the file extension. - - Use `metadata` to attach an arbitrary JSON object of metadata (for example - `metadata={\"category\":\"docs\"}`). - - `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not - override an existing `metadata.title`). - - For backwards compatibility, you can also pass form fields named `metadata_` (for example - `metadata_author=...`). These override keys from `metadata`. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your - account. - - Args: - source_connection_content_version (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost): - - 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: - FileUploadResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/email_domains/__init__.py b/seclai/_generated/api/email_domains/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/email_domains/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/email_domains/add_email_domain_api_api_email_domains_post.py b/seclai/_generated/api/email_domains/add_email_domain_api_api_email_domains_post.py deleted file mode 100644 index 8abdb0a..0000000 --- a/seclai/_generated/api/email_domains/add_email_domain_api_api_email_domains_post.py +++ /dev/null @@ -1,230 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.add_email_domain_request import AddEmailDomainRequest -from ...models.email_domain_response import EmailDomainResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: AddEmailDomainRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/email-domains", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EmailDomainResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = EmailDomainResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EmailDomainResponse | 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: AuthenticatedClient | Client, - body: AddEmailDomainRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainResponse | HTTPValidationError]: - """Add + provision an email domain - - Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, - `value=agent.mycompany.com`; optional `delegated=true` to let Seclai manage a dedicated Route53 - zone). Stands up the SES identity + DNS and returns the records the customer must publish. - Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AddEmailDomainRequest): - - 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[EmailDomainResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: AddEmailDomainRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EmailDomainResponse | HTTPValidationError | None: - """Add + provision an email domain - - Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, - `value=agent.mycompany.com`; optional `delegated=true` to let Seclai manage a dedicated Route53 - zone). Stands up the SES identity + DNS and returns the records the customer must publish. - Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AddEmailDomainRequest): - - 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: - EmailDomainResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: AddEmailDomainRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainResponse | HTTPValidationError]: - """Add + provision an email domain - - Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, - `value=agent.mycompany.com`; optional `delegated=true` to let Seclai manage a dedicated Route53 - zone). Stands up the SES identity + DNS and returns the records the customer must publish. - Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AddEmailDomainRequest): - - 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[EmailDomainResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: AddEmailDomainRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EmailDomainResponse | HTTPValidationError | None: - """Add + provision an email domain - - Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, - `value=agent.mycompany.com`; optional `delegated=true` to let Seclai manage a dedicated Route53 - zone). Stands up the SES identity + DNS and returns the records the customer must publish. - Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AddEmailDomainRequest): - - 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: - EmailDomainResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/email_domains/get_dmarc_summary_api_api_email_domains_domain_id_dmarc_get.py b/seclai/_generated/api/email_domains/get_dmarc_summary_api_api_email_domains_domain_id_dmarc_get.py deleted file mode 100644 index d9a5537..0000000 --- a/seclai/_generated/api/email_domains/get_dmarc_summary_api_api_email_domains_domain_id_dmarc_get.py +++ /dev/null @@ -1,263 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.dmarc_summary_response import DmarcSummaryResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - domain_id: UUID, - *, - days: int | Unset = 30, - top_sources: int | Unset = 10, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["days"] = days - - params["top_sources"] = top_sources - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/email-domains/{domain_id}/dmarc".format( - domain_id=quote(str(domain_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DmarcSummaryResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = DmarcSummaryResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DmarcSummaryResponse | 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( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - days: int | Unset = 30, - top_sources: int | Unset = 10, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[DmarcSummaryResponse | HTTPValidationError]: - """DMARC aggregate-report summary for a domain - - Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the - DMARC `rua` aggregate reports over the last `days` (clamped by the service). Populated for domains - whose DNS zone Seclai controls (vanity + delegated custom); a self-managed custom domain keeps its - own DMARC reporting and returns an all-zero summary. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - days (int | Unset): Default: 30. - top_sources (int | Unset): Default: 10. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[DmarcSummaryResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - domain_id=domain_id, - days=days, - top_sources=top_sources, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - days: int | Unset = 30, - top_sources: int | Unset = 10, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> DmarcSummaryResponse | HTTPValidationError | None: - """DMARC aggregate-report summary for a domain - - Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the - DMARC `rua` aggregate reports over the last `days` (clamped by the service). Populated for domains - whose DNS zone Seclai controls (vanity + delegated custom); a self-managed custom domain keeps its - own DMARC reporting and returns an all-zero summary. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - days (int | Unset): Default: 30. - top_sources (int | Unset): Default: 10. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - DmarcSummaryResponse | HTTPValidationError - """ - - return sync_detailed( - domain_id=domain_id, - client=client, - days=days, - top_sources=top_sources, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - days: int | Unset = 30, - top_sources: int | Unset = 10, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[DmarcSummaryResponse | HTTPValidationError]: - """DMARC aggregate-report summary for a domain - - Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the - DMARC `rua` aggregate reports over the last `days` (clamped by the service). Populated for domains - whose DNS zone Seclai controls (vanity + delegated custom); a self-managed custom domain keeps its - own DMARC reporting and returns an all-zero summary. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - days (int | Unset): Default: 30. - top_sources (int | Unset): Default: 10. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[DmarcSummaryResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - domain_id=domain_id, - days=days, - top_sources=top_sources, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - days: int | Unset = 30, - top_sources: int | Unset = 10, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> DmarcSummaryResponse | HTTPValidationError | None: - """DMARC aggregate-report summary for a domain - - Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the - DMARC `rua` aggregate reports over the last `days` (clamped by the service). Populated for domains - whose DNS zone Seclai controls (vanity + delegated custom); a self-managed custom domain keeps its - own DMARC reporting and returns an all-zero summary. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - days (int | Unset): Default: 30. - top_sources (int | Unset): Default: 10. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - DmarcSummaryResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - domain_id=domain_id, - client=client, - days=days, - top_sources=top_sources, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/email_domains/list_email_domains_api_api_email_domains_get.py b/seclai/_generated/api/email_domains/list_email_domains_api_api_email_domains_get.py deleted file mode 100644 index 27ebc69..0000000 --- a/seclai/_generated/api/email_domains/list_email_domains_api_api_email_domains_get.py +++ /dev/null @@ -1,206 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.email_domains_list_response import EmailDomainsListResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/email-domains", - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EmailDomainsListResponse | None: - if response.status_code == 200: - response_200 = EmailDomainsListResponse.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EmailDomainsListResponse]: - 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: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainsListResponse]: - """List the account's email domains + plan capabilities - - List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email - domains with their verification status, the DNS records the customer must publish, and the plan - capabilities (`can_add_vanity`/`can_add_custom`) plus whether one of each kind already exists - (`has_vanity`/`has_custom` — the per-kind limit is 1). - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EmailDomainsListResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EmailDomainsListResponse | None: - """List the account's email domains + plan capabilities - - List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email - domains with their verification status, the DNS records the customer must publish, and the plan - capabilities (`can_add_vanity`/`can_add_custom`) plus whether one of each kind already exists - (`has_vanity`/`has_custom` — the per-kind limit is 1). - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EmailDomainsListResponse - """ - - return sync_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainsListResponse]: - """List the account's email domains + plan capabilities - - List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email - domains with their verification status, the DNS records the customer must publish, and the plan - capabilities (`can_add_vanity`/`can_add_custom`) plus whether one of each kind already exists - (`has_vanity`/`has_custom` — the per-kind limit is 1). - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EmailDomainsListResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EmailDomainsListResponse | None: - """List the account's email domains + plan capabilities - - List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email - domains with their verification status, the DNS records the customer must publish, and the plan - capabilities (`can_add_vanity`/`can_add_custom`) plus whether one of each kind already exists - (`has_vanity`/`has_custom` — the per-kind limit is 1). - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EmailDomainsListResponse - """ - - return ( - await asyncio_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/email_domains/remove_email_domain_api_api_email_domains_domain_id_delete.py b/seclai/_generated/api/email_domains/remove_email_domain_api_api_email_domains_domain_id_delete.py deleted file mode 100644 index 3e3254b..0000000 --- a/seclai/_generated/api/email_domains/remove_email_domain_api_api_email_domains_domain_id_delete.py +++ /dev/null @@ -1,228 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.remove_email_domain_response import RemoveEmailDomainResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - domain_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/email-domains/{domain_id}".format( - domain_id=quote(str(domain_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | RemoveEmailDomainResponse | None: - if response.status_code == 200: - response_200 = RemoveEmailDomainResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | RemoveEmailDomainResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | RemoveEmailDomainResponse]: - """Remove an email domain - - Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a - `cleanup_note` when the removed domain was Seclai-managed (delegated), reminding the caller to - delete the registrar NS delegation record (dangling-delegation / subdomain-takeover guard). - Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | RemoveEmailDomainResponse] - """ - - kwargs = _get_kwargs( - domain_id=domain_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | RemoveEmailDomainResponse | None: - """Remove an email domain - - Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a - `cleanup_note` when the removed domain was Seclai-managed (delegated), reminding the caller to - delete the registrar NS delegation record (dangling-delegation / subdomain-takeover guard). - Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | RemoveEmailDomainResponse - """ - - return sync_detailed( - domain_id=domain_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | RemoveEmailDomainResponse]: - """Remove an email domain - - Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a - `cleanup_note` when the removed domain was Seclai-managed (delegated), reminding the caller to - delete the registrar NS delegation record (dangling-delegation / subdomain-takeover guard). - Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | RemoveEmailDomainResponse] - """ - - kwargs = _get_kwargs( - domain_id=domain_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | RemoveEmailDomainResponse | None: - """Remove an email domain - - Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a - `cleanup_note` when the removed domain was Seclai-managed (delegated), reminding the caller to - delete the registrar NS delegation record (dangling-delegation / subdomain-takeover guard). - Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | RemoveEmailDomainResponse - """ - - return ( - await asyncio_detailed( - domain_id=domain_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/email_domains/send_test_email_api_api_email_domains_domain_id_test_email_post.py b/seclai/_generated/api/email_domains/send_test_email_api_api_email_domains_domain_id_test_email_post.py deleted file mode 100644 index 9717401..0000000 --- a/seclai/_generated/api/email_domains/send_test_email_api_api_email_domains_domain_id_test_email_post.py +++ /dev/null @@ -1,224 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.send_test_email_response import SendTestEmailResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - domain_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/email-domains/{domain_id}/test-email".format( - domain_id=quote(str(domain_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SendTestEmailResponse | None: - if response.status_code == 200: - response_200 = SendTestEmailResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SendTestEmailResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SendTestEmailResponse]: - """Send a test email from a verified domain to the account owner - - Send a test message FROM the verified domain (`noreply@`) TO the account owner's email, to - confirm end-to-end that the domain actually sends (SES verified, DKIM/SPF aligned). Never sends to - any other address, so it can't be used as an open relay. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SendTestEmailResponse] - """ - - kwargs = _get_kwargs( - domain_id=domain_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SendTestEmailResponse | None: - """Send a test email from a verified domain to the account owner - - Send a test message FROM the verified domain (`noreply@`) TO the account owner's email, to - confirm end-to-end that the domain actually sends (SES verified, DKIM/SPF aligned). Never sends to - any other address, so it can't be used as an open relay. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SendTestEmailResponse - """ - - return sync_detailed( - domain_id=domain_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SendTestEmailResponse]: - """Send a test email from a verified domain to the account owner - - Send a test message FROM the verified domain (`noreply@`) TO the account owner's email, to - confirm end-to-end that the domain actually sends (SES verified, DKIM/SPF aligned). Never sends to - any other address, so it can't be used as an open relay. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SendTestEmailResponse] - """ - - kwargs = _get_kwargs( - domain_id=domain_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SendTestEmailResponse | None: - """Send a test email from a verified domain to the account owner - - Send a test message FROM the verified domain (`noreply@`) TO the account owner's email, to - confirm end-to-end that the domain actually sends (SES verified, DKIM/SPF aligned). Never sends to - any other address, so it can't be used as an open relay. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SendTestEmailResponse - """ - - return ( - await asyncio_detailed( - domain_id=domain_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/email_domains/set_primary_email_domain_api_api_email_domains_domain_id_primary_post.py b/seclai/_generated/api/email_domains/set_primary_email_domain_api_api_email_domains_domain_id_primary_post.py deleted file mode 100644 index 46b83f8..0000000 --- a/seclai/_generated/api/email_domains/set_primary_email_domain_api_api_email_domains_domain_id_primary_post.py +++ /dev/null @@ -1,224 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.email_domain_response import EmailDomainResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - domain_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/email-domains/{domain_id}/primary".format( - domain_id=quote(str(domain_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EmailDomainResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = EmailDomainResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EmailDomainResponse | 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( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainResponse | HTTPValidationError]: - """Make a verified domain the account's primary sending/inbound domain - - Promote a verified domain to the account's primary domain — agent email then sends FROM and receives - ON this domain (`@`, `@`) instead of the shared `agent.seclai.com`. - The domain must be verified. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EmailDomainResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - domain_id=domain_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EmailDomainResponse | HTTPValidationError | None: - """Make a verified domain the account's primary sending/inbound domain - - Promote a verified domain to the account's primary domain — agent email then sends FROM and receives - ON this domain (`@`, `@`) instead of the shared `agent.seclai.com`. - The domain must be verified. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EmailDomainResponse | HTTPValidationError - """ - - return sync_detailed( - domain_id=domain_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainResponse | HTTPValidationError]: - """Make a verified domain the account's primary sending/inbound domain - - Promote a verified domain to the account's primary domain — agent email then sends FROM and receives - ON this domain (`@`, `@`) instead of the shared `agent.seclai.com`. - The domain must be verified. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EmailDomainResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - domain_id=domain_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EmailDomainResponse | HTTPValidationError | None: - """Make a verified domain the account's primary sending/inbound domain - - Promote a verified domain to the account's primary domain — agent email then sends FROM and receives - ON this domain (`@`, `@`) instead of the shared `agent.seclai.com`. - The domain must be verified. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EmailDomainResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - domain_id=domain_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/email_domains/use_shared_domain_api_api_email_domains_use_shared_domain_post.py b/seclai/_generated/api/email_domains/use_shared_domain_api_api_email_domains_use_shared_domain_post.py deleted file mode 100644 index 8de81c5..0000000 --- a/seclai/_generated/api/email_domains/use_shared_domain_api_api_email_domains_use_shared_domain_post.py +++ /dev/null @@ -1,129 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/email-domains/use-shared-domain", - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | None: - if response.status_code == 204: - return None - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any]: - 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: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any]: - """Revert to the shared agent.seclai.com sending domain - - Clear the account's primary domain so agent email reverts to the shared `agent.seclai.com` - sending/inbound scheme, WITHOUT removing the configured domain(s) — they stay verified and can be - promoted again later. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any]: - """Revert to the shared agent.seclai.com sending domain - - Clear the account's primary domain so agent email reverts to the shared `agent.seclai.com` - sending/inbound scheme, WITHOUT removing the configured domain(s) — they stay verified and can be - promoted again later. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) diff --git a/seclai/_generated/api/email_domains/verify_email_domain_api_api_email_domains_domain_id_verify_post.py b/seclai/_generated/api/email_domains/verify_email_domain_api_api_email_domains_domain_id_verify_post.py deleted file mode 100644 index 64d112c..0000000 --- a/seclai/_generated/api/email_domains/verify_email_domain_api_api_email_domains_domain_id_verify_post.py +++ /dev/null @@ -1,224 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.email_domain_response import EmailDomainResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - domain_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/email-domains/{domain_id}/verify".format( - domain_id=quote(str(domain_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EmailDomainResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = EmailDomainResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EmailDomainResponse | 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( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainResponse | HTTPValidationError]: - """Run a verification check immediately ('Check now') - - Re-poll SES + DNS for this domain right now instead of waiting for the background verification - sweep, and return its updated status + DNS-record check results. Useful right after publishing the - required records. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EmailDomainResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - domain_id=domain_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EmailDomainResponse | HTTPValidationError | None: - """Run a verification check immediately ('Check now') - - Re-poll SES + DNS for this domain right now instead of waiting for the background verification - sweep, and return its updated status + DNS-record check results. Useful right after publishing the - required records. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EmailDomainResponse | HTTPValidationError - """ - - return sync_detailed( - domain_id=domain_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EmailDomainResponse | HTTPValidationError]: - """Run a verification check immediately ('Check now') - - Re-poll SES + DNS for this domain right now instead of waiting for the background verification - sweep, and return its updated status + DNS-record check results. Useful right after publishing the - required records. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[EmailDomainResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - domain_id=domain_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - domain_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EmailDomainResponse | HTTPValidationError | None: - """Run a verification check immediately ('Check now') - - Re-poll SES + DNS for this domain right now instead of waiting for the background verification - sweep, and return its updated status + DNS-record check results. Useful right after publishing the - required records. Owner/admin only. - - Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an - account-only key is refused with 403); the domain is scoped to the key's account. - - Args: - domain_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - EmailDomainResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - domain_id=domain_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/governance/__init__.py b/seclai/_generated/api/governance/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/governance/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/governance/governance_ai_accept_api_governance_ai_assistant_conversation_id_accept_post.py b/seclai/_generated/api/governance/governance_ai_accept_api_governance_ai_assistant_conversation_id_accept_post.py deleted file mode 100644 index ea9ef49..0000000 --- a/seclai/_generated/api/governance/governance_ai_accept_api_governance_ai_assistant_conversation_id_accept_post.py +++ /dev/null @@ -1,224 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.governance_ai_accept_response import GovernanceAiAcceptResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - conversation_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/governance/ai-assistant/{conversation_id}/accept".format( - conversation_id=quote(str(conversation_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | GovernanceAiAcceptResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = GovernanceAiAcceptResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = cast(Any, None) - return response_400 - - if response.status_code == 403: - response_403 = cast(Any, None) - return response_403 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | GovernanceAiAcceptResponse | 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( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | GovernanceAiAcceptResponse | HTTPValidationError]: - """Accept a governance plan - - Execute the proposed policy changes from a governance AI assistant conversation. Each action is - applied in order and results are returned. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | GovernanceAiAcceptResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - conversation_id=conversation_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | GovernanceAiAcceptResponse | HTTPValidationError | None: - """Accept a governance plan - - Execute the proposed policy changes from a governance AI assistant conversation. Each action is - applied in order and results are returned. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | GovernanceAiAcceptResponse | HTTPValidationError - """ - - return sync_detailed( - conversation_id=conversation_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | GovernanceAiAcceptResponse | HTTPValidationError]: - """Accept a governance plan - - Execute the proposed policy changes from a governance AI assistant conversation. Each action is - applied in order and results are returned. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | GovernanceAiAcceptResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - conversation_id=conversation_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | GovernanceAiAcceptResponse | HTTPValidationError | None: - """Accept a governance plan - - Execute the proposed policy changes from a governance AI assistant conversation. Each action is - applied in order and results are returned. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | GovernanceAiAcceptResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - conversation_id=conversation_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/governance/governance_ai_decline_api_governance_ai_assistant_conversation_id_decline_post.py b/seclai/_generated/api/governance/governance_ai_decline_api_governance_ai_assistant_conversation_id_decline_post.py deleted file mode 100644 index 9252846..0000000 --- a/seclai/_generated/api/governance/governance_ai_decline_api_governance_ai_assistant_conversation_id_decline_post.py +++ /dev/null @@ -1,222 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - conversation_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/governance/ai-assistant/{conversation_id}/decline".format( - conversation_id=quote(str(conversation_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 400: - response_400 = cast(Any, None) - return response_400 - - if response.status_code == 403: - response_403 = cast(Any, None) - return response_403 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Decline a governance plan - - Reject a previously proposed governance AI assistant plan without applying any changes. The - conversation is marked as declined and no policy modifications are made. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - conversation_id=conversation_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Decline a governance plan - - Reject a previously proposed governance AI assistant plan without applying any changes. The - conversation is marked as declined and no policy modifications are made. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - conversation_id=conversation_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Decline a governance plan - - Reject a previously proposed governance AI assistant plan without applying any changes. The - conversation is marked as declined and no policy modifications are made. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - conversation_id=conversation_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Decline a governance plan - - Reject a previously proposed governance AI assistant plan without applying any changes. The - conversation is marked as declined and no policy modifications are made. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - conversation_id=conversation_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/governance/governance_ai_generate_api_governance_ai_assistant_post.py b/seclai/_generated/api/governance/governance_ai_generate_api_governance_ai_assistant_post.py deleted file mode 100644 index f13cda2..0000000 --- a/seclai/_generated/api/governance/governance_ai_generate_api_governance_ai_assistant_post.py +++ /dev/null @@ -1,226 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.governance_ai_assistant_request import GovernanceAiAssistantRequest -from ...models.governance_ai_assistant_response import GovernanceAiAssistantResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: GovernanceAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/governance/ai-assistant", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | GovernanceAiAssistantResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = GovernanceAiAssistantResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = cast(Any, None) - return response_400 - - if response.status_code == 403: - response_403 = cast(Any, None) - return response_403 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | GovernanceAiAssistantResponse | 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: AuthenticatedClient | Client, - body: GovernanceAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | GovernanceAiAssistantResponse | HTTPValidationError]: - """Generate a governance plan - - Send a natural-language request to the governance AI assistant to generate a plan of policy changes. - Returns a conversation with proposed actions that can be accepted or declined. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (GovernanceAiAssistantRequest): Request body for the governance AI assistant. - - 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 | GovernanceAiAssistantResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: GovernanceAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | GovernanceAiAssistantResponse | HTTPValidationError | None: - """Generate a governance plan - - Send a natural-language request to the governance AI assistant to generate a plan of policy changes. - Returns a conversation with proposed actions that can be accepted or declined. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (GovernanceAiAssistantRequest): Request body for the governance AI assistant. - - 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 | GovernanceAiAssistantResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: GovernanceAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | GovernanceAiAssistantResponse | HTTPValidationError]: - """Generate a governance plan - - Send a natural-language request to the governance AI assistant to generate a plan of policy changes. - Returns a conversation with proposed actions that can be accepted or declined. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (GovernanceAiAssistantRequest): Request body for the governance AI assistant. - - 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 | GovernanceAiAssistantResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: GovernanceAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | GovernanceAiAssistantResponse | HTTPValidationError | None: - """Generate a governance plan - - Send a natural-language request to the governance AI assistant to generate a plan of policy changes. - Returns a conversation with proposed actions that can be accepted or declined. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (GovernanceAiAssistantRequest): Request body for the governance AI assistant. - - 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 | GovernanceAiAssistantResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/governance/list_governance_ai_conversations_api_governance_ai_assistant_conversations_get.py b/seclai/_generated/api/governance/list_governance_ai_conversations_api_governance_ai_assistant_conversations_get.py deleted file mode 100644 index d6cc9f0..0000000 --- a/seclai/_generated/api/governance/list_governance_ai_conversations_api_governance_ai_assistant_conversations_get.py +++ /dev/null @@ -1,227 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.governance_conversation_response import GovernanceConversationResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/governance/ai-assistant/conversations", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | list[GovernanceConversationResponse] | None: - if response.status_code == 200: - response_200 = [] - _response_200 = response.json() - for response_200_item_data in _response_200: - response_200_item = GovernanceConversationResponse.from_dict( - response_200_item_data - ) - - response_200.append(response_200_item) - - return response_200 - - if response.status_code == 403: - response_403 = cast(Any, None) - return response_403 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | list[GovernanceConversationResponse]]: - 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: AuthenticatedClient | Client, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | list[GovernanceConversationResponse]]: - """List AI assistant conversations - - Return recent governance AI assistant conversations for the account, ordered by most recent first. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - limit (int | Unset): Number of conversations. Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[GovernanceConversationResponse]] - """ - - kwargs = _get_kwargs( - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | list[GovernanceConversationResponse] | None: - """List AI assistant conversations - - Return recent governance AI assistant conversations for the account, ordered by most recent first. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - limit (int | Unset): Number of conversations. Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[GovernanceConversationResponse] - """ - - return sync_detailed( - client=client, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | list[GovernanceConversationResponse]]: - """List AI assistant conversations - - Return recent governance AI assistant conversations for the account, ordered by most recent first. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - limit (int | Unset): Number of conversations. Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[GovernanceConversationResponse]] - """ - - kwargs = _get_kwargs( - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | list[GovernanceConversationResponse] | None: - """List AI assistant conversations - - Return recent governance AI assistant conversations for the account, ordered by most recent first. - - Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - - Args: - limit (int | Unset): Number of conversations. Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[GovernanceConversationResponse] - """ - - return ( - await asyncio_detailed( - client=client, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/identity/__init__.py b/seclai/_generated/api/identity/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/identity/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/identity/get_me_api_me_get.py b/seclai/_generated/api/identity/get_me_api_me_get.py deleted file mode 100644 index 89f9a28..0000000 --- a/seclai/_generated/api/identity/get_me_api_me_get.py +++ /dev/null @@ -1,190 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.me_response import MeResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/me", - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> MeResponse | None: - if response.status_code == 200: - response_200 = MeResponse.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[MeResponse]: - 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: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[MeResponse]: - """Get current user identity - - Returns the authenticated user's personal account ID and a list of organisations they belong to. - Each organisation entry includes the organisation's own id, display name, and account_id. Useful - for CLI tooling that needs to let the user pick an org context. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[MeResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> MeResponse | None: - """Get current user identity - - Returns the authenticated user's personal account ID and a list of organisations they belong to. - Each organisation entry includes the organisation's own id, display name, and account_id. Useful - for CLI tooling that needs to let the user pick an org context. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - MeResponse - """ - - return sync_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[MeResponse]: - """Get current user identity - - Returns the authenticated user's personal account ID and a list of organisations they belong to. - Each organisation entry includes the organisation's own id, display name, and account_id. Useful - for CLI tooling that needs to let the user pick an org context. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[MeResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> MeResponse | None: - """Get current user identity - - Returns the authenticated user's personal account ID and a list of organisations they belong to. - Each organisation entry includes the organisation's own id, display name, and account_id. Useful - for CLI tooling that needs to let the user pick an org context. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - MeResponse - """ - - return ( - await asyncio_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/knowledge_bases/__init__.py b/seclai/_generated/api/knowledge_bases/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/knowledge_bases/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/knowledge_bases/create_knowledge_base_api_knowledge_bases_post.py b/seclai/_generated/api/knowledge_bases/create_knowledge_base_api_knowledge_bases_post.py deleted file mode 100644 index 0550f97..0000000 --- a/seclai/_generated/api/knowledge_bases/create_knowledge_base_api_knowledge_bases_post.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_knowledge_base_body import CreateKnowledgeBaseBody -from ...models.http_validation_error import HTTPValidationError -from ...models.knowledge_base import KnowledgeBase -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: CreateKnowledgeBaseBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/knowledge_bases", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | KnowledgeBase | None: - if response.status_code == 201: - response_201 = KnowledgeBase.from_dict(response.json()) - - return response_201 - - if response.status_code == 402: - response_402 = cast(Any, None) - return response_402 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | KnowledgeBase]: - 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: AuthenticatedClient | Client, - body: CreateKnowledgeBaseBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | KnowledgeBase]: - """Create Knowledge Base - - Create a new knowledge base. - - At least one `source_id` is required. The source connections must belong to the same account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateKnowledgeBaseBody): Request body for creating a knowledge base. - - 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 | KnowledgeBase] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateKnowledgeBaseBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | KnowledgeBase | None: - """Create Knowledge Base - - Create a new knowledge base. - - At least one `source_id` is required. The source connections must belong to the same account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateKnowledgeBaseBody): Request body for creating a knowledge base. - - 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 | KnowledgeBase - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateKnowledgeBaseBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | KnowledgeBase]: - """Create Knowledge Base - - Create a new knowledge base. - - At least one `source_id` is required. The source connections must belong to the same account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateKnowledgeBaseBody): Request body for creating a knowledge base. - - 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 | KnowledgeBase] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateKnowledgeBaseBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | KnowledgeBase | None: - """Create Knowledge Base - - Create a new knowledge base. - - At least one `source_id` is required. The source connections must belong to the same account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateKnowledgeBaseBody): Request body for creating a knowledge base. - - 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 | KnowledgeBase - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/knowledge_bases/delete_knowledge_base_api_knowledge_bases_knowledge_base_id_delete.py b/seclai/_generated/api/knowledge_bases/delete_knowledge_base_api_knowledge_bases_knowledge_base_id_delete.py deleted file mode 100644 index 911e5e4..0000000 --- a/seclai/_generated/api/knowledge_bases/delete_knowledge_base_api_knowledge_bases_knowledge_base_id_delete.py +++ /dev/null @@ -1,214 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - knowledge_base_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/knowledge_bases/{knowledge_base_id}".format( - knowledge_base_id=quote(str(knowledge_base_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - knowledge_base_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete Knowledge Base - - Soft-delete a knowledge base. This action cannot be undone. - - Fails if the knowledge base is referenced by any agent definitions. Remove the knowledge base from - agents first. - - Args: - knowledge_base_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - knowledge_base_id=knowledge_base_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - knowledge_base_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete Knowledge Base - - Soft-delete a knowledge base. This action cannot be undone. - - Fails if the knowledge base is referenced by any agent definitions. Remove the knowledge base from - agents first. - - Args: - knowledge_base_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - knowledge_base_id=knowledge_base_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - knowledge_base_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete Knowledge Base - - Soft-delete a knowledge base. This action cannot be undone. - - Fails if the knowledge base is referenced by any agent definitions. Remove the knowledge base from - agents first. - - Args: - knowledge_base_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - knowledge_base_id=knowledge_base_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - knowledge_base_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete Knowledge Base - - Soft-delete a knowledge base. This action cannot be undone. - - Fails if the knowledge base is referenced by any agent definitions. Remove the knowledge base from - agents first. - - Args: - knowledge_base_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - knowledge_base_id=knowledge_base_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/knowledge_bases/get_knowledge_base_api_knowledge_bases_knowledge_base_id_get.py b/seclai/_generated/api/knowledge_bases/get_knowledge_base_api_knowledge_bases_knowledge_base_id_get.py deleted file mode 100644 index eb5c7c6..0000000 --- a/seclai/_generated/api/knowledge_bases/get_knowledge_base_api_knowledge_bases_knowledge_base_id_get.py +++ /dev/null @@ -1,220 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.knowledge_base import KnowledgeBase -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - knowledge_base_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/knowledge_bases/{knowledge_base_id}".format( - knowledge_base_id=quote(str(knowledge_base_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | KnowledgeBase | None: - if response.status_code == 200: - response_200 = KnowledgeBase.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | KnowledgeBase]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - knowledge_base_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | KnowledgeBase]: - """Get Knowledge Base - - Fetch a knowledge base by ID. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access knowledge bases belonging - to your account. - - Args: - knowledge_base_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | KnowledgeBase] - """ - - kwargs = _get_kwargs( - knowledge_base_id=knowledge_base_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - knowledge_base_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | KnowledgeBase | None: - """Get Knowledge Base - - Fetch a knowledge base by ID. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access knowledge bases belonging - to your account. - - Args: - knowledge_base_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | KnowledgeBase - """ - - return sync_detailed( - knowledge_base_id=knowledge_base_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - knowledge_base_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | KnowledgeBase]: - """Get Knowledge Base - - Fetch a knowledge base by ID. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access knowledge bases belonging - to your account. - - Args: - knowledge_base_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | KnowledgeBase] - """ - - kwargs = _get_kwargs( - knowledge_base_id=knowledge_base_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - knowledge_base_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | KnowledgeBase | None: - """Get Knowledge Base - - Fetch a knowledge base by ID. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access knowledge bases belonging - to your account. - - Args: - knowledge_base_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | KnowledgeBase - """ - - return ( - await asyncio_detailed( - knowledge_base_id=knowledge_base_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/knowledge_bases/list_knowledge_bases_api_knowledge_bases_get.py b/seclai/_generated/api/knowledge_bases/list_knowledge_bases_api_knowledge_bases_get.py deleted file mode 100644 index b7abd30..0000000 --- a/seclai/_generated/api/knowledge_bases/list_knowledge_bases_api_knowledge_bases_get.py +++ /dev/null @@ -1,273 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.knowledge_base_list_response_model import KnowledgeBaseListResponseModel -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - params["sort"] = sort - - params["order"] = order - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/knowledge_bases", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | KnowledgeBaseListResponseModel | None: - if response.status_code == 200: - response_200 = KnowledgeBaseListResponseModel.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | KnowledgeBaseListResponseModel]: - 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: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | KnowledgeBaseListResponseModel]: - """List Knowledge Bases - - List knowledge bases for the account. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - page (int | Unset): Page number (1-based). Default: 1. - limit (int | Unset): Items per page. Default: 20. - sort (str | Unset): Sort field. One of: created_at, updated_at, name. Default: - 'created_at'. - order (str | Unset): Sort direction: asc or desc. Default: 'desc'. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | KnowledgeBaseListResponseModel] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - sort=sort, - order=order, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | KnowledgeBaseListResponseModel | None: - """List Knowledge Bases - - List knowledge bases for the account. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - page (int | Unset): Page number (1-based). Default: 1. - limit (int | Unset): Items per page. Default: 20. - sort (str | Unset): Sort field. One of: created_at, updated_at, name. Default: - 'created_at'. - order (str | Unset): Sort direction: asc or desc. Default: 'desc'. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | KnowledgeBaseListResponseModel - """ - - return sync_detailed( - client=client, - page=page, - limit=limit, - sort=sort, - order=order, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | KnowledgeBaseListResponseModel]: - """List Knowledge Bases - - List knowledge bases for the account. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - page (int | Unset): Page number (1-based). Default: 1. - limit (int | Unset): Items per page. Default: 20. - sort (str | Unset): Sort field. One of: created_at, updated_at, name. Default: - 'created_at'. - order (str | Unset): Sort direction: asc or desc. Default: 'desc'. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | KnowledgeBaseListResponseModel] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - sort=sort, - order=order, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | KnowledgeBaseListResponseModel | None: - """List Knowledge Bases - - List knowledge bases for the account. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - page (int | Unset): Page number (1-based). Default: 1. - limit (int | Unset): Items per page. Default: 20. - sort (str | Unset): Sort field. One of: created_at, updated_at, name. Default: - 'created_at'. - order (str | Unset): Sort direction: asc or desc. Default: 'desc'. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | KnowledgeBaseListResponseModel - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - limit=limit, - sort=sort, - order=order, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/knowledge_bases/update_knowledge_base_api_knowledge_bases_knowledge_base_id_put.py b/seclai/_generated/api/knowledge_bases/update_knowledge_base_api_knowledge_bases_knowledge_base_id_put.py deleted file mode 100644 index e6b8395..0000000 --- a/seclai/_generated/api/knowledge_bases/update_knowledge_base_api_knowledge_bases_knowledge_base_id_put.py +++ /dev/null @@ -1,242 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.knowledge_base import KnowledgeBase -from ...models.update_knowledge_base_body import UpdateKnowledgeBaseBody -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - knowledge_base_id: str, - *, - body: UpdateKnowledgeBaseBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/knowledge_bases/{knowledge_base_id}".format( - knowledge_base_id=quote(str(knowledge_base_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | KnowledgeBase | None: - if response.status_code == 200: - response_200 = KnowledgeBase.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | KnowledgeBase]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - knowledge_base_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateKnowledgeBaseBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | KnowledgeBase]: - """Update Knowledge Base - - Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left - unchanged. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only update knowledge bases belonging - to your account. - - Args: - knowledge_base_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateKnowledgeBaseBody): Request body for updating a knowledge base. - - 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 | KnowledgeBase] - """ - - kwargs = _get_kwargs( - knowledge_base_id=knowledge_base_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - knowledge_base_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateKnowledgeBaseBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | KnowledgeBase | None: - """Update Knowledge Base - - Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left - unchanged. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only update knowledge bases belonging - to your account. - - Args: - knowledge_base_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateKnowledgeBaseBody): Request body for updating a knowledge base. - - 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 | KnowledgeBase - """ - - return sync_detailed( - knowledge_base_id=knowledge_base_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - knowledge_base_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateKnowledgeBaseBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | KnowledgeBase]: - """Update Knowledge Base - - Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left - unchanged. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only update knowledge bases belonging - to your account. - - Args: - knowledge_base_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateKnowledgeBaseBody): Request body for updating a knowledge base. - - 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 | KnowledgeBase] - """ - - kwargs = _get_kwargs( - knowledge_base_id=knowledge_base_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - knowledge_base_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateKnowledgeBaseBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | KnowledgeBase | None: - """Update Knowledge Base - - Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left - unchanged. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only update knowledge bases belonging - to your account. - - Args: - knowledge_base_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateKnowledgeBaseBody): Request body for updating a knowledge base. - - 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 | KnowledgeBase - """ - - return ( - await asyncio_detailed( - knowledge_base_id=knowledge_base_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/__init__.py b/seclai/_generated/api/memory_banks/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/memory_banks/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/memory_banks/compact_memory_bank_api_memory_banks_memory_bank_id_compact_post.py b/seclai/_generated/api/memory_banks/compact_memory_bank_api_memory_banks_memory_bank_id_compact_post.py deleted file mode 100644 index c78a7f0..0000000 --- a/seclai/_generated/api/memory_banks/compact_memory_bank_api_memory_banks_memory_bank_id_compact_post.py +++ /dev/null @@ -1,216 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.compaction_scheduled_response import CompactionScheduledResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - memory_bank_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/memory_banks/{memory_bank_id}/compact".format( - memory_bank_id=quote(str(memory_bank_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CompactionScheduledResponse | HTTPValidationError | None: - if response.status_code == 202: - response_202 = CompactionScheduledResponse.from_dict(response.json()) - - return response_202 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CompactionScheduledResponse | 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( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CompactionScheduledResponse | HTTPValidationError]: - """Compact Memory Bank - - Trigger an on-demand compaction run for a memory bank. - - The bank must have at least one compaction threshold configured (max_age_days, max_turns, or - max_size_tokens). Compaction runs asynchronously — the response confirms scheduling, not completion. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[CompactionScheduledResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - memory_bank_id=memory_bank_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CompactionScheduledResponse | HTTPValidationError | None: - """Compact Memory Bank - - Trigger an on-demand compaction run for a memory bank. - - The bank must have at least one compaction threshold configured (max_age_days, max_turns, or - max_size_tokens). Compaction runs asynchronously — the response confirms scheduling, not completion. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - CompactionScheduledResponse | HTTPValidationError - """ - - return sync_detailed( - memory_bank_id=memory_bank_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CompactionScheduledResponse | HTTPValidationError]: - """Compact Memory Bank - - Trigger an on-demand compaction run for a memory bank. - - The bank must have at least one compaction threshold configured (max_age_days, max_turns, or - max_size_tokens). Compaction runs asynchronously — the response confirms scheduling, not completion. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[CompactionScheduledResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - memory_bank_id=memory_bank_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CompactionScheduledResponse | HTTPValidationError | None: - """Compact Memory Bank - - Trigger an on-demand compaction run for a memory bank. - - The bank must have at least one compaction threshold configured (max_age_days, max_turns, or - max_size_tokens). Compaction runs asynchronously — the response confirms scheduling, not completion. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - CompactionScheduledResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - memory_bank_id=memory_bank_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/create_memory_bank_api_memory_banks_post.py b/seclai/_generated/api/memory_banks/create_memory_bank_api_memory_banks_post.py deleted file mode 100644 index 9953a07..0000000 --- a/seclai/_generated/api/memory_banks/create_memory_bank_api_memory_banks_post.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_memory_bank_body import CreateMemoryBankBody -from ...models.http_validation_error import HTTPValidationError -from ...models.memory_bank import MemoryBank -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: CreateMemoryBankBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/memory_banks", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBank | None: - if response.status_code == 201: - response_201 = MemoryBank.from_dict(response.json()) - - return response_201 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBank]: - 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: AuthenticatedClient | Client, - body: CreateMemoryBankBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBank]: - """Create Memory Bank - - Create a new memory bank. - - Modes: `fast_and_cheap` (256-dim), `balanced` (512-dim), `slow_and_thorough` (1024-dim), or `custom` - (supply your own embedding params). - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateMemoryBankBody): Request body for creating a memory bank. - - 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 | MemoryBank] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateMemoryBankBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBank | None: - """Create Memory Bank - - Create a new memory bank. - - Modes: `fast_and_cheap` (256-dim), `balanced` (512-dim), `slow_and_thorough` (1024-dim), or `custom` - (supply your own embedding params). - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateMemoryBankBody): Request body for creating a memory bank. - - 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 | MemoryBank - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMemoryBankBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBank]: - """Create Memory Bank - - Create a new memory bank. - - Modes: `fast_and_cheap` (256-dim), `balanced` (512-dim), `slow_and_thorough` (1024-dim), or `custom` - (supply your own embedding params). - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateMemoryBankBody): Request body for creating a memory bank. - - 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 | MemoryBank] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateMemoryBankBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBank | None: - """Create Memory Bank - - Create a new memory bank. - - Modes: `fast_and_cheap` (256-dim), `balanced` (512-dim), `slow_and_thorough` (1024-dim), or `custom` - (supply your own embedding params). - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateMemoryBankBody): Request body for creating a memory bank. - - 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 | MemoryBank - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/delete_memory_bank_api_memory_banks_memory_bank_id_delete.py b/seclai/_generated/api/memory_banks/delete_memory_bank_api_memory_banks_memory_bank_id_delete.py deleted file mode 100644 index 4ad3519..0000000 --- a/seclai/_generated/api/memory_banks/delete_memory_bank_api_memory_banks_memory_bank_id_delete.py +++ /dev/null @@ -1,210 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - memory_bank_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/memory_banks/{memory_bank_id}".format( - memory_bank_id=quote(str(memory_bank_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete Memory Bank - - Soft-delete a memory bank. This action is permanent and cannot be undone. - - The linked content source and all stored conversation memory entries will also be removed. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - memory_bank_id=memory_bank_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete Memory Bank - - Soft-delete a memory bank. This action is permanent and cannot be undone. - - The linked content source and all stored conversation memory entries will also be removed. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - memory_bank_id=memory_bank_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete Memory Bank - - Soft-delete a memory bank. This action is permanent and cannot be undone. - - The linked content source and all stored conversation memory entries will also be removed. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - memory_bank_id=memory_bank_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete Memory Bank - - Soft-delete a memory bank. This action is permanent and cannot be undone. - - The linked content source and all stored conversation memory entries will also be removed. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - memory_bank_id=memory_bank_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/delete_memory_bank_source_api_memory_banks_memory_bank_id_source_delete.py b/seclai/_generated/api/memory_banks/delete_memory_bank_source_api_memory_banks_memory_bank_id_source_delete.py deleted file mode 100644 index 9227dcd..0000000 --- a/seclai/_generated/api/memory_banks/delete_memory_bank_source_api_memory_banks_memory_bank_id_source_delete.py +++ /dev/null @@ -1,214 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - memory_bank_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/memory_banks/{memory_bank_id}/source".format( - memory_bank_id=quote(str(memory_bank_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete Memory Bank Source - - Delete the content source linked to a memory bank, removing all stored memory entries. - - A new content source is automatically created on the next write. Use this to reset a bank's data - without deleting the bank itself. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - memory_bank_id=memory_bank_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete Memory Bank Source - - Delete the content source linked to a memory bank, removing all stored memory entries. - - A new content source is automatically created on the next write. Use this to reset a bank's data - without deleting the bank itself. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - memory_bank_id=memory_bank_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete Memory Bank Source - - Delete the content source linked to a memory bank, removing all stored memory entries. - - A new content source is automatically created on the next write. Use this to reset a bank's data - without deleting the bank itself. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - memory_bank_id=memory_bank_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete Memory Bank Source - - Delete the content source linked to a memory bank, removing all stored memory entries. - - A new content source is automatically created on the next write. Use this to reset a bank's data - without deleting the bank itself. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - memory_bank_id=memory_bank_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/get_agents_using_bank_api_memory_banks_memory_bank_id_agents_get.py b/seclai/_generated/api/memory_banks/get_agents_using_bank_api_memory_banks_memory_bank_id_agents_get.py deleted file mode 100644 index 5598220..0000000 --- a/seclai/_generated/api/memory_banks/get_agents_using_bank_api_memory_banks_memory_bank_id_agents_get.py +++ /dev/null @@ -1,210 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - memory_bank_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/memory_banks/{memory_bank_id}/agents".format( - memory_bank_id=quote(str(memory_bank_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - 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 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Get Agents Using Bank - - List agents whose current definition references this memory bank. - - Returns an array of `{agent_id, agent_name}` objects. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - memory_bank_id=memory_bank_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Get Agents Using Bank - - List agents whose current definition references this memory bank. - - Returns an array of `{agent_id, agent_name}` objects. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - memory_bank_id=memory_bank_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Get Agents Using Bank - - List agents whose current definition references this memory bank. - - Returns an array of `{agent_id, agent_name}` objects. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - memory_bank_id=memory_bank_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Get Agents Using Bank - - List agents whose current definition references this memory bank. - - Returns an array of `{agent_id, agent_name}` objects. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - memory_bank_id=memory_bank_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/get_memory_bank_api_memory_banks_memory_bank_id_get.py b/seclai/_generated/api/memory_banks/get_memory_bank_api_memory_banks_memory_bank_id_get.py deleted file mode 100644 index 9597be3..0000000 --- a/seclai/_generated/api/memory_banks/get_memory_bank_api_memory_banks_memory_bank_id_get.py +++ /dev/null @@ -1,220 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.memory_bank import MemoryBank -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - memory_bank_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/memory_banks/{memory_bank_id}".format( - memory_bank_id=quote(str(memory_bank_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBank | None: - if response.status_code == 200: - response_200 = MemoryBank.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBank]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBank]: - """Get Memory Bank - - Fetch a memory bank by ID. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access memory banks belonging to - your account. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBank] - """ - - kwargs = _get_kwargs( - memory_bank_id=memory_bank_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBank | None: - """Get Memory Bank - - Fetch a memory bank by ID. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access memory banks belonging to - your account. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBank - """ - - return sync_detailed( - memory_bank_id=memory_bank_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBank]: - """Get Memory Bank - - Fetch a memory bank by ID. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access memory banks belonging to - your account. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBank] - """ - - kwargs = _get_kwargs( - memory_bank_id=memory_bank_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBank | None: - """Get Memory Bank - - Fetch a memory bank by ID. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access memory banks belonging to - your account. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBank - """ - - return ( - await asyncio_detailed( - memory_bank_id=memory_bank_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get.py b/seclai/_generated/api/memory_banks/get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get.py deleted file mode 100644 index 0f47ac0..0000000 --- a/seclai/_generated/api/memory_banks/get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get.py +++ /dev/null @@ -1,302 +0,0 @@ -import datetime -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get_response_get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get import ( - GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet, -) -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - memory_bank_id: str, - *, - days: int | Unset = 30, - start_date: datetime.date | None | Unset = UNSET, - end_date: datetime.date | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["days"] = days - - json_start_date: None | str | Unset - if isinstance(start_date, Unset): - json_start_date = UNSET - elif isinstance(start_date, datetime.date): - json_start_date = start_date.isoformat() - else: - json_start_date = start_date - params["start_date"] = json_start_date - - json_end_date: None | str | Unset - if isinstance(end_date, Unset): - json_end_date = UNSET - elif isinstance(end_date, datetime.date): - json_end_date = end_date.isoformat() - else: - json_end_date = end_date - params["end_date"] = json_end_date - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/memory_banks/{memory_bank_id}/stats".format( - memory_bank_id=quote(str(memory_bank_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ( - GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet - | HTTPValidationError - | None -): - if response.status_code == 200: - response_200 = GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet.from_dict( - response.json() - ) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ - GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet - | 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( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - days: int | Unset = 30, - start_date: datetime.date | None | Unset = UNSET, - end_date: datetime.date | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ - GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet - | HTTPValidationError -]: - """Get Memory Bank Entry Stats - - Return aggregated entry statistics for a memory bank, including total counts, token/age/entries-per- - key distributions (avg, p95, min, max), and top conversation keys, group keys, speakers, and tags. - Supports time-range filtering via `days`, `start_date`, and `end_date` query parameters. - - Args: - memory_bank_id (str): - days (int | Unset): Default: 30. - start_date (datetime.date | None | Unset): - end_date (datetime.date | None | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError] - """ - - kwargs = _get_kwargs( - memory_bank_id=memory_bank_id, - days=days, - start_date=start_date, - end_date=end_date, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - days: int | Unset = 30, - start_date: datetime.date | None | Unset = UNSET, - end_date: datetime.date | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ( - GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet - | HTTPValidationError - | None -): - """Get Memory Bank Entry Stats - - Return aggregated entry statistics for a memory bank, including total counts, token/age/entries-per- - key distributions (avg, p95, min, max), and top conversation keys, group keys, speakers, and tags. - Supports time-range filtering via `days`, `start_date`, and `end_date` query parameters. - - Args: - memory_bank_id (str): - days (int | Unset): Default: 30. - start_date (datetime.date | None | Unset): - end_date (datetime.date | None | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError - """ - - return sync_detailed( - memory_bank_id=memory_bank_id, - client=client, - days=days, - start_date=start_date, - end_date=end_date, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - days: int | Unset = 30, - start_date: datetime.date | None | Unset = UNSET, - end_date: datetime.date | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ - GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet - | HTTPValidationError -]: - """Get Memory Bank Entry Stats - - Return aggregated entry statistics for a memory bank, including total counts, token/age/entries-per- - key distributions (avg, p95, min, max), and top conversation keys, group keys, speakers, and tags. - Supports time-range filtering via `days`, `start_date`, and `end_date` query parameters. - - Args: - memory_bank_id (str): - days (int | Unset): Default: 30. - start_date (datetime.date | None | Unset): - end_date (datetime.date | None | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError] - """ - - kwargs = _get_kwargs( - memory_bank_id=memory_bank_id, - days=days, - start_date=start_date, - end_date=end_date, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - days: int | Unset = 30, - start_date: datetime.date | None | Unset = UNSET, - end_date: datetime.date | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ( - GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet - | HTTPValidationError - | None -): - """Get Memory Bank Entry Stats - - Return aggregated entry statistics for a memory bank, including total counts, token/age/entries-per- - key distributions (avg, p95, min, max), and top conversation keys, group keys, speakers, and tags. - Supports time-range filtering via `days`, `start_date`, and `end_date` query parameters. - - Args: - memory_bank_id (str): - days (int | Unset): Default: 30. - start_date (datetime.date | None | Unset): - end_date (datetime.date | None | Unset): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet | HTTPValidationError - """ - - return ( - await asyncio_detailed( - memory_bank_id=memory_bank_id, - client=client, - days=days, - start_date=start_date, - end_date=end_date, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/list_memory_banks_api_memory_banks_get.py b/seclai/_generated/api/memory_banks/list_memory_banks_api_memory_banks_get.py deleted file mode 100644 index 3c2e752..0000000 --- a/seclai/_generated/api/memory_banks/list_memory_banks_api_memory_banks_get.py +++ /dev/null @@ -1,293 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.memory_bank_list_response_model import MemoryBankListResponseModel -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - type_: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - params["sort"] = sort - - params["order"] = order - - json_type_: None | str | Unset - if isinstance(type_, Unset): - json_type_ = UNSET - else: - json_type_ = type_ - params["type"] = json_type_ - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/memory_banks", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBankListResponseModel | None: - if response.status_code == 200: - response_200 = MemoryBankListResponseModel.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBankListResponseModel]: - 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: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - type_: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankListResponseModel]: - """List Memory Banks - - List memory banks for the account. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - page (int | Unset): Page number (1-based). Default: 1. - limit (int | Unset): Items per page. Default: 20. - sort (str | Unset): Sort field. One of: created_at, updated_at, name. Default: - 'created_at'. - order (str | Unset): Sort direction: asc or desc. Default: 'desc'. - type_ (None | str | Unset): Filter by bank type: conversation or general. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBankListResponseModel] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - sort=sort, - order=order, - type_=type_, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - type_: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankListResponseModel | None: - """List Memory Banks - - List memory banks for the account. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - page (int | Unset): Page number (1-based). Default: 1. - limit (int | Unset): Items per page. Default: 20. - sort (str | Unset): Sort field. One of: created_at, updated_at, name. Default: - 'created_at'. - order (str | Unset): Sort direction: asc or desc. Default: 'desc'. - type_ (None | str | Unset): Filter by bank type: conversation or general. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBankListResponseModel - """ - - return sync_detailed( - client=client, - page=page, - limit=limit, - sort=sort, - order=order, - type_=type_, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - type_: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankListResponseModel]: - """List Memory Banks - - List memory banks for the account. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - page (int | Unset): Page number (1-based). Default: 1. - limit (int | Unset): Items per page. Default: 20. - sort (str | Unset): Sort field. One of: created_at, updated_at, name. Default: - 'created_at'. - order (str | Unset): Sort direction: asc or desc. Default: 'desc'. - type_ (None | str | Unset): Filter by bank type: conversation or general. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBankListResponseModel] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - sort=sort, - order=order, - type_=type_, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - type_: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankListResponseModel | None: - """List Memory Banks - - List memory banks for the account. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's - account. - - Args: - page (int | Unset): Page number (1-based). Default: 1. - limit (int | Unset): Items per page. Default: 20. - sort (str | Unset): Sort field. One of: created_at, updated_at, name. Default: - 'created_at'. - order (str | Unset): Sort direction: asc or desc. Default: 'desc'. - type_ (None | str | Unset): Filter by bank type: conversation or general. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBankListResponseModel - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - limit=limit, - sort=sort, - order=order, - type_=type_, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/list_templates_api_memory_banks_templates_get.py b/seclai/_generated/api/memory_banks/list_templates_api_memory_banks_templates_get.py deleted file mode 100644 index 2f13e03..0000000 --- a/seclai/_generated/api/memory_banks/list_templates_api_memory_banks_templates_get.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/memory_banks/templates", - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | None: - if response.status_code == 200: - return None - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any]: - 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: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any]: - """List Templates - - Return pre-built template configurations for common memory bank use cases. - - Each template includes a name, description, suggested use case, and full default settings that can - be used directly with the create endpoint. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any]: - """List Templates - - Return pre-built template configurations for common memory bank use cases. - - Each template includes a name, description, suggested use case, and full default settings that can - be used directly with the create endpoint. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) diff --git a/seclai/_generated/api/memory_banks/memory_bank_ai_accept_api_memory_banks_ai_assistant_conversation_id_patch.py b/seclai/_generated/api/memory_banks/memory_bank_ai_accept_api_memory_banks_ai_assistant_conversation_id_patch.py deleted file mode 100644 index 342ebbc..0000000 --- a/seclai/_generated/api/memory_banks/memory_bank_ai_accept_api_memory_banks_ai_assistant_conversation_id_patch.py +++ /dev/null @@ -1,238 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.memory_bank_accept_request import MemoryBankAcceptRequest -from ...models.ok_response import OkResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - conversation_id: UUID, - *, - body: MemoryBankAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/memory_banks/ai-assistant/{conversation_id}".format( - conversation_id=quote(str(conversation_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | OkResponse | None: - if response.status_code == 200: - response_200 = OkResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | OkResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: MemoryBankAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OkResponse]: - """Accept or decline a memory bank AI suggestion - - Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to - true to accept the proposed configuration, or false to decline it. The accepted status is recorded - for audit purposes. - - Auth: requires `X-API-Key` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAcceptRequest): Accept or decline a memory bank AI suggestion. - - 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 | OkResponse] - """ - - kwargs = _get_kwargs( - conversation_id=conversation_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: MemoryBankAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OkResponse | None: - """Accept or decline a memory bank AI suggestion - - Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to - true to accept the proposed configuration, or false to decline it. The accepted status is recorded - for audit purposes. - - Auth: requires `X-API-Key` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAcceptRequest): Accept or decline a memory bank AI suggestion. - - 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 | OkResponse - """ - - return sync_detailed( - conversation_id=conversation_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: MemoryBankAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | OkResponse]: - """Accept or decline a memory bank AI suggestion - - Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to - true to accept the proposed configuration, or false to decline it. The accepted status is recorded - for audit purposes. - - Auth: requires `X-API-Key` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAcceptRequest): Accept or decline a memory bank AI suggestion. - - 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 | OkResponse] - """ - - kwargs = _get_kwargs( - conversation_id=conversation_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: MemoryBankAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | OkResponse | None: - """Accept or decline a memory bank AI suggestion - - Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to - true to accept the proposed configuration, or false to decline it. The accepted status is recorded - for audit purposes. - - Auth: requires `X-API-Key` header or OAuth Bearer token. - - Args: - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAcceptRequest): Accept or decline a memory bank AI suggestion. - - 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 | OkResponse - """ - - return ( - await asyncio_detailed( - conversation_id=conversation_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/memory_bank_ai_generate_api_memory_banks_ai_assistant_post.py b/seclai/_generated/api/memory_banks/memory_bank_ai_generate_api_memory_banks_ai_assistant_post.py deleted file mode 100644 index 5701975..0000000 --- a/seclai/_generated/api/memory_banks/memory_bank_ai_generate_api_memory_banks_ai_assistant_post.py +++ /dev/null @@ -1,222 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.memory_bank_ai_assistant_request import MemoryBankAiAssistantRequest -from ...models.memory_bank_ai_assistant_response import MemoryBankAiAssistantResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: MemoryBankAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/memory_banks/ai-assistant", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | MemoryBankAiAssistantResponse | None: - if response.status_code == 200: - response_200 = MemoryBankAiAssistantResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = cast(Any, None) - return response_400 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | MemoryBankAiAssistantResponse]: - 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: AuthenticatedClient | Client, - body: MemoryBankAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | MemoryBankAiAssistantResponse]: - """Generate a memory bank configuration - - Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, - mode, compaction prompt, and retention settings based on the user's description. - - Auth: requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAiAssistantRequest): Request body for the memory bank AI assistant. - - 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 | MemoryBankAiAssistantResponse] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: MemoryBankAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | MemoryBankAiAssistantResponse | None: - """Generate a memory bank configuration - - Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, - mode, compaction prompt, and retention settings based on the user's description. - - Auth: requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAiAssistantRequest): Request body for the memory bank AI assistant. - - 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 | MemoryBankAiAssistantResponse - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: MemoryBankAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | MemoryBankAiAssistantResponse]: - """Generate a memory bank configuration - - Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, - mode, compaction prompt, and retention settings based on the user's description. - - Auth: requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAiAssistantRequest): Request body for the memory bank AI assistant. - - 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 | MemoryBankAiAssistantResponse] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: MemoryBankAiAssistantRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | MemoryBankAiAssistantResponse | None: - """Generate a memory bank configuration - - Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, - mode, compaction prompt, and retention settings based on the user's description. - - Auth: requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MemoryBankAiAssistantRequest): Request body for the memory bank AI assistant. - - 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 | MemoryBankAiAssistantResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/memory_bank_ai_last_conversation_api_memory_banks_ai_assistant_last_conversation_get.py b/seclai/_generated/api/memory_banks/memory_bank_ai_last_conversation_api_memory_banks_ai_assistant_last_conversation_get.py deleted file mode 100644 index 591ba3f..0000000 --- a/seclai/_generated/api/memory_banks/memory_bank_ai_last_conversation_api_memory_banks_ai_assistant_last_conversation_get.py +++ /dev/null @@ -1,237 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.memory_bank_last_conversation_response import ( - MemoryBankLastConversationResponse, -) -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - limit: int | Unset = 5, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["limit"] = limit - - params["offset"] = offset - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/memory_banks/ai-assistant/last-conversation", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBankLastConversationResponse | None: - if response.status_code == 200: - response_200 = MemoryBankLastConversationResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBankLastConversationResponse]: - 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: AuthenticatedClient | Client, - limit: int | Unset = 5, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankLastConversationResponse]: - """Fetch memory bank AI conversation history - - Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports - pagination via limit/offset. - - Auth: requires `X-API-Key` header or OAuth Bearer token. - - Args: - limit (int | Unset): Max turns to return. Default: 5. - offset (int | Unset): Number of most-recent turns to skip. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBankLastConversationResponse] - """ - - kwargs = _get_kwargs( - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - limit: int | Unset = 5, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankLastConversationResponse | None: - """Fetch memory bank AI conversation history - - Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports - pagination via limit/offset. - - Auth: requires `X-API-Key` header or OAuth Bearer token. - - Args: - limit (int | Unset): Max turns to return. Default: 5. - offset (int | Unset): Number of most-recent turns to skip. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBankLastConversationResponse - """ - - return sync_detailed( - client=client, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - limit: int | Unset = 5, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBankLastConversationResponse]: - """Fetch memory bank AI conversation history - - Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports - pagination via limit/offset. - - Auth: requires `X-API-Key` header or OAuth Bearer token. - - Args: - limit (int | Unset): Max turns to return. Default: 5. - offset (int | Unset): Number of most-recent turns to skip. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBankLastConversationResponse] - """ - - kwargs = _get_kwargs( - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - limit: int | Unset = 5, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBankLastConversationResponse | None: - """Fetch memory bank AI conversation history - - Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports - pagination via limit/offset. - - Auth: requires `X-API-Key` header or OAuth Bearer token. - - Args: - limit (int | Unset): Max turns to return. Default: 5. - offset (int | Unset): Number of most-recent turns to skip. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | MemoryBankLastConversationResponse - """ - - return ( - await asyncio_detailed( - client=client, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/test_compaction_prompt_api_memory_banks_memory_bank_id_test_compaction_post.py b/seclai/_generated/api/memory_banks/test_compaction_prompt_api_memory_banks_memory_bank_id_test_compaction_post.py deleted file mode 100644 index 68ce20b..0000000 --- a/seclai/_generated/api/memory_banks/test_compaction_prompt_api_memory_banks_memory_bank_id_test_compaction_post.py +++ /dev/null @@ -1,278 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.compaction_test_response_model import CompactionTestResponseModel -from ...models.http_validation_error import HTTPValidationError -from ...models.test_compaction_request import TestCompactionRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - memory_bank_id: str, - *, - body: TestCompactionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/memory_banks/{memory_bank_id}/test-compaction".format( - memory_bank_id=quote(str(memory_bank_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CompactionTestResponseModel | HTTPValidationError | None: - if response.status_code == 200: - response_200 = CompactionTestResponseModel.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CompactionTestResponseModel | 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( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - body: TestCompactionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CompactionTestResponseModel | HTTPValidationError]: - """Test Compaction Prompt - - Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. - Returns original entries, compaction summary, surviving entries, and a structured quality evaluation - with verdict, score, and reasoning. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (TestCompactionRequest): Request body for testing a compaction prompt against an - existing bank. - - The user may supply a ``compaction_prompt`` to override (or provide when - the bank has none). Content can come from three sources: - - 1. Existing entries in the bank (default when neither field is set). - 2. ``sample_entries`` – caller-provided list of strings. - 3. ``generate_direction`` – an instruction to the LLM to generate sample - memory entries. Useful for trying a prompt before any real data - exists. - - At most one of ``sample_entries`` / ``generate_direction`` may be given. - - 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[CompactionTestResponseModel | HTTPValidationError] - """ - - kwargs = _get_kwargs( - memory_bank_id=memory_bank_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - body: TestCompactionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CompactionTestResponseModel | HTTPValidationError | None: - """Test Compaction Prompt - - Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. - Returns original entries, compaction summary, surviving entries, and a structured quality evaluation - with verdict, score, and reasoning. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (TestCompactionRequest): Request body for testing a compaction prompt against an - existing bank. - - The user may supply a ``compaction_prompt`` to override (or provide when - the bank has none). Content can come from three sources: - - 1. Existing entries in the bank (default when neither field is set). - 2. ``sample_entries`` – caller-provided list of strings. - 3. ``generate_direction`` – an instruction to the LLM to generate sample - memory entries. Useful for trying a prompt before any real data - exists. - - At most one of ``sample_entries`` / ``generate_direction`` may be given. - - 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: - CompactionTestResponseModel | HTTPValidationError - """ - - return sync_detailed( - memory_bank_id=memory_bank_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - body: TestCompactionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CompactionTestResponseModel | HTTPValidationError]: - """Test Compaction Prompt - - Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. - Returns original entries, compaction summary, surviving entries, and a structured quality evaluation - with verdict, score, and reasoning. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (TestCompactionRequest): Request body for testing a compaction prompt against an - existing bank. - - The user may supply a ``compaction_prompt`` to override (or provide when - the bank has none). Content can come from three sources: - - 1. Existing entries in the bank (default when neither field is set). - 2. ``sample_entries`` – caller-provided list of strings. - 3. ``generate_direction`` – an instruction to the LLM to generate sample - memory entries. Useful for trying a prompt before any real data - exists. - - At most one of ``sample_entries`` / ``generate_direction`` may be given. - - 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[CompactionTestResponseModel | HTTPValidationError] - """ - - kwargs = _get_kwargs( - memory_bank_id=memory_bank_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - body: TestCompactionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CompactionTestResponseModel | HTTPValidationError | None: - """Test Compaction Prompt - - Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. - Returns original entries, compaction summary, surviving entries, and a structured quality evaluation - with verdict, score, and reasoning. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (TestCompactionRequest): Request body for testing a compaction prompt against an - existing bank. - - The user may supply a ``compaction_prompt`` to override (or provide when - the bank has none). Content can come from three sources: - - 1. Existing entries in the bank (default when neither field is set). - 2. ``sample_entries`` – caller-provided list of strings. - 3. ``generate_direction`` – an instruction to the LLM to generate sample - memory entries. Useful for trying a prompt before any real data - exists. - - At most one of ``sample_entries`` / ``generate_direction`` may be given. - - 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: - CompactionTestResponseModel | HTTPValidationError - """ - - return ( - await asyncio_detailed( - memory_bank_id=memory_bank_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/test_compaction_prompt_standalone_api_memory_banks_test_compaction_post.py b/seclai/_generated/api/memory_banks/test_compaction_prompt_standalone_api_memory_banks_test_compaction_post.py deleted file mode 100644 index d4096b4..0000000 --- a/seclai/_generated/api/memory_banks/test_compaction_prompt_standalone_api_memory_banks_test_compaction_post.py +++ /dev/null @@ -1,238 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.compaction_test_response_model import CompactionTestResponseModel -from ...models.http_validation_error import HTTPValidationError -from ...models.standalone_test_compaction_request import StandaloneTestCompactionRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: StandaloneTestCompactionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/memory_banks/test-compaction", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CompactionTestResponseModel | HTTPValidationError | None: - if response.status_code == 200: - response_200 = CompactionTestResponseModel.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CompactionTestResponseModel | 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: AuthenticatedClient | Client, - body: StandaloneTestCompactionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CompactionTestResponseModel | HTTPValidationError]: - """Test Compaction Prompt Standalone - - Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. - Returns original entries, compaction summary, surviving entries, and a structured quality evaluation - with verdict, score, and reasoning. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (StandaloneTestCompactionRequest): Request body for testing a compaction prompt - *without* an existing bank. - - Used on the create-memory-bank page where no bank ID exists yet. - ``compaction_prompt`` is required (no bank to fall back to). - Content must come from ``sample_entries`` or ``generate_direction`` - (no existing entries to fetch). - - 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[CompactionTestResponseModel | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: StandaloneTestCompactionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CompactionTestResponseModel | HTTPValidationError | None: - """Test Compaction Prompt Standalone - - Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. - Returns original entries, compaction summary, surviving entries, and a structured quality evaluation - with verdict, score, and reasoning. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (StandaloneTestCompactionRequest): Request body for testing a compaction prompt - *without* an existing bank. - - Used on the create-memory-bank page where no bank ID exists yet. - ``compaction_prompt`` is required (no bank to fall back to). - Content must come from ``sample_entries`` or ``generate_direction`` - (no existing entries to fetch). - - 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: - CompactionTestResponseModel | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: StandaloneTestCompactionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CompactionTestResponseModel | HTTPValidationError]: - """Test Compaction Prompt Standalone - - Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. - Returns original entries, compaction summary, surviving entries, and a structured quality evaluation - with verdict, score, and reasoning. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (StandaloneTestCompactionRequest): Request body for testing a compaction prompt - *without* an existing bank. - - Used on the create-memory-bank page where no bank ID exists yet. - ``compaction_prompt`` is required (no bank to fall back to). - Content must come from ``sample_entries`` or ``generate_direction`` - (no existing entries to fetch). - - 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[CompactionTestResponseModel | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: StandaloneTestCompactionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CompactionTestResponseModel | HTTPValidationError | None: - """Test Compaction Prompt Standalone - - Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. - Returns original entries, compaction summary, surviving entries, and a structured quality evaluation - with verdict, score, and reasoning. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (StandaloneTestCompactionRequest): Request body for testing a compaction prompt - *without* an existing bank. - - Used on the create-memory-bank page where no bank ID exists yet. - ``compaction_prompt`` is required (no bank to fall back to). - Content must come from ``sample_entries`` or ``generate_direction`` - (no existing entries to fetch). - - 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: - CompactionTestResponseModel | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/memory_banks/update_memory_bank_api_memory_banks_memory_bank_id_put.py b/seclai/_generated/api/memory_banks/update_memory_bank_api_memory_banks_memory_bank_id_put.py deleted file mode 100644 index ea1c237..0000000 --- a/seclai/_generated/api/memory_banks/update_memory_bank_api_memory_banks_memory_bank_id_put.py +++ /dev/null @@ -1,250 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.memory_bank import MemoryBank -from ...models.update_memory_bank_body import UpdateMemoryBankBody -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - memory_bank_id: str, - *, - body: UpdateMemoryBankBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/memory_banks/{memory_bank_id}".format( - memory_bank_id=quote(str(memory_bank_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | MemoryBank | None: - if response.status_code == 200: - response_200 = MemoryBank.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | MemoryBank]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateMemoryBankBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBank]: - """Update Memory Bank - - Update a memory bank's configuration. Only provided fields are changed; omitted fields are left - unchanged. - - Note: the embedding `mode` cannot be changed after creation because it determines the vector - dimensions used to store entries. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateMemoryBankBody): Request body for updating a memory bank. - - Omitted fields are left unchanged. To **clear** a field back to null, - send a zero-value sentinel: ``0`` for integers, ``""`` for strings. - - 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 | MemoryBank] - """ - - kwargs = _get_kwargs( - memory_bank_id=memory_bank_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateMemoryBankBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBank | None: - """Update Memory Bank - - Update a memory bank's configuration. Only provided fields are changed; omitted fields are left - unchanged. - - Note: the embedding `mode` cannot be changed after creation because it determines the vector - dimensions used to store entries. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateMemoryBankBody): Request body for updating a memory bank. - - Omitted fields are left unchanged. To **clear** a field back to null, - send a zero-value sentinel: ``0`` for integers, ``""`` for strings. - - 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 | MemoryBank - """ - - return sync_detailed( - memory_bank_id=memory_bank_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateMemoryBankBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | MemoryBank]: - """Update Memory Bank - - Update a memory bank's configuration. Only provided fields are changed; omitted fields are left - unchanged. - - Note: the embedding `mode` cannot be changed after creation because it determines the vector - dimensions used to store entries. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateMemoryBankBody): Request body for updating a memory bank. - - Omitted fields are left unchanged. To **clear** a field back to null, - send a zero-value sentinel: ``0`` for integers, ``""`` for strings. - - 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 | MemoryBank] - """ - - kwargs = _get_kwargs( - memory_bank_id=memory_bank_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - memory_bank_id: str, - *, - client: AuthenticatedClient | Client, - body: UpdateMemoryBankBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | MemoryBank | None: - """Update Memory Bank - - Update a memory bank's configuration. Only provided fields are changed; omitted fields are left - unchanged. - - Note: the embedding `mode` cannot be changed after creation because it determines the vector - dimensions used to store entries. - - Args: - memory_bank_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateMemoryBankBody): Request body for updating a memory bank. - - Omitted fields are left unchanged. To **clear** a field back to null, - send a zero-value sentinel: ``0`` for integers, ``""`` for strings. - - 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 | MemoryBank - """ - - return ( - await asyncio_detailed( - memory_bank_id=memory_bank_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/models/__init__.py b/seclai/_generated/api/models/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/models/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/models/cancel_experiment_endpoint_api_models_playground_experiments_experiment_id_cancel_post.py b/seclai/_generated/api/models/cancel_experiment_endpoint_api_models_playground_experiments_experiment_id_cancel_post.py deleted file mode 100644 index 89bc106..0000000 --- a/seclai/_generated/api/models/cancel_experiment_endpoint_api_models_playground_experiments_experiment_id_cancel_post.py +++ /dev/null @@ -1,228 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.cancel_experiment_response import CancelExperimentResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - experiment_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/models/playground/experiments/{experiment_id}/cancel".format( - experiment_id=quote(str(experiment_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CancelExperimentResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = CancelExperimentResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CancelExperimentResponse | 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( - experiment_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CancelExperimentResponse | HTTPValidationError]: - """Cancel Experiment Endpoint - - Cancel a running or pending model playground experiment. - - Signals running model calls to abort and marks the experiment as canceled. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. - - Args: - experiment_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[CancelExperimentResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - experiment_id=experiment_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - experiment_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CancelExperimentResponse | HTTPValidationError | None: - """Cancel Experiment Endpoint - - Cancel a running or pending model playground experiment. - - Signals running model calls to abort and marks the experiment as canceled. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. - - Args: - experiment_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - CancelExperimentResponse | HTTPValidationError - """ - - return sync_detailed( - experiment_id=experiment_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - experiment_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CancelExperimentResponse | HTTPValidationError]: - """Cancel Experiment Endpoint - - Cancel a running or pending model playground experiment. - - Signals running model calls to abort and marks the experiment as canceled. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. - - Args: - experiment_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[CancelExperimentResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - experiment_id=experiment_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - experiment_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CancelExperimentResponse | HTTPValidationError | None: - """Cancel Experiment Endpoint - - Cancel a running or pending model playground experiment. - - Signals running model calls to abort and marks the experiment as canceled. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. - - Args: - experiment_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - CancelExperimentResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - experiment_id=experiment_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/models/create_experiment_api_models_playground_experiments_post.py b/seclai/_generated/api/models/create_experiment_api_models_playground_experiments_post.py deleted file mode 100644 index cf6e09c..0000000 --- a/seclai/_generated/api/models/create_experiment_api_models_playground_experiments_post.py +++ /dev/null @@ -1,230 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_experiment_response import CreateExperimentResponse -from ...models.http_validation_error import HTTPValidationError -from ...models.playground_create_request import PlaygroundCreateRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: PlaygroundCreateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/models/playground/experiments", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateExperimentResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = CreateExperimentResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateExperimentResponse | 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: AuthenticatedClient | Client, - body: PlaygroundCreateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CreateExperimentResponse | HTTPValidationError]: - """Create Experiment - - Create and schedule a model playground experiment. - - Runs the given prompt against 1-10 models in parallel and optionally evaluates the outputs with an - LLM judge. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (PlaygroundCreateRequest): Create a model playground experiment via the public API. - - 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[CreateExperimentResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: PlaygroundCreateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CreateExperimentResponse | HTTPValidationError | None: - """Create Experiment - - Create and schedule a model playground experiment. - - Runs the given prompt against 1-10 models in parallel and optionally evaluates the outputs with an - LLM judge. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (PlaygroundCreateRequest): Create a model playground experiment via the public API. - - 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: - CreateExperimentResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: PlaygroundCreateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[CreateExperimentResponse | HTTPValidationError]: - """Create Experiment - - Create and schedule a model playground experiment. - - Runs the given prompt against 1-10 models in parallel and optionally evaluates the outputs with an - LLM judge. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (PlaygroundCreateRequest): Create a model playground experiment via the public API. - - 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[CreateExperimentResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: PlaygroundCreateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> CreateExperimentResponse | HTTPValidationError | None: - """Create Experiment - - Create and schedule a model playground experiment. - - Runs the given prompt against 1-10 models in parallel and optionally evaluates the outputs with an - LLM judge. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (PlaygroundCreateRequest): Create a model playground experiment via the public API. - - 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: - CreateExperimentResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/models/delete_experiment_endpoint_api_models_playground_experiments_experiment_id_delete.py b/seclai/_generated/api/models/delete_experiment_endpoint_api_models_playground_experiments_experiment_id_delete.py deleted file mode 100644 index 0e6b53f..0000000 --- a/seclai/_generated/api/models/delete_experiment_endpoint_api_models_playground_experiments_experiment_id_delete.py +++ /dev/null @@ -1,226 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - experiment_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/models/playground/experiments/{experiment_id}".format( - experiment_id=quote(str(experiment_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - experiment_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete Experiment Endpoint - - Soft-delete a model playground experiment. - - Removes the experiment from list/detail views while preserving audit history. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's - account. - - Args: - experiment_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - experiment_id=experiment_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - experiment_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete Experiment Endpoint - - Soft-delete a model playground experiment. - - Removes the experiment from list/detail views while preserving audit history. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's - account. - - Args: - experiment_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - experiment_id=experiment_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - experiment_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete Experiment Endpoint - - Soft-delete a model playground experiment. - - Removes the experiment from list/detail views while preserving audit history. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's - account. - - Args: - experiment_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - experiment_id=experiment_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - experiment_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete Experiment Endpoint - - Soft-delete a model playground experiment. - - Removes the experiment from list/detail views while preserving audit history. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's - account. - - Args: - experiment_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - experiment_id=experiment_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/models/get_alert_unread_count_api_models_alerts_unread_count_get.py b/seclai/_generated/api/models/get_alert_unread_count_api_models_alerts_unread_count_get.py deleted file mode 100644 index 25a65f1..0000000 --- a/seclai/_generated/api/models/get_alert_unread_count_api_models_alerts_unread_count_get.py +++ /dev/null @@ -1,202 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.unread_count_response import UnreadCountResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/models/alerts/unread-count", - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> UnreadCountResponse | None: - if response.status_code == 200: - response_200 = UnreadCountResponse.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[UnreadCountResponse]: - 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: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[UnreadCountResponse]: - """Get Alert Unread Count - - Get the count of unread model lifecycle alerts. - - Useful for badge indicators in UIs and dashboards. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Count is scoped to the caller's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[UnreadCountResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> UnreadCountResponse | None: - """Get Alert Unread Count - - Get the count of unread model lifecycle alerts. - - Useful for badge indicators in UIs and dashboards. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Count is scoped to the caller's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - UnreadCountResponse - """ - - return sync_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[UnreadCountResponse]: - """Get Alert Unread Count - - Get the count of unread model lifecycle alerts. - - Useful for badge indicators in UIs and dashboards. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Count is scoped to the caller's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[UnreadCountResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> UnreadCountResponse | None: - """Get Alert Unread Count - - Get the count of unread model lifecycle alerts. - - Useful for badge indicators in UIs and dashboards. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Count is scoped to the caller's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - UnreadCountResponse - """ - - return ( - await asyncio_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/models/get_experiment_api_models_playground_experiments_experiment_id_get.py b/seclai/_generated/api/models/get_experiment_api_models_playground_experiments_experiment_id_get.py deleted file mode 100644 index 4c59601..0000000 --- a/seclai/_generated/api/models/get_experiment_api_models_playground_experiments_experiment_id_get.py +++ /dev/null @@ -1,232 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.experiment_detail_response import ExperimentDetailResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - experiment_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/models/playground/experiments/{experiment_id}".format( - experiment_id=quote(str(experiment_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ExperimentDetailResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = ExperimentDetailResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ExperimentDetailResponse | 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( - experiment_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ExperimentDetailResponse | HTTPValidationError]: - """Get Experiment - - Get details and results for a specific model playground experiment. - - Returns the full experiment payload including prompt, model outputs, and evaluation results (if - available). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. - - Args: - experiment_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ExperimentDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - experiment_id=experiment_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - experiment_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ExperimentDetailResponse | HTTPValidationError | None: - """Get Experiment - - Get details and results for a specific model playground experiment. - - Returns the full experiment payload including prompt, model outputs, and evaluation results (if - available). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. - - Args: - experiment_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ExperimentDetailResponse | HTTPValidationError - """ - - return sync_detailed( - experiment_id=experiment_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - experiment_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ExperimentDetailResponse | HTTPValidationError]: - """Get Experiment - - Get details and results for a specific model playground experiment. - - Returns the full experiment payload including prompt, model outputs, and evaluation results (if - available). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. - - Args: - experiment_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ExperimentDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - experiment_id=experiment_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - experiment_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ExperimentDetailResponse | HTTPValidationError | None: - """Get Experiment - - Get details and results for a specific model playground experiment. - - Returns the full experiment payload including prompt, model outputs, and evaluation results (if - available). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's - account. - - Args: - experiment_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ExperimentDetailResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - experiment_id=experiment_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/models/get_generation_tiers_api_models_generation_tiers_get.py b/seclai/_generated/api/models/get_generation_tiers_api_models_generation_tiers_get.py deleted file mode 100644 index 1fda8e9..0000000 --- a/seclai/_generated/api/models/get_generation_tiers_api_models_generation_tiers_get.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.generation_tier_list_response import GenerationTierListResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/models/generation-tiers", - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GenerationTierListResponse | None: - if response.status_code == 200: - response_200 = GenerationTierListResponse.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GenerationTierListResponse]: - 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: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[GenerationTierListResponse]: - """Get Generation Tiers - - List the media-generation quality tiers and the model + cost each resolves to. - - On a prompt_call's `media_generation` tool — and the dedicated generate_* steps via tier routing — - the author/LLM chooses a *tier* (fast/balanced/thorough), never a model. This is the surface that - maps each `(modality, tier)` to its concrete generator, raw `credits_per_unit`, `unit_label`, and a - human-readable scaled `price_label`. Global routing/pricing (the same for every account); read-only. - REST parity with the `list_generation_tiers` MCP tool. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[GenerationTierListResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> GenerationTierListResponse | None: - """Get Generation Tiers - - List the media-generation quality tiers and the model + cost each resolves to. - - On a prompt_call's `media_generation` tool — and the dedicated generate_* steps via tier routing — - the author/LLM chooses a *tier* (fast/balanced/thorough), never a model. This is the surface that - maps each `(modality, tier)` to its concrete generator, raw `credits_per_unit`, `unit_label`, and a - human-readable scaled `price_label`. Global routing/pricing (the same for every account); read-only. - REST parity with the `list_generation_tiers` MCP tool. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - GenerationTierListResponse - """ - - return sync_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[GenerationTierListResponse]: - """Get Generation Tiers - - List the media-generation quality tiers and the model + cost each resolves to. - - On a prompt_call's `media_generation` tool — and the dedicated generate_* steps via tier routing — - the author/LLM chooses a *tier* (fast/balanced/thorough), never a model. This is the surface that - maps each `(modality, tier)` to its concrete generator, raw `credits_per_unit`, `unit_label`, and a - human-readable scaled `price_label`. Global routing/pricing (the same for every account); read-only. - REST parity with the `list_generation_tiers` MCP tool. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[GenerationTierListResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> GenerationTierListResponse | None: - """Get Generation Tiers - - List the media-generation quality tiers and the model + cost each resolves to. - - On a prompt_call's `media_generation` tool — and the dedicated generate_* steps via tier routing — - the author/LLM chooses a *tier* (fast/balanced/thorough), never a model. This is the surface that - maps each `(modality, tier)` to its concrete generator, raw `credits_per_unit`, `unit_label`, and a - human-readable scaled `price_label`. Global routing/pricing (the same for every account); read-only. - REST parity with the `list_generation_tiers` MCP tool. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - GenerationTierListResponse - """ - - return ( - await asyncio_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/models/get_model_api_models_model_id_details_get.py b/seclai/_generated/api/models/get_model_api_models_model_id_details_get.py deleted file mode 100644 index 45bf1fb..0000000 --- a/seclai/_generated/api/models/get_model_api_models_model_id_details_get.py +++ /dev/null @@ -1,236 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.prompt_model_response import PromptModelResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - model_id: str, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/models/{model_id}/details".format( - model_id=quote(str(model_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | PromptModelResponse | None: - if response.status_code == 200: - response_200 = PromptModelResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | PromptModelResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - model_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | PromptModelResponse]: - """Get Model - - Get detailed information about a specific model. - - Returns full model details including capabilities, credit pricing, tool support, variant tiers, and - lifecycle status. - - The `model_id` is the model enum identifier (e.g. 'anthropic_claude_opus_4_6'). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - model_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | PromptModelResponse] - """ - - kwargs = _get_kwargs( - model_id=model_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - model_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | PromptModelResponse | None: - """Get Model - - Get detailed information about a specific model. - - Returns full model details including capabilities, credit pricing, tool support, variant tiers, and - lifecycle status. - - The `model_id` is the model enum identifier (e.g. 'anthropic_claude_opus_4_6'). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - model_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | PromptModelResponse - """ - - return sync_detailed( - model_id=model_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - model_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | PromptModelResponse]: - """Get Model - - Get detailed information about a specific model. - - Returns full model details including capabilities, credit pricing, tool support, variant tiers, and - lifecycle status. - - The `model_id` is the model enum identifier (e.g. 'anthropic_claude_opus_4_6'). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - model_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | PromptModelResponse] - """ - - kwargs = _get_kwargs( - model_id=model_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - model_id: str, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | PromptModelResponse | None: - """Get Model - - Get detailed information about a specific model. - - Returns full model details including capabilities, credit pricing, tool support, variant tiers, and - lifecycle status. - - The `model_id` is the model enum identifier (e.g. 'anthropic_claude_opus_4_6'). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - model_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | PromptModelResponse - """ - - return ( - await asyncio_detailed( - model_id=model_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/models/get_recommendations_api_models_model_id_recommendations_get.py b/seclai/_generated/api/models/get_recommendations_api_models_model_id_recommendations_get.py deleted file mode 100644 index e58a035..0000000 --- a/seclai/_generated/api/models/get_recommendations_api_models_model_id_recommendations_get.py +++ /dev/null @@ -1,341 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.model_recommendations_response import ModelRecommendationsResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - model_id: str, - *, - require_tool_use: bool | None | Unset = UNSET, - require_structured_output: bool | None | Unset = UNSET, - require_thinking: bool | None | Unset = UNSET, - min_context_tokens: int | None | Unset = UNSET, - min_output_tokens: int | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - json_require_tool_use: bool | None | Unset - if isinstance(require_tool_use, Unset): - json_require_tool_use = UNSET - else: - json_require_tool_use = require_tool_use - params["require_tool_use"] = json_require_tool_use - - json_require_structured_output: bool | None | Unset - if isinstance(require_structured_output, Unset): - json_require_structured_output = UNSET - else: - json_require_structured_output = require_structured_output - params["require_structured_output"] = json_require_structured_output - - json_require_thinking: bool | None | Unset - if isinstance(require_thinking, Unset): - json_require_thinking = UNSET - else: - json_require_thinking = require_thinking - params["require_thinking"] = json_require_thinking - - json_min_context_tokens: int | None | Unset - if isinstance(min_context_tokens, Unset): - json_min_context_tokens = UNSET - else: - json_min_context_tokens = min_context_tokens - params["min_context_tokens"] = json_min_context_tokens - - json_min_output_tokens: int | None | Unset - if isinstance(min_output_tokens, Unset): - json_min_output_tokens = UNSET - else: - json_min_output_tokens = min_output_tokens - params["min_output_tokens"] = json_min_output_tokens - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/models/{model_id}/recommendations".format( - model_id=quote(str(model_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | ModelRecommendationsResponse | None: - if response.status_code == 200: - response_200 = ModelRecommendationsResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | ModelRecommendationsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - model_id: str, - *, - client: AuthenticatedClient | Client, - require_tool_use: bool | None | Unset = UNSET, - require_structured_output: bool | None | Unset = UNSET, - require_thinking: bool | None | Unset = UNSET, - min_context_tokens: int | None | Unset = UNSET, - min_output_tokens: int | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | ModelRecommendationsResponse]: - """Get Recommendations - - Get replacement/upgrade recommendations for a model. - - Returns a designated successor (if any), same-family upgrades, and cross-provider/cross-family - alternatives. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - model_id (str): - require_tool_use (bool | None | Unset): Only recommend models that support tool use. - require_structured_output (bool | None | Unset): Only recommend models that support - structured output. - require_thinking (bool | None | Unset): Only recommend models that support - thinking/reasoning. - min_context_tokens (int | None | Unset): Minimum context window size in tokens. - min_output_tokens (int | None | Unset): Minimum output token limit. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | ModelRecommendationsResponse] - """ - - kwargs = _get_kwargs( - model_id=model_id, - require_tool_use=require_tool_use, - require_structured_output=require_structured_output, - require_thinking=require_thinking, - min_context_tokens=min_context_tokens, - min_output_tokens=min_output_tokens, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - model_id: str, - *, - client: AuthenticatedClient | Client, - require_tool_use: bool | None | Unset = UNSET, - require_structured_output: bool | None | Unset = UNSET, - require_thinking: bool | None | Unset = UNSET, - min_context_tokens: int | None | Unset = UNSET, - min_output_tokens: int | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | ModelRecommendationsResponse | None: - """Get Recommendations - - Get replacement/upgrade recommendations for a model. - - Returns a designated successor (if any), same-family upgrades, and cross-provider/cross-family - alternatives. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - model_id (str): - require_tool_use (bool | None | Unset): Only recommend models that support tool use. - require_structured_output (bool | None | Unset): Only recommend models that support - structured output. - require_thinking (bool | None | Unset): Only recommend models that support - thinking/reasoning. - min_context_tokens (int | None | Unset): Minimum context window size in tokens. - min_output_tokens (int | None | Unset): Minimum output token limit. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | ModelRecommendationsResponse - """ - - return sync_detailed( - model_id=model_id, - client=client, - require_tool_use=require_tool_use, - require_structured_output=require_structured_output, - require_thinking=require_thinking, - min_context_tokens=min_context_tokens, - min_output_tokens=min_output_tokens, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - model_id: str, - *, - client: AuthenticatedClient | Client, - require_tool_use: bool | None | Unset = UNSET, - require_structured_output: bool | None | Unset = UNSET, - require_thinking: bool | None | Unset = UNSET, - min_context_tokens: int | None | Unset = UNSET, - min_output_tokens: int | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | ModelRecommendationsResponse]: - """Get Recommendations - - Get replacement/upgrade recommendations for a model. - - Returns a designated successor (if any), same-family upgrades, and cross-provider/cross-family - alternatives. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - model_id (str): - require_tool_use (bool | None | Unset): Only recommend models that support tool use. - require_structured_output (bool | None | Unset): Only recommend models that support - structured output. - require_thinking (bool | None | Unset): Only recommend models that support - thinking/reasoning. - min_context_tokens (int | None | Unset): Minimum context window size in tokens. - min_output_tokens (int | None | Unset): Minimum output token limit. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | ModelRecommendationsResponse] - """ - - kwargs = _get_kwargs( - model_id=model_id, - require_tool_use=require_tool_use, - require_structured_output=require_structured_output, - require_thinking=require_thinking, - min_context_tokens=min_context_tokens, - min_output_tokens=min_output_tokens, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - model_id: str, - *, - client: AuthenticatedClient | Client, - require_tool_use: bool | None | Unset = UNSET, - require_structured_output: bool | None | Unset = UNSET, - require_thinking: bool | None | Unset = UNSET, - min_context_tokens: int | None | Unset = UNSET, - min_output_tokens: int | None | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | ModelRecommendationsResponse | None: - """Get Recommendations - - Get replacement/upgrade recommendations for a model. - - Returns a designated successor (if any), same-family upgrades, and cross-provider/cross-family - alternatives. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - model_id (str): - require_tool_use (bool | None | Unset): Only recommend models that support tool use. - require_structured_output (bool | None | Unset): Only recommend models that support - structured output. - require_thinking (bool | None | Unset): Only recommend models that support - thinking/reasoning. - min_context_tokens (int | None | Unset): Minimum context window size in tokens. - min_output_tokens (int | None | Unset): Minimum output token limit. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | ModelRecommendationsResponse - """ - - return ( - await asyncio_detailed( - model_id=model_id, - client=client, - require_tool_use=require_tool_use, - require_structured_output=require_structured_output, - require_thinking=require_thinking, - min_context_tokens=min_context_tokens, - min_output_tokens=min_output_tokens, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/models/list_alerts_api_models_alerts_get.py b/seclai/_generated/api/models/list_alerts_api_models_alerts_get.py deleted file mode 100644 index 64735a7..0000000 --- a/seclai/_generated/api/models/list_alerts_api_models_alerts_get.py +++ /dev/null @@ -1,282 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.model_alert_list_response import ModelAlertListResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - agent_id: None | str | Unset = UNSET, - unread_only: bool | Unset = False, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - json_agent_id: None | str | Unset - if isinstance(agent_id, Unset): - json_agent_id = UNSET - else: - json_agent_id = agent_id - params["agent_id"] = json_agent_id - - params["unread_only"] = unread_only - - params["limit"] = limit - - params["offset"] = offset - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/models/alerts", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | ModelAlertListResponse | None: - if response.status_code == 200: - response_200 = ModelAlertListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | ModelAlertListResponse]: - 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: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - unread_only: bool | Unset = False, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | ModelAlertListResponse]: - """List Alerts - - List model lifecycle alerts for the account. - - Returns in-app notifications about model deprecations, sunsets, and newer model availability. - Supports filtering by agent, unread-only, and pagination. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Alerts are scoped to the caller's account. - - Args: - agent_id (None | str | Unset): Filter alerts to a specific agent UUID. - unread_only (bool | Unset): When true, only return unread alerts. Default: False. - limit (int | Unset): Maximum number of alerts to return (1-100). Default: 50. - offset (int | Unset): Pagination offset. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | ModelAlertListResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - unread_only=unread_only, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - unread_only: bool | Unset = False, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | ModelAlertListResponse | None: - """List Alerts - - List model lifecycle alerts for the account. - - Returns in-app notifications about model deprecations, sunsets, and newer model availability. - Supports filtering by agent, unread-only, and pagination. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Alerts are scoped to the caller's account. - - Args: - agent_id (None | str | Unset): Filter alerts to a specific agent UUID. - unread_only (bool | Unset): When true, only return unread alerts. Default: False. - limit (int | Unset): Maximum number of alerts to return (1-100). Default: 50. - offset (int | Unset): Pagination offset. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | ModelAlertListResponse - """ - - return sync_detailed( - client=client, - agent_id=agent_id, - unread_only=unread_only, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - unread_only: bool | Unset = False, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | ModelAlertListResponse]: - """List Alerts - - List model lifecycle alerts for the account. - - Returns in-app notifications about model deprecations, sunsets, and newer model availability. - Supports filtering by agent, unread-only, and pagination. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Alerts are scoped to the caller's account. - - Args: - agent_id (None | str | Unset): Filter alerts to a specific agent UUID. - unread_only (bool | Unset): When true, only return unread alerts. Default: False. - limit (int | Unset): Maximum number of alerts to return (1-100). Default: 50. - offset (int | Unset): Pagination offset. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | ModelAlertListResponse] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - unread_only=unread_only, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - agent_id: None | str | Unset = UNSET, - unread_only: bool | Unset = False, - limit: int | Unset = 50, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | ModelAlertListResponse | None: - """List Alerts - - List model lifecycle alerts for the account. - - Returns in-app notifications about model deprecations, sunsets, and newer model availability. - Supports filtering by agent, unread-only, and pagination. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Alerts are scoped to the caller's account. - - Args: - agent_id (None | str | Unset): Filter alerts to a specific agent UUID. - unread_only (bool | Unset): When true, only return unread alerts. Default: False. - limit (int | Unset): Maximum number of alerts to return (1-100). Default: 50. - offset (int | Unset): Pagination offset. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | ModelAlertListResponse - """ - - return ( - await asyncio_detailed( - client=client, - agent_id=agent_id, - unread_only=unread_only, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/models/list_experiments_api_models_playground_experiments_get.py b/seclai/_generated/api/models/list_experiments_api_models_playground_experiments_get.py deleted file mode 100644 index 3c94f7d..0000000 --- a/seclai/_generated/api/models/list_experiments_api_models_playground_experiments_get.py +++ /dev/null @@ -1,303 +0,0 @@ -import datetime -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.experiment_list_response import ExperimentListResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - days: int | Unset = 30, - start_date: datetime.date | None | Unset = UNSET, - end_date: datetime.date | None | Unset = UNSET, - limit: int | Unset = 20, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["days"] = days - - json_start_date: None | str | Unset - if isinstance(start_date, Unset): - json_start_date = UNSET - elif isinstance(start_date, datetime.date): - json_start_date = start_date.isoformat() - else: - json_start_date = start_date - params["start_date"] = json_start_date - - json_end_date: None | str | Unset - if isinstance(end_date, Unset): - json_end_date = UNSET - elif isinstance(end_date, datetime.date): - json_end_date = end_date.isoformat() - else: - json_end_date = end_date - params["end_date"] = json_end_date - - params["limit"] = limit - - params["offset"] = offset - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/models/playground/experiments", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ExperimentListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = ExperimentListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ExperimentListResponse | 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: AuthenticatedClient | Client, - days: int | Unset = 30, - start_date: datetime.date | None | Unset = UNSET, - end_date: datetime.date | None | Unset = UNSET, - limit: int | Unset = 20, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ExperimentListResponse | HTTPValidationError]: - """List Experiments - - List model playground experiments for the account. - - Returns a paginated, time-filtered list of experiments ordered by creation date descending. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account. - - Args: - days (int | Unset): Look-back window in days. Default: 30. - start_date (datetime.date | None | Unset): Explicit start date (overrides days). - end_date (datetime.date | None | Unset): Explicit end date (overrides days). - limit (int | Unset): Page size. Default: 20. - offset (int | Unset): Pagination offset. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ExperimentListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - days=days, - start_date=start_date, - end_date=end_date, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - days: int | Unset = 30, - start_date: datetime.date | None | Unset = UNSET, - end_date: datetime.date | None | Unset = UNSET, - limit: int | Unset = 20, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ExperimentListResponse | HTTPValidationError | None: - """List Experiments - - List model playground experiments for the account. - - Returns a paginated, time-filtered list of experiments ordered by creation date descending. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account. - - Args: - days (int | Unset): Look-back window in days. Default: 30. - start_date (datetime.date | None | Unset): Explicit start date (overrides days). - end_date (datetime.date | None | Unset): Explicit end date (overrides days). - limit (int | Unset): Page size. Default: 20. - offset (int | Unset): Pagination offset. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ExperimentListResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - days=days, - start_date=start_date, - end_date=end_date, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - days: int | Unset = 30, - start_date: datetime.date | None | Unset = UNSET, - end_date: datetime.date | None | Unset = UNSET, - limit: int | Unset = 20, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ExperimentListResponse | HTTPValidationError]: - """List Experiments - - List model playground experiments for the account. - - Returns a paginated, time-filtered list of experiments ordered by creation date descending. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account. - - Args: - days (int | Unset): Look-back window in days. Default: 30. - start_date (datetime.date | None | Unset): Explicit start date (overrides days). - end_date (datetime.date | None | Unset): Explicit end date (overrides days). - limit (int | Unset): Page size. Default: 20. - offset (int | Unset): Pagination offset. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ExperimentListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - days=days, - start_date=start_date, - end_date=end_date, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - days: int | Unset = 30, - start_date: datetime.date | None | Unset = UNSET, - end_date: datetime.date | None | Unset = UNSET, - limit: int | Unset = 20, - offset: int | Unset = 0, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ExperimentListResponse | HTTPValidationError | None: - """List Experiments - - List model playground experiments for the account. - - Returns a paginated, time-filtered list of experiments ordered by creation date descending. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account. - - Args: - days (int | Unset): Look-back window in days. Default: 30. - start_date (datetime.date | None | Unset): Explicit start date (overrides days). - end_date (datetime.date | None | Unset): Explicit end date (overrides days). - limit (int | Unset): Page size. Default: 20. - offset (int | Unset): Pagination offset. Default: 0. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ExperimentListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - days=days, - start_date=start_date, - end_date=end_date, - limit=limit, - offset=offset, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/models/list_models_api_models_get.py b/seclai/_generated/api/models/list_models_api_models_get.py deleted file mode 100644 index 89197e2..0000000 --- a/seclai/_generated/api/models/list_models_api_models_get.py +++ /dev/null @@ -1,370 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.provider_group_response import ProviderGroupResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - provider: None | str | Unset = UNSET, - supports_tool_use: bool | None | Unset = UNSET, - supports_thinking: bool | None | Unset = UNSET, - supports_input_media: None | str | Unset = UNSET, - supports_output_media: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - json_provider: None | str | Unset - if isinstance(provider, Unset): - json_provider = UNSET - else: - json_provider = provider - params["provider"] = json_provider - - json_supports_tool_use: bool | None | Unset - if isinstance(supports_tool_use, Unset): - json_supports_tool_use = UNSET - else: - json_supports_tool_use = supports_tool_use - params["supports_tool_use"] = json_supports_tool_use - - json_supports_thinking: bool | None | Unset - if isinstance(supports_thinking, Unset): - json_supports_thinking = UNSET - else: - json_supports_thinking = supports_thinking - params["supports_thinking"] = json_supports_thinking - - json_supports_input_media: None | str | Unset - if isinstance(supports_input_media, Unset): - json_supports_input_media = UNSET - else: - json_supports_input_media = supports_input_media - params["supports_input_media"] = json_supports_input_media - - json_supports_output_media: None | str | Unset - if isinstance(supports_output_media, Unset): - json_supports_output_media = UNSET - else: - json_supports_output_media = supports_output_media - params["supports_output_media"] = json_supports_output_media - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/models", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | list[ProviderGroupResponse] | None: - if response.status_code == 200: - response_200 = [] - _response_200 = response.json() - for response_200_item_data in _response_200: - response_200_item = ProviderGroupResponse.from_dict(response_200_item_data) - - response_200.append(response_200_item) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | list[ProviderGroupResponse]]: - 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: AuthenticatedClient | Client, - provider: None | str | Unset = UNSET, - supports_tool_use: bool | None | Unset = UNSET, - supports_thinking: bool | None | Unset = UNSET, - supports_input_media: None | str | Unset = UNSET, - supports_output_media: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[ProviderGroupResponse]]: - """List Models - - List all enabled LLM models with full details. - - Returns models grouped by provider, including capabilities, credit pricing, tool support, variant - tiers, and lifecycle status. - - Optional query parameters: - - `provider`: filter by provider (e.g. 'anthropic', 'openai') - - `supports_tool_use`: filter to models with tool calling support - - `supports_thinking`: filter to models with extended thinking support - - `supports_input_media`: filter to models accepting an input modality - (`image`/`audio`/`video`/`pdf` or a full MIME) - - `supports_output_media`: filter to models producing an output modality (`image`/`audio`/`video`) — - e.g. to find generation models - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - provider (None | str | Unset): Filter by provider name - supports_tool_use (bool | None | Unset): Filter to models that support tool use - supports_thinking (bool | None | Unset): Filter to models that support extended thinking - supports_input_media (None | str | Unset): Filter to models that accept this input - modality — a coarse kind (`image`, `audio`, `video`, `pdf`) or a full MIME. - supports_output_media (None | str | Unset): Filter to models that produce this output - modality — a coarse kind (`image`, `audio`, `video`) or a full MIME. Use to find - image/audio/video generation models. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[ProviderGroupResponse]] - """ - - kwargs = _get_kwargs( - provider=provider, - supports_tool_use=supports_tool_use, - supports_thinking=supports_thinking, - supports_input_media=supports_input_media, - supports_output_media=supports_output_media, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - provider: None | str | Unset = UNSET, - supports_tool_use: bool | None | Unset = UNSET, - supports_thinking: bool | None | Unset = UNSET, - supports_input_media: None | str | Unset = UNSET, - supports_output_media: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[ProviderGroupResponse] | None: - """List Models - - List all enabled LLM models with full details. - - Returns models grouped by provider, including capabilities, credit pricing, tool support, variant - tiers, and lifecycle status. - - Optional query parameters: - - `provider`: filter by provider (e.g. 'anthropic', 'openai') - - `supports_tool_use`: filter to models with tool calling support - - `supports_thinking`: filter to models with extended thinking support - - `supports_input_media`: filter to models accepting an input modality - (`image`/`audio`/`video`/`pdf` or a full MIME) - - `supports_output_media`: filter to models producing an output modality (`image`/`audio`/`video`) — - e.g. to find generation models - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - provider (None | str | Unset): Filter by provider name - supports_tool_use (bool | None | Unset): Filter to models that support tool use - supports_thinking (bool | None | Unset): Filter to models that support extended thinking - supports_input_media (None | str | Unset): Filter to models that accept this input - modality — a coarse kind (`image`, `audio`, `video`, `pdf`) or a full MIME. - supports_output_media (None | str | Unset): Filter to models that produce this output - modality — a coarse kind (`image`, `audio`, `video`) or a full MIME. Use to find - image/audio/video generation models. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[ProviderGroupResponse] - """ - - return sync_detailed( - client=client, - provider=provider, - supports_tool_use=supports_tool_use, - supports_thinking=supports_thinking, - supports_input_media=supports_input_media, - supports_output_media=supports_output_media, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - provider: None | str | Unset = UNSET, - supports_tool_use: bool | None | Unset = UNSET, - supports_thinking: bool | None | Unset = UNSET, - supports_input_media: None | str | Unset = UNSET, - supports_output_media: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[ProviderGroupResponse]]: - """List Models - - List all enabled LLM models with full details. - - Returns models grouped by provider, including capabilities, credit pricing, tool support, variant - tiers, and lifecycle status. - - Optional query parameters: - - `provider`: filter by provider (e.g. 'anthropic', 'openai') - - `supports_tool_use`: filter to models with tool calling support - - `supports_thinking`: filter to models with extended thinking support - - `supports_input_media`: filter to models accepting an input modality - (`image`/`audio`/`video`/`pdf` or a full MIME) - - `supports_output_media`: filter to models producing an output modality (`image`/`audio`/`video`) — - e.g. to find generation models - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - provider (None | str | Unset): Filter by provider name - supports_tool_use (bool | None | Unset): Filter to models that support tool use - supports_thinking (bool | None | Unset): Filter to models that support extended thinking - supports_input_media (None | str | Unset): Filter to models that accept this input - modality — a coarse kind (`image`, `audio`, `video`, `pdf`) or a full MIME. - supports_output_media (None | str | Unset): Filter to models that produce this output - modality — a coarse kind (`image`, `audio`, `video`) or a full MIME. Use to find - image/audio/video generation models. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[ProviderGroupResponse]] - """ - - kwargs = _get_kwargs( - provider=provider, - supports_tool_use=supports_tool_use, - supports_thinking=supports_thinking, - supports_input_media=supports_input_media, - supports_output_media=supports_output_media, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - provider: None | str | Unset = UNSET, - supports_tool_use: bool | None | Unset = UNSET, - supports_thinking: bool | None | Unset = UNSET, - supports_input_media: None | str | Unset = UNSET, - supports_output_media: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[ProviderGroupResponse] | None: - """List Models - - List all enabled LLM models with full details. - - Returns models grouped by provider, including capabilities, credit pricing, tool support, variant - tiers, and lifecycle status. - - Optional query parameters: - - `provider`: filter by provider (e.g. 'anthropic', 'openai') - - `supports_tool_use`: filter to models with tool calling support - - `supports_thinking`: filter to models with extended thinking support - - `supports_input_media`: filter to models accepting an input modality - (`image`/`audio`/`video`/`pdf` or a full MIME) - - `supports_output_media`: filter to models producing an output modality (`image`/`audio`/`video`) — - e.g. to find generation models - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. - - Args: - provider (None | str | Unset): Filter by provider name - supports_tool_use (bool | None | Unset): Filter to models that support tool use - supports_thinking (bool | None | Unset): Filter to models that support extended thinking - supports_input_media (None | str | Unset): Filter to models that accept this input - modality — a coarse kind (`image`, `audio`, `video`, `pdf`) or a full MIME. - supports_output_media (None | str | Unset): Filter to models that produce this output - modality — a coarse kind (`image`, `audio`, `video`) or a full MIME. Use to find - image/audio/video generation models. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[ProviderGroupResponse] - """ - - return ( - await asyncio_detailed( - client=client, - provider=provider, - supports_tool_use=supports_tool_use, - supports_thinking=supports_thinking, - supports_input_media=supports_input_media, - supports_output_media=supports_output_media, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/models/mark_all_read_api_models_alerts_mark_all_read_post.py b/seclai/_generated/api/models/mark_all_read_api_models_alerts_mark_all_read_post.py deleted file mode 100644 index 8abbbd9..0000000 --- a/seclai/_generated/api/models/mark_all_read_api_models_alerts_mark_all_read_post.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/models/alerts/mark-all-read", - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | None: - if response.status_code == 204: - return None - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any]: - 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: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any]: - """Mark All Read - - Mark all model lifecycle alerts as read for the account. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Scoped to the caller's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any]: - """Mark All Read - - Mark all model lifecycle alerts as read for the account. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Scoped to the caller's account. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) diff --git a/seclai/_generated/api/models/mark_read_api_models_alerts_alert_id_read_patch.py b/seclai/_generated/api/models/mark_read_api_models_alerts_alert_id_read_patch.py deleted file mode 100644 index 3682eeb..0000000 --- a/seclai/_generated/api/models/mark_read_api_models_alerts_alert_id_read_patch.py +++ /dev/null @@ -1,214 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - alert_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/models/alerts/{alert_id}/read".format( - alert_id=quote(str(alert_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - alert_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Mark Read - - Mark a single model lifecycle alert as read (dismissed). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The alert must belong to the caller's account. - - Args: - alert_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - alert_id=alert_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - alert_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Mark Read - - Mark a single model lifecycle alert as read (dismissed). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The alert must belong to the caller's account. - - Args: - alert_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - alert_id=alert_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - alert_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Mark Read - - Mark a single model lifecycle alert as read (dismissed). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The alert must belong to the caller's account. - - Args: - alert_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - alert_id=alert_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - alert_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Mark Read - - Mark a single model lifecycle alert as read (dismissed). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. The alert must belong to the caller's account. - - Args: - alert_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - alert_id=alert_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/search/__init__.py b/seclai/_generated/api/search/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/search/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/search/docs_search_api_docs_search_get.py b/seclai/_generated/api/search/docs_search_api_docs_search_get.py deleted file mode 100644 index b2f6e77..0000000 --- a/seclai/_generated/api/search/docs_search_api_docs_search_get.py +++ /dev/null @@ -1,279 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.docs_search_api_docs_search_get_mode import ( - DocsSearchApiDocsSearchGetMode, -) -from ...models.docs_search_response import DocsSearchResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - q: str, - mode: ( - DocsSearchApiDocsSearchGetMode | Unset - ) = DocsSearchApiDocsSearchGetMode.KEYWORD, - limit: int | Unset = 8, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["q"] = q - - json_mode: str | Unset = UNSET - if not isinstance(mode, Unset): - json_mode = mode.value - - params["mode"] = json_mode - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/docs-search", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> DocsSearchResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = DocsSearchResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[DocsSearchResponse | 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: AuthenticatedClient | Client, - q: str, - mode: ( - DocsSearchApiDocsSearchGetMode | Unset - ) = DocsSearchApiDocsSearchGetMode.KEYWORD, - limit: int | Unset = 8, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[DocsSearchResponse | HTTPValidationError]: - """Search documentation - - Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page - titles and summaries (fast, no AI cost); `mode=semantic` matches page body content by meaning (uses - an embedding). Each result carries a `doc_slug` and an optional section `anchor` for building a - `https://seclai.com/docs/[#]` link, a `score` (relevance; not comparable across - modes), and — in semantic mode — a `highlight` (best matching verbatim sentence; `null` for - keyword). Documentation is global, so results are not account-scoped. - - Args: - q (str): Search query - mode (DocsSearchApiDocsSearchGetMode | Unset): Search strategy Default: - DocsSearchApiDocsSearchGetMode.KEYWORD. - limit (int | Unset): Maximum results Default: 8. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[DocsSearchResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - q=q, - mode=mode, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - q: str, - mode: ( - DocsSearchApiDocsSearchGetMode | Unset - ) = DocsSearchApiDocsSearchGetMode.KEYWORD, - limit: int | Unset = 8, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> DocsSearchResponse | HTTPValidationError | None: - """Search documentation - - Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page - titles and summaries (fast, no AI cost); `mode=semantic` matches page body content by meaning (uses - an embedding). Each result carries a `doc_slug` and an optional section `anchor` for building a - `https://seclai.com/docs/[#]` link, a `score` (relevance; not comparable across - modes), and — in semantic mode — a `highlight` (best matching verbatim sentence; `null` for - keyword). Documentation is global, so results are not account-scoped. - - Args: - q (str): Search query - mode (DocsSearchApiDocsSearchGetMode | Unset): Search strategy Default: - DocsSearchApiDocsSearchGetMode.KEYWORD. - limit (int | Unset): Maximum results Default: 8. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - DocsSearchResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - q=q, - mode=mode, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - q: str, - mode: ( - DocsSearchApiDocsSearchGetMode | Unset - ) = DocsSearchApiDocsSearchGetMode.KEYWORD, - limit: int | Unset = 8, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[DocsSearchResponse | HTTPValidationError]: - """Search documentation - - Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page - titles and summaries (fast, no AI cost); `mode=semantic` matches page body content by meaning (uses - an embedding). Each result carries a `doc_slug` and an optional section `anchor` for building a - `https://seclai.com/docs/[#]` link, a `score` (relevance; not comparable across - modes), and — in semantic mode — a `highlight` (best matching verbatim sentence; `null` for - keyword). Documentation is global, so results are not account-scoped. - - Args: - q (str): Search query - mode (DocsSearchApiDocsSearchGetMode | Unset): Search strategy Default: - DocsSearchApiDocsSearchGetMode.KEYWORD. - limit (int | Unset): Maximum results Default: 8. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[DocsSearchResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - q=q, - mode=mode, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - q: str, - mode: ( - DocsSearchApiDocsSearchGetMode | Unset - ) = DocsSearchApiDocsSearchGetMode.KEYWORD, - limit: int | Unset = 8, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> DocsSearchResponse | HTTPValidationError | None: - """Search documentation - - Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page - titles and summaries (fast, no AI cost); `mode=semantic` matches page body content by meaning (uses - an embedding). Each result carries a `doc_slug` and an optional section `anchor` for building a - `https://seclai.com/docs/[#]` link, a `score` (relevance; not comparable across - modes), and — in semantic mode — a `highlight` (best matching verbatim sentence; `null` for - keyword). Documentation is global, so results are not account-scoped. - - Args: - q (str): Search query - mode (DocsSearchApiDocsSearchGetMode | Unset): Search strategy Default: - DocsSearchApiDocsSearchGetMode.KEYWORD. - limit (int | Unset): Maximum results Default: 8. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - DocsSearchResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - q=q, - mode=mode, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/search/search_api_search_get.py b/seclai/_generated/api/search/search_api_search_get.py deleted file mode 100644 index 751dd09..0000000 --- a/seclai/_generated/api/search/search_api_search_get.py +++ /dev/null @@ -1,263 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.search_response import SearchResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - q: str, - limit: int | Unset = 10, - entity_type: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["q"] = q - - params["limit"] = limit - - json_entity_type: None | str | Unset - if isinstance(entity_type, Unset): - json_entity_type = UNSET - else: - json_entity_type = entity_type - params["entity_type"] = json_entity_type - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/search", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SearchResponse | None: - if response.status_code == 200: - response_200 = SearchResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SearchResponse]: - 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: AuthenticatedClient | Client, - q: str, - limit: int | Unset = 10, - entity_type: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SearchResponse]: - """Search resources - - Search across all resource types in your account. Accepts a free-text keyword query or a UUID. - UUIDs are matched exactly; keywords are matched by name and description (case-insensitive - substring). Results are ranked: name-prefix > name-substring > description-substring. Searchable - types: agent, knowledge_base, source_connection, solution, memory_bank, alert, api_key, - governance_policy, mcp_client. - - Args: - q (str): Search query - limit (int | Unset): Maximum results Default: 10. - entity_type (None | str | Unset): Optional entity type filter (e.g. 'agent', - 'knowledge_base') - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SearchResponse] - """ - - kwargs = _get_kwargs( - q=q, - limit=limit, - entity_type=entity_type, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - q: str, - limit: int | Unset = 10, - entity_type: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SearchResponse | None: - """Search resources - - Search across all resource types in your account. Accepts a free-text keyword query or a UUID. - UUIDs are matched exactly; keywords are matched by name and description (case-insensitive - substring). Results are ranked: name-prefix > name-substring > description-substring. Searchable - types: agent, knowledge_base, source_connection, solution, memory_bank, alert, api_key, - governance_policy, mcp_client. - - Args: - q (str): Search query - limit (int | Unset): Maximum results Default: 10. - entity_type (None | str | Unset): Optional entity type filter (e.g. 'agent', - 'knowledge_base') - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SearchResponse - """ - - return sync_detailed( - client=client, - q=q, - limit=limit, - entity_type=entity_type, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - q: str, - limit: int | Unset = 10, - entity_type: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SearchResponse]: - """Search resources - - Search across all resource types in your account. Accepts a free-text keyword query or a UUID. - UUIDs are matched exactly; keywords are matched by name and description (case-insensitive - substring). Results are ranked: name-prefix > name-substring > description-substring. Searchable - types: agent, knowledge_base, source_connection, solution, memory_bank, alert, api_key, - governance_policy, mcp_client. - - Args: - q (str): Search query - limit (int | Unset): Maximum results Default: 10. - entity_type (None | str | Unset): Optional entity type filter (e.g. 'agent', - 'knowledge_base') - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SearchResponse] - """ - - kwargs = _get_kwargs( - q=q, - limit=limit, - entity_type=entity_type, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - q: str, - limit: int | Unset = 10, - entity_type: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SearchResponse | None: - """Search resources - - Search across all resource types in your account. Accepts a free-text keyword query or a UUID. - UUIDs are matched exactly; keywords are matched by name and description (case-insensitive - substring). Results are ranked: name-prefix > name-substring > description-substring. Searchable - types: agent, knowledge_base, source_connection, solution, memory_bank, alert, api_key, - governance_policy, mcp_client. - - Args: - q (str): Search query - limit (int | Unset): Maximum results Default: 10. - entity_type (None | str | Unset): Optional entity type filter (e.g. 'agent', - 'knowledge_base') - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SearchResponse - """ - - return ( - await asyncio_detailed( - client=client, - q=q, - limit=limit, - entity_type=entity_type, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/__init__.py b/seclai/_generated/api/solutions/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/solutions/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/solutions/add_conversation_turn_api_solutions_solution_id_conversations_post.py b/seclai/_generated/api/solutions/add_conversation_turn_api_solutions_solution_id_conversations_post.py deleted file mode 100644 index cf9f4a0..0000000 --- a/seclai/_generated/api/solutions/add_conversation_turn_api_solutions_solution_id_conversations_post.py +++ /dev/null @@ -1,234 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.add_conversation_turn_request import AddConversationTurnRequest -from ...models.http_validation_error import HTTPValidationError -from ...models.solution_conversation_response import SolutionConversationResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - body: AddConversationTurnRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/solutions/{solution_id}/conversations".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionConversationResponse | None: - if response.status_code == 201: - response_201 = SolutionConversationResponse.from_dict(response.json()) - - return response_201 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionConversationResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AddConversationTurnRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionConversationResponse]: - """Add conversation turn - - Add a conversation turn to a solution's AI assistant history. - - Records a user input and optional AI response and actions taken. This is typically called internally - by AI assistant endpoints, but can also be used to manually log interactions. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AddConversationTurnRequest): - - 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 | SolutionConversationResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AddConversationTurnRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionConversationResponse | None: - """Add conversation turn - - Add a conversation turn to a solution's AI assistant history. - - Records a user input and optional AI response and actions taken. This is typically called internally - by AI assistant endpoints, but can also be used to manually log interactions. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AddConversationTurnRequest): - - 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 | SolutionConversationResponse - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AddConversationTurnRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionConversationResponse]: - """Add conversation turn - - Add a conversation turn to a solution's AI assistant history. - - Records a user input and optional AI response and actions taken. This is typically called internally - by AI assistant endpoints, but can also be used to manually log interactions. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AddConversationTurnRequest): - - 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 | SolutionConversationResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AddConversationTurnRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionConversationResponse | None: - """Add conversation turn - - Add a conversation turn to a solution's AI assistant history. - - Records a user input and optional AI response and actions taken. This is typically called internally - by AI assistant endpoints, but can also be used to manually log interactions. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AddConversationTurnRequest): - - 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 | SolutionConversationResponse - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/ai_assistant_accept_api_solutions_solution_id_ai_assistant_conversation_id_accept_post.py b/seclai/_generated/api/solutions/ai_assistant_accept_api_solutions_solution_id_ai_assistant_conversation_id_accept_post.py deleted file mode 100644 index ba50d36..0000000 --- a/seclai/_generated/api/solutions/ai_assistant_accept_api_solutions_solution_id_ai_assistant_conversation_id_accept_post.py +++ /dev/null @@ -1,252 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.ai_assistant_accept_request import AiAssistantAcceptRequest -from ...models.ai_assistant_accept_response import AiAssistantAcceptResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - conversation_id: UUID, - *, - body: AiAssistantAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/solutions/{solution_id}/ai-assistant/{conversation_id}/accept".format( - solution_id=quote(str(solution_id), safe=""), - conversation_id=quote(str(conversation_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantAcceptResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AiAssistantAcceptResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantAcceptResponse | 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( - solution_id: UUID, - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantAcceptResponse | HTTPValidationError]: - """Accept plan - - Accept and execute a proposed plan generated by one of the AI assistant endpoints. - - Executes all proposed actions in the plan and returns the results of each action. If the plan - contains destructive actions (e.g. deletions), you must set `confirm_deletions` to `true` in the - request body. Returns a summary of executed actions with success/failure status. - - Args: - solution_id (UUID): - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantAcceptRequest): Request body for accepting a proposed plan. - - 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[AiAssistantAcceptResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - conversation_id=conversation_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantAcceptResponse | HTTPValidationError | None: - """Accept plan - - Accept and execute a proposed plan generated by one of the AI assistant endpoints. - - Executes all proposed actions in the plan and returns the results of each action. If the plan - contains destructive actions (e.g. deletions), you must set `confirm_deletions` to `true` in the - request body. Returns a summary of executed actions with success/failure status. - - Args: - solution_id (UUID): - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantAcceptRequest): Request body for accepting a proposed plan. - - 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: - AiAssistantAcceptResponse | HTTPValidationError - """ - - return sync_detailed( - solution_id=solution_id, - conversation_id=conversation_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantAcceptResponse | HTTPValidationError]: - """Accept plan - - Accept and execute a proposed plan generated by one of the AI assistant endpoints. - - Executes all proposed actions in the plan and returns the results of each action. If the plan - contains destructive actions (e.g. deletions), you must set `confirm_deletions` to `true` in the - request body. Returns a summary of executed actions with success/failure status. - - Args: - solution_id (UUID): - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantAcceptRequest): Request body for accepting a proposed plan. - - 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[AiAssistantAcceptResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - conversation_id=conversation_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantAcceptRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantAcceptResponse | HTTPValidationError | None: - """Accept plan - - Accept and execute a proposed plan generated by one of the AI assistant endpoints. - - Executes all proposed actions in the plan and returns the results of each action. If the plan - contains destructive actions (e.g. deletions), you must set `confirm_deletions` to `true` in the - request body. Returns a summary of executed actions with success/failure status. - - Args: - solution_id (UUID): - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantAcceptRequest): Request body for accepting a proposed plan. - - 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: - AiAssistantAcceptResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - conversation_id=conversation_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/ai_assistant_decline_api_solutions_solution_id_ai_assistant_conversation_id_decline_post.py b/seclai/_generated/api/solutions/ai_assistant_decline_api_solutions_solution_id_ai_assistant_conversation_id_decline_post.py deleted file mode 100644 index b2ce507..0000000 --- a/seclai/_generated/api/solutions/ai_assistant_decline_api_solutions_solution_id_ai_assistant_conversation_id_decline_post.py +++ /dev/null @@ -1,228 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - conversation_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/solutions/{solution_id}/ai-assistant/{conversation_id}/decline".format( - solution_id=quote(str(solution_id), safe=""), - conversation_id=quote(str(conversation_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - solution_id: UUID, - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Decline plan - - Decline a proposed plan generated by one of the AI assistant endpoints. - - Marks the conversation as declined without executing any actions. The conversation history is - preserved for reference. You can generate a new plan afterwards if needed. - - Args: - solution_id (UUID): - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - solution_id=solution_id, - conversation_id=conversation_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Decline plan - - Decline a proposed plan generated by one of the AI assistant endpoints. - - Marks the conversation as declined without executing any actions. The conversation history is - preserved for reference. You can generate a new plan afterwards if needed. - - Args: - solution_id (UUID): - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - solution_id=solution_id, - conversation_id=conversation_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Decline plan - - Decline a proposed plan generated by one of the AI assistant endpoints. - - Marks the conversation as declined without executing any actions. The conversation history is - preserved for reference. You can generate a new plan afterwards if needed. - - Args: - solution_id (UUID): - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - solution_id=solution_id, - conversation_id=conversation_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Decline plan - - Decline a proposed plan generated by one of the AI assistant endpoints. - - Marks the conversation as declined without executing any actions. The conversation history is - preserved for reference. You can generate a new plan afterwards if needed. - - Args: - solution_id (UUID): - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - solution_id=solution_id, - conversation_id=conversation_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/ai_assistant_generate_api_solutions_solution_id_ai_assistant_generate_post.py b/seclai/_generated/api/solutions/ai_assistant_generate_api_solutions_solution_id_ai_assistant_generate_post.py deleted file mode 100644 index 1e6b98a..0000000 --- a/seclai/_generated/api/solutions/ai_assistant_generate_api_solutions_solution_id_ai_assistant_generate_post.py +++ /dev/null @@ -1,246 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.ai_assistant_generate_request import AiAssistantGenerateRequest -from ...models.ai_assistant_generate_response import AiAssistantGenerateResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/solutions/{solution_id}/ai-assistant/generate".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AiAssistantGenerateResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantGenerateResponse | 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( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: - """Generate solution plan - - Generate a comprehensive solution management plan via the solution AI assistant. - - This is the most powerful assistant — it can propose changes across sources, knowledge bases, and - agents. Describe your goal in natural language and the assistant will create a multi-step plan. - Review the proposed actions and use the accept or decline endpoint. - - Supports SSE streaming when `Accept: text/event-stream` is set. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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[AiAssistantGenerateResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - """Generate solution plan - - Generate a comprehensive solution management plan via the solution AI assistant. - - This is the most powerful assistant — it can propose changes across sources, knowledge bases, and - agents. Describe your goal in natural language and the assistant will create a multi-step plan. - Review the proposed actions and use the accept or decline endpoint. - - Supports SSE streaming when `Accept: text/event-stream` is set. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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: - AiAssistantGenerateResponse | HTTPValidationError - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: - """Generate solution plan - - Generate a comprehensive solution management plan via the solution AI assistant. - - This is the most powerful assistant — it can propose changes across sources, knowledge bases, and - agents. Describe your goal in natural language and the assistant will create a multi-step plan. - Review the proposed actions and use the accept or decline endpoint. - - Supports SSE streaming when `Accept: text/event-stream` is set. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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[AiAssistantGenerateResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - """Generate solution plan - - Generate a comprehensive solution management plan via the solution AI assistant. - - This is the most powerful assistant — it can propose changes across sources, knowledge bases, and - agents. Describe your goal in natural language and the assistant will create a multi-step plan. - Review the proposed actions and use the accept or decline endpoint. - - Supports SSE streaming when `Accept: text/event-stream` is set. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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: - AiAssistantGenerateResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/ai_assistant_knowledge_base_api_solutions_solution_id_ai_assistant_knowledge_base_post.py b/seclai/_generated/api/solutions/ai_assistant_knowledge_base_api_solutions_solution_id_ai_assistant_knowledge_base_post.py deleted file mode 100644 index 4bea15f..0000000 --- a/seclai/_generated/api/solutions/ai_assistant_knowledge_base_api_solutions_solution_id_ai_assistant_knowledge_base_post.py +++ /dev/null @@ -1,238 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.ai_assistant_generate_request import AiAssistantGenerateRequest -from ...models.ai_assistant_generate_response import AiAssistantGenerateResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/solutions/{solution_id}/ai-assistant/knowledge-base".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AiAssistantGenerateResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantGenerateResponse | 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( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: - """Generate knowledge base plan - - Generate a knowledge base plan via the KB AI assistant. - - Describe what knowledge bases you need in natural language and the assistant will propose a plan - with create, update, or delete actions. The assistant may also propose creating new sources if - needed. Review the proposed actions and use the accept or decline endpoint. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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[AiAssistantGenerateResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - """Generate knowledge base plan - - Generate a knowledge base plan via the KB AI assistant. - - Describe what knowledge bases you need in natural language and the assistant will propose a plan - with create, update, or delete actions. The assistant may also propose creating new sources if - needed. Review the proposed actions and use the accept or decline endpoint. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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: - AiAssistantGenerateResponse | HTTPValidationError - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: - """Generate knowledge base plan - - Generate a knowledge base plan via the KB AI assistant. - - Describe what knowledge bases you need in natural language and the assistant will propose a plan - with create, update, or delete actions. The assistant may also propose creating new sources if - needed. Review the proposed actions and use the accept or decline endpoint. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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[AiAssistantGenerateResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - """Generate knowledge base plan - - Generate a knowledge base plan via the KB AI assistant. - - Describe what knowledge bases you need in natural language and the assistant will propose a plan - with create, update, or delete actions. The assistant may also propose creating new sources if - needed. Review the proposed actions and use the accept or decline endpoint. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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: - AiAssistantGenerateResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/ai_assistant_source_api_solutions_solution_id_ai_assistant_source_post.py b/seclai/_generated/api/solutions/ai_assistant_source_api_solutions_solution_id_ai_assistant_source_post.py deleted file mode 100644 index ed6201d..0000000 --- a/seclai/_generated/api/solutions/ai_assistant_source_api_solutions_solution_id_ai_assistant_source_post.py +++ /dev/null @@ -1,238 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.ai_assistant_generate_request import AiAssistantGenerateRequest -from ...models.ai_assistant_generate_response import AiAssistantGenerateResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/solutions/{solution_id}/ai-assistant/source".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AiAssistantGenerateResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AiAssistantGenerateResponse | 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( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: - """Generate source plan - - Generate a content source plan via the source AI assistant. - - Describe what sources you need in natural language and the assistant will propose a plan with - create, update, or delete actions. Review the proposed actions and use the accept or decline - endpoint to execute or discard the plan. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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[AiAssistantGenerateResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - """Generate source plan - - Generate a content source plan via the source AI assistant. - - Describe what sources you need in natural language and the assistant will propose a plan with - create, update, or delete actions. Review the proposed actions and use the accept or decline - endpoint to execute or discard the plan. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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: - AiAssistantGenerateResponse | HTTPValidationError - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[AiAssistantGenerateResponse | HTTPValidationError]: - """Generate source plan - - Generate a content source plan via the source AI assistant. - - Describe what sources you need in natural language and the assistant will propose a plan with - create, update, or delete actions. Review the proposed actions and use the accept or decline - endpoint to execute or discard the plan. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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[AiAssistantGenerateResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: AiAssistantGenerateRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> AiAssistantGenerateResponse | HTTPValidationError | None: - """Generate source plan - - Generate a content source plan via the source AI assistant. - - Describe what sources you need in natural language and the assistant will propose a plan with - create, update, or delete actions. Review the proposed actions and use the accept or decline - endpoint to execute or discard the plan. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (AiAssistantGenerateRequest): Request body for AI assistant generate endpoints. - - 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: - AiAssistantGenerateResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/create_solution_api_solutions_post.py b/seclai/_generated/api/solutions/create_solution_api_solutions_post.py deleted file mode 100644 index cd7a18d..0000000 --- a/seclai/_generated/api/solutions/create_solution_api_solutions_post.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_solution_request import CreateSolutionRequest -from ...models.http_validation_error import HTTPValidationError -from ...models.solution_response import SolutionResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: CreateSolutionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/solutions", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: - if response.status_code == 201: - response_201 = SolutionResponse.from_dict(response.json()) - - return response_201 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: - 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: AuthenticatedClient | Client, - body: CreateSolutionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Create a solution - - Create a new solution for the caller's account. - - A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Provide a - `name` and optional `description` in the request body. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateSolutionRequest): Request model for creating a new solution - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateSolutionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Create a solution - - Create a new solution for the caller's account. - - A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Provide a - `name` and optional `description` in the request body. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateSolutionRequest): Request model for creating a new solution - - 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 | SolutionResponse - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateSolutionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Create a solution - - Create a new solution for the caller's account. - - A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Provide a - `name` and optional `description` in the request body. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateSolutionRequest): Request model for creating a new solution - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateSolutionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Create a solution - - Create a new solution for the caller's account. - - A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Provide a - `name` and optional `description` in the request body. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateSolutionRequest): Request model for creating a new solution - - 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 | SolutionResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/delete_solution_api_solutions_solution_id_delete.py b/seclai/_generated/api/solutions/delete_solution_api_solutions_solution_id_delete.py deleted file mode 100644 index d5142a9..0000000 --- a/seclai/_generated/api/solutions/delete_solution_api_solutions_solution_id_delete.py +++ /dev/null @@ -1,214 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/solutions/{solution_id}".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete a solution - - Delete a solution by its ID. - - This permanently removes the solution and all its resource associations (agent links, knowledge base - links, source connection links). The underlying resources themselves are not deleted. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - solution_id=solution_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete a solution - - Delete a solution by its ID. - - This permanently removes the solution and all its resource associations (agent links, knowledge base - links, source connection links). The underlying resources themselves are not deleted. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - solution_id=solution_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete a solution - - Delete a solution by its ID. - - This permanently removes the solution and all its resource associations (agent links, knowledge base - links, source connection links). The underlying resources themselves are not deleted. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - solution_id=solution_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete a solution - - Delete a solution by its ID. - - This permanently removes the solution and all its resource associations (agent links, knowledge base - links, source connection links). The underlying resources themselves are not deleted. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - solution_id=solution_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/get_solution_api_solutions_solution_id_get.py b/seclai/_generated/api/solutions/get_solution_api_solutions_solution_id_get.py deleted file mode 100644 index ae5c7f1..0000000 --- a/seclai/_generated/api/solutions/get_solution_api_solutions_solution_id_get.py +++ /dev/null @@ -1,212 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.solution_response import SolutionResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/solutions/{solution_id}".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: - if response.status_code == 200: - response_200 = SolutionResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Get a solution - - Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections. - - Returns the full solution detail with nested resource information. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Get a solution - - Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections. - - Returns the full solution detail with nested resource information. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SolutionResponse - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Get a solution - - Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections. - - Returns the full solution detail with nested resource information. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Get a solution - - Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections. - - Returns the full solution detail with nested resource information. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SolutionResponse - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/link_agents_api_solutions_solution_id_agents_post.py b/seclai/_generated/api/solutions/link_agents_api_solutions_solution_id_agents_post.py deleted file mode 100644 index 6bc5316..0000000 --- a/seclai/_generated/api/solutions/link_agents_api_solutions_solution_id_agents_post.py +++ /dev/null @@ -1,234 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.link_resources_request import LinkResourcesRequest -from ...models.solution_response import SolutionResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/solutions/{solution_id}/agents".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: - if response.status_code == 200: - response_200 = SolutionResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Link agents - - Link one or more agents to a solution by their IDs. - - Pass a JSON body with an `ids` array of agent UUIDs. Already-linked agents are silently ignored. - Returns the updated solution with all linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (LinkResourcesRequest): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Link agents - - Link one or more agents to a solution by their IDs. - - Pass a JSON body with an `ids` array of agent UUIDs. Already-linked agents are silently ignored. - Returns the updated solution with all linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (LinkResourcesRequest): - - 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 | SolutionResponse - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Link agents - - Link one or more agents to a solution by their IDs. - - Pass a JSON body with an `ids` array of agent UUIDs. Already-linked agents are silently ignored. - Returns the updated solution with all linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (LinkResourcesRequest): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Link agents - - Link one or more agents to a solution by their IDs. - - Pass a JSON body with an `ids` array of agent UUIDs. Already-linked agents are silently ignored. - Returns the updated solution with all linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (LinkResourcesRequest): - - 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 | SolutionResponse - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/link_knowledge_bases_api_solutions_solution_id_knowledge_bases_post.py b/seclai/_generated/api/solutions/link_knowledge_bases_api_solutions_solution_id_knowledge_bases_post.py deleted file mode 100644 index 2a21e45..0000000 --- a/seclai/_generated/api/solutions/link_knowledge_bases_api_solutions_solution_id_knowledge_bases_post.py +++ /dev/null @@ -1,234 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.link_resources_request import LinkResourcesRequest -from ...models.solution_response import SolutionResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/solutions/{solution_id}/knowledge-bases".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: - if response.status_code == 200: - response_200 = SolutionResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Link knowledge bases - - Link one or more knowledge bases to a solution by their IDs. - - Pass a JSON body with an `ids` array of knowledge base UUIDs. Already-linked knowledge bases are - silently ignored. Returns the updated solution with all linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (LinkResourcesRequest): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Link knowledge bases - - Link one or more knowledge bases to a solution by their IDs. - - Pass a JSON body with an `ids` array of knowledge base UUIDs. Already-linked knowledge bases are - silently ignored. Returns the updated solution with all linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (LinkResourcesRequest): - - 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 | SolutionResponse - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Link knowledge bases - - Link one or more knowledge bases to a solution by their IDs. - - Pass a JSON body with an `ids` array of knowledge base UUIDs. Already-linked knowledge bases are - silently ignored. Returns the updated solution with all linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (LinkResourcesRequest): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Link knowledge bases - - Link one or more knowledge bases to a solution by their IDs. - - Pass a JSON body with an `ids` array of knowledge base UUIDs. Already-linked knowledge bases are - silently ignored. Returns the updated solution with all linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (LinkResourcesRequest): - - 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 | SolutionResponse - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/link_source_connections_api_solutions_solution_id_source_connections_post.py b/seclai/_generated/api/solutions/link_source_connections_api_solutions_solution_id_source_connections_post.py deleted file mode 100644 index 469dc2c..0000000 --- a/seclai/_generated/api/solutions/link_source_connections_api_solutions_solution_id_source_connections_post.py +++ /dev/null @@ -1,234 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.link_resources_request import LinkResourcesRequest -from ...models.solution_response import SolutionResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/solutions/{solution_id}/source-connections".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: - if response.status_code == 200: - response_200 = SolutionResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Link source connections - - Link one or more source connections to a solution by their IDs. - - Pass a JSON body with an `ids` array of source connection UUIDs. Already-linked sources are silently - ignored. Returns the updated solution with all linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (LinkResourcesRequest): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Link source connections - - Link one or more source connections to a solution by their IDs. - - Pass a JSON body with an `ids` array of source connection UUIDs. Already-linked sources are silently - ignored. Returns the updated solution with all linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (LinkResourcesRequest): - - 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 | SolutionResponse - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Link source connections - - Link one or more source connections to a solution by their IDs. - - Pass a JSON body with an `ids` array of source connection UUIDs. Already-linked sources are silently - ignored. Returns the updated solution with all linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (LinkResourcesRequest): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: LinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Link source connections - - Link one or more source connections to a solution by their IDs. - - Pass a JSON body with an `ids` array of source connection UUIDs. Already-linked sources are silently - ignored. Returns the updated solution with all linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (LinkResourcesRequest): - - 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 | SolutionResponse - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/list_conversations_api_solutions_solution_id_conversations_get.py b/seclai/_generated/api/solutions/list_conversations_api_solutions_solution_id_conversations_get.py deleted file mode 100644 index 113c752..0000000 --- a/seclai/_generated/api/solutions/list_conversations_api_solutions_solution_id_conversations_get.py +++ /dev/null @@ -1,223 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.solution_conversation_response import SolutionConversationResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/solutions/{solution_id}/conversations".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | list[SolutionConversationResponse] | None: - if response.status_code == 200: - response_200 = [] - _response_200 = response.json() - for response_200_item_data in _response_200: - response_200_item = SolutionConversationResponse.from_dict( - response_200_item_data - ) - - response_200.append(response_200_item) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | list[SolutionConversationResponse]]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[SolutionConversationResponse]]: - """List conversations - - List AI assistant conversation history for a solution. - - Returns all conversation turns for the given solution, including user inputs, AI responses, proposed - actions, and acceptance status. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[SolutionConversationResponse]] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[SolutionConversationResponse] | None: - """List conversations - - List AI assistant conversation history for a solution. - - Returns all conversation turns for the given solution, including user inputs, AI responses, proposed - actions, and acceptance status. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[SolutionConversationResponse] - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | list[SolutionConversationResponse]]: - """List conversations - - List AI assistant conversation history for a solution. - - Returns all conversation turns for the given solution, including user inputs, AI responses, proposed - actions, and acceptance status. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[SolutionConversationResponse]] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | list[SolutionConversationResponse] | None: - """List conversations - - List AI assistant conversation history for a solution. - - Returns all conversation turns for the given solution, including user inputs, AI responses, proposed - actions, and acceptance status. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | list[SolutionConversationResponse] - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/list_solutions_api_solutions_get.py b/seclai/_generated/api/solutions/list_solutions_api_solutions_get.py deleted file mode 100644 index da2730f..0000000 --- a/seclai/_generated/api/solutions/list_solutions_api_solutions_get.py +++ /dev/null @@ -1,317 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.solution_list_response import SolutionListResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - search: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - params["sort"] = sort - - params["order"] = order - - json_search: None | str | Unset - if isinstance(search, Unset): - json_search = UNSET - else: - json_search = search - params["search"] = json_search - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/solutions", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionListResponse | None: - if response.status_code == 200: - response_200 = SolutionListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionListResponse]: - 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: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - search: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionListResponse]: - """List solutions - - List solutions for your account. - - A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Use solutions - to organise related resources and leverage AI assistants for automated setup. - - Parameters: - - Pagination: `page` and `limit`. - - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). - - Filtering: `search` to filter by solution name (case-insensitive partial match). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - sort (str | Unset): Sort field Default: 'created_at'. - order (str | Unset): Sort order Default: 'desc'. - search (None | str | Unset): Filter by solution name (case-insensitive partial match) - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SolutionListResponse] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - sort=sort, - order=order, - search=search, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - search: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionListResponse | None: - """List solutions - - List solutions for your account. - - A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Use solutions - to organise related resources and leverage AI assistants for automated setup. - - Parameters: - - Pagination: `page` and `limit`. - - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). - - Filtering: `search` to filter by solution name (case-insensitive partial match). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - sort (str | Unset): Sort field Default: 'created_at'. - order (str | Unset): Sort order Default: 'desc'. - search (None | str | Unset): Filter by solution name (case-insensitive partial match) - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SolutionListResponse - """ - - return sync_detailed( - client=client, - page=page, - limit=limit, - sort=sort, - order=order, - search=search, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - search: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionListResponse]: - """List solutions - - List solutions for your account. - - A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Use solutions - to organise related resources and leverage AI assistants for automated setup. - - Parameters: - - Pagination: `page` and `limit`. - - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). - - Filtering: `search` to filter by solution name (case-insensitive partial match). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - sort (str | Unset): Sort field Default: 'created_at'. - order (str | Unset): Sort order Default: 'desc'. - search (None | str | Unset): Filter by solution name (case-insensitive partial match) - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SolutionListResponse] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - sort=sort, - order=order, - search=search, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - search: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionListResponse | None: - """List solutions - - List solutions for your account. - - A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Use solutions - to organise related resources and leverage AI assistants for automated setup. - - Parameters: - - Pagination: `page` and `limit`. - - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). - - Filtering: `search` to filter by solution name (case-insensitive partial match). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - sort (str | Unset): Sort field Default: 'created_at'. - order (str | Unset): Sort order Default: 'desc'. - search (None | str | Unset): Filter by solution name (case-insensitive partial match) - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SolutionListResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - limit=limit, - sort=sort, - order=order, - search=search, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/mark_conversation_turn_api_solutions_solution_id_conversations_conversation_id_patch.py b/seclai/_generated/api/solutions/mark_conversation_turn_api_solutions_solution_id_conversations_conversation_id_patch.py deleted file mode 100644 index 36c5d6c..0000000 --- a/seclai/_generated/api/solutions/mark_conversation_turn_api_solutions_solution_id_conversations_conversation_id_patch.py +++ /dev/null @@ -1,246 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.mark_conversation_turn_request import MarkConversationTurnRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - conversation_id: UUID, - *, - body: MarkConversationTurnRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/solutions/{solution_id}/conversations/{conversation_id}".format( - solution_id=quote(str(solution_id), safe=""), - conversation_id=quote(str(conversation_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - solution_id: UUID, - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: MarkConversationTurnRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Mark conversation turn - - Mark a conversation turn as accepted or declined. - - Updates the `accepted` field on an existing conversation turn. Use this after reviewing a proposed - plan to record whether it was accepted or declined by the user. - - Args: - solution_id (UUID): - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MarkConversationTurnRequest): - - 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( - solution_id=solution_id, - conversation_id=conversation_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: MarkConversationTurnRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Mark conversation turn - - Mark a conversation turn as accepted or declined. - - Updates the `accepted` field on an existing conversation turn. Use this after reviewing a proposed - plan to record whether it was accepted or declined by the user. - - Args: - solution_id (UUID): - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MarkConversationTurnRequest): - - 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( - solution_id=solution_id, - conversation_id=conversation_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: MarkConversationTurnRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Mark conversation turn - - Mark a conversation turn as accepted or declined. - - Updates the `accepted` field on an existing conversation turn. Use this after reviewing a proposed - plan to record whether it was accepted or declined by the user. - - Args: - solution_id (UUID): - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MarkConversationTurnRequest): - - 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( - solution_id=solution_id, - conversation_id=conversation_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - conversation_id: UUID, - *, - client: AuthenticatedClient | Client, - body: MarkConversationTurnRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Mark conversation turn - - Mark a conversation turn as accepted or declined. - - Updates the `accepted` field on an existing conversation turn. Use this after reviewing a proposed - plan to record whether it was accepted or declined by the user. - - Args: - solution_id (UUID): - conversation_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (MarkConversationTurnRequest): - - 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( - solution_id=solution_id, - conversation_id=conversation_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/unlink_agents_api_solutions_solution_id_agents_delete.py b/seclai/_generated/api/solutions/unlink_agents_api_solutions_solution_id_agents_delete.py deleted file mode 100644 index 39c4757..0000000 --- a/seclai/_generated/api/solutions/unlink_agents_api_solutions_solution_id_agents_delete.py +++ /dev/null @@ -1,234 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.solution_response import SolutionResponse -from ...models.unlink_resources_request import UnlinkResourcesRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/solutions/{solution_id}/agents".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: - if response.status_code == 200: - response_200 = SolutionResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Unlink agents - - Unlink one or more agents from a solution by their IDs. - - Pass a JSON body with an `ids` array of agent UUIDs to remove. Agents not currently linked are - silently ignored. Returns the updated solution with remaining linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UnlinkResourcesRequest): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Unlink agents - - Unlink one or more agents from a solution by their IDs. - - Pass a JSON body with an `ids` array of agent UUIDs to remove. Agents not currently linked are - silently ignored. Returns the updated solution with remaining linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UnlinkResourcesRequest): - - 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 | SolutionResponse - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Unlink agents - - Unlink one or more agents from a solution by their IDs. - - Pass a JSON body with an `ids` array of agent UUIDs to remove. Agents not currently linked are - silently ignored. Returns the updated solution with remaining linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UnlinkResourcesRequest): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Unlink agents - - Unlink one or more agents from a solution by their IDs. - - Pass a JSON body with an `ids` array of agent UUIDs to remove. Agents not currently linked are - silently ignored. Returns the updated solution with remaining linked resources. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UnlinkResourcesRequest): - - 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 | SolutionResponse - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/unlink_knowledge_bases_api_solutions_solution_id_knowledge_bases_delete.py b/seclai/_generated/api/solutions/unlink_knowledge_bases_api_solutions_solution_id_knowledge_bases_delete.py deleted file mode 100644 index 00b5690..0000000 --- a/seclai/_generated/api/solutions/unlink_knowledge_bases_api_solutions_solution_id_knowledge_bases_delete.py +++ /dev/null @@ -1,234 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.solution_response import SolutionResponse -from ...models.unlink_resources_request import UnlinkResourcesRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/solutions/{solution_id}/knowledge-bases".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: - if response.status_code == 200: - response_200 = SolutionResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Unlink knowledge bases - - Unlink one or more knowledge bases from a solution by their IDs. - - Pass a JSON body with an `ids` array of knowledge base UUIDs to remove. Knowledge bases not - currently linked are silently ignored. Returns the updated solution. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UnlinkResourcesRequest): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Unlink knowledge bases - - Unlink one or more knowledge bases from a solution by their IDs. - - Pass a JSON body with an `ids` array of knowledge base UUIDs to remove. Knowledge bases not - currently linked are silently ignored. Returns the updated solution. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UnlinkResourcesRequest): - - 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 | SolutionResponse - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Unlink knowledge bases - - Unlink one or more knowledge bases from a solution by their IDs. - - Pass a JSON body with an `ids` array of knowledge base UUIDs to remove. Knowledge bases not - currently linked are silently ignored. Returns the updated solution. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UnlinkResourcesRequest): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Unlink knowledge bases - - Unlink one or more knowledge bases from a solution by their IDs. - - Pass a JSON body with an `ids` array of knowledge base UUIDs to remove. Knowledge bases not - currently linked are silently ignored. Returns the updated solution. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UnlinkResourcesRequest): - - 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 | SolutionResponse - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/unlink_source_connections_api_solutions_solution_id_source_connections_delete.py b/seclai/_generated/api/solutions/unlink_source_connections_api_solutions_solution_id_source_connections_delete.py deleted file mode 100644 index da920c1..0000000 --- a/seclai/_generated/api/solutions/unlink_source_connections_api_solutions_solution_id_source_connections_delete.py +++ /dev/null @@ -1,234 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.solution_response import SolutionResponse -from ...models.unlink_resources_request import UnlinkResourcesRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/solutions/{solution_id}/source-connections".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: - if response.status_code == 200: - response_200 = SolutionResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Unlink source connections - - Unlink one or more source connections from a solution by their IDs. - - Pass a JSON body with an `ids` array of source connection UUIDs to remove. Sources not currently - linked are silently ignored. Returns the updated solution. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UnlinkResourcesRequest): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Unlink source connections - - Unlink one or more source connections from a solution by their IDs. - - Pass a JSON body with an `ids` array of source connection UUIDs to remove. Sources not currently - linked are silently ignored. Returns the updated solution. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UnlinkResourcesRequest): - - 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 | SolutionResponse - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Unlink source connections - - Unlink one or more source connections from a solution by their IDs. - - Pass a JSON body with an `ids` array of source connection UUIDs to remove. Sources not currently - linked are silently ignored. Returns the updated solution. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UnlinkResourcesRequest): - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UnlinkResourcesRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Unlink source connections - - Unlink one or more source connections from a solution by their IDs. - - Pass a JSON body with an `ids` array of source connection UUIDs to remove. Sources not currently - linked are silently ignored. Returns the updated solution. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UnlinkResourcesRequest): - - 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 | SolutionResponse - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/solutions/update_solution_api_solutions_solution_id_patch.py b/seclai/_generated/api/solutions/update_solution_api_solutions_solution_id_patch.py deleted file mode 100644 index 3d7f917..0000000 --- a/seclai/_generated/api/solutions/update_solution_api_solutions_solution_id_patch.py +++ /dev/null @@ -1,230 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.solution_response import SolutionResponse -from ...models.update_solution_request import UpdateSolutionRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - solution_id: UUID, - *, - body: UpdateSolutionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/solutions/{solution_id}".format( - solution_id=quote(str(solution_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SolutionResponse | None: - if response.status_code == 200: - response_200 = SolutionResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SolutionResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UpdateSolutionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Update a solution - - Update an existing solution's name or description. - - Pass the fields you wish to change in the request body. Fields not included remain unchanged. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateSolutionRequest): Request model for updating a solution - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UpdateSolutionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Update a solution - - Update an existing solution's name or description. - - Pass the fields you wish to change in the request body. Fields not included remain unchanged. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateSolutionRequest): Request model for updating a solution - - 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 | SolutionResponse - """ - - return sync_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UpdateSolutionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SolutionResponse]: - """Update a solution - - Update an existing solution's name or description. - - Pass the fields you wish to change in the request body. Fields not included remain unchanged. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateSolutionRequest): Request model for updating a solution - - 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 | SolutionResponse] - """ - - kwargs = _get_kwargs( - solution_id=solution_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - solution_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UpdateSolutionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SolutionResponse | None: - """Update a solution - - Update an existing solution's name or description. - - Pass the fields you wish to change in the request body. Fields not included remain unchanged. - - Args: - solution_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateSolutionRequest): Request model for updating a solution - - 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 | SolutionResponse - """ - - return ( - await asyncio_detailed( - solution_id=solution_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/source_exports/__init__.py b/seclai/_generated/api/source_exports/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/source_exports/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/source_exports/cancel_source_export_api_sources_source_connection_id_exports_export_id_cancel_post.py b/seclai/_generated/api/source_exports/cancel_source_export_api_sources_source_connection_id_exports_export_id_cancel_post.py deleted file mode 100644 index c5d82e7..0000000 --- a/seclai/_generated/api/source_exports/cancel_source_export_api_sources_source_connection_id_exports_export_id_cancel_post.py +++ /dev/null @@ -1,222 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.export_response import ExportResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - export_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/sources/{source_connection_id}/exports/{export_id}/cancel".format( - source_connection_id=quote(str(source_connection_id), safe=""), - export_id=quote(str(export_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ExportResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = ExportResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ExportResponse | 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( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ExportResponse | HTTPValidationError]: - """Cancel export - - Cancel a pending or running export. The background task will stop at the next chunk boundary. - Completed, failed, expired, or already-cancelled exports cannot be cancelled. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ExportResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - export_id=export_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ExportResponse | HTTPValidationError | None: - """Cancel export - - Cancel a pending or running export. The background task will stop at the next chunk boundary. - Completed, failed, expired, or already-cancelled exports cannot be cancelled. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ExportResponse | HTTPValidationError - """ - - return sync_detailed( - source_connection_id=source_connection_id, - export_id=export_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ExportResponse | HTTPValidationError]: - """Cancel export - - Cancel a pending or running export. The background task will stop at the next chunk boundary. - Completed, failed, expired, or already-cancelled exports cannot be cancelled. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ExportResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - export_id=export_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ExportResponse | HTTPValidationError | None: - """Cancel export - - Cancel a pending or running export. The background task will stop at the next chunk boundary. - Completed, failed, expired, or already-cancelled exports cannot be cancelled. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ExportResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - export_id=export_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/source_exports/create_source_export_api_sources_source_connection_id_exports_post.py b/seclai/_generated/api/source_exports/create_source_export_api_sources_source_connection_id_exports_post.py deleted file mode 100644 index 09899b1..0000000 --- a/seclai/_generated/api/source_exports/create_source_export_api_sources_source_connection_id_exports_post.py +++ /dev/null @@ -1,226 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_export_request import CreateExportRequest -from ...models.export_response import ExportResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - *, - body: CreateExportRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/sources/{source_connection_id}/exports".format( - source_connection_id=quote(str(source_connection_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ExportResponse | HTTPValidationError | None: - if response.status_code == 202: - response_202 = ExportResponse.from_dict(response.json()) - - return response_202 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ExportResponse | 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( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: CreateExportRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ExportResponse | HTTPValidationError]: - """Create export - - Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, - then use /download to retrieve the file. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateExportRequest): Parameters for creating a new export job. - - 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[ExportResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: CreateExportRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ExportResponse | HTTPValidationError | None: - """Create export - - Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, - then use /download to retrieve the file. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateExportRequest): Parameters for creating a new export job. - - 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: - ExportResponse | HTTPValidationError - """ - - return sync_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: CreateExportRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ExportResponse | HTTPValidationError]: - """Create export - - Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, - then use /download to retrieve the file. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateExportRequest): Parameters for creating a new export job. - - 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[ExportResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: CreateExportRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ExportResponse | HTTPValidationError | None: - """Create export - - Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, - then use /download to retrieve the file. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateExportRequest): Parameters for creating a new export job. - - 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: - ExportResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/source_exports/delete_source_export_api_sources_source_connection_id_exports_export_id_delete.py b/seclai/_generated/api/source_exports/delete_source_export_api_sources_source_connection_id_exports_export_id_delete.py deleted file mode 100644 index 352099a..0000000 --- a/seclai/_generated/api/source_exports/delete_source_export_api_sources_source_connection_id_exports_export_id_delete.py +++ /dev/null @@ -1,220 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - export_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/sources/{source_connection_id}/exports/{export_id}".format( - source_connection_id=quote(str(source_connection_id), safe=""), - export_id=quote(str(export_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete export - - Delete an export job and remove the associated file from S3. This is a soft-delete: the database - record is retained for audit purposes but the backing file is permanently removed. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_id=source_connection_id, - export_id=export_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete export - - Delete an export job and remove the associated file from S3. This is a soft-delete: the database - record is retained for audit purposes but the backing file is permanently removed. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_id=source_connection_id, - export_id=export_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete export - - Delete an export job and remove the associated file from S3. This is a soft-delete: the database - record is retained for audit purposes but the backing file is permanently removed. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_id=source_connection_id, - export_id=export_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete export - - Delete an export job and remove the associated file from S3. This is a soft-delete: the database - record is retained for audit purposes but the backing file is permanently removed. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_id=source_connection_id, - export_id=export_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/source_exports/download_source_export_api_sources_source_connection_id_exports_export_id_download_get.py b/seclai/_generated/api/source_exports/download_source_export_api_sources_source_connection_id_exports_export_id_download_get.py deleted file mode 100644 index 25b8df9..0000000 --- a/seclai/_generated/api/source_exports/download_source_export_api_sources_source_connection_id_exports_export_id_download_get.py +++ /dev/null @@ -1,224 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - export_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/sources/{source_connection_id}/exports/{export_id}/download".format( - source_connection_id=quote(str(source_connection_id), safe=""), - export_id=quote(str(export_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - 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 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Download export - - Stream the completed export file. Returns the file content with appropriate Content-Type and - Content-Disposition headers. Returns 409 if the export is not yet completed and 410 if it has - expired. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_id=source_connection_id, - export_id=export_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Download export - - Stream the completed export file. Returns the file content with appropriate Content-Type and - Content-Disposition headers. Returns 409 if the export is not yet completed and 410 if it has - expired. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_id=source_connection_id, - export_id=export_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Download export - - Stream the completed export file. Returns the file content with appropriate Content-Type and - Content-Disposition headers. Returns 409 if the export is not yet completed and 410 if it has - expired. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_id=source_connection_id, - export_id=export_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Download export - - Stream the completed export file. Returns the file content with appropriate Content-Type and - Content-Disposition headers. Returns 409 if the export is not yet completed and 410 if it has - expired. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_id=source_connection_id, - export_id=export_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/source_exports/estimate_source_export_api_sources_source_connection_id_exports_estimate_post.py b/seclai/_generated/api/source_exports/estimate_source_export_api_sources_source_connection_id_exports_estimate_post.py deleted file mode 100644 index 112d656..0000000 --- a/seclai/_generated/api/source_exports/estimate_source_export_api_sources_source_connection_id_exports_estimate_post.py +++ /dev/null @@ -1,226 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.estimate_export_request import EstimateExportRequest -from ...models.estimate_export_response import EstimateExportResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - *, - body: EstimateExportRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/sources/{source_connection_id}/exports/estimate".format( - source_connection_id=quote(str(source_connection_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> EstimateExportResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = EstimateExportResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[EstimateExportResponse | 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( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: EstimateExportRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EstimateExportResponse | HTTPValidationError]: - """Estimate export size - - Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use - this to show users how large the download will be before they commit to running the export. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (EstimateExportRequest): Parameters for estimating export size. - - 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[EstimateExportResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: EstimateExportRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EstimateExportResponse | HTTPValidationError | None: - """Estimate export size - - Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use - this to show users how large the download will be before they commit to running the export. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (EstimateExportRequest): Parameters for estimating export size. - - 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: - EstimateExportResponse | HTTPValidationError - """ - - return sync_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: EstimateExportRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[EstimateExportResponse | HTTPValidationError]: - """Estimate export size - - Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use - this to show users how large the download will be before they commit to running the export. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (EstimateExportRequest): Parameters for estimating export size. - - 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[EstimateExportResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: EstimateExportRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> EstimateExportResponse | HTTPValidationError | None: - """Estimate export size - - Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use - this to show users how large the download will be before they commit to running the export. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (EstimateExportRequest): Parameters for estimating export size. - - 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: - EstimateExportResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/source_exports/get_source_export_api_sources_source_connection_id_exports_export_id_get.py b/seclai/_generated/api/source_exports/get_source_export_api_sources_source_connection_id_exports_export_id_get.py deleted file mode 100644 index d1f1b2f..0000000 --- a/seclai/_generated/api/source_exports/get_source_export_api_sources_source_connection_id_exports_export_id_get.py +++ /dev/null @@ -1,222 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.export_response import ExportResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - export_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/sources/{source_connection_id}/exports/{export_id}".format( - source_connection_id=quote(str(source_connection_id), safe=""), - export_id=quote(str(export_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ExportResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = ExportResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ExportResponse | 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( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ExportResponse | HTTPValidationError]: - """Get export status - - Retrieve the current status and progress of an export job. Returns all metadata including progress - counters, file size, item count, and expiration time once completed. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ExportResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - export_id=export_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ExportResponse | HTTPValidationError | None: - """Get export status - - Retrieve the current status and progress of an export job. Returns all metadata including progress - counters, file size, item count, and expiration time once completed. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ExportResponse | HTTPValidationError - """ - - return sync_detailed( - source_connection_id=source_connection_id, - export_id=export_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ExportResponse | HTTPValidationError]: - """Get export status - - Retrieve the current status and progress of an export job. Returns all metadata including progress - counters, file size, item count, and expiration time once completed. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ExportResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - export_id=export_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - export_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ExportResponse | HTTPValidationError | None: - """Get export status - - Retrieve the current status and progress of an export job. Returns all metadata including progress - counters, file size, item count, and expiration time once completed. - - Args: - source_connection_id (UUID): - export_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ExportResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - export_id=export_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/source_exports/list_source_exports_api_sources_source_connection_id_exports_get.py b/seclai/_generated/api/source_exports/list_source_exports_api_sources_source_connection_id_exports_get.py deleted file mode 100644 index 76434e6..0000000 --- a/seclai/_generated/api/source_exports/list_source_exports_api_sources_source_connection_id_exports_get.py +++ /dev/null @@ -1,247 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.export_list_response import ExportListResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - *, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/sources/{source_connection_id}/exports".format( - source_connection_id=quote(str(source_connection_id), safe=""), - ), - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ExportListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = ExportListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ExportListResponse | 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( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ExportListResponse | HTTPValidationError]: - """List exports - - List all export jobs for a source connection, ordered newest first. Supports pagination via - ``page`` and ``limit`` query parameters. Returns status, progress, and file metadata for each - export. - - Args: - source_connection_id (UUID): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ExportListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ExportListResponse | HTTPValidationError | None: - """List exports - - List all export jobs for a source connection, ordered newest first. Supports pagination via - ``page`` and ``limit`` query parameters. Returns status, progress, and file metadata for each - export. - - Args: - source_connection_id (UUID): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ExportListResponse | HTTPValidationError - """ - - return sync_detailed( - source_connection_id=source_connection_id, - client=client, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ExportListResponse | HTTPValidationError]: - """List exports - - List all export jobs for a source connection, ordered newest first. Supports pagination via - ``page`` and ``limit`` query parameters. Returns status, progress, and file metadata for each - export. - - Args: - source_connection_id (UUID): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ExportListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ExportListResponse | HTTPValidationError | None: - """List exports - - List all export jobs for a source connection, ordered newest first. Supports pagination via - ``page`` and ``limit`` query parameters. Returns status, progress, and file metadata for each - export. - - Args: - source_connection_id (UUID): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ExportListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - client=client, - page=page, - limit=limit, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/sources/__init__.py b/seclai/_generated/api/sources/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/sources/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/sources/cancel_source_embedding_migration_api_sources_source_connection_id_embedding_migration_cancel_post.py b/seclai/_generated/api/sources/cancel_source_embedding_migration_api_sources_source_connection_id_embedding_migration_cancel_post.py deleted file mode 100644 index 7610c7f..0000000 --- a/seclai/_generated/api/sources/cancel_source_embedding_migration_api_sources_source_connection_id_embedding_migration_cancel_post.py +++ /dev/null @@ -1,214 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.source_embedding_migration_response import ( - SourceEmbeddingMigrationResponse, -) -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/sources/{source_connection_id}/embedding-migration/cancel".format( - source_connection_id=quote(str(source_connection_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SourceEmbeddingMigrationResponse | None: - if response.status_code == 200: - response_200 = SourceEmbeddingMigrationResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SourceEmbeddingMigrationResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceEmbeddingMigrationResponse]: - """Cancel Source Embedding Migration - - Cancel an active embedding migration for a custom-index source. - - Only pending, running, or switching migrations can be cancelled. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SourceEmbeddingMigrationResponse] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceEmbeddingMigrationResponse | None: - """Cancel Source Embedding Migration - - Cancel an active embedding migration for a custom-index source. - - Only pending, running, or switching migrations can be cancelled. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SourceEmbeddingMigrationResponse - """ - - return sync_detailed( - source_connection_id=source_connection_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceEmbeddingMigrationResponse]: - """Cancel Source Embedding Migration - - Cancel an active embedding migration for a custom-index source. - - Only pending, running, or switching migrations can be cancelled. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SourceEmbeddingMigrationResponse] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceEmbeddingMigrationResponse | None: - """Cancel Source Embedding Migration - - Cancel an active embedding migration for a custom-index source. - - Only pending, running, or switching migrations can be cancelled. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SourceEmbeddingMigrationResponse - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/sources/create_source_api_sources_post.py b/seclai/_generated/api/sources/create_source_api_sources_post.py deleted file mode 100644 index 0b6b70d..0000000 --- a/seclai/_generated/api/sources/create_source_api_sources_post.py +++ /dev/null @@ -1,246 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_source_body import CreateSourceBody -from ...models.http_validation_error import HTTPValidationError -from ...models.source_response import SourceResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: CreateSourceBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/sources", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | SourceResponse | None: - if response.status_code == 201: - response_201 = SourceResponse.from_dict(response.json()) - - return response_201 - - if response.status_code == 402: - response_402 = cast(Any, None) - return response_402 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | SourceResponse]: - 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: AuthenticatedClient | Client, - body: CreateSourceBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | SourceResponse]: - """Create Source - - Create a new content source. - - Source types: `rss`, `website`, `custom_index`. - - For RSS and website sources, provide the URL. For custom index sources, the URL is created - automatically. - - For custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), - `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as - an alias for `custom_index` with `index_mode=fast_and_cheap`. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateSourceBody): Request body for creating a content source. - - 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 | SourceResponse] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateSourceBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | SourceResponse | None: - """Create Source - - Create a new content source. - - Source types: `rss`, `website`, `custom_index`. - - For RSS and website sources, provide the URL. For custom index sources, the URL is created - automatically. - - For custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), - `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as - an alias for `custom_index` with `index_mode=fast_and_cheap`. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateSourceBody): Request body for creating a content source. - - 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 | SourceResponse - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateSourceBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | SourceResponse]: - """Create Source - - Create a new content source. - - Source types: `rss`, `website`, `custom_index`. - - For RSS and website sources, provide the URL. For custom index sources, the URL is created - automatically. - - For custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), - `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as - an alias for `custom_index` with `index_mode=fast_and_cheap`. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateSourceBody): Request body for creating a content source. - - 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 | SourceResponse] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateSourceBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | SourceResponse | None: - """Create Source - - Create a new content source. - - Source types: `rss`, `website`, `custom_index`. - - For RSS and website sources, provide the URL. For custom index sources, the URL is created - automatically. - - For custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), - `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as - an alias for `custom_index` with `index_mode=fast_and_cheap`. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (CreateSourceBody): Request body for creating a content source. - - 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 | SourceResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/sources/delete_source_api_sources_source_connection_id_delete.py b/seclai/_generated/api/sources/delete_source_api_sources_source_connection_id_delete.py deleted file mode 100644 index f75100e..0000000 --- a/seclai/_generated/api/sources/delete_source_api_sources_source_connection_id_delete.py +++ /dev/null @@ -1,214 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/sources/{source_connection_id}".format( - source_connection_id=quote(str(source_connection_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete Source - - Soft-delete a content source. This action cannot be undone. - - System-managed sources (such as agent history or conversation memory) cannot be deleted through this - endpoint. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_id=source_connection_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete Source - - Soft-delete a content source. This action cannot be undone. - - System-managed sources (such as agent history or conversation memory) cannot be deleted through this - endpoint. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_id=source_connection_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError]: - """Delete Source - - Soft-delete a content source. This action cannot be undone. - - System-managed sources (such as agent history or conversation memory) cannot be deleted through this - endpoint. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_id=source_connection_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | None: - """Delete Source - - Soft-delete a content source. This action cannot be undone. - - System-managed sources (such as agent history or conversation memory) cannot be deleted through this - endpoint. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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( - source_connection_id=source_connection_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/sources/get_source_api_sources_source_connection_id_get.py b/seclai/_generated/api/sources/get_source_api_sources_source_connection_id_get.py deleted file mode 100644 index fd5ff4d..0000000 --- a/seclai/_generated/api/sources/get_source_api_sources_source_connection_id_get.py +++ /dev/null @@ -1,220 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.source_response import SourceResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/sources/{source_connection_id}".format( - source_connection_id=quote(str(source_connection_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SourceResponse | None: - if response.status_code == 200: - response_200 = SourceResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SourceResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceResponse]: - """Get Source - - Fetch a content source by ID. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access sources belonging to your - account. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SourceResponse] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceResponse | None: - """Get Source - - Fetch a content source by ID. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access sources belonging to your - account. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SourceResponse - """ - - return sync_detailed( - source_connection_id=source_connection_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceResponse]: - """Get Source - - Fetch a content source by ID. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access sources belonging to your - account. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SourceResponse] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceResponse | None: - """Get Source - - Fetch a content source by ID. - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. You can only access sources belonging to your - account. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SourceResponse - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/sources/get_source_embedding_migration_api_sources_source_connection_id_embedding_migration_get.py b/seclai/_generated/api/sources/get_source_embedding_migration_api_sources_source_connection_id_embedding_migration_get.py deleted file mode 100644 index 49c14e7..0000000 --- a/seclai/_generated/api/sources/get_source_embedding_migration_api_sources_source_connection_id_embedding_migration_get.py +++ /dev/null @@ -1,230 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.source_embedding_migration_response import ( - SourceEmbeddingMigrationResponse, -) -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/sources/{source_connection_id}/embedding-migration".format( - source_connection_id=quote(str(source_connection_id), safe=""), - ), - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | None | SourceEmbeddingMigrationResponse | None: - if response.status_code == 200: - - def _parse_response_200( - data: object, - ) -> None | SourceEmbeddingMigrationResponse: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - response_200_type_0 = SourceEmbeddingMigrationResponse.from_dict(data) - - return response_200_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SourceEmbeddingMigrationResponse, data) - - 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 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | None | SourceEmbeddingMigrationResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | None | SourceEmbeddingMigrationResponse]: - """Get Source Embedding Migration - - Get the latest embedding migration status for a custom-index source. - - Returns `null` when no migration has ever been started for this source. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | None | SourceEmbeddingMigrationResponse] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | None | SourceEmbeddingMigrationResponse | None: - """Get Source Embedding Migration - - Get the latest embedding migration status for a custom-index source. - - Returns `null` when no migration has ever been started for this source. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | None | SourceEmbeddingMigrationResponse - """ - - return sync_detailed( - source_connection_id=source_connection_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | None | SourceEmbeddingMigrationResponse]: - """Get Source Embedding Migration - - Get the latest embedding migration status for a custom-index source. - - Returns `null` when no migration has ever been started for this source. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | None | SourceEmbeddingMigrationResponse] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | None | SourceEmbeddingMigrationResponse | None: - """Get Source Embedding Migration - - Get the latest embedding migration status for a custom-index source. - - Returns `null` when no migration has ever been started for this source. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | None | SourceEmbeddingMigrationResponse - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/sources/list_sources_api_sources_get.py b/seclai/_generated/api/sources/list_sources_api_sources_get.py deleted file mode 100644 index 1da1e43..0000000 --- a/seclai/_generated/api/sources/list_sources_api_sources_get.py +++ /dev/null @@ -1,325 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.source_list_response import SourceListResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - account_id: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - params["sort"] = sort - - params["order"] = order - - json_account_id: None | str | Unset - if isinstance(account_id, Unset): - json_account_id = UNSET - else: - json_account_id = account_id - params["account_id"] = json_account_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": "get", - "url": "/sources", - "params": params, - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SourceListResponse | None: - if response.status_code == 200: - response_200 = SourceListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SourceListResponse]: - 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: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - account_id: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceListResponse]: - """List sources - - List content sources for your account. - - A *source* is where Seclai pulls or receives content from — RSS feeds, websites, or content stores - (``custom_index``). Content stores support file uploads and API-driven content ingestion with - configurable index modes (``fast_and_cheap``, ``balanced``, ``slow_and_thorough``, or ``custom``). - - Parameters: - - Pagination: `page` and `limit`. - - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - - The optional `account_id` query param is only allowed when it matches the caller's account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - sort (str | Unset): Sort field Default: 'created_at'. - order (str | Unset): Sort order Default: 'desc'. - account_id (None | str | Unset): List sources for the given account. Defaults to the - caller's account. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SourceListResponse] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - sort=sort, - order=order, - account_id=account_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - account_id: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceListResponse | None: - """List sources - - List content sources for your account. - - A *source* is where Seclai pulls or receives content from — RSS feeds, websites, or content stores - (``custom_index``). Content stores support file uploads and API-driven content ingestion with - configurable index modes (``fast_and_cheap``, ``balanced``, ``slow_and_thorough``, or ``custom``). - - Parameters: - - Pagination: `page` and `limit`. - - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - - The optional `account_id` query param is only allowed when it matches the caller's account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - sort (str | Unset): Sort field Default: 'created_at'. - order (str | Unset): Sort order Default: 'desc'. - account_id (None | str | Unset): List sources for the given account. Defaults to the - caller's account. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SourceListResponse - """ - - return sync_detailed( - client=client, - page=page, - limit=limit, - sort=sort, - order=order, - account_id=account_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - account_id: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceListResponse]: - """List sources - - List content sources for your account. - - A *source* is where Seclai pulls or receives content from — RSS feeds, websites, or content stores - (``custom_index``). Content stores support file uploads and API-driven content ingestion with - configurable index modes (``fast_and_cheap``, ``balanced``, ``slow_and_thorough``, or ``custom``). - - Parameters: - - Pagination: `page` and `limit`. - - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - - The optional `account_id` query param is only allowed when it matches the caller's account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - sort (str | Unset): Sort field Default: 'created_at'. - order (str | Unset): Sort order Default: 'desc'. - account_id (None | str | Unset): List sources for the given account. Defaults to the - caller's account. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SourceListResponse] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - sort=sort, - order=order, - account_id=account_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - account_id: None | str | Unset = UNSET, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceListResponse | None: - """List sources - - List content sources for your account. - - A *source* is where Seclai pulls or receives content from — RSS feeds, websites, or content stores - (``custom_index``). Content stores support file uploads and API-driven content ingestion with - configurable index modes (``fast_and_cheap``, ``balanced``, ``slow_and_thorough``, or ``custom``). - - Parameters: - - Pagination: `page` and `limit`. - - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). - - Auth & scoping: - - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - - The optional `account_id` query param is only allowed when it matches the caller's account. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - sort (str | Unset): Sort field Default: 'created_at'. - order (str | Unset): Sort order Default: 'desc'. - account_id (None | str | Unset): List sources for the given account. Defaults to the - caller's account. - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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 | SourceListResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - limit=limit, - sort=sort, - order=order, - account_id=account_id, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/sources/start_source_embedding_migration_api_sources_source_connection_id_embedding_migration_post.py b/seclai/_generated/api/sources/start_source_embedding_migration_api_sources_source_connection_id_embedding_migration_post.py deleted file mode 100644 index 8db7841..0000000 --- a/seclai/_generated/api/sources/start_source_embedding_migration_api_sources_source_connection_id_embedding_migration_post.py +++ /dev/null @@ -1,282 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.source_embedding_migration_response import ( - SourceEmbeddingMigrationResponse, -) -from ...models.start_source_embedding_migration_request import ( - StartSourceEmbeddingMigrationRequest, -) -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - *, - body: StartSourceEmbeddingMigrationRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/sources/{source_connection_id}/embedding-migration".format( - source_connection_id=quote(str(source_connection_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | SourceEmbeddingMigrationResponse | None: - if response.status_code == 200: - response_200 = SourceEmbeddingMigrationResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 409: - response_409 = cast(Any, None) - return response_409 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | SourceEmbeddingMigrationResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: StartSourceEmbeddingMigrationRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | SourceEmbeddingMigrationResponse]: - """Start Source Embedding Migration - - Start an embedding model migration for a custom-index source. - - The migration runs asynchronously in the background. Poll `GET /sources/{id}/embedding-migration` - to track progress. - - Optionally override chunking configuration (`chunk_size`, `chunk_overlap`, `chunk_language`, - `chunk_separators`, `chunk_regex_separators`). When a chunking field is omitted (null), the current - source's value is preserved. - - Constraints: - - Only `custom_index` source types support migration. - - A migration cannot be started while another is already active. - - The target model + dimensions must differ from the source's current settings. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (StartSourceEmbeddingMigrationRequest): Request payload to start a source embedding - migration. - - 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 | SourceEmbeddingMigrationResponse] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: StartSourceEmbeddingMigrationRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | SourceEmbeddingMigrationResponse | None: - """Start Source Embedding Migration - - Start an embedding model migration for a custom-index source. - - The migration runs asynchronously in the background. Poll `GET /sources/{id}/embedding-migration` - to track progress. - - Optionally override chunking configuration (`chunk_size`, `chunk_overlap`, `chunk_language`, - `chunk_separators`, `chunk_regex_separators`). When a chunking field is omitted (null), the current - source's value is preserved. - - Constraints: - - Only `custom_index` source types support migration. - - A migration cannot be started while another is already active. - - The target model + dimensions must differ from the source's current settings. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (StartSourceEmbeddingMigrationRequest): Request payload to start a source embedding - migration. - - 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 | SourceEmbeddingMigrationResponse - """ - - return sync_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: StartSourceEmbeddingMigrationRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | SourceEmbeddingMigrationResponse]: - """Start Source Embedding Migration - - Start an embedding model migration for a custom-index source. - - The migration runs asynchronously in the background. Poll `GET /sources/{id}/embedding-migration` - to track progress. - - Optionally override chunking configuration (`chunk_size`, `chunk_overlap`, `chunk_language`, - `chunk_separators`, `chunk_regex_separators`). When a chunking field is omitted (null), the current - source's value is preserved. - - Constraints: - - Only `custom_index` source types support migration. - - A migration cannot be started while another is already active. - - The target model + dimensions must differ from the source's current settings. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (StartSourceEmbeddingMigrationRequest): Request payload to start a source embedding - migration. - - 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 | SourceEmbeddingMigrationResponse] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: StartSourceEmbeddingMigrationRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Any | HTTPValidationError | SourceEmbeddingMigrationResponse | None: - """Start Source Embedding Migration - - Start an embedding model migration for a custom-index source. - - The migration runs asynchronously in the background. Poll `GET /sources/{id}/embedding-migration` - to track progress. - - Optionally override chunking configuration (`chunk_size`, `chunk_overlap`, `chunk_language`, - `chunk_separators`, `chunk_regex_separators`). When a chunking field is omitted (null), the current - source's value is preserved. - - Constraints: - - Only `custom_index` source types support migration. - - A migration cannot be started while another is already active. - - The target model + dimensions must differ from the source's current settings. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (StartSourceEmbeddingMigrationRequest): Request payload to start a source embedding - migration. - - 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 | SourceEmbeddingMigrationResponse - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/sources/update_source_api_sources_source_connection_id_put.py b/seclai/_generated/api/sources/update_source_api_sources_source_connection_id_put.py deleted file mode 100644 index ea81c87..0000000 --- a/seclai/_generated/api/sources/update_source_api_sources_source_connection_id_put.py +++ /dev/null @@ -1,234 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.source_response import SourceResponse -from ...models.update_source_body import UpdateSourceBody -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - *, - body: UpdateSourceBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/sources/{source_connection_id}".format( - source_connection_id=quote(str(source_connection_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SourceResponse | None: - if response.status_code == 200: - response_200 = SourceResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SourceResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UpdateSourceBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceResponse]: - """Update Source - - Update a content source's configuration. Only provided fields are changed; omitted fields are left - unchanged. - - System-managed sources only allow `retention_days` updates. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateSourceBody): Request body for updating a content source. - - 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 | SourceResponse] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UpdateSourceBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceResponse | None: - """Update Source - - Update a content source's configuration. Only provided fields are changed; omitted fields are left - unchanged. - - System-managed sources only allow `retention_days` updates. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateSourceBody): Request body for updating a content source. - - 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 | SourceResponse - """ - - return sync_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UpdateSourceBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceResponse]: - """Update Source - - Update a content source's configuration. Only provided fields are changed; omitted fields are left - unchanged. - - System-managed sources only allow `retention_days` updates. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateSourceBody): Request body for updating a content source. - - 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 | SourceResponse] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: UpdateSourceBody, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | SourceResponse | None: - """Update Source - - Update a content source's configuration. Only provided fields are changed; omitted fields are left - unchanged. - - System-managed sources only allow `retention_days` updates. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateSourceBody): Request body for updating a content source. - - 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 | SourceResponse - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/sources/upload_file_to_source_api_sources_source_connection_id_upload_post.py b/seclai/_generated/api/sources/upload_file_to_source_api_sources_source_connection_id_upload_post.py deleted file mode 100644 index 4c46455..0000000 --- a/seclai/_generated/api/sources/upload_file_to_source_api_sources_source_connection_id_upload_post.py +++ /dev/null @@ -1,416 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.body_upload_file_to_source_api_sources_source_connection_id_upload_post import ( - BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, -) -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: str, - *, - body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/sources/{source_connection_id}/upload".format( - source_connection_id=quote(str(source_connection_id), safe=""), - ), - } - - _kwargs["files"] = body.to_multipart() - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | None: - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[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( - source_connection_id: str, - *, - client: AuthenticatedClient | Client, - body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError]: - r"""Upload a file to a content source - - Upload a file to a content source. - - **Maximum file size:** 209715200 bytes. - - **Supported MIME types:** - - `application/epub+zip` - - `application/json` - - `application/pdf` - - `application/vnd.ms-excel` - - `application/vnd.ms-outlook` - - `application/vnd.ms-powerpoint` - - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - - `application/xml` - - `application/zip` - - `audio/flac` - - `audio/mp4` - - `audio/mpeg` - - `audio/ogg` - - `audio/wav` - - `image/bmp` - - `image/gif` - - `image/jpeg` - - `image/png` - - `image/svg+xml` - - `image/tiff` - - `image/webp` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - `video/mp4` - - `video/quicktime` - - `video/x-msvideo` - - Notes: - - If the uploaded file's content type is `application/octet-stream`, the server attempts to infer - the type from the file extension. - - Use `metadata` to attach an arbitrary JSON object of metadata (for example - `metadata={\"author\":\"Ada\",\"category\":\"docs\"}`). - - `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not - override an existing `metadata.title`). - - For backwards compatibility, you can also pass form fields named `metadata_` (for example - `metadata_author=...`). These override keys from `metadata`. - - Response: - - `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this - source. - - Args: - source_connection_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost): - - 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] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: str, - *, - client: AuthenticatedClient | Client, - body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | None: - r"""Upload a file to a content source - - Upload a file to a content source. - - **Maximum file size:** 209715200 bytes. - - **Supported MIME types:** - - `application/epub+zip` - - `application/json` - - `application/pdf` - - `application/vnd.ms-excel` - - `application/vnd.ms-outlook` - - `application/vnd.ms-powerpoint` - - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - - `application/xml` - - `application/zip` - - `audio/flac` - - `audio/mp4` - - `audio/mpeg` - - `audio/ogg` - - `audio/wav` - - `image/bmp` - - `image/gif` - - `image/jpeg` - - `image/png` - - `image/svg+xml` - - `image/tiff` - - `image/webp` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - `video/mp4` - - `video/quicktime` - - `video/x-msvideo` - - Notes: - - If the uploaded file's content type is `application/octet-stream`, the server attempts to infer - the type from the file extension. - - Use `metadata` to attach an arbitrary JSON object of metadata (for example - `metadata={\"author\":\"Ada\",\"category\":\"docs\"}`). - - `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not - override an existing `metadata.title`). - - For backwards compatibility, you can also pass form fields named `metadata_` (for example - `metadata_author=...`). These override keys from `metadata`. - - Response: - - `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this - source. - - Args: - source_connection_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost): - - 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 - """ - - return sync_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: str, - *, - client: AuthenticatedClient | Client, - body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError]: - r"""Upload a file to a content source - - Upload a file to a content source. - - **Maximum file size:** 209715200 bytes. - - **Supported MIME types:** - - `application/epub+zip` - - `application/json` - - `application/pdf` - - `application/vnd.ms-excel` - - `application/vnd.ms-outlook` - - `application/vnd.ms-powerpoint` - - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - - `application/xml` - - `application/zip` - - `audio/flac` - - `audio/mp4` - - `audio/mpeg` - - `audio/ogg` - - `audio/wav` - - `image/bmp` - - `image/gif` - - `image/jpeg` - - `image/png` - - `image/svg+xml` - - `image/tiff` - - `image/webp` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - `video/mp4` - - `video/quicktime` - - `video/x-msvideo` - - Notes: - - If the uploaded file's content type is `application/octet-stream`, the server attempts to infer - the type from the file extension. - - Use `metadata` to attach an arbitrary JSON object of metadata (for example - `metadata={\"author\":\"Ada\",\"category\":\"docs\"}`). - - `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not - override an existing `metadata.title`). - - For backwards compatibility, you can also pass form fields named `metadata_` (for example - `metadata_author=...`). These override keys from `metadata`. - - Response: - - `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this - source. - - Args: - source_connection_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost): - - 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] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: str, - *, - client: AuthenticatedClient | Client, - body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | None: - r"""Upload a file to a content source - - Upload a file to a content source. - - **Maximum file size:** 209715200 bytes. - - **Supported MIME types:** - - `application/epub+zip` - - `application/json` - - `application/pdf` - - `application/vnd.ms-excel` - - `application/vnd.ms-outlook` - - `application/vnd.ms-powerpoint` - - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - - `application/xml` - - `application/zip` - - `audio/flac` - - `audio/mp4` - - `audio/mpeg` - - `audio/ogg` - - `audio/wav` - - `image/bmp` - - `image/gif` - - `image/jpeg` - - `image/png` - - `image/svg+xml` - - `image/tiff` - - `image/webp` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - `video/mp4` - - `video/quicktime` - - `video/x-msvideo` - - Notes: - - If the uploaded file's content type is `application/octet-stream`, the server attempts to infer - the type from the file extension. - - Use `metadata` to attach an arbitrary JSON object of metadata (for example - `metadata={\"author\":\"Ada\",\"category\":\"docs\"}`). - - `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not - override an existing `metadata.title`). - - For backwards compatibility, you can also pass form fields named `metadata_` (for example - `metadata_author=...`). These override keys from `metadata`. - - Response: - - `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this - source. - - Args: - source_connection_id (str): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost): - - 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 - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/sources/upload_inline_text_to_source_api_sources_source_connection_id_post.py b/seclai/_generated/api/sources/upload_inline_text_to_source_api_sources_source_connection_id_post.py deleted file mode 100644 index ec91232..0000000 --- a/seclai/_generated/api/sources/upload_inline_text_to_source_api_sources_source_connection_id_post.py +++ /dev/null @@ -1,280 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.inline_text_upload_request import InlineTextUploadRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_id: UUID, - *, - body: InlineTextUploadRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/sources/{source_connection_id}".format( - source_connection_id=quote(str(source_connection_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | None: - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[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( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: InlineTextUploadRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError]: - """Upload inline text to a content source - - Upload a small text payload to a content source (no multipart/form-data required). - - **Maximum payload size:** 8192 bytes (UTF-8). - - **Supported content types:** - - `application/json` - - `application/xml` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - Notes: - - Use this endpoint for small text payloads; larger files should use `/upload`. - - `title` is merged into `metadata.title` when not already present. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (InlineTextUploadRequest): Request model for inline text uploads. - - 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] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: InlineTextUploadRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | None: - """Upload inline text to a content source - - Upload a small text payload to a content source (no multipart/form-data required). - - **Maximum payload size:** 8192 bytes (UTF-8). - - **Supported content types:** - - `application/json` - - `application/xml` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - Notes: - - Use this endpoint for small text payloads; larger files should use `/upload`. - - `title` is merged into `metadata.title` when not already present. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (InlineTextUploadRequest): Request model for inline text uploads. - - 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 - """ - - return sync_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: InlineTextUploadRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[HTTPValidationError]: - """Upload inline text to a content source - - Upload a small text payload to a content source (no multipart/form-data required). - - **Maximum payload size:** 8192 bytes (UTF-8). - - **Supported content types:** - - `application/json` - - `application/xml` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - Notes: - - Use this endpoint for small text payloads; larger files should use `/upload`. - - `title` is merged into `metadata.title` when not already present. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (InlineTextUploadRequest): Request model for inline text uploads. - - 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] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: UUID, - *, - client: AuthenticatedClient | Client, - body: InlineTextUploadRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> HTTPValidationError | None: - """Upload inline text to a content source - - Upload a small text payload to a content source (no multipart/form-data required). - - **Maximum payload size:** 8192 bytes (UTF-8). - - **Supported content types:** - - `application/json` - - `application/xml` - - `text/csv` - - `text/html` - - `text/markdown` - - `text/plain` - - `text/x-markdown` - - `text/xml` - - Notes: - - Use this endpoint for small text payloads; larger files should use `/upload`. - - `title` is merged into `metadata.title` when not already present. - - Args: - source_connection_id (UUID): - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (InlineTextUploadRequest): Request model for inline text uploads. - - 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 - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/version/__init__.py b/seclai/_generated/api/version/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/api/version/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/api/version/get_api_version_api_version_get.py b/seclai/_generated/api/version/get_api_version_api_version_get.py deleted file mode 100644 index 787051f..0000000 --- a/seclai/_generated/api/version/get_api_version_api_version_get.py +++ /dev/null @@ -1,190 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_version_response import ApiVersionResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/version", - } - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiVersionResponse | None: - if response.status_code == 200: - response_200 = ApiVersionResponse.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiVersionResponse]: - 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: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ApiVersionResponse]: - """Get the account's API version - - Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request - resolved to, and the default/latest/known versions. Pin your account with `PUT /version` or override - per request with the `Seclai-Version` header. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ApiVersionResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ApiVersionResponse | None: - """Get the account's API version - - Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request - resolved to, and the default/latest/known versions. Pin your account with `PUT /version` or override - per request with the `Seclai-Version` header. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ApiVersionResponse - """ - - return sync_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ApiVersionResponse]: - """Get the account's API version - - Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request - resolved to, and the default/latest/known versions. Pin your account with `PUT /version` or override - per request with the `Seclai-Version` header. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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[ApiVersionResponse] - """ - - kwargs = _get_kwargs( - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ApiVersionResponse | None: - """Get the account's API version - - Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request - resolved to, and the default/latest/known versions. Pin your account with `PUT /version` or override - per request with the `Seclai-Version` header. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - - 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: - ApiVersionResponse - """ - - return ( - await asyncio_detailed( - client=client, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/api/version/update_api_version_api_version_put.py b/seclai/_generated/api/version/update_api_version_api_version_put.py deleted file mode 100644 index a98e697..0000000 --- a/seclai/_generated/api/version/update_api_version_api_version_put.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any -from uuid import UUID - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_version_response import ApiVersionResponse -from ...models.http_validation_error import HTTPValidationError -from ...models.update_api_version_request import UpdateApiVersionRequest -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - body: UpdateApiVersionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - if not isinstance(x_account_id, Unset): - headers["X-Account-Id"] = x_account_id - - if not isinstance(seclai_version, Unset): - headers["Seclai-Version"] = seclai_version - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/version", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiVersionResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = ApiVersionResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiVersionResponse | 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: AuthenticatedClient | Client, - body: UpdateApiVersionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ApiVersionResponse | HTTPValidationError]: - """Pin (or clear) the account's API version - - Sets the account's sticky `Seclai-Version` to the given `YYYY-MM-DD` date, or clears it with `null`. - The new pin applies to subsequent header-less requests; a `Seclai-Version` request header still - overrides it. Owner/admin only. `effective_version` in the response reflects the current request, - not the new pin. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateApiVersionRequest): - - 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[ApiVersionResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: UpdateApiVersionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ApiVersionResponse | HTTPValidationError | None: - """Pin (or clear) the account's API version - - Sets the account's sticky `Seclai-Version` to the given `YYYY-MM-DD` date, or clears it with `null`. - The new pin applies to subsequent header-less requests; a `Seclai-Version` request header still - overrides it. Owner/admin only. `effective_version` in the response reflects the current request, - not the new pin. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateApiVersionRequest): - - 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: - ApiVersionResponse | HTTPValidationError - """ - - return sync_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: UpdateApiVersionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> Response[ApiVersionResponse | HTTPValidationError]: - """Pin (or clear) the account's API version - - Sets the account's sticky `Seclai-Version` to the given `YYYY-MM-DD` date, or clears it with `null`. - The new pin applies to subsequent header-less requests; a `Seclai-Version` request header still - overrides it. Owner/admin only. `effective_version` in the response reflects the current request, - not the new pin. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateApiVersionRequest): - - 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[ApiVersionResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: UpdateApiVersionRequest, - x_account_id: UUID | Unset = UNSET, - seclai_version: str | Unset = UNSET, -) -> ApiVersionResponse | HTTPValidationError | None: - """Pin (or clear) the account's API version - - Sets the account's sticky `Seclai-Version` to the given `YYYY-MM-DD` date, or clears it with `null`. - The new pin applies to subsequent header-less requests; a `Seclai-Version` request header still - overrides it. Owner/admin only. `effective_version` in the response reflects the current request, - not the new pin. - - Args: - x_account_id (UUID | Unset): - seclai_version (str | Unset): - body (UpdateApiVersionRequest): - - 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: - ApiVersionResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - x_account_id=x_account_id, - seclai_version=seclai_version, - ) - ).parsed diff --git a/seclai/_generated/client.py b/seclai/_generated/client.py deleted file mode 100644 index 0ab1589..0000000 --- a/seclai/_generated/client.py +++ /dev/null @@ -1,282 +0,0 @@ -import ssl -from typing import Any - -import httpx -from attrs import define, evolve, field - - -@define -class Client: - """A class for keeping track of data related to the API - - The following are accepted as keyword arguments and will be used to construct httpx Clients internally: - - ``base_url``: The base URL for the API, all requests are made to a relative path to this URL - - ``cookies``: A dictionary of cookies to be sent with every request - - ``headers``: A dictionary of headers to be sent with every request - - ``timeout``: The maximum amount of a time a request can take. API functions will raise - httpx.TimeoutException if this is exceeded. - - ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, - but can be set to False for testing purposes. - - ``follow_redirects``: Whether or not to follow redirects. Default value is False. - - ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. - - - Attributes: - raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a - status code that was not documented in the source OpenAPI document. Can also be provided as a keyword - argument to the constructor. - """ - - raise_on_unexpected_status: bool = field(default=False, kw_only=True) - _base_url: str = field(alias="base_url") - _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") - _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: str | bool | ssl.SSLContext = field( - default=True, kw_only=True, alias="verify_ssl" - ) - _follow_redirects: bool = field( - default=False, kw_only=True, alias="follow_redirects" - ) - _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: httpx.Client | None = field(default=None, init=False) - _async_client: httpx.AsyncClient | None = field(default=None, init=False) - - def with_headers(self, headers: dict[str, str]) -> "Client": - """Get a new client matching this one with additional headers""" - if self._client is not None: - self._client.headers.update(headers) - if self._async_client is not None: - self._async_client.headers.update(headers) - return evolve(self, headers={**self._headers, **headers}) - - def with_cookies(self, cookies: dict[str, str]) -> "Client": - """Get a new client matching this one with additional cookies""" - if self._client is not None: - self._client.cookies.update(cookies) - if self._async_client is not None: - self._async_client.cookies.update(cookies) - return evolve(self, cookies={**self._cookies, **cookies}) - - def with_timeout(self, timeout: httpx.Timeout) -> "Client": - """Get a new client matching this one with a new timeout configuration""" - if self._client is not None: - self._client.timeout = timeout - if self._async_client is not None: - self._async_client.timeout = timeout - return evolve(self, timeout=timeout) - - def set_httpx_client(self, client: httpx.Client) -> "Client": - """Manually set the underlying httpx.Client - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._client = client - return self - - def get_httpx_client(self) -> httpx.Client: - """Get the underlying httpx.Client, constructing a new one if not previously set""" - if self._client is None: - self._client = httpx.Client( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._client - - def __enter__(self) -> "Client": - """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" - self.get_httpx_client().__enter__() - return self - - def __exit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for internal httpx.Client (see httpx docs)""" - self.get_httpx_client().__exit__(*args, **kwargs) - - def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": - """Manually set the underlying httpx.AsyncClient - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._async_client = async_client - return self - - def get_async_httpx_client(self) -> httpx.AsyncClient: - """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" - if self._async_client is None: - self._async_client = httpx.AsyncClient( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._async_client - - async def __aenter__(self) -> "Client": - """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" - await self.get_async_httpx_client().__aenter__() - return self - - async def __aexit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" - await self.get_async_httpx_client().__aexit__(*args, **kwargs) - - -@define -class AuthenticatedClient: - """A Client which has been authenticated for use on secured endpoints - - The following are accepted as keyword arguments and will be used to construct httpx Clients internally: - - ``base_url``: The base URL for the API, all requests are made to a relative path to this URL - - ``cookies``: A dictionary of cookies to be sent with every request - - ``headers``: A dictionary of headers to be sent with every request - - ``timeout``: The maximum amount of a time a request can take. API functions will raise - httpx.TimeoutException if this is exceeded. - - ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, - but can be set to False for testing purposes. - - ``follow_redirects``: Whether or not to follow redirects. Default value is False. - - ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. - - - Attributes: - raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a - status code that was not documented in the source OpenAPI document. Can also be provided as a keyword - argument to the constructor. - token: The token to use for authentication - prefix: The prefix to use for the Authorization header - auth_header_name: The name of the Authorization header - """ - - raise_on_unexpected_status: bool = field(default=False, kw_only=True) - _base_url: str = field(alias="base_url") - _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") - _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: str | bool | ssl.SSLContext = field( - default=True, kw_only=True, alias="verify_ssl" - ) - _follow_redirects: bool = field( - default=False, kw_only=True, alias="follow_redirects" - ) - _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: httpx.Client | None = field(default=None, init=False) - _async_client: httpx.AsyncClient | None = field(default=None, init=False) - - token: str - prefix: str = "Bearer" - auth_header_name: str = "Authorization" - - def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": - """Get a new client matching this one with additional headers""" - if self._client is not None: - self._client.headers.update(headers) - if self._async_client is not None: - self._async_client.headers.update(headers) - return evolve(self, headers={**self._headers, **headers}) - - def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": - """Get a new client matching this one with additional cookies""" - if self._client is not None: - self._client.cookies.update(cookies) - if self._async_client is not None: - self._async_client.cookies.update(cookies) - return evolve(self, cookies={**self._cookies, **cookies}) - - def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": - """Get a new client matching this one with a new timeout configuration""" - if self._client is not None: - self._client.timeout = timeout - if self._async_client is not None: - self._async_client.timeout = timeout - return evolve(self, timeout=timeout) - - def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": - """Manually set the underlying httpx.Client - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._client = client - return self - - def get_httpx_client(self) -> httpx.Client: - """Get the underlying httpx.Client, constructing a new one if not previously set""" - if self._client is None: - self._headers[self.auth_header_name] = ( - f"{self.prefix} {self.token}" if self.prefix else self.token - ) - self._client = httpx.Client( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._client - - def __enter__(self) -> "AuthenticatedClient": - """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" - self.get_httpx_client().__enter__() - return self - - def __exit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for internal httpx.Client (see httpx docs)""" - self.get_httpx_client().__exit__(*args, **kwargs) - - def set_async_httpx_client( - self, async_client: httpx.AsyncClient - ) -> "AuthenticatedClient": - """Manually set the underlying httpx.AsyncClient - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._async_client = async_client - return self - - def get_async_httpx_client(self) -> httpx.AsyncClient: - """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" - if self._async_client is None: - self._headers[self.auth_header_name] = ( - f"{self.prefix} {self.token}" if self.prefix else self.token - ) - self._async_client = httpx.AsyncClient( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._async_client - - async def __aenter__(self) -> "AuthenticatedClient": - """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" - await self.get_async_httpx_client().__aenter__() - return self - - async def __aexit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" - await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/seclai/_generated/errors.py b/seclai/_generated/errors.py deleted file mode 100644 index 5f92e76..0000000 --- a/seclai/_generated/errors.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Contains shared errors types that can be raised from API functions""" - - -class UnexpectedStatus(Exception): - """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" - - def __init__(self, status_code: int, content: bytes): - self.status_code = status_code - self.content = content - - super().__init__( - f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" - ) - - -__all__ = ["UnexpectedStatus"] diff --git a/seclai/_generated/models/__init__.py b/seclai/_generated/models/__init__.py deleted file mode 100644 index 74d1c28..0000000 --- a/seclai/_generated/models/__init__.py +++ /dev/null @@ -1,625 +0,0 @@ -"""Contains all the data models used in inputs/outputs""" - -from .add_comment_request import AddCommentRequest -from .add_conversation_turn_request import AddConversationTurnRequest -from .add_conversation_turn_request_actions_taken_type_0 import ( - AddConversationTurnRequestActionsTakenType0, -) -from .add_email_domain_request import AddEmailDomainRequest -from .agent_attachment_refs_api_response import AgentAttachmentRefsApiResponse -from .agent_caller_api_response import AgentCallerApiResponse -from .agent_definition_import_error_response import AgentDefinitionImportErrorResponse -from .agent_definition_response import AgentDefinitionResponse -from .agent_definition_response_definition import AgentDefinitionResponseDefinition -from .agent_definition_response_warnings_type_0_item import ( - AgentDefinitionResponseWarningsType0Item, -) -from .agent_email_opt_out_list_response import AgentEmailOptOutListResponse -from .agent_email_opt_out_response import AgentEmailOptOutResponse -from .agent_evaluation_tier import AgentEvaluationTier -from .agent_export_response import AgentExportResponse -from .agent_export_response_agent import AgentExportResponseAgent -from .agent_export_response_alert_configs_type_0_item import ( - AgentExportResponseAlertConfigsType0Item, -) -from .agent_export_response_dependencies_type_0 import ( - AgentExportResponseDependenciesType0, -) -from .agent_export_response_evaluation_criteria_type_0_item import ( - AgentExportResponseEvaluationCriteriaType0Item, -) -from .agent_export_response_governance_policies_type_0_item import ( - AgentExportResponseGovernancePoliciesType0Item, -) -from .agent_export_response_trigger_type_0 import AgentExportResponseTriggerType0 -from .agent_import_preview_request import AgentImportPreviewRequest -from .agent_import_preview_request_agent_definition import ( - AgentImportPreviewRequestAgentDefinition, -) -from .agent_import_preview_response import AgentImportPreviewResponse -from .agent_import_preview_response_unresolved_refs_item import ( - AgentImportPreviewResponseUnresolvedRefsItem, -) -from .agent_list_response import AgentListResponse -from .agent_run_attempt_response import AgentRunAttemptResponse -from .agent_run_list_response import AgentRunListResponse -from .agent_run_request import AgentRunRequest -from .agent_run_request_metadata_type_0 import AgentRunRequestMetadataType0 -from .agent_run_response import AgentRunResponse -from .agent_run_step_response import AgentRunStepResponse -from .agent_run_stream_request import AgentRunStreamRequest -from .agent_run_stream_request_metadata_type_0 import AgentRunStreamRequestMetadataType0 -from .agent_run_tool_call_response import AgentRunToolCallResponse -from .agent_summary_response import AgentSummaryResponse -from .agent_summary_response_sampling_config_type_0 import ( - AgentSummaryResponseSamplingConfigType0, -) -from .agent_trace_match_response import AgentTraceMatchResponse -from .agent_trace_search_request import AgentTraceSearchRequest -from .agent_trace_search_response import AgentTraceSearchResponse -from .ai_assistant_accept_request import AiAssistantAcceptRequest -from .ai_assistant_accept_response import AiAssistantAcceptResponse -from .ai_assistant_feedback_request import AiAssistantFeedbackRequest -from .ai_assistant_feedback_request_context_type_0 import ( - AiAssistantFeedbackRequestContextType0, -) -from .ai_assistant_feedback_response import AiAssistantFeedbackResponse -from .ai_assistant_generate_request import AiAssistantGenerateRequest -from .ai_assistant_generate_response import AiAssistantGenerateResponse -from .ai_conversation_history_response import AiConversationHistoryResponse -from .ai_conversation_turn_response import AiConversationTurnResponse -from .ai_conversation_turn_response_resulting_config_type_0 import ( - AiConversationTurnResponseResultingConfigType0, -) -from .alert_comment_response import AlertCommentResponse -from .alert_config_list_response import AlertConfigListResponse -from .alert_config_response import AlertConfigResponse -from .alert_config_response_threshold_type_0 import AlertConfigResponseThresholdType0 -from .alert_detail_response import AlertDetailResponse -from .alert_history_entry_response import AlertHistoryEntryResponse -from .alert_list_response import AlertListResponse -from .alert_response import AlertResponse -from .alert_subscriber_response import AlertSubscriberResponse -from .api_version_response import ApiVersionResponse -from .applied_action_response import AppliedActionResponse -from .attachment_refs_source_api_summary import AttachmentRefsSourceApiSummary -from .block_email_sender_request import BlockEmailSenderRequest -from .blocked_email_sender_list_response import BlockedEmailSenderListResponse -from .blocked_email_sender_response import BlockedEmailSenderResponse -from .body_upload_file_to_content_api_contents_source_connection_content_version_upload_post import ( - BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, -) -from .body_upload_file_to_source_api_sources_source_connection_id_upload_post import ( - BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, -) -from .cancel_experiment_response import CancelExperimentResponse -from .cancel_queued_runs_response import CancelQueuedRunsResponse -from .change_status_request import ChangeStatusRequest -from .compaction_evaluation_model import CompactionEvaluationModel -from .compaction_scheduled_response import CompactionScheduledResponse -from .compaction_test_response_model import CompactionTestResponseModel -from .compatible_run_list_response import CompatibleRunListResponse -from .compatible_run_response import CompatibleRunResponse -from .content_detail_response import ContentDetailResponse -from .content_detail_response_metadata_type_0_item import ( - ContentDetailResponseMetadataType0Item, -) -from .content_embedding_response import ContentEmbeddingResponse -from .content_embeddings_list_response import ContentEmbeddingsListResponse -from .create_agent_request import CreateAgentRequest -from .create_agent_request_agent_definition_type_0 import ( - CreateAgentRequestAgentDefinitionType0, -) -from .create_agent_request_entity_remap_type_0 import CreateAgentRequestEntityRemapType0 -from .create_alert_config_request import CreateAlertConfigRequest -from .create_alert_config_request_threshold_type_0 import ( - CreateAlertConfigRequestThresholdType0, -) -from .create_evaluation_criteria_request import CreateEvaluationCriteriaRequest -from .create_evaluation_criteria_request_expectation_config_type_0 import ( - CreateEvaluationCriteriaRequestExpectationConfigType0, -) -from .create_evaluation_result_request import CreateEvaluationResultRequest -from .create_evaluation_result_request_details_type_0 import ( - CreateEvaluationResultRequestDetailsType0, -) -from .create_experiment_response import CreateExperimentResponse -from .create_export_request import CreateExportRequest -from .create_export_request_metadata_filter_type_0 import ( - CreateExportRequestMetadataFilterType0, -) -from .create_knowledge_base_body import CreateKnowledgeBaseBody -from .create_memory_bank_body import CreateMemoryBankBody -from .create_solution_request import CreateSolutionRequest -from .create_source_body import CreateSourceBody -from .dmarc_failing_source_response import DmarcFailingSourceResponse -from .dmarc_summary_response import DmarcSummaryResponse -from .dmarc_summary_response_dispositions import DmarcSummaryResponseDispositions -from .dns_provider_response import DnsProviderResponse -from .dns_record_response import DnsRecordResponse -from .docs_search_api_docs_search_get_mode import DocsSearchApiDocsSearchGetMode -from .docs_search_response import DocsSearchResponse -from .docs_search_result_response import DocsSearchResultResponse -from .email_domain_response import EmailDomainResponse -from .email_domains_list_response import EmailDomainsListResponse -from .email_trigger_config_response import EmailTriggerConfigResponse -from .estimate_export_request import EstimateExportRequest -from .estimate_export_request_metadata_filter_type_0 import ( - EstimateExportRequestMetadataFilterType0, -) -from .estimate_export_response import EstimateExportResponse -from .evaluation_criteria_response import EvaluationCriteriaResponse -from .evaluation_criteria_response_expectation_config_type_0 import ( - EvaluationCriteriaResponseExpectationConfigType0, -) -from .evaluation_criteria_response_result_summary import ( - EvaluationCriteriaResponseResultSummary, -) -from .evaluation_result_list_response import EvaluationResultListResponse -from .evaluation_result_response import EvaluationResultResponse -from .evaluation_result_response_details_type_0 import ( - EvaluationResultResponseDetailsType0, -) -from .evaluation_result_summary_response import EvaluationResultSummaryResponse -from .evaluation_result_with_criteria_list_response import ( - EvaluationResultWithCriteriaListResponse, -) -from .evaluation_result_with_criteria_response import ( - EvaluationResultWithCriteriaResponse, -) -from .evaluation_result_with_criteria_response_details_type_0 import ( - EvaluationResultWithCriteriaResponseDetailsType0, -) -from .evaluation_run_summary_list_response import EvaluationRunSummaryListResponse -from .evaluation_run_summary_response import EvaluationRunSummaryResponse -from .evaluation_status import EvaluationStatus -from .example_prompt import ExamplePrompt -from .executed_action_response import ExecutedActionResponse -from .experiment_detail_response import ExperimentDetailResponse -from .experiment_detail_response_result_data_type_0 import ( - ExperimentDetailResponseResultDataType0, -) -from .experiment_list_response import ExperimentListResponse -from .experiment_summary_response import ExperimentSummaryResponse -from .export_format import ExportFormat -from .export_list_response import ExportListResponse -from .export_response import ExportResponse -from .export_response_metadata_filter_type_0 import ExportResponseMetadataFilterType0 -from .file_upload_response import FileUploadResponse -from .generate_agent_steps_request import GenerateAgentStepsRequest -from .generate_agent_steps_request_agent_steps_type_0_item import ( - GenerateAgentStepsRequestAgentStepsType0Item, -) -from .generate_agent_steps_response import GenerateAgentStepsResponse -from .generate_agent_steps_response_agent_config_type_0 import ( - GenerateAgentStepsResponseAgentConfigType0, -) -from .generate_agent_steps_response_steps_item import ( - GenerateAgentStepsResponseStepsItem, -) -from .generate_step_config_request import GenerateStepConfigRequest -from .generate_step_config_request_agent_steps_type_0_item import ( - GenerateStepConfigRequestAgentStepsType0Item, -) -from .generate_step_config_request_current_config_type_0 import ( - GenerateStepConfigRequestCurrentConfigType0, -) -from .generate_step_config_response import GenerateStepConfigResponse -from .generate_step_config_response_resulting_config_type_0 import ( - GenerateStepConfigResponseResultingConfigType0, -) -from .generation_tier_list_response import GenerationTierListResponse -from .generation_tier_response import GenerationTierResponse -from .get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get_response_get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get import ( - GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet, -) -from .governance_ai_accept_response import GovernanceAiAcceptResponse -from .governance_ai_assistant_request import GovernanceAiAssistantRequest -from .governance_ai_assistant_response import GovernanceAiAssistantResponse -from .governance_conversation_response import GovernanceConversationResponse -from .governance_conversation_response_proposed_actions_type_0 import ( - GovernanceConversationResponseProposedActionsType0, -) -from .governance_policy_ref_response import GovernancePolicyRefResponse -from .http_validation_error import HTTPValidationError -from .import_field_error_model import ImportFieldErrorModel -from .import_skip_response import ImportSkipResponse -from .import_skip_response_details import ImportSkipResponseDetails -from .inbound_email_rejection_response import InboundEmailRejectionResponse -from .inbound_email_status_response import InboundEmailStatusResponse -from .inline_text_replace_request import InlineTextReplaceRequest -from .inline_text_replace_request_metadata_type_0 import ( - InlineTextReplaceRequestMetadataType0, -) -from .inline_text_upload_request import InlineTextUploadRequest -from .inline_text_upload_request_metadata_type_0 import ( - InlineTextUploadRequestMetadataType0, -) -from .insufficient_credits_detail import InsufficientCreditsDetail -from .insufficient_credits_response import InsufficientCreditsResponse -from .knowledge_base import KnowledgeBase -from .knowledge_base_list_response_model import KnowledgeBaseListResponseModel -from .link_resources_request import LinkResourcesRequest -from .mark_ai_suggestion_request import MarkAiSuggestionRequest -from .mark_conversation_turn_request import MarkConversationTurnRequest -from .me_response import MeResponse -from .memory_bank import MemoryBank -from .memory_bank_accept_request import MemoryBankAcceptRequest -from .memory_bank_ai_assistant_request import MemoryBankAiAssistantRequest -from .memory_bank_ai_assistant_request_current_config_type_0 import ( - MemoryBankAiAssistantRequestCurrentConfigType0, -) -from .memory_bank_ai_assistant_response import MemoryBankAiAssistantResponse -from .memory_bank_config_response import MemoryBankConfigResponse -from .memory_bank_conversation_turn_response import MemoryBankConversationTurnResponse -from .memory_bank_conversation_turn_response_resulting_config_type_0 import ( - MemoryBankConversationTurnResponseResultingConfigType0, -) -from .memory_bank_last_conversation_response import MemoryBankLastConversationResponse -from .memory_bank_list_response_model import MemoryBankListResponseModel -from .modality_rate_response import ModalityRateResponse -from .model_alert_list_response import ModelAlertListResponse -from .model_alert_response import ModelAlertResponse -from .model_recommendation_response import ModelRecommendationResponse -from .model_recommendations_response import ModelRecommendationsResponse -from .non_manual_evaluation_mode_stat_response import ( - NonManualEvaluationModeStatResponse, -) -from .non_manual_evaluation_summary_response import NonManualEvaluationSummaryResponse -from .ok_response import OkResponse -from .organization_alert_preference_list_response import ( - OrganizationAlertPreferenceListResponse, -) -from .organization_alert_preference_response import OrganizationAlertPreferenceResponse -from .organization_info_response import OrganizationInfoResponse -from .pagination_response import PaginationResponse -from .pending_processing_completed_failed_status import ( - PendingProcessingCompletedFailedStatus, -) -from .playground_create_request import PlaygroundCreateRequest -from .playground_create_request_evaluation_complexity import ( - PlaygroundCreateRequestEvaluationComplexity, -) -from .playground_create_request_evaluation_mode import ( - PlaygroundCreateRequestEvaluationMode, -) -from .prompt_model_auto_upgrade_strategy import PromptModelAutoUpgradeStrategy -from .prompt_model_response import PromptModelResponse -from .prompt_model_response_generation_params_type_0 import ( - PromptModelResponseGenerationParamsType0, -) -from .prompt_model_response_payload_schema_type_0 import ( - PromptModelResponsePayloadSchemaType0, -) -from .prompt_tool_response import PromptToolResponse -from .prompt_tool_response_headers_type_0 import PromptToolResponseHeadersType0 -from .proposed_action_response import ProposedActionResponse -from .proposed_action_response_params import ProposedActionResponseParams -from .proposed_action_response_preview_type_0 import ProposedActionResponsePreviewType0 -from .proposed_policy_action_response import ProposedPolicyActionResponse -from .proposed_policy_action_response_params import ProposedPolicyActionResponseParams -from .provider_group_response import ProviderGroupResponse -from .remove_email_domain_response import RemoveEmailDomainResponse -from .resume_inbound_response import ResumeInboundResponse -from .search_response import SearchResponse -from .search_result_response import SearchResultResponse -from .send_test_email_response import SendTestEmailResponse -from .set_auto_block_mode_request import SetAutoBlockModeRequest -from .set_email_trigger_config_request import SetEmailTriggerConfigRequest -from .solution_agent_response import SolutionAgentResponse -from .solution_conversation_response import SolutionConversationResponse -from .solution_conversation_response_actions_taken_type_0 import ( - SolutionConversationResponseActionsTakenType0, -) -from .solution_knowledge_base_response import SolutionKnowledgeBaseResponse -from .solution_list_response import SolutionListResponse -from .solution_response import SolutionResponse -from .solution_source_connection_response import SolutionSourceConnectionResponse -from .solution_summary_response import SolutionSummaryResponse -from .source_connection_response_model import SourceConnectionResponseModel -from .source_embedding_migration_response import SourceEmbeddingMigrationResponse -from .source_index_mode import SourceIndexMode -from .source_list_response import SourceListResponse -from .source_response import SourceResponse -from .standalone_test_compaction_request import StandaloneTestCompactionRequest -from .start_source_embedding_migration_request import ( - StartSourceEmbeddingMigrationRequest, -) -from .test_compaction_request import TestCompactionRequest -from .test_draft_evaluation_request import TestDraftEvaluationRequest -from .test_draft_evaluation_request_expectation_config_type_0 import ( - TestDraftEvaluationRequestExpectationConfigType0, -) -from .test_draft_evaluation_response import TestDraftEvaluationResponse -from .unlink_resources_request import UnlinkResourcesRequest -from .unread_count_response import UnreadCountResponse -from .update_agent_definition_request import UpdateAgentDefinitionRequest -from .update_agent_definition_request_definition import ( - UpdateAgentDefinitionRequestDefinition, -) -from .update_agent_request import UpdateAgentRequest -from .update_agent_request_agent_definition_type_0 import ( - UpdateAgentRequestAgentDefinitionType0, -) -from .update_agent_request_entity_remap_type_0 import UpdateAgentRequestEntityRemapType0 -from .update_agent_request_sampling_config_type_0 import ( - UpdateAgentRequestSamplingConfigType0, -) -from .update_alert_config_request import UpdateAlertConfigRequest -from .update_alert_config_request_threshold_type_0 import ( - UpdateAlertConfigRequestThresholdType0, -) -from .update_api_version_request import UpdateApiVersionRequest -from .update_evaluation_criteria_request import UpdateEvaluationCriteriaRequest -from .update_evaluation_criteria_request_expectation_config_type_0 import ( - UpdateEvaluationCriteriaRequestExpectationConfigType0, -) -from .update_knowledge_base_body import UpdateKnowledgeBaseBody -from .update_memory_bank_body import UpdateMemoryBankBody -from .update_organization_alert_preference_request import ( - UpdateOrganizationAlertPreferenceRequest, -) -from .update_solution_request import UpdateSolutionRequest -from .update_source_body import UpdateSourceBody -from .upload_agent_input_api_response import UploadAgentInputApiResponse -from .validation_error import ValidationError -from .variant_category_response import VariantCategoryResponse -from .variant_option_response import VariantOptionResponse - -__all__ = ( - "AddCommentRequest", - "AddConversationTurnRequest", - "AddConversationTurnRequestActionsTakenType0", - "AddEmailDomainRequest", - "AgentAttachmentRefsApiResponse", - "AgentCallerApiResponse", - "AgentDefinitionImportErrorResponse", - "AgentDefinitionResponse", - "AgentDefinitionResponseDefinition", - "AgentDefinitionResponseWarningsType0Item", - "AgentEmailOptOutListResponse", - "AgentEmailOptOutResponse", - "AgentEvaluationTier", - "AgentExportResponse", - "AgentExportResponseAgent", - "AgentExportResponseAlertConfigsType0Item", - "AgentExportResponseDependenciesType0", - "AgentExportResponseEvaluationCriteriaType0Item", - "AgentExportResponseGovernancePoliciesType0Item", - "AgentExportResponseTriggerType0", - "AgentImportPreviewRequest", - "AgentImportPreviewRequestAgentDefinition", - "AgentImportPreviewResponse", - "AgentImportPreviewResponseUnresolvedRefsItem", - "AgentListResponse", - "AgentRunAttemptResponse", - "AgentRunListResponse", - "AgentRunRequest", - "AgentRunRequestMetadataType0", - "AgentRunResponse", - "AgentRunStepResponse", - "AgentRunStreamRequest", - "AgentRunStreamRequestMetadataType0", - "AgentRunToolCallResponse", - "AgentSummaryResponse", - "AgentSummaryResponseSamplingConfigType0", - "AgentTraceMatchResponse", - "AgentTraceSearchRequest", - "AgentTraceSearchResponse", - "AiAssistantAcceptRequest", - "AiAssistantAcceptResponse", - "AiAssistantFeedbackRequest", - "AiAssistantFeedbackRequestContextType0", - "AiAssistantFeedbackResponse", - "AiAssistantGenerateRequest", - "AiAssistantGenerateResponse", - "AiConversationHistoryResponse", - "AiConversationTurnResponse", - "AiConversationTurnResponseResultingConfigType0", - "AlertCommentResponse", - "AlertConfigListResponse", - "AlertConfigResponse", - "AlertConfigResponseThresholdType0", - "AlertDetailResponse", - "AlertHistoryEntryResponse", - "AlertListResponse", - "AlertResponse", - "AlertSubscriberResponse", - "ApiVersionResponse", - "AppliedActionResponse", - "AttachmentRefsSourceApiSummary", - "BlockedEmailSenderListResponse", - "BlockedEmailSenderResponse", - "BlockEmailSenderRequest", - "BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost", - "BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost", - "CancelExperimentResponse", - "CancelQueuedRunsResponse", - "ChangeStatusRequest", - "CompactionEvaluationModel", - "CompactionScheduledResponse", - "CompactionTestResponseModel", - "CompatibleRunListResponse", - "CompatibleRunResponse", - "ContentDetailResponse", - "ContentDetailResponseMetadataType0Item", - "ContentEmbeddingResponse", - "ContentEmbeddingsListResponse", - "CreateAgentRequest", - "CreateAgentRequestAgentDefinitionType0", - "CreateAgentRequestEntityRemapType0", - "CreateAlertConfigRequest", - "CreateAlertConfigRequestThresholdType0", - "CreateEvaluationCriteriaRequest", - "CreateEvaluationCriteriaRequestExpectationConfigType0", - "CreateEvaluationResultRequest", - "CreateEvaluationResultRequestDetailsType0", - "CreateExperimentResponse", - "CreateExportRequest", - "CreateExportRequestMetadataFilterType0", - "CreateKnowledgeBaseBody", - "CreateMemoryBankBody", - "CreateSolutionRequest", - "CreateSourceBody", - "DmarcFailingSourceResponse", - "DmarcSummaryResponse", - "DmarcSummaryResponseDispositions", - "DnsProviderResponse", - "DnsRecordResponse", - "DocsSearchApiDocsSearchGetMode", - "DocsSearchResponse", - "DocsSearchResultResponse", - "EmailDomainResponse", - "EmailDomainsListResponse", - "EmailTriggerConfigResponse", - "EstimateExportRequest", - "EstimateExportRequestMetadataFilterType0", - "EstimateExportResponse", - "EvaluationCriteriaResponse", - "EvaluationCriteriaResponseExpectationConfigType0", - "EvaluationCriteriaResponseResultSummary", - "EvaluationResultListResponse", - "EvaluationResultResponse", - "EvaluationResultResponseDetailsType0", - "EvaluationResultSummaryResponse", - "EvaluationResultWithCriteriaListResponse", - "EvaluationResultWithCriteriaResponse", - "EvaluationResultWithCriteriaResponseDetailsType0", - "EvaluationRunSummaryListResponse", - "EvaluationRunSummaryResponse", - "EvaluationStatus", - "ExamplePrompt", - "ExecutedActionResponse", - "ExperimentDetailResponse", - "ExperimentDetailResponseResultDataType0", - "ExperimentListResponse", - "ExperimentSummaryResponse", - "ExportFormat", - "ExportListResponse", - "ExportResponse", - "ExportResponseMetadataFilterType0", - "FileUploadResponse", - "GenerateAgentStepsRequest", - "GenerateAgentStepsRequestAgentStepsType0Item", - "GenerateAgentStepsResponse", - "GenerateAgentStepsResponseAgentConfigType0", - "GenerateAgentStepsResponseStepsItem", - "GenerateStepConfigRequest", - "GenerateStepConfigRequestAgentStepsType0Item", - "GenerateStepConfigRequestCurrentConfigType0", - "GenerateStepConfigResponse", - "GenerateStepConfigResponseResultingConfigType0", - "GenerationTierListResponse", - "GenerationTierResponse", - "GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet", - "GovernanceAiAcceptResponse", - "GovernanceAiAssistantRequest", - "GovernanceAiAssistantResponse", - "GovernanceConversationResponse", - "GovernanceConversationResponseProposedActionsType0", - "GovernancePolicyRefResponse", - "HTTPValidationError", - "ImportFieldErrorModel", - "ImportSkipResponse", - "ImportSkipResponseDetails", - "InboundEmailRejectionResponse", - "InboundEmailStatusResponse", - "InlineTextReplaceRequest", - "InlineTextReplaceRequestMetadataType0", - "InlineTextUploadRequest", - "InlineTextUploadRequestMetadataType0", - "InsufficientCreditsDetail", - "InsufficientCreditsResponse", - "KnowledgeBase", - "KnowledgeBaseListResponseModel", - "LinkResourcesRequest", - "MarkAiSuggestionRequest", - "MarkConversationTurnRequest", - "MemoryBank", - "MemoryBankAcceptRequest", - "MemoryBankAiAssistantRequest", - "MemoryBankAiAssistantRequestCurrentConfigType0", - "MemoryBankAiAssistantResponse", - "MemoryBankConfigResponse", - "MemoryBankConversationTurnResponse", - "MemoryBankConversationTurnResponseResultingConfigType0", - "MemoryBankLastConversationResponse", - "MemoryBankListResponseModel", - "MeResponse", - "ModalityRateResponse", - "ModelAlertListResponse", - "ModelAlertResponse", - "ModelRecommendationResponse", - "ModelRecommendationsResponse", - "NonManualEvaluationModeStatResponse", - "NonManualEvaluationSummaryResponse", - "OkResponse", - "OrganizationAlertPreferenceListResponse", - "OrganizationAlertPreferenceResponse", - "OrganizationInfoResponse", - "PaginationResponse", - "PendingProcessingCompletedFailedStatus", - "PlaygroundCreateRequest", - "PlaygroundCreateRequestEvaluationComplexity", - "PlaygroundCreateRequestEvaluationMode", - "PromptModelAutoUpgradeStrategy", - "PromptModelResponse", - "PromptModelResponseGenerationParamsType0", - "PromptModelResponsePayloadSchemaType0", - "PromptToolResponse", - "PromptToolResponseHeadersType0", - "ProposedActionResponse", - "ProposedActionResponseParams", - "ProposedActionResponsePreviewType0", - "ProposedPolicyActionResponse", - "ProposedPolicyActionResponseParams", - "ProviderGroupResponse", - "RemoveEmailDomainResponse", - "ResumeInboundResponse", - "SearchResponse", - "SearchResultResponse", - "SendTestEmailResponse", - "SetAutoBlockModeRequest", - "SetEmailTriggerConfigRequest", - "SolutionAgentResponse", - "SolutionConversationResponse", - "SolutionConversationResponseActionsTakenType0", - "SolutionKnowledgeBaseResponse", - "SolutionListResponse", - "SolutionResponse", - "SolutionSourceConnectionResponse", - "SolutionSummaryResponse", - "SourceConnectionResponseModel", - "SourceEmbeddingMigrationResponse", - "SourceIndexMode", - "SourceListResponse", - "SourceResponse", - "StandaloneTestCompactionRequest", - "StartSourceEmbeddingMigrationRequest", - "TestCompactionRequest", - "TestDraftEvaluationRequest", - "TestDraftEvaluationRequestExpectationConfigType0", - "TestDraftEvaluationResponse", - "UnlinkResourcesRequest", - "UnreadCountResponse", - "UpdateAgentDefinitionRequest", - "UpdateAgentDefinitionRequestDefinition", - "UpdateAgentRequest", - "UpdateAgentRequestAgentDefinitionType0", - "UpdateAgentRequestEntityRemapType0", - "UpdateAgentRequestSamplingConfigType0", - "UpdateAlertConfigRequest", - "UpdateAlertConfigRequestThresholdType0", - "UpdateApiVersionRequest", - "UpdateEvaluationCriteriaRequest", - "UpdateEvaluationCriteriaRequestExpectationConfigType0", - "UpdateKnowledgeBaseBody", - "UpdateMemoryBankBody", - "UpdateOrganizationAlertPreferenceRequest", - "UpdateSolutionRequest", - "UpdateSourceBody", - "UploadAgentInputApiResponse", - "ValidationError", - "VariantCategoryResponse", - "VariantOptionResponse", -) diff --git a/seclai/_generated/models/add_comment_request.py b/seclai/_generated/models/add_comment_request.py deleted file mode 100644 index a10326f..0000000 --- a/seclai/_generated/models/add_comment_request.py +++ /dev/null @@ -1,61 +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="AddCommentRequest") - - -@_attrs_define -class AddCommentRequest: - """ - Attributes: - body (str): Comment text - """ - - body: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - body = self.body - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "body": body, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - body = d.pop("body") - - add_comment_request = cls( - body=body, - ) - - add_comment_request.additional_properties = d - return add_comment_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/seclai/_generated/models/add_conversation_turn_request.py b/seclai/_generated/models/add_conversation_turn_request.py deleted file mode 100644 index f8a3c24..0000000 --- a/seclai/_generated/models/add_conversation_turn_request.py +++ /dev/null @@ -1,135 +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.add_conversation_turn_request_actions_taken_type_0 import ( - AddConversationTurnRequestActionsTakenType0, - ) - - -T = TypeVar("T", bound="AddConversationTurnRequest") - - -@_attrs_define -class AddConversationTurnRequest: - """ - Attributes: - user_input (str): User input text - actions_taken (AddConversationTurnRequestActionsTakenType0 | None | Unset): Actions taken by the AI - ai_response (None | str | Unset): AI response text - """ - - user_input: str - actions_taken: AddConversationTurnRequestActionsTakenType0 | None | Unset = UNSET - ai_response: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.add_conversation_turn_request_actions_taken_type_0 import ( - AddConversationTurnRequestActionsTakenType0, - ) - - user_input = self.user_input - - actions_taken: dict[str, Any] | None | Unset - if isinstance(self.actions_taken, Unset): - actions_taken = UNSET - elif isinstance( - self.actions_taken, AddConversationTurnRequestActionsTakenType0 - ): - actions_taken = self.actions_taken.to_dict() - else: - actions_taken = self.actions_taken - - ai_response: None | str | Unset - if isinstance(self.ai_response, Unset): - ai_response = UNSET - else: - ai_response = self.ai_response - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "user_input": user_input, - } - ) - if actions_taken is not UNSET: - field_dict["actions_taken"] = actions_taken - if ai_response is not UNSET: - field_dict["ai_response"] = ai_response - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.add_conversation_turn_request_actions_taken_type_0 import ( - AddConversationTurnRequestActionsTakenType0, - ) - - d = dict(src_dict) - user_input = d.pop("user_input") - - def _parse_actions_taken( - data: object, - ) -> AddConversationTurnRequestActionsTakenType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - actions_taken_type_0 = ( - AddConversationTurnRequestActionsTakenType0.from_dict(data) - ) - - return actions_taken_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - AddConversationTurnRequestActionsTakenType0 | None | Unset, data - ) - - actions_taken = _parse_actions_taken(d.pop("actions_taken", UNSET)) - - def _parse_ai_response(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - ai_response = _parse_ai_response(d.pop("ai_response", UNSET)) - - add_conversation_turn_request = cls( - user_input=user_input, - actions_taken=actions_taken, - ai_response=ai_response, - ) - - add_conversation_turn_request.additional_properties = d - return add_conversation_turn_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/seclai/_generated/models/add_conversation_turn_request_actions_taken_type_0.py b/seclai/_generated/models/add_conversation_turn_request_actions_taken_type_0.py deleted file mode 100644 index 6ffd995..0000000 --- a/seclai/_generated/models/add_conversation_turn_request_actions_taken_type_0.py +++ /dev/null @@ -1,46 +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="AddConversationTurnRequestActionsTakenType0") - - -@_attrs_define -class AddConversationTurnRequestActionsTakenType0: - """ """ - - additional_properties: dict[str, Any] = _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) - add_conversation_turn_request_actions_taken_type_0 = cls() - - add_conversation_turn_request_actions_taken_type_0.additional_properties = d - return add_conversation_turn_request_actions_taken_type_0 - - @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/seclai/_generated/models/add_email_domain_request.py b/seclai/_generated/models/add_email_domain_request.py deleted file mode 100644 index 475eff0..0000000 --- a/seclai/_generated/models/add_email_domain_request.py +++ /dev/null @@ -1,80 +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 - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AddEmailDomainRequest") - - -@_attrs_define -class AddEmailDomainRequest: - """ - Attributes: - kind (str): 'vanity' or 'custom' - value (str): - delegated (bool | Unset): Default: False. - """ - - kind: str - value: str - delegated: bool | Unset = False - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - kind = self.kind - - value = self.value - - delegated = self.delegated - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "kind": kind, - "value": value, - } - ) - if delegated is not UNSET: - field_dict["delegated"] = delegated - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - kind = d.pop("kind") - - value = d.pop("value") - - delegated = d.pop("delegated", UNSET) - - add_email_domain_request = cls( - kind=kind, - value=value, - delegated=delegated, - ) - - add_email_domain_request.additional_properties = d - return add_email_domain_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/seclai/_generated/models/agent_attachment_refs_api_response.py b/seclai/_generated/models/agent_attachment_refs_api_response.py deleted file mode 100644 index 5df7f52..0000000 --- a/seclai/_generated/models/agent_attachment_refs_api_response.py +++ /dev/null @@ -1,97 +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 - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.attachment_refs_source_api_summary import ( - AttachmentRefsSourceApiSummary, - ) - - -T = TypeVar("T", bound="AgentAttachmentRefsApiResponse") - - -@_attrs_define -class AgentAttachmentRefsApiResponse: - """Static attachment-reference contract for an agent. - - Mirrors the MCP ``get_agent_attachment_references`` tool: returns - what files (if any) an agent's templates expect on a run so API - consumers can stage uploads correctly before calling - ``POST /agents/{id}/runs``. - - Attributes: - requires_uploads (bool): When ``false`` the agent's definition does NOT reference any uploaded attachments — - ``POST /agents/{id}/upload-input`` will reject with HTTP 400. When ``true`` the ``agent`` block lists the - specific selectors a run-time batch must satisfy. - agent (AttachmentRefsSourceApiSummary | Unset): Per-source attachment-reference summary. - """ - - requires_uploads: bool - agent: AttachmentRefsSourceApiSummary | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - requires_uploads = self.requires_uploads - - agent: dict[str, Any] | Unset = UNSET - if not isinstance(self.agent, Unset): - agent = self.agent.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "requires_uploads": requires_uploads, - } - ) - if agent is not UNSET: - field_dict["agent"] = agent - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.attachment_refs_source_api_summary import ( - AttachmentRefsSourceApiSummary, - ) - - d = dict(src_dict) - requires_uploads = d.pop("requires_uploads") - - _agent = d.pop("agent", UNSET) - agent: AttachmentRefsSourceApiSummary | Unset - if isinstance(_agent, Unset): - agent = UNSET - else: - agent = AttachmentRefsSourceApiSummary.from_dict(_agent) - - agent_attachment_refs_api_response = cls( - requires_uploads=requires_uploads, - agent=agent, - ) - - agent_attachment_refs_api_response.additional_properties = d - return agent_attachment_refs_api_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/seclai/_generated/models/agent_caller_api_response.py b/seclai/_generated/models/agent_caller_api_response.py deleted file mode 100644 index 6df371b..0000000 --- a/seclai/_generated/models/agent_caller_api_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="AgentCallerApiResponse") - - -@_attrs_define -class AgentCallerApiResponse: - """One agent that calls another (blocks disabling the callee while live). - - Attributes: - disabled (bool): - id (UUID): - name (str): - """ - - disabled: bool - id: UUID - name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - disabled = self.disabled - - id = str(self.id) - - name = self.name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "disabled": disabled, - "id": id, - "name": name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - disabled = d.pop("disabled") - - id = UUID(d.pop("id")) - - name = d.pop("name") - - agent_caller_api_response = cls( - disabled=disabled, - id=id, - name=name, - ) - - agent_caller_api_response.additional_properties = d - return agent_caller_api_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/seclai/_generated/models/agent_definition_import_error_response.py b/seclai/_generated/models/agent_definition_import_error_response.py deleted file mode 100644 index c4829e4..0000000 --- a/seclai/_generated/models/agent_definition_import_error_response.py +++ /dev/null @@ -1,106 +0,0 @@ -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 - -if TYPE_CHECKING: - from ..models.import_field_error_model import ImportFieldErrorModel - - -T = TypeVar("T", bound="AgentDefinitionImportErrorResponse") - - -@_attrs_define -class AgentDefinitionImportErrorResponse: - """422 body for invalid `agent_definition` payloads. - - Mirrors `AgentDefinitionImportError.to_response_dict`. - - Attributes: - error (Literal['invalid_agent_definition']): Stable machine-readable error code. - errors (list[ImportFieldErrorModel]): - message (str): - source (str): Canonical pretty-printed echo of the supplied payload — error line/column refer to this string. - """ - - error: Literal["invalid_agent_definition"] - errors: list[ImportFieldErrorModel] - message: str - source: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - error = self.error - - errors = [] - for errors_item_data in self.errors: - errors_item = errors_item_data.to_dict() - errors.append(errors_item) - - message = self.message - - source = self.source - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "error": error, - "errors": errors, - "message": message, - "source": source, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.import_field_error_model import ImportFieldErrorModel - - d = dict(src_dict) - error = cast(Literal["invalid_agent_definition"], d.pop("error")) - if error != "invalid_agent_definition": - raise ValueError( - f"error must match const 'invalid_agent_definition', got '{error}'" - ) - - errors = [] - _errors = d.pop("errors") - for errors_item_data in _errors: - errors_item = ImportFieldErrorModel.from_dict(errors_item_data) - - errors.append(errors_item) - - message = d.pop("message") - - source = d.pop("source") - - agent_definition_import_error_response = cls( - error=error, - errors=errors, - message=message, - source=source, - ) - - agent_definition_import_error_response.additional_properties = d - return agent_definition_import_error_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/seclai/_generated/models/agent_definition_response.py b/seclai/_generated/models/agent_definition_response.py deleted file mode 100644 index e49f7e0..0000000 --- a/seclai/_generated/models/agent_definition_response.py +++ /dev/null @@ -1,146 +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.agent_definition_response_definition import ( - AgentDefinitionResponseDefinition, - ) - from ..models.agent_definition_response_warnings_type_0_item import ( - AgentDefinitionResponseWarningsType0Item, - ) - - -T = TypeVar("T", bound="AgentDefinitionResponse") - - -@_attrs_define -class AgentDefinitionResponse: - """ - Attributes: - change_id (str): Current change ID (use as expected_change_id when updating). - definition (AgentDefinitionResponseDefinition): The agent definition containing name, description, tags, and - step workflow tree. Step types include prompt_call, retrieval, regex_replace, gate, retry, evaluate_step, - extract_data, extract_content, add_chat_turn, load_chat_history, add_memory, search_memory, load_memory, - streaming_result, send_email, webhook_call, call_agent, write_metadata, write_content_attachment, - load_content_attachment, load_content, display_result, merge, for_each, if_else, switch, and others. - schema_version (str): Agent schema version. - warnings (list[AgentDefinitionResponseWarningsType0Item] | None | Unset): Validation warnings, if any. - """ - - change_id: str - definition: AgentDefinitionResponseDefinition - schema_version: str - warnings: list[AgentDefinitionResponseWarningsType0Item] | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - change_id = self.change_id - - definition = self.definition.to_dict() - - schema_version = self.schema_version - - warnings: list[dict[str, Any]] | None | Unset - if isinstance(self.warnings, Unset): - warnings = UNSET - elif isinstance(self.warnings, list): - warnings = [] - for warnings_type_0_item_data in self.warnings: - warnings_type_0_item = warnings_type_0_item_data.to_dict() - warnings.append(warnings_type_0_item) - - else: - warnings = self.warnings - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "change_id": change_id, - "definition": definition, - "schema_version": schema_version, - } - ) - if warnings is not UNSET: - field_dict["warnings"] = warnings - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_definition_response_definition import ( - AgentDefinitionResponseDefinition, - ) - from ..models.agent_definition_response_warnings_type_0_item import ( - AgentDefinitionResponseWarningsType0Item, - ) - - d = dict(src_dict) - change_id = d.pop("change_id") - - definition = AgentDefinitionResponseDefinition.from_dict(d.pop("definition")) - - schema_version = d.pop("schema_version") - - def _parse_warnings( - data: object, - ) -> list[AgentDefinitionResponseWarningsType0Item] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - warnings_type_0 = [] - _warnings_type_0 = data - for warnings_type_0_item_data in _warnings_type_0: - warnings_type_0_item = ( - AgentDefinitionResponseWarningsType0Item.from_dict( - warnings_type_0_item_data - ) - ) - - warnings_type_0.append(warnings_type_0_item) - - return warnings_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - list[AgentDefinitionResponseWarningsType0Item] | None | Unset, data - ) - - warnings = _parse_warnings(d.pop("warnings", UNSET)) - - agent_definition_response = cls( - change_id=change_id, - definition=definition, - schema_version=schema_version, - warnings=warnings, - ) - - agent_definition_response.additional_properties = d - return agent_definition_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/seclai/_generated/models/agent_definition_response_definition.py b/seclai/_generated/models/agent_definition_response_definition.py deleted file mode 100644 index 3689015..0000000 --- a/seclai/_generated/models/agent_definition_response_definition.py +++ /dev/null @@ -1,52 +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="AgentDefinitionResponseDefinition") - - -@_attrs_define -class AgentDefinitionResponseDefinition: - """The agent definition containing name, description, tags, and step workflow tree. Step types include prompt_call, - retrieval, regex_replace, gate, retry, evaluate_step, extract_data, extract_content, add_chat_turn, - load_chat_history, add_memory, search_memory, load_memory, streaming_result, send_email, webhook_call, call_agent, - write_metadata, write_content_attachment, load_content_attachment, load_content, display_result, merge, for_each, - if_else, switch, and others. - - """ - - additional_properties: dict[str, Any] = _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_definition_response_definition = cls() - - agent_definition_response_definition.additional_properties = d - return agent_definition_response_definition - - @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/seclai/_generated/models/agent_definition_response_warnings_type_0_item.py b/seclai/_generated/models/agent_definition_response_warnings_type_0_item.py deleted file mode 100644 index cfc7887..0000000 --- a/seclai/_generated/models/agent_definition_response_warnings_type_0_item.py +++ /dev/null @@ -1,46 +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="AgentDefinitionResponseWarningsType0Item") - - -@_attrs_define -class AgentDefinitionResponseWarningsType0Item: - """ """ - - 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_definition_response_warnings_type_0_item = cls() - - agent_definition_response_warnings_type_0_item.additional_properties = d - return agent_definition_response_warnings_type_0_item - - @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/seclai/_generated/models/agent_email_opt_out_list_response.py b/seclai/_generated/models/agent_email_opt_out_list_response.py deleted file mode 100644 index 8bf6dcd..0000000 --- a/seclai/_generated/models/agent_email_opt_out_list_response.py +++ /dev/null @@ -1,84 +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.agent_email_opt_out_response import AgentEmailOptOutResponse - - -T = TypeVar("T", bound="AgentEmailOptOutListResponse") - - -@_attrs_define -class AgentEmailOptOutListResponse: - """A page of agent-email opt-outs plus the total (for pagination). - - Attributes: - items (list[AgentEmailOptOutResponse]): - total (int): - """ - - items: list[AgentEmailOptOutResponse] - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - items = [] - for items_item_data in self.items: - items_item = items_item_data.to_dict() - items.append(items_item) - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "items": items, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_email_opt_out_response import AgentEmailOptOutResponse - - d = dict(src_dict) - items = [] - _items = d.pop("items") - for items_item_data in _items: - items_item = AgentEmailOptOutResponse.from_dict(items_item_data) - - items.append(items_item) - - total = d.pop("total") - - agent_email_opt_out_list_response = cls( - items=items, - total=total, - ) - - agent_email_opt_out_list_response.additional_properties = d - return agent_email_opt_out_list_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/seclai/_generated/models/agent_email_opt_out_response.py b/seclai/_generated/models/agent_email_opt_out_response.py deleted file mode 100644 index eedca64..0000000 --- a/seclai/_generated/models/agent_email_opt_out_response.py +++ /dev/null @@ -1,147 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="AgentEmailOptOutResponse") - - -@_attrs_define -class AgentEmailOptOutResponse: - """A recipient's opt-out from an account's agent emails (one agent or all). - - Attributes: - agent_id (None | UUID): - agent_name (None | str): - comment (None | str): - created_at (str): - id (UUID): - reason (None | str): - recipient_email (str): - """ - - agent_id: None | UUID - agent_name: None | str - comment: None | str - created_at: str - id: UUID - reason: None | str - recipient_email: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_id: None | str - if isinstance(self.agent_id, UUID): - agent_id = str(self.agent_id) - else: - agent_id = self.agent_id - - agent_name: None | str - agent_name = self.agent_name - - comment: None | str - comment = self.comment - - created_at = self.created_at - - id = str(self.id) - - reason: None | str - reason = self.reason - - recipient_email = self.recipient_email - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_id": agent_id, - "agent_name": agent_name, - "comment": comment, - "created_at": created_at, - "id": id, - "reason": reason, - "recipient_email": recipient_email, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_agent_id(data: object) -> None | UUID: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - agent_id_type_0 = UUID(data) - - return agent_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UUID, data) - - agent_id = _parse_agent_id(d.pop("agent_id")) - - def _parse_agent_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - agent_name = _parse_agent_name(d.pop("agent_name")) - - def _parse_comment(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - comment = _parse_comment(d.pop("comment")) - - created_at = d.pop("created_at") - - id = UUID(d.pop("id")) - - def _parse_reason(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - reason = _parse_reason(d.pop("reason")) - - recipient_email = d.pop("recipient_email") - - agent_email_opt_out_response = cls( - agent_id=agent_id, - agent_name=agent_name, - comment=comment, - created_at=created_at, - id=id, - reason=reason, - recipient_email=recipient_email, - ) - - agent_email_opt_out_response.additional_properties = d - return agent_email_opt_out_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/seclai/_generated/models/agent_evaluation_tier.py b/seclai/_generated/models/agent_evaluation_tier.py deleted file mode 100644 index ea671db..0000000 --- a/seclai/_generated/models/agent_evaluation_tier.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class AgentEvaluationTier(str, Enum): - BALANCED = "balanced" - FAST = "fast" - THOROUGH = "thorough" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/models/agent_export_response.py b/seclai/_generated/models/agent_export_response.py deleted file mode 100644 index f51281a..0000000 --- a/seclai/_generated/models/agent_export_response.py +++ /dev/null @@ -1,358 +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.agent_export_response_agent import AgentExportResponseAgent - from ..models.agent_export_response_alert_configs_type_0_item import ( - AgentExportResponseAlertConfigsType0Item, - ) - from ..models.agent_export_response_dependencies_type_0 import ( - AgentExportResponseDependenciesType0, - ) - from ..models.agent_export_response_evaluation_criteria_type_0_item import ( - AgentExportResponseEvaluationCriteriaType0Item, - ) - from ..models.agent_export_response_governance_policies_type_0_item import ( - AgentExportResponseGovernancePoliciesType0Item, - ) - from ..models.agent_export_response_trigger_type_0 import ( - AgentExportResponseTriggerType0, - ) - - -T = TypeVar("T", bound="AgentExportResponse") - - -@_attrs_define -class AgentExportResponse: - """Portable JSON snapshot of an agent definition. - - Attributes: - agent (AgentExportResponseAgent): Agent metadata and full definition. Keys: name, description, schema_version, - definition, default_evaluation_tier, evaluation_mode, sampling_config, max_retries, retry_on_failure, - prompt_model_auto_upgrade_strategy, prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, - created_at, updated_at. - export_version (str): Schema version of the export format (currently "2"). - exported_at (str): ISO-8601 timestamp of when the export was generated. - software_version (str): Application version that produced this export. - alert_configs (list[AgentExportResponseAlertConfigsType0Item] | None | Unset): Alert configurations. - dependencies (AgentExportResponseDependenciesType0 | None | Unset): Resolved dependency manifest. Keys: - knowledge_bases, memory_banks, source_connections, agents, users — each a list of {id, name, description, …}. - evaluation_criteria (list[AgentExportResponseEvaluationCriteriaType0Item] | None | Unset): Evaluation criteria - for agent steps. - governance_policies (list[AgentExportResponseGovernancePoliciesType0Item] | None | Unset): Agent-scoped - governance policies. - trigger (AgentExportResponseTriggerType0 | None | Unset): Trigger configuration with schedules. - """ - - agent: AgentExportResponseAgent - export_version: str - exported_at: str - software_version: str - alert_configs: list[AgentExportResponseAlertConfigsType0Item] | None | Unset = UNSET - dependencies: AgentExportResponseDependenciesType0 | None | Unset = UNSET - evaluation_criteria: ( - list[AgentExportResponseEvaluationCriteriaType0Item] | None | Unset - ) = UNSET - governance_policies: ( - list[AgentExportResponseGovernancePoliciesType0Item] | None | Unset - ) = UNSET - trigger: AgentExportResponseTriggerType0 | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.agent_export_response_dependencies_type_0 import ( - AgentExportResponseDependenciesType0, - ) - from ..models.agent_export_response_trigger_type_0 import ( - AgentExportResponseTriggerType0, - ) - - agent = self.agent.to_dict() - - export_version = self.export_version - - exported_at = self.exported_at - - software_version = self.software_version - - alert_configs: list[dict[str, Any]] | None | Unset - if isinstance(self.alert_configs, Unset): - alert_configs = UNSET - elif isinstance(self.alert_configs, list): - alert_configs = [] - for alert_configs_type_0_item_data in self.alert_configs: - alert_configs_type_0_item = alert_configs_type_0_item_data.to_dict() - alert_configs.append(alert_configs_type_0_item) - - else: - alert_configs = self.alert_configs - - dependencies: dict[str, Any] | None | Unset - if isinstance(self.dependencies, Unset): - dependencies = UNSET - elif isinstance(self.dependencies, AgentExportResponseDependenciesType0): - dependencies = self.dependencies.to_dict() - else: - dependencies = self.dependencies - - evaluation_criteria: list[dict[str, Any]] | None | Unset - if isinstance(self.evaluation_criteria, Unset): - evaluation_criteria = UNSET - elif isinstance(self.evaluation_criteria, list): - evaluation_criteria = [] - for evaluation_criteria_type_0_item_data in self.evaluation_criteria: - evaluation_criteria_type_0_item = ( - evaluation_criteria_type_0_item_data.to_dict() - ) - evaluation_criteria.append(evaluation_criteria_type_0_item) - - else: - evaluation_criteria = self.evaluation_criteria - - governance_policies: list[dict[str, Any]] | None | Unset - if isinstance(self.governance_policies, Unset): - governance_policies = UNSET - elif isinstance(self.governance_policies, list): - governance_policies = [] - for governance_policies_type_0_item_data in self.governance_policies: - governance_policies_type_0_item = ( - governance_policies_type_0_item_data.to_dict() - ) - governance_policies.append(governance_policies_type_0_item) - - else: - governance_policies = self.governance_policies - - trigger: dict[str, Any] | None | Unset - if isinstance(self.trigger, Unset): - trigger = UNSET - elif isinstance(self.trigger, AgentExportResponseTriggerType0): - trigger = self.trigger.to_dict() - else: - trigger = self.trigger - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent": agent, - "export_version": export_version, - "exported_at": exported_at, - "software_version": software_version, - } - ) - if alert_configs is not UNSET: - field_dict["alert_configs"] = alert_configs - if dependencies is not UNSET: - field_dict["dependencies"] = dependencies - if evaluation_criteria is not UNSET: - field_dict["evaluation_criteria"] = evaluation_criteria - if governance_policies is not UNSET: - field_dict["governance_policies"] = governance_policies - if trigger is not UNSET: - field_dict["trigger"] = trigger - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_export_response_agent import AgentExportResponseAgent - from ..models.agent_export_response_alert_configs_type_0_item import ( - AgentExportResponseAlertConfigsType0Item, - ) - from ..models.agent_export_response_dependencies_type_0 import ( - AgentExportResponseDependenciesType0, - ) - from ..models.agent_export_response_evaluation_criteria_type_0_item import ( - AgentExportResponseEvaluationCriteriaType0Item, - ) - from ..models.agent_export_response_governance_policies_type_0_item import ( - AgentExportResponseGovernancePoliciesType0Item, - ) - from ..models.agent_export_response_trigger_type_0 import ( - AgentExportResponseTriggerType0, - ) - - d = dict(src_dict) - agent = AgentExportResponseAgent.from_dict(d.pop("agent")) - - export_version = d.pop("export_version") - - exported_at = d.pop("exported_at") - - software_version = d.pop("software_version") - - def _parse_alert_configs( - data: object, - ) -> list[AgentExportResponseAlertConfigsType0Item] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - alert_configs_type_0 = [] - _alert_configs_type_0 = data - for alert_configs_type_0_item_data in _alert_configs_type_0: - alert_configs_type_0_item = ( - AgentExportResponseAlertConfigsType0Item.from_dict( - alert_configs_type_0_item_data - ) - ) - - alert_configs_type_0.append(alert_configs_type_0_item) - - return alert_configs_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - list[AgentExportResponseAlertConfigsType0Item] | None | Unset, data - ) - - alert_configs = _parse_alert_configs(d.pop("alert_configs", UNSET)) - - def _parse_dependencies( - data: object, - ) -> AgentExportResponseDependenciesType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - dependencies_type_0 = AgentExportResponseDependenciesType0.from_dict( - data - ) - - return dependencies_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentExportResponseDependenciesType0 | None | Unset, data) - - dependencies = _parse_dependencies(d.pop("dependencies", UNSET)) - - def _parse_evaluation_criteria( - data: object, - ) -> list[AgentExportResponseEvaluationCriteriaType0Item] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - evaluation_criteria_type_0 = [] - _evaluation_criteria_type_0 = data - for evaluation_criteria_type_0_item_data in _evaluation_criteria_type_0: - evaluation_criteria_type_0_item = ( - AgentExportResponseEvaluationCriteriaType0Item.from_dict( - evaluation_criteria_type_0_item_data - ) - ) - - evaluation_criteria_type_0.append(evaluation_criteria_type_0_item) - - return evaluation_criteria_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - list[AgentExportResponseEvaluationCriteriaType0Item] | None | Unset, - data, - ) - - evaluation_criteria = _parse_evaluation_criteria( - d.pop("evaluation_criteria", UNSET) - ) - - def _parse_governance_policies( - data: object, - ) -> list[AgentExportResponseGovernancePoliciesType0Item] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - governance_policies_type_0 = [] - _governance_policies_type_0 = data - for governance_policies_type_0_item_data in _governance_policies_type_0: - governance_policies_type_0_item = ( - AgentExportResponseGovernancePoliciesType0Item.from_dict( - governance_policies_type_0_item_data - ) - ) - - governance_policies_type_0.append(governance_policies_type_0_item) - - return governance_policies_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - list[AgentExportResponseGovernancePoliciesType0Item] | None | Unset, - data, - ) - - governance_policies = _parse_governance_policies( - d.pop("governance_policies", UNSET) - ) - - def _parse_trigger( - data: object, - ) -> AgentExportResponseTriggerType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - trigger_type_0 = AgentExportResponseTriggerType0.from_dict(data) - - return trigger_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentExportResponseTriggerType0 | None | Unset, data) - - trigger = _parse_trigger(d.pop("trigger", UNSET)) - - agent_export_response = cls( - agent=agent, - export_version=export_version, - exported_at=exported_at, - software_version=software_version, - alert_configs=alert_configs, - dependencies=dependencies, - evaluation_criteria=evaluation_criteria, - governance_policies=governance_policies, - trigger=trigger, - ) - - agent_export_response.additional_properties = d - return agent_export_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/seclai/_generated/models/agent_export_response_agent.py b/seclai/_generated/models/agent_export_response_agent.py deleted file mode 100644 index b01a142..0000000 --- a/seclai/_generated/models/agent_export_response_agent.py +++ /dev/null @@ -1,50 +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="AgentExportResponseAgent") - - -@_attrs_define -class AgentExportResponseAgent: - """Agent metadata and full definition. Keys: name, description, schema_version, definition, default_evaluation_tier, - evaluation_mode, sampling_config, max_retries, retry_on_failure, prompt_model_auto_upgrade_strategy, - prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, created_at, updated_at. - - """ - - additional_properties: dict[str, Any] = _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_export_response_agent = cls() - - agent_export_response_agent.additional_properties = d - return agent_export_response_agent - - @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/seclai/_generated/models/agent_export_response_alert_configs_type_0_item.py b/seclai/_generated/models/agent_export_response_alert_configs_type_0_item.py deleted file mode 100644 index e256120..0000000 --- a/seclai/_generated/models/agent_export_response_alert_configs_type_0_item.py +++ /dev/null @@ -1,46 +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="AgentExportResponseAlertConfigsType0Item") - - -@_attrs_define -class AgentExportResponseAlertConfigsType0Item: - """ """ - - additional_properties: dict[str, Any] = _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_export_response_alert_configs_type_0_item = cls() - - agent_export_response_alert_configs_type_0_item.additional_properties = d - return agent_export_response_alert_configs_type_0_item - - @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/seclai/_generated/models/agent_export_response_dependencies_type_0.py b/seclai/_generated/models/agent_export_response_dependencies_type_0.py deleted file mode 100644 index 787acc2..0000000 --- a/seclai/_generated/models/agent_export_response_dependencies_type_0.py +++ /dev/null @@ -1,46 +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="AgentExportResponseDependenciesType0") - - -@_attrs_define -class AgentExportResponseDependenciesType0: - """ """ - - additional_properties: dict[str, Any] = _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_export_response_dependencies_type_0 = cls() - - agent_export_response_dependencies_type_0.additional_properties = d - return agent_export_response_dependencies_type_0 - - @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/seclai/_generated/models/agent_export_response_evaluation_criteria_type_0_item.py b/seclai/_generated/models/agent_export_response_evaluation_criteria_type_0_item.py deleted file mode 100644 index a2501b8..0000000 --- a/seclai/_generated/models/agent_export_response_evaluation_criteria_type_0_item.py +++ /dev/null @@ -1,46 +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="AgentExportResponseEvaluationCriteriaType0Item") - - -@_attrs_define -class AgentExportResponseEvaluationCriteriaType0Item: - """ """ - - additional_properties: dict[str, Any] = _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_export_response_evaluation_criteria_type_0_item = cls() - - agent_export_response_evaluation_criteria_type_0_item.additional_properties = d - return agent_export_response_evaluation_criteria_type_0_item - - @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/seclai/_generated/models/agent_export_response_governance_policies_type_0_item.py b/seclai/_generated/models/agent_export_response_governance_policies_type_0_item.py deleted file mode 100644 index 15b78d3..0000000 --- a/seclai/_generated/models/agent_export_response_governance_policies_type_0_item.py +++ /dev/null @@ -1,46 +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="AgentExportResponseGovernancePoliciesType0Item") - - -@_attrs_define -class AgentExportResponseGovernancePoliciesType0Item: - """ """ - - additional_properties: dict[str, Any] = _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_export_response_governance_policies_type_0_item = cls() - - agent_export_response_governance_policies_type_0_item.additional_properties = d - return agent_export_response_governance_policies_type_0_item - - @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/seclai/_generated/models/agent_export_response_trigger_type_0.py b/seclai/_generated/models/agent_export_response_trigger_type_0.py deleted file mode 100644 index 927472c..0000000 --- a/seclai/_generated/models/agent_export_response_trigger_type_0.py +++ /dev/null @@ -1,46 +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="AgentExportResponseTriggerType0") - - -@_attrs_define -class AgentExportResponseTriggerType0: - """ """ - - additional_properties: dict[str, Any] = _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_export_response_trigger_type_0 = cls() - - agent_export_response_trigger_type_0.additional_properties = d - return agent_export_response_trigger_type_0 - - @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/seclai/_generated/models/agent_import_preview_request.py b/seclai/_generated/models/agent_import_preview_request.py deleted file mode 100644 index ebfcb8c..0000000 --- a/seclai/_generated/models/agent_import_preview_request.py +++ /dev/null @@ -1,75 +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.agent_import_preview_request_agent_definition import ( - AgentImportPreviewRequestAgentDefinition, - ) - - -T = TypeVar("T", bound="AgentImportPreviewRequest") - - -@_attrs_define -class AgentImportPreviewRequest: - """Dry-run import request — same payload shape as the export endpoint. - - Attributes: - agent_definition (AgentImportPreviewRequestAgentDefinition): Payload in the same shape as GET - /agents/{agent_id}/export. - """ - - agent_definition: AgentImportPreviewRequestAgentDefinition - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_definition = self.agent_definition.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_definition": agent_definition, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_import_preview_request_agent_definition import ( - AgentImportPreviewRequestAgentDefinition, - ) - - d = dict(src_dict) - agent_definition = AgentImportPreviewRequestAgentDefinition.from_dict( - d.pop("agent_definition") - ) - - agent_import_preview_request = cls( - agent_definition=agent_definition, - ) - - agent_import_preview_request.additional_properties = d - return agent_import_preview_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/seclai/_generated/models/agent_import_preview_request_agent_definition.py b/seclai/_generated/models/agent_import_preview_request_agent_definition.py deleted file mode 100644 index 8a43450..0000000 --- a/seclai/_generated/models/agent_import_preview_request_agent_definition.py +++ /dev/null @@ -1,46 +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="AgentImportPreviewRequestAgentDefinition") - - -@_attrs_define -class AgentImportPreviewRequestAgentDefinition: - """Payload in the same shape as GET /agents/{agent_id}/export.""" - - additional_properties: dict[str, Any] = _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_import_preview_request_agent_definition = cls() - - agent_import_preview_request_agent_definition.additional_properties = d - return agent_import_preview_request_agent_definition - - @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/seclai/_generated/models/agent_import_preview_response.py b/seclai/_generated/models/agent_import_preview_response.py deleted file mode 100644 index 4437f28..0000000 --- a/seclai/_generated/models/agent_import_preview_response.py +++ /dev/null @@ -1,222 +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.agent_import_preview_response_unresolved_refs_item import ( - AgentImportPreviewResponseUnresolvedRefsItem, - ) - - -T = TypeVar("T", bound="AgentImportPreviewResponse") - - -@_attrs_define -class AgentImportPreviewResponse: - """Summary of a successfully validated import payload (no DB writes). - - Counts are derived from the validated payload as supplied — they - reflect what was requested, not what would eventually be persisted - (cross-account skips for recipients and KB names happen later, only - on commit). - - Attributes: - agent_name (None | str): Imported agent name, if any. - alert_configs (int): Number of alert configs in the payload. - description (None | str): Imported agent description, if any. - evaluation_criteria (int): Number of evaluation criteria in the payload. - governance_policies (int): Number of agent-scoped governance policies in the payload. - ok (bool): Always true on a 200 response; failures use HTTP 422. - schedules (int): Number of trigger schedules in the payload. - step_count (int): Total number of steps in the workflow tree (recursive). - payload_export_version (None | str | Unset): Export-format version the payload claims (or ``null`` for legacy - payloads). When this differs from ``supported_export_version``, fields may have been silently dropped or - defaulted on import. - solutions (int | Unset): Number of solutions the source agent belonged to. On import these are matched by name - in the target account; unmatched names are silently skipped. Default: 0. - supported_export_version (str | Unset): Export-format version this server understands. Compare against - ``payload_export_version`` to detect cross-version imports. Default: '2'. - unresolved_refs (list[AgentImportPreviewResponseUnresolvedRefsItem] | Unset): Entity references in the imported - workflow that don't exist in the target account. Each entry: {category, ref_id, ref_name?, - locations:[step:], alternatives:[{id, name, description?}]}. Pass {source_uuid: target_uuid} as - ``entity_remap`` on the create/update call to substitute these references before save. - """ - - agent_name: None | str - alert_configs: int - description: None | str - evaluation_criteria: int - governance_policies: int - ok: bool - schedules: int - step_count: int - payload_export_version: None | str | Unset = UNSET - solutions: int | Unset = 0 - supported_export_version: str | Unset = "2" - unresolved_refs: list[AgentImportPreviewResponseUnresolvedRefsItem] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_name: None | str - agent_name = self.agent_name - - alert_configs = self.alert_configs - - description: None | str - description = self.description - - evaluation_criteria = self.evaluation_criteria - - governance_policies = self.governance_policies - - ok = self.ok - - schedules = self.schedules - - step_count = self.step_count - - payload_export_version: None | str | Unset - if isinstance(self.payload_export_version, Unset): - payload_export_version = UNSET - else: - payload_export_version = self.payload_export_version - - solutions = self.solutions - - supported_export_version = self.supported_export_version - - unresolved_refs: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.unresolved_refs, Unset): - unresolved_refs = [] - for unresolved_refs_item_data in self.unresolved_refs: - unresolved_refs_item = unresolved_refs_item_data.to_dict() - unresolved_refs.append(unresolved_refs_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_name": agent_name, - "alert_configs": alert_configs, - "description": description, - "evaluation_criteria": evaluation_criteria, - "governance_policies": governance_policies, - "ok": ok, - "schedules": schedules, - "step_count": step_count, - } - ) - if payload_export_version is not UNSET: - field_dict["payload_export_version"] = payload_export_version - if solutions is not UNSET: - field_dict["solutions"] = solutions - if supported_export_version is not UNSET: - field_dict["supported_export_version"] = supported_export_version - if unresolved_refs is not UNSET: - field_dict["unresolved_refs"] = unresolved_refs - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_import_preview_response_unresolved_refs_item import ( - AgentImportPreviewResponseUnresolvedRefsItem, - ) - - d = dict(src_dict) - - def _parse_agent_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - agent_name = _parse_agent_name(d.pop("agent_name")) - - alert_configs = d.pop("alert_configs") - - def _parse_description(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - description = _parse_description(d.pop("description")) - - evaluation_criteria = d.pop("evaluation_criteria") - - governance_policies = d.pop("governance_policies") - - ok = d.pop("ok") - - schedules = d.pop("schedules") - - step_count = d.pop("step_count") - - def _parse_payload_export_version(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - payload_export_version = _parse_payload_export_version( - d.pop("payload_export_version", UNSET) - ) - - solutions = d.pop("solutions", UNSET) - - supported_export_version = d.pop("supported_export_version", UNSET) - - _unresolved_refs = d.pop("unresolved_refs", UNSET) - unresolved_refs: list[AgentImportPreviewResponseUnresolvedRefsItem] | Unset = ( - UNSET - ) - if _unresolved_refs is not UNSET: - unresolved_refs = [] - for unresolved_refs_item_data in _unresolved_refs: - unresolved_refs_item = ( - AgentImportPreviewResponseUnresolvedRefsItem.from_dict( - unresolved_refs_item_data - ) - ) - - unresolved_refs.append(unresolved_refs_item) - - agent_import_preview_response = cls( - agent_name=agent_name, - alert_configs=alert_configs, - description=description, - evaluation_criteria=evaluation_criteria, - governance_policies=governance_policies, - ok=ok, - schedules=schedules, - step_count=step_count, - payload_export_version=payload_export_version, - solutions=solutions, - supported_export_version=supported_export_version, - unresolved_refs=unresolved_refs, - ) - - agent_import_preview_response.additional_properties = d - return agent_import_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/seclai/_generated/models/agent_import_preview_response_unresolved_refs_item.py b/seclai/_generated/models/agent_import_preview_response_unresolved_refs_item.py deleted file mode 100644 index bb355d8..0000000 --- a/seclai/_generated/models/agent_import_preview_response_unresolved_refs_item.py +++ /dev/null @@ -1,46 +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="AgentImportPreviewResponseUnresolvedRefsItem") - - -@_attrs_define -class AgentImportPreviewResponseUnresolvedRefsItem: - """ """ - - additional_properties: dict[str, Any] = _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_import_preview_response_unresolved_refs_item = cls() - - agent_import_preview_response_unresolved_refs_item.additional_properties = d - return agent_import_preview_response_unresolved_refs_item - - @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/seclai/_generated/models/agent_list_response.py b/seclai/_generated/models/agent_list_response.py deleted file mode 100644 index a53173f..0000000 --- a/seclai/_generated/models/agent_list_response.py +++ /dev/null @@ -1,85 +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.agent_summary_response import AgentSummaryResponse - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="AgentListResponse") - - -@_attrs_define -class AgentListResponse: - """ - Attributes: - data (list[AgentSummaryResponse]): List of agents. - pagination (PaginationResponse): Pagination information. - """ - - data: list[AgentSummaryResponse] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_summary_response import AgentSummaryResponse - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = AgentSummaryResponse.from_dict(data_item_data) - - data.append(data_item) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - agent_list_response = cls( - data=data, - pagination=pagination, - ) - - agent_list_response.additional_properties = d - return agent_list_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/seclai/_generated/models/agent_run_attempt_response.py b/seclai/_generated/models/agent_run_attempt_response.py deleted file mode 100644 index d38b013..0000000 --- a/seclai/_generated/models/agent_run_attempt_response.py +++ /dev/null @@ -1,122 +0,0 @@ -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 ..models.pending_processing_completed_failed_status import ( - PendingProcessingCompletedFailedStatus, -) - -T = TypeVar("T", bound="AgentRunAttemptResponse") - - -@_attrs_define -class AgentRunAttemptResponse: - """ - Attributes: - duration (float | None): Duration of the attempt in seconds. - ended_at (None | str): Timestamp when the attempt ended. - error (None | str): Error message if the attempt failed. - started_at (None | str): Timestamp when the attempt started. - status (PendingProcessingCompletedFailedStatus): - """ - - duration: float | None - ended_at: None | str - error: None | str - started_at: None | str - status: PendingProcessingCompletedFailedStatus - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - duration: float | None - duration = self.duration - - ended_at: None | str - ended_at = self.ended_at - - error: None | str - error = self.error - - started_at: None | str - started_at = self.started_at - - status = self.status.value - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "duration": duration, - "ended_at": ended_at, - "error": error, - "started_at": started_at, - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_duration(data: object) -> float | None: - if data is None: - return data - return cast(float | None, data) - - duration = _parse_duration(d.pop("duration")) - - def _parse_ended_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - ended_at = _parse_ended_at(d.pop("ended_at")) - - def _parse_error(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - error = _parse_error(d.pop("error")) - - def _parse_started_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - started_at = _parse_started_at(d.pop("started_at")) - - status = PendingProcessingCompletedFailedStatus(d.pop("status")) - - agent_run_attempt_response = cls( - duration=duration, - ended_at=ended_at, - error=error, - started_at=started_at, - status=status, - ) - - agent_run_attempt_response.additional_properties = d - return agent_run_attempt_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/seclai/_generated/models/agent_run_list_response.py b/seclai/_generated/models/agent_run_list_response.py deleted file mode 100644 index f799b86..0000000 --- a/seclai/_generated/models/agent_run_list_response.py +++ /dev/null @@ -1,85 +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.agent_run_response import AgentRunResponse - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="AgentRunListResponse") - - -@_attrs_define -class AgentRunListResponse: - """ - Attributes: - data (list[AgentRunResponse]): List of agent runs. - pagination (PaginationResponse): Pagination information. - """ - - data: list[AgentRunResponse] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_run_response import AgentRunResponse - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = AgentRunResponse.from_dict(data_item_data) - - data.append(data_item) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - agent_run_list_response = cls( - data=data, - pagination=pagination, - ) - - agent_run_list_response.additional_properties = d - return agent_run_list_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/seclai/_generated/models/agent_run_request.py b/seclai/_generated/models/agent_run_request.py deleted file mode 100644 index 2c22f9a..0000000 --- a/seclai/_generated/models/agent_run_request.py +++ /dev/null @@ -1,249 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.agent_run_request_metadata_type_0 import AgentRunRequestMetadataType0 - - -T = TypeVar("T", bound="AgentRunRequest") - - -@_attrs_define -class AgentRunRequest: - """ - Attributes: - input_ (None | str | Unset): Input to provide to the agent upon running for agents with dynamic triggers. - input_upload_id (None | Unset | UUID): ID of a previously uploaded file (via POST /{agent_id}/upload-input) to - use as the run input for dynamic-input triggers. Mutually exclusive with the 'input' field. Use - ``input_upload_ids`` to attach multiple files. - - **Attachment visibility:** a step only sees the upload when its template references the input — via - ``{{input}}`` / ``{{agent.input}}`` / ``{{step..input|output}}`` (implicit, all attachments) or the - ``{{attachments[…]}}`` family (explicit narrowing — e.g. ``{{attachments[0]}}``, ``{{attachments[*.pdf]}}``). - - **Per-batch validation:** every selector the agent's definition declares must be satisfied or the run is - rejected with HTTP 400. Exact-name selectors require that filename to be present; indexed selectors require at - least N+1 files; glob patterns require at least one matching filename. - input_upload_ids (list[UUID] | None | Unset): IDs of multiple previously uploaded files. Each upload's extracted - text is concatenated under a heading; each upload's binary is surfaced as a separate ``MediaAttachment`` so - multi-modal prompt steps reason over all files at once. Steps narrow visibility via ``{{attachments[…]}}`` - selectors (by index, filename, or fnmatch glob). The batch must satisfy every selector the agent declares — - exact names, indexed references (length must exceed the highest index), and glob patterns (each pattern needs at - least one match). Mismatches return HTTP 400 with the unmet requirements listed. Mutually exclusive with - ``input`` and ``input_upload_id`` — pass exactly one of the three. Max 20 uploads per run. - metadata (AgentRunRequestMetadataType0 | None | Unset): Metadata to make available for string substitution - expressions in agent tasks. - priority (bool | Unset): If true, the agent run will be treated as priority execution. Default: False. - replay_of_run_id (None | Unset | UUID): Re-run this agent reusing a prior run's uploaded input files. The files - are re-resolved server-side from the source run (which must belong to this account and agent) — you do not re- - upload them. Combine with ``input`` to change the text while keeping the files. A fresh upload batch - (``input_upload_id(s)``) takes precedence and disables replay. Binaries swept by retention fall back to their - extracted text. - """ - - input_: None | str | Unset = UNSET - input_upload_id: None | Unset | UUID = UNSET - input_upload_ids: list[UUID] | None | Unset = UNSET - metadata: AgentRunRequestMetadataType0 | None | Unset = UNSET - priority: bool | Unset = False - replay_of_run_id: None | Unset | UUID = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.agent_run_request_metadata_type_0 import ( - AgentRunRequestMetadataType0, - ) - - input_: None | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - else: - input_ = self.input_ - - input_upload_id: None | str | Unset - if isinstance(self.input_upload_id, Unset): - input_upload_id = UNSET - elif isinstance(self.input_upload_id, UUID): - input_upload_id = str(self.input_upload_id) - else: - input_upload_id = self.input_upload_id - - input_upload_ids: list[str] | None | Unset - if isinstance(self.input_upload_ids, Unset): - input_upload_ids = UNSET - elif isinstance(self.input_upload_ids, list): - input_upload_ids = [] - for input_upload_ids_type_0_item_data in self.input_upload_ids: - input_upload_ids_type_0_item = str(input_upload_ids_type_0_item_data) - input_upload_ids.append(input_upload_ids_type_0_item) - - else: - input_upload_ids = self.input_upload_ids - - metadata: dict[str, Any] | None | Unset - if isinstance(self.metadata, Unset): - metadata = UNSET - elif isinstance(self.metadata, AgentRunRequestMetadataType0): - metadata = self.metadata.to_dict() - else: - metadata = self.metadata - - priority = self.priority - - replay_of_run_id: None | str | Unset - if isinstance(self.replay_of_run_id, Unset): - replay_of_run_id = UNSET - elif isinstance(self.replay_of_run_id, UUID): - replay_of_run_id = str(self.replay_of_run_id) - else: - replay_of_run_id = self.replay_of_run_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if input_ is not UNSET: - field_dict["input"] = input_ - if input_upload_id is not UNSET: - field_dict["input_upload_id"] = input_upload_id - if input_upload_ids is not UNSET: - field_dict["input_upload_ids"] = input_upload_ids - if metadata is not UNSET: - field_dict["metadata"] = metadata - if priority is not UNSET: - field_dict["priority"] = priority - if replay_of_run_id is not UNSET: - field_dict["replay_of_run_id"] = replay_of_run_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_run_request_metadata_type_0 import ( - AgentRunRequestMetadataType0, - ) - - d = dict(src_dict) - - def _parse_input_(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_input_upload_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() - input_upload_id_type_0 = UUID(data) - - return input_upload_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - input_upload_id = _parse_input_upload_id(d.pop("input_upload_id", UNSET)) - - def _parse_input_upload_ids(data: object) -> list[UUID] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_upload_ids_type_0 = [] - _input_upload_ids_type_0 = data - for input_upload_ids_type_0_item_data in _input_upload_ids_type_0: - input_upload_ids_type_0_item = UUID( - input_upload_ids_type_0_item_data - ) - - input_upload_ids_type_0.append(input_upload_ids_type_0_item) - - return input_upload_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[UUID] | None | Unset, data) - - input_upload_ids = _parse_input_upload_ids(d.pop("input_upload_ids", UNSET)) - - def _parse_metadata( - data: object, - ) -> AgentRunRequestMetadataType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_type_0 = AgentRunRequestMetadataType0.from_dict(data) - - return metadata_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentRunRequestMetadataType0 | None | Unset, data) - - metadata = _parse_metadata(d.pop("metadata", UNSET)) - - priority = d.pop("priority", UNSET) - - def _parse_replay_of_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() - replay_of_run_id_type_0 = UUID(data) - - return replay_of_run_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - replay_of_run_id = _parse_replay_of_run_id(d.pop("replay_of_run_id", UNSET)) - - agent_run_request = cls( - input_=input_, - input_upload_id=input_upload_id, - input_upload_ids=input_upload_ids, - metadata=metadata, - priority=priority, - replay_of_run_id=replay_of_run_id, - ) - - agent_run_request.additional_properties = d - return agent_run_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/seclai/_generated/models/agent_run_request_metadata_type_0.py b/seclai/_generated/models/agent_run_request_metadata_type_0.py deleted file mode 100644 index d133748..0000000 --- a/seclai/_generated/models/agent_run_request_metadata_type_0.py +++ /dev/null @@ -1,46 +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="AgentRunRequestMetadataType0") - - -@_attrs_define -class AgentRunRequestMetadataType0: - """ """ - - additional_properties: dict[str, Any] = _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_run_request_metadata_type_0 = cls() - - agent_run_request_metadata_type_0.additional_properties = d - return agent_run_request_metadata_type_0 - - @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/seclai/_generated/models/agent_run_response.py b/seclai/_generated/models/agent_run_response.py deleted file mode 100644 index 0b5c219..0000000 --- a/seclai/_generated/models/agent_run_response.py +++ /dev/null @@ -1,405 +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.pending_processing_completed_failed_status import ( - PendingProcessingCompletedFailedStatus, -) -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.agent_run_attempt_response import AgentRunAttemptResponse - from ..models.agent_run_step_response import AgentRunStepResponse - from ..models.governance_policy_ref_response import GovernancePolicyRefResponse - - -T = TypeVar("T", bound="AgentRunResponse") - - -@_attrs_define -class AgentRunResponse: - """ - Attributes: - attempts (list[AgentRunAttemptResponse]): List of attempts made for this agent run. - credits_ (float | None): Credits consumed by the agent run, if applicable. - error_count (int): Number of errors encountered during the run. - input_ (None | str): Input provided to the agent for this run. - output (None | str): Output produced by the agent run. - priority (bool): Indicates if the run was treated as a priority execution. - run_id (str): Unique identifier for the agent run. - status (PendingProcessingCompletedFailedStatus): - blocked_policies (list[GovernancePolicyRefResponse] | Unset): Governance policies that produced at least one - BLOCK verdict during this run. Deduplicated by policy id. - flagged_policies (list[GovernancePolicyRefResponse] | Unset): Governance policies that produced at least one - FLAG verdict during this run. Deduplicated by policy id. - governance_input_status (None | str | Unset): Result of the governance input evaluation: safe, blocked, skipped, - or timed_out. - governance_input_wait_ms (int | None | Unset): Milliseconds spent waiting for governance input evaluation. - hitl_wait_ms (int | None | Unset): Cumulative milliseconds the run was parked waiting for a human decision on a - human_in_the_loop step. Subtracted from active duration in run-detail and duration-stats responses. - input_scan_status (None | str | Unset): Result of the prompt injection scan: safe, unsafe, skipped, timed_out, - or error. - output_content_type (None | str | Unset): MIME type of `output` — mirrors the terminal step's - `output_content_type`. Consumers interpret `output` differently depending on this value: - `application/vnd.seclai.manifest+json` is a multi-asset manifest with shape `{text, attachments: [{storage_key, - mime, name, bytes}]}` — fetch each attachment via `GET /v2/agent-runs/{run_id}/attachments/{attachment_id}`, - where `attachment_id` is the URL-safe base64 of the attachment's `storage_key` (accepts an API key or OAuth - token). `text/plain` / `text/*` are free-form text. `application/json` is a JSON document. Null on runs that - produced no terminal output or that pre-date this column. - scan_wait_ms (int | None | Unset): Milliseconds spent waiting for prompt injection scan. - steps (list[AgentRunStepResponse] | None | Unset): Step outputs and per-step timing/credits. Only included when - requested. - wait_ms (int | None | Unset): Cumulative milliseconds the run was parked on standard-mode wait steps. - Subtracted from active duration in run-detail and duration-stats responses, exactly like hitl_wait_ms. Priority - waits block inline and are not counted here. - """ - - attempts: list[AgentRunAttemptResponse] - credits_: float | None - error_count: int - input_: None | str - output: None | str - priority: bool - run_id: str - status: PendingProcessingCompletedFailedStatus - blocked_policies: list[GovernancePolicyRefResponse] | Unset = UNSET - flagged_policies: list[GovernancePolicyRefResponse] | Unset = UNSET - governance_input_status: None | str | Unset = UNSET - governance_input_wait_ms: int | None | Unset = UNSET - hitl_wait_ms: int | None | Unset = UNSET - input_scan_status: None | str | Unset = UNSET - output_content_type: None | str | Unset = UNSET - scan_wait_ms: int | None | Unset = UNSET - steps: list[AgentRunStepResponse] | None | Unset = UNSET - wait_ms: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - attempts = [] - for attempts_item_data in self.attempts: - attempts_item = attempts_item_data.to_dict() - attempts.append(attempts_item) - - credits_: float | None - credits_ = self.credits_ - - error_count = self.error_count - - input_: None | str - input_ = self.input_ - - output: None | str - output = self.output - - priority = self.priority - - run_id = self.run_id - - status = self.status.value - - blocked_policies: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.blocked_policies, Unset): - blocked_policies = [] - for blocked_policies_item_data in self.blocked_policies: - blocked_policies_item = blocked_policies_item_data.to_dict() - blocked_policies.append(blocked_policies_item) - - flagged_policies: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.flagged_policies, Unset): - flagged_policies = [] - for flagged_policies_item_data in self.flagged_policies: - flagged_policies_item = flagged_policies_item_data.to_dict() - flagged_policies.append(flagged_policies_item) - - governance_input_status: None | str | Unset - if isinstance(self.governance_input_status, Unset): - governance_input_status = UNSET - else: - governance_input_status = self.governance_input_status - - governance_input_wait_ms: int | None | Unset - if isinstance(self.governance_input_wait_ms, Unset): - governance_input_wait_ms = UNSET - else: - governance_input_wait_ms = self.governance_input_wait_ms - - hitl_wait_ms: int | None | Unset - if isinstance(self.hitl_wait_ms, Unset): - hitl_wait_ms = UNSET - else: - hitl_wait_ms = self.hitl_wait_ms - - input_scan_status: None | str | Unset - if isinstance(self.input_scan_status, Unset): - input_scan_status = UNSET - else: - input_scan_status = self.input_scan_status - - output_content_type: None | str | Unset - if isinstance(self.output_content_type, Unset): - output_content_type = UNSET - else: - output_content_type = self.output_content_type - - scan_wait_ms: int | None | Unset - if isinstance(self.scan_wait_ms, Unset): - scan_wait_ms = UNSET - else: - scan_wait_ms = self.scan_wait_ms - - steps: list[dict[str, Any]] | None | Unset - if isinstance(self.steps, Unset): - steps = UNSET - elif isinstance(self.steps, list): - steps = [] - for steps_type_0_item_data in self.steps: - steps_type_0_item = steps_type_0_item_data.to_dict() - steps.append(steps_type_0_item) - - else: - steps = self.steps - - wait_ms: int | None | Unset - if isinstance(self.wait_ms, Unset): - wait_ms = UNSET - else: - wait_ms = self.wait_ms - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "attempts": attempts, - "credits": credits_, - "error_count": error_count, - "input": input_, - "output": output, - "priority": priority, - "run_id": run_id, - "status": status, - } - ) - if blocked_policies is not UNSET: - field_dict["blocked_policies"] = blocked_policies - if flagged_policies is not UNSET: - field_dict["flagged_policies"] = flagged_policies - if governance_input_status is not UNSET: - field_dict["governance_input_status"] = governance_input_status - if governance_input_wait_ms is not UNSET: - field_dict["governance_input_wait_ms"] = governance_input_wait_ms - if hitl_wait_ms is not UNSET: - field_dict["hitl_wait_ms"] = hitl_wait_ms - if input_scan_status is not UNSET: - field_dict["input_scan_status"] = input_scan_status - if output_content_type is not UNSET: - field_dict["output_content_type"] = output_content_type - if scan_wait_ms is not UNSET: - field_dict["scan_wait_ms"] = scan_wait_ms - if steps is not UNSET: - field_dict["steps"] = steps - if wait_ms is not UNSET: - field_dict["wait_ms"] = wait_ms - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_run_attempt_response import AgentRunAttemptResponse - from ..models.agent_run_step_response import AgentRunStepResponse - from ..models.governance_policy_ref_response import GovernancePolicyRefResponse - - d = dict(src_dict) - attempts = [] - _attempts = d.pop("attempts") - for attempts_item_data in _attempts: - attempts_item = AgentRunAttemptResponse.from_dict(attempts_item_data) - - attempts.append(attempts_item) - - def _parse_credits_(data: object) -> float | None: - if data is None: - return data - return cast(float | None, data) - - credits_ = _parse_credits_(d.pop("credits")) - - error_count = d.pop("error_count") - - def _parse_input_(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - input_ = _parse_input_(d.pop("input")) - - def _parse_output(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - output = _parse_output(d.pop("output")) - - priority = d.pop("priority") - - run_id = d.pop("run_id") - - status = PendingProcessingCompletedFailedStatus(d.pop("status")) - - _blocked_policies = d.pop("blocked_policies", UNSET) - blocked_policies: list[GovernancePolicyRefResponse] | Unset = UNSET - if _blocked_policies is not UNSET: - blocked_policies = [] - for blocked_policies_item_data in _blocked_policies: - blocked_policies_item = GovernancePolicyRefResponse.from_dict( - blocked_policies_item_data - ) - - blocked_policies.append(blocked_policies_item) - - _flagged_policies = d.pop("flagged_policies", UNSET) - flagged_policies: list[GovernancePolicyRefResponse] | Unset = UNSET - if _flagged_policies is not UNSET: - flagged_policies = [] - for flagged_policies_item_data in _flagged_policies: - flagged_policies_item = GovernancePolicyRefResponse.from_dict( - flagged_policies_item_data - ) - - flagged_policies.append(flagged_policies_item) - - def _parse_governance_input_status(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - governance_input_status = _parse_governance_input_status( - d.pop("governance_input_status", UNSET) - ) - - def _parse_governance_input_wait_ms(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - governance_input_wait_ms = _parse_governance_input_wait_ms( - d.pop("governance_input_wait_ms", UNSET) - ) - - def _parse_hitl_wait_ms(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - hitl_wait_ms = _parse_hitl_wait_ms(d.pop("hitl_wait_ms", UNSET)) - - def _parse_input_scan_status(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - input_scan_status = _parse_input_scan_status(d.pop("input_scan_status", UNSET)) - - def _parse_output_content_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - output_content_type = _parse_output_content_type( - d.pop("output_content_type", UNSET) - ) - - def _parse_scan_wait_ms(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - scan_wait_ms = _parse_scan_wait_ms(d.pop("scan_wait_ms", UNSET)) - - def _parse_steps(data: object) -> list[AgentRunStepResponse] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - steps_type_0 = [] - _steps_type_0 = data - for steps_type_0_item_data in _steps_type_0: - steps_type_0_item = AgentRunStepResponse.from_dict( - steps_type_0_item_data - ) - - steps_type_0.append(steps_type_0_item) - - return steps_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[AgentRunStepResponse] | None | Unset, data) - - steps = _parse_steps(d.pop("steps", UNSET)) - - def _parse_wait_ms(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - wait_ms = _parse_wait_ms(d.pop("wait_ms", UNSET)) - - agent_run_response = cls( - attempts=attempts, - credits_=credits_, - error_count=error_count, - input_=input_, - output=output, - priority=priority, - run_id=run_id, - status=status, - blocked_policies=blocked_policies, - flagged_policies=flagged_policies, - governance_input_status=governance_input_status, - governance_input_wait_ms=governance_input_wait_ms, - hitl_wait_ms=hitl_wait_ms, - input_scan_status=input_scan_status, - output_content_type=output_content_type, - scan_wait_ms=scan_wait_ms, - steps=steps, - wait_ms=wait_ms, - ) - - agent_run_response.additional_properties = d - return agent_run_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/seclai/_generated/models/agent_run_step_response.py b/seclai/_generated/models/agent_run_step_response.py deleted file mode 100644 index cfc6b7e..0000000 --- a/seclai/_generated/models/agent_run_step_response.py +++ /dev/null @@ -1,204 +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.pending_processing_completed_failed_status import ( - PendingProcessingCompletedFailedStatus, -) -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.agent_run_tool_call_response import AgentRunToolCallResponse - - -T = TypeVar("T", bound="AgentRunStepResponse") - - -@_attrs_define -class AgentRunStepResponse: - """ - Attributes: - agent_step_id (str): Agent step identifier. - credits_used (float): Credits consumed by the step attempt, if applicable. - duration_seconds (float | None): Duration of the step attempt in seconds. - ended_at (None | str): Timestamp when the step attempt ended. - input_ (None | str): Input provided to the step, if any. - output (None | str): Output produced by the step, if any. - output_content_type (None | str): Content type of the step output, if any. - started_at (None | str): Timestamp when the step attempt started. - status (PendingProcessingCompletedFailedStatus): - step_type (str): Type of the agent step. - tool_calls (list[AgentRunToolCallResponse] | Unset): LLM tool calls made during this step (prompt_call steps - only), ordered by execution. Empty for steps that invoked no tools. - """ - - agent_step_id: str - credits_used: float - duration_seconds: float | None - ended_at: None | str - input_: None | str - output: None | str - output_content_type: None | str - started_at: None | str - status: PendingProcessingCompletedFailedStatus - step_type: str - tool_calls: list[AgentRunToolCallResponse] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_step_id = self.agent_step_id - - credits_used = self.credits_used - - duration_seconds: float | None - duration_seconds = self.duration_seconds - - ended_at: None | str - ended_at = self.ended_at - - input_: None | str - input_ = self.input_ - - output: None | str - output = self.output - - output_content_type: None | str - output_content_type = self.output_content_type - - started_at: None | str - started_at = self.started_at - - status = self.status.value - - step_type = self.step_type - - tool_calls: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.tool_calls, Unset): - tool_calls = [] - for tool_calls_item_data in self.tool_calls: - tool_calls_item = tool_calls_item_data.to_dict() - tool_calls.append(tool_calls_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_step_id": agent_step_id, - "credits_used": credits_used, - "duration_seconds": duration_seconds, - "ended_at": ended_at, - "input": input_, - "output": output, - "output_content_type": output_content_type, - "started_at": started_at, - "status": status, - "step_type": step_type, - } - ) - if tool_calls is not UNSET: - field_dict["tool_calls"] = tool_calls - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_run_tool_call_response import AgentRunToolCallResponse - - d = dict(src_dict) - agent_step_id = d.pop("agent_step_id") - - credits_used = d.pop("credits_used") - - def _parse_duration_seconds(data: object) -> float | None: - if data is None: - return data - return cast(float | None, data) - - duration_seconds = _parse_duration_seconds(d.pop("duration_seconds")) - - def _parse_ended_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - ended_at = _parse_ended_at(d.pop("ended_at")) - - def _parse_input_(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - input_ = _parse_input_(d.pop("input")) - - def _parse_output(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - output = _parse_output(d.pop("output")) - - def _parse_output_content_type(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - output_content_type = _parse_output_content_type(d.pop("output_content_type")) - - def _parse_started_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - started_at = _parse_started_at(d.pop("started_at")) - - status = PendingProcessingCompletedFailedStatus(d.pop("status")) - - step_type = d.pop("step_type") - - _tool_calls = d.pop("tool_calls", UNSET) - tool_calls: list[AgentRunToolCallResponse] | Unset = UNSET - if _tool_calls is not UNSET: - tool_calls = [] - for tool_calls_item_data in _tool_calls: - tool_calls_item = AgentRunToolCallResponse.from_dict( - tool_calls_item_data - ) - - tool_calls.append(tool_calls_item) - - agent_run_step_response = cls( - agent_step_id=agent_step_id, - credits_used=credits_used, - duration_seconds=duration_seconds, - ended_at=ended_at, - input_=input_, - output=output, - output_content_type=output_content_type, - started_at=started_at, - status=status, - step_type=step_type, - tool_calls=tool_calls, - ) - - agent_run_step_response.additional_properties = d - return agent_run_step_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/seclai/_generated/models/agent_run_stream_request.py b/seclai/_generated/models/agent_run_stream_request.py deleted file mode 100644 index c3f68b4..0000000 --- a/seclai/_generated/models/agent_run_stream_request.py +++ /dev/null @@ -1,228 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.agent_run_stream_request_metadata_type_0 import ( - AgentRunStreamRequestMetadataType0, - ) - - -T = TypeVar("T", bound="AgentRunStreamRequest") - - -@_attrs_define -class AgentRunStreamRequest: - """ - Attributes: - input_ (None | str | Unset): Input to provide to the agent upon running for agents with dynamic triggers. - input_upload_id (None | Unset | UUID): ID of a previously uploaded file (via POST /{agent_id}/upload-input) to - use as the run input for dynamic-input triggers. Mutually exclusive with the 'input' field. Use - ``input_upload_ids`` to attach multiple files. Subject to the same per-batch attachment-selector validation as - the non-streaming endpoint. - input_upload_ids (list[UUID] | None | Unset): IDs of multiple previously uploaded files. See the non-streaming - endpoint for full semantics, including per-batch selector validation (exact names, indexed references, and glob - patterns must all be satisfied or the run is rejected with HTTP 400). Max 20. - metadata (AgentRunStreamRequestMetadataType0 | None | Unset): Metadata to make available for string substitution - expressions in agent tasks. - replay_of_run_id (None | Unset | UUID): Re-run reusing a prior run's uploaded input files (re-resolved server- - side from the source run, which must belong to this account and agent). A fresh upload batch takes precedence. - """ - - input_: None | str | Unset = UNSET - input_upload_id: None | Unset | UUID = UNSET - input_upload_ids: list[UUID] | None | Unset = UNSET - metadata: AgentRunStreamRequestMetadataType0 | None | Unset = UNSET - replay_of_run_id: None | Unset | UUID = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.agent_run_stream_request_metadata_type_0 import ( - AgentRunStreamRequestMetadataType0, - ) - - input_: None | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - else: - input_ = self.input_ - - input_upload_id: None | str | Unset - if isinstance(self.input_upload_id, Unset): - input_upload_id = UNSET - elif isinstance(self.input_upload_id, UUID): - input_upload_id = str(self.input_upload_id) - else: - input_upload_id = self.input_upload_id - - input_upload_ids: list[str] | None | Unset - if isinstance(self.input_upload_ids, Unset): - input_upload_ids = UNSET - elif isinstance(self.input_upload_ids, list): - input_upload_ids = [] - for input_upload_ids_type_0_item_data in self.input_upload_ids: - input_upload_ids_type_0_item = str(input_upload_ids_type_0_item_data) - input_upload_ids.append(input_upload_ids_type_0_item) - - else: - input_upload_ids = self.input_upload_ids - - metadata: dict[str, Any] | None | Unset - if isinstance(self.metadata, Unset): - metadata = UNSET - elif isinstance(self.metadata, AgentRunStreamRequestMetadataType0): - metadata = self.metadata.to_dict() - else: - metadata = self.metadata - - replay_of_run_id: None | str | Unset - if isinstance(self.replay_of_run_id, Unset): - replay_of_run_id = UNSET - elif isinstance(self.replay_of_run_id, UUID): - replay_of_run_id = str(self.replay_of_run_id) - else: - replay_of_run_id = self.replay_of_run_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if input_ is not UNSET: - field_dict["input"] = input_ - if input_upload_id is not UNSET: - field_dict["input_upload_id"] = input_upload_id - if input_upload_ids is not UNSET: - field_dict["input_upload_ids"] = input_upload_ids - if metadata is not UNSET: - field_dict["metadata"] = metadata - if replay_of_run_id is not UNSET: - field_dict["replay_of_run_id"] = replay_of_run_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_run_stream_request_metadata_type_0 import ( - AgentRunStreamRequestMetadataType0, - ) - - d = dict(src_dict) - - def _parse_input_(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_input_upload_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() - input_upload_id_type_0 = UUID(data) - - return input_upload_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - input_upload_id = _parse_input_upload_id(d.pop("input_upload_id", UNSET)) - - def _parse_input_upload_ids(data: object) -> list[UUID] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - input_upload_ids_type_0 = [] - _input_upload_ids_type_0 = data - for input_upload_ids_type_0_item_data in _input_upload_ids_type_0: - input_upload_ids_type_0_item = UUID( - input_upload_ids_type_0_item_data - ) - - input_upload_ids_type_0.append(input_upload_ids_type_0_item) - - return input_upload_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[UUID] | None | Unset, data) - - input_upload_ids = _parse_input_upload_ids(d.pop("input_upload_ids", UNSET)) - - def _parse_metadata( - data: object, - ) -> AgentRunStreamRequestMetadataType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_type_0 = AgentRunStreamRequestMetadataType0.from_dict(data) - - return metadata_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentRunStreamRequestMetadataType0 | None | Unset, data) - - metadata = _parse_metadata(d.pop("metadata", UNSET)) - - def _parse_replay_of_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() - replay_of_run_id_type_0 = UUID(data) - - return replay_of_run_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - replay_of_run_id = _parse_replay_of_run_id(d.pop("replay_of_run_id", UNSET)) - - agent_run_stream_request = cls( - input_=input_, - input_upload_id=input_upload_id, - input_upload_ids=input_upload_ids, - metadata=metadata, - replay_of_run_id=replay_of_run_id, - ) - - agent_run_stream_request.additional_properties = d - return agent_run_stream_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/seclai/_generated/models/agent_run_stream_request_metadata_type_0.py b/seclai/_generated/models/agent_run_stream_request_metadata_type_0.py deleted file mode 100644 index e35d7be..0000000 --- a/seclai/_generated/models/agent_run_stream_request_metadata_type_0.py +++ /dev/null @@ -1,46 +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="AgentRunStreamRequestMetadataType0") - - -@_attrs_define -class AgentRunStreamRequestMetadataType0: - """ """ - - additional_properties: dict[str, Any] = _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_run_stream_request_metadata_type_0 = cls() - - agent_run_stream_request_metadata_type_0.additional_properties = d - return agent_run_stream_request_metadata_type_0 - - @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/seclai/_generated/models/agent_run_tool_call_response.py b/seclai/_generated/models/agent_run_tool_call_response.py deleted file mode 100644 index 375f3fb..0000000 --- a/seclai/_generated/models/agent_run_tool_call_response.py +++ /dev/null @@ -1,228 +0,0 @@ -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="AgentRunToolCallResponse") - - -@_attrs_define -class AgentRunToolCallResponse: - """A single LLM tool call made during a prompt_call step. - - Attributes: - function_name (str): Name of the tool/function invoked. - id (str): Tool call identifier. - credits_used (float | Unset): Credits consumed by this tool call (0 for tools that don't bill). Default: 0.0. - duration_seconds (float | None | Unset): Duration of the tool call in seconds. - ended_at (None | str | Unset): Timestamp when the tool call ended. - error (None | str | Unset): Error message when the tool call failed. - input_ (None | str | Unset): JSON arguments the LLM passed to the tool, if persisted. - output (None | str | Unset): JSON result the tool returned to the LLM, if persisted. - round_index (int | Unset): 0-based tool-loop round this call belonged to. Default: 0. - sequence (int | Unset): 0-based ordinal of this call within its step run. Default: 0. - started_at (None | str | Unset): Timestamp when the tool call started. - succeeded (bool | Unset): Whether the tool call completed without error. Default: True. - """ - - function_name: str - id: str - credits_used: float | Unset = 0.0 - duration_seconds: float | None | Unset = UNSET - ended_at: None | str | Unset = UNSET - error: None | str | Unset = UNSET - input_: None | str | Unset = UNSET - output: None | str | Unset = UNSET - round_index: int | Unset = 0 - sequence: int | Unset = 0 - started_at: None | str | Unset = UNSET - succeeded: bool | Unset = True - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - function_name = self.function_name - - id = self.id - - credits_used = self.credits_used - - duration_seconds: float | None | Unset - if isinstance(self.duration_seconds, Unset): - duration_seconds = UNSET - else: - duration_seconds = self.duration_seconds - - ended_at: None | str | Unset - if isinstance(self.ended_at, Unset): - ended_at = UNSET - else: - ended_at = self.ended_at - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - input_: None | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - else: - input_ = self.input_ - - output: None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - else: - output = self.output - - round_index = self.round_index - - sequence = self.sequence - - started_at: None | str | Unset - if isinstance(self.started_at, Unset): - started_at = UNSET - else: - started_at = self.started_at - - succeeded = self.succeeded - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "function_name": function_name, - "id": id, - } - ) - if credits_used is not UNSET: - field_dict["credits_used"] = credits_used - if duration_seconds is not UNSET: - field_dict["duration_seconds"] = duration_seconds - if ended_at is not UNSET: - field_dict["ended_at"] = ended_at - if error is not UNSET: - field_dict["error"] = error - if input_ is not UNSET: - field_dict["input"] = input_ - if output is not UNSET: - field_dict["output"] = output - if round_index is not UNSET: - field_dict["round_index"] = round_index - if sequence is not UNSET: - field_dict["sequence"] = sequence - if started_at is not UNSET: - field_dict["started_at"] = started_at - if succeeded is not UNSET: - field_dict["succeeded"] = succeeded - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - function_name = d.pop("function_name") - - id = d.pop("id") - - credits_used = d.pop("credits_used", UNSET) - - def _parse_duration_seconds(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - duration_seconds = _parse_duration_seconds(d.pop("duration_seconds", UNSET)) - - def _parse_ended_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_input_(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - round_index = d.pop("round_index", UNSET) - - sequence = d.pop("sequence", UNSET) - - def _parse_started_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - started_at = _parse_started_at(d.pop("started_at", UNSET)) - - succeeded = d.pop("succeeded", UNSET) - - agent_run_tool_call_response = cls( - function_name=function_name, - id=id, - credits_used=credits_used, - duration_seconds=duration_seconds, - ended_at=ended_at, - error=error, - input_=input_, - output=output, - round_index=round_index, - sequence=sequence, - started_at=started_at, - succeeded=succeeded, - ) - - agent_run_tool_call_response.additional_properties = d - return agent_run_tool_call_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/seclai/_generated/models/agent_summary_response.py b/seclai/_generated/models/agent_summary_response.py deleted file mode 100644 index ed8789b..0000000 --- a/seclai/_generated/models/agent_summary_response.py +++ /dev/null @@ -1,388 +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.agent_summary_response_sampling_config_type_0 import ( - AgentSummaryResponseSamplingConfigType0, - ) - from ..models.import_skip_response import ImportSkipResponse - - -T = TypeVar("T", bound="AgentSummaryResponse") - - -@_attrs_define -class AgentSummaryResponse: - """ - Attributes: - created_at (str): ISO 8601 creation timestamp. - description (None | str): Agent description. - id (str): Unique agent identifier. - name (str): Agent name. - updated_at (str): ISO 8601 last-updated timestamp. - default_evaluation_tier (None | str | Unset): Default evaluation tier: fast, balanced, or thorough. - disabled (bool | Unset): Whether the agent is paused (disabled). Default: False. - disabled_at (None | str | Unset): ISO 8601 timestamp the agent was paused. - disabled_reason (None | str | Unset): Why the agent is paused: 'manual' or 'email_overload'. - evaluation_mode (str | Unset): Evaluation mode: output_expectation, eval_and_retry, or sample_and_flag. Default: - 'eval_and_retry'. - import_warnings (list[ImportSkipResponse] | None | Unset): One entry per item dropped or substituted during - import. Present only on endpoints that accept agent_definition; null on non-import calls; [] when the import had - no skips. - max_retries (int | Unset): Max retries for eval_and_retry mode. Default: 3. - prompt_model_auto_rollback_enabled (bool | Unset): Whether automatic rollback is enabled for upgraded models. - Default: False. - prompt_model_auto_rollback_triggers (list[str] | None | Unset): Failure signals that trigger rollback. Defaults - to agent_eval_fail, governance_block, agent_run_failed when null. - prompt_model_auto_upgrade_strategy (str | Unset): Auto-upgrade strategy: none, early_adopter, middle_of_road, - cautious_adopter. Default: 'none'. - retry_on_failure (bool | Unset): Whether to retry on evaluation failure. Default: True. - sampling_config (AgentSummaryResponseSamplingConfigType0 | None | Unset): Sampling configuration for - sample_and_flag mode. - trigger_type (None | str | Unset): Trigger type for the agent. - """ - - created_at: str - description: None | str - id: str - name: str - updated_at: str - default_evaluation_tier: None | str | Unset = UNSET - disabled: bool | Unset = False - disabled_at: None | str | Unset = UNSET - disabled_reason: None | str | Unset = UNSET - evaluation_mode: str | Unset = "eval_and_retry" - import_warnings: list[ImportSkipResponse] | None | Unset = UNSET - max_retries: int | Unset = 3 - prompt_model_auto_rollback_enabled: bool | Unset = False - prompt_model_auto_rollback_triggers: list[str] | None | Unset = UNSET - prompt_model_auto_upgrade_strategy: str | Unset = "none" - retry_on_failure: bool | Unset = True - sampling_config: AgentSummaryResponseSamplingConfigType0 | None | Unset = UNSET - trigger_type: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.agent_summary_response_sampling_config_type_0 import ( - AgentSummaryResponseSamplingConfigType0, - ) - - created_at = self.created_at - - description: None | str - description = self.description - - id = self.id - - name = self.name - - updated_at = self.updated_at - - default_evaluation_tier: None | str | Unset - if isinstance(self.default_evaluation_tier, Unset): - default_evaluation_tier = UNSET - else: - default_evaluation_tier = self.default_evaluation_tier - - disabled = self.disabled - - disabled_at: None | str | Unset - if isinstance(self.disabled_at, Unset): - disabled_at = UNSET - else: - disabled_at = self.disabled_at - - disabled_reason: None | str | Unset - if isinstance(self.disabled_reason, Unset): - disabled_reason = UNSET - else: - disabled_reason = self.disabled_reason - - evaluation_mode = self.evaluation_mode - - import_warnings: list[dict[str, Any]] | None | Unset - if isinstance(self.import_warnings, Unset): - import_warnings = UNSET - elif isinstance(self.import_warnings, list): - import_warnings = [] - for import_warnings_type_0_item_data in self.import_warnings: - import_warnings_type_0_item = import_warnings_type_0_item_data.to_dict() - import_warnings.append(import_warnings_type_0_item) - - else: - import_warnings = self.import_warnings - - max_retries = self.max_retries - - prompt_model_auto_rollback_enabled = self.prompt_model_auto_rollback_enabled - - prompt_model_auto_rollback_triggers: list[str] | None | Unset - if isinstance(self.prompt_model_auto_rollback_triggers, Unset): - prompt_model_auto_rollback_triggers = UNSET - elif isinstance(self.prompt_model_auto_rollback_triggers, list): - prompt_model_auto_rollback_triggers = ( - self.prompt_model_auto_rollback_triggers - ) - - else: - prompt_model_auto_rollback_triggers = ( - self.prompt_model_auto_rollback_triggers - ) - - prompt_model_auto_upgrade_strategy = self.prompt_model_auto_upgrade_strategy - - retry_on_failure = self.retry_on_failure - - sampling_config: dict[str, Any] | None | Unset - if isinstance(self.sampling_config, Unset): - sampling_config = UNSET - elif isinstance(self.sampling_config, AgentSummaryResponseSamplingConfigType0): - sampling_config = self.sampling_config.to_dict() - else: - sampling_config = self.sampling_config - - trigger_type: None | str | Unset - if isinstance(self.trigger_type, Unset): - trigger_type = UNSET - else: - trigger_type = self.trigger_type - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "created_at": created_at, - "description": description, - "id": id, - "name": name, - "updated_at": updated_at, - } - ) - if default_evaluation_tier is not UNSET: - field_dict["default_evaluation_tier"] = default_evaluation_tier - if disabled is not UNSET: - field_dict["disabled"] = disabled - if disabled_at is not UNSET: - field_dict["disabled_at"] = disabled_at - if disabled_reason is not UNSET: - field_dict["disabled_reason"] = disabled_reason - if evaluation_mode is not UNSET: - field_dict["evaluation_mode"] = evaluation_mode - if import_warnings is not UNSET: - field_dict["import_warnings"] = import_warnings - if max_retries is not UNSET: - field_dict["max_retries"] = max_retries - if prompt_model_auto_rollback_enabled is not UNSET: - field_dict["prompt_model_auto_rollback_enabled"] = ( - prompt_model_auto_rollback_enabled - ) - if prompt_model_auto_rollback_triggers is not UNSET: - field_dict["prompt_model_auto_rollback_triggers"] = ( - prompt_model_auto_rollback_triggers - ) - if prompt_model_auto_upgrade_strategy is not UNSET: - field_dict["prompt_model_auto_upgrade_strategy"] = ( - prompt_model_auto_upgrade_strategy - ) - if retry_on_failure is not UNSET: - field_dict["retry_on_failure"] = retry_on_failure - if sampling_config is not UNSET: - field_dict["sampling_config"] = sampling_config - if trigger_type is not UNSET: - field_dict["trigger_type"] = trigger_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_summary_response_sampling_config_type_0 import ( - AgentSummaryResponseSamplingConfigType0, - ) - from ..models.import_skip_response import ImportSkipResponse - - d = dict(src_dict) - created_at = d.pop("created_at") - - def _parse_description(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - description = _parse_description(d.pop("description")) - - id = d.pop("id") - - name = d.pop("name") - - updated_at = d.pop("updated_at") - - def _parse_default_evaluation_tier(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - default_evaluation_tier = _parse_default_evaluation_tier( - d.pop("default_evaluation_tier", UNSET) - ) - - disabled = d.pop("disabled", UNSET) - - def _parse_disabled_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - disabled_at = _parse_disabled_at(d.pop("disabled_at", UNSET)) - - def _parse_disabled_reason(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - disabled_reason = _parse_disabled_reason(d.pop("disabled_reason", UNSET)) - - evaluation_mode = d.pop("evaluation_mode", UNSET) - - def _parse_import_warnings( - data: object, - ) -> list[ImportSkipResponse] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - import_warnings_type_0 = [] - _import_warnings_type_0 = data - for import_warnings_type_0_item_data in _import_warnings_type_0: - import_warnings_type_0_item = ImportSkipResponse.from_dict( - import_warnings_type_0_item_data - ) - - import_warnings_type_0.append(import_warnings_type_0_item) - - return import_warnings_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[ImportSkipResponse] | None | Unset, data) - - import_warnings = _parse_import_warnings(d.pop("import_warnings", UNSET)) - - max_retries = d.pop("max_retries", UNSET) - - prompt_model_auto_rollback_enabled = d.pop( - "prompt_model_auto_rollback_enabled", UNSET - ) - - def _parse_prompt_model_auto_rollback_triggers( - 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() - prompt_model_auto_rollback_triggers_type_0 = cast(list[str], data) - - return prompt_model_auto_rollback_triggers_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - prompt_model_auto_rollback_triggers = ( - _parse_prompt_model_auto_rollback_triggers( - d.pop("prompt_model_auto_rollback_triggers", UNSET) - ) - ) - - prompt_model_auto_upgrade_strategy = d.pop( - "prompt_model_auto_upgrade_strategy", UNSET - ) - - retry_on_failure = d.pop("retry_on_failure", UNSET) - - def _parse_sampling_config( - data: object, - ) -> AgentSummaryResponseSamplingConfigType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - sampling_config_type_0 = ( - AgentSummaryResponseSamplingConfigType0.from_dict(data) - ) - - return sampling_config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentSummaryResponseSamplingConfigType0 | None | Unset, data) - - sampling_config = _parse_sampling_config(d.pop("sampling_config", UNSET)) - - def _parse_trigger_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trigger_type = _parse_trigger_type(d.pop("trigger_type", UNSET)) - - agent_summary_response = cls( - created_at=created_at, - description=description, - id=id, - name=name, - updated_at=updated_at, - default_evaluation_tier=default_evaluation_tier, - disabled=disabled, - disabled_at=disabled_at, - disabled_reason=disabled_reason, - evaluation_mode=evaluation_mode, - import_warnings=import_warnings, - max_retries=max_retries, - prompt_model_auto_rollback_enabled=prompt_model_auto_rollback_enabled, - prompt_model_auto_rollback_triggers=prompt_model_auto_rollback_triggers, - prompt_model_auto_upgrade_strategy=prompt_model_auto_upgrade_strategy, - retry_on_failure=retry_on_failure, - sampling_config=sampling_config, - trigger_type=trigger_type, - ) - - agent_summary_response.additional_properties = d - return agent_summary_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/seclai/_generated/models/agent_summary_response_sampling_config_type_0.py b/seclai/_generated/models/agent_summary_response_sampling_config_type_0.py deleted file mode 100644 index a9ce7fb..0000000 --- a/seclai/_generated/models/agent_summary_response_sampling_config_type_0.py +++ /dev/null @@ -1,46 +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="AgentSummaryResponseSamplingConfigType0") - - -@_attrs_define -class AgentSummaryResponseSamplingConfigType0: - """ """ - - additional_properties: dict[str, Any] = _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_summary_response_sampling_config_type_0 = cls() - - agent_summary_response_sampling_config_type_0.additional_properties = d - return agent_summary_response_sampling_config_type_0 - - @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/seclai/_generated/models/agent_trace_match_response.py b/seclai/_generated/models/agent_trace_match_response.py deleted file mode 100644 index 7081edf..0000000 --- a/seclai/_generated/models/agent_trace_match_response.py +++ /dev/null @@ -1,168 +0,0 @@ -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 - -T = TypeVar("T", bound="AgentTraceMatchResponse") - - -@_attrs_define -class AgentTraceMatchResponse: - """ - Attributes: - agent_id (None | str): Agent ID. - agent_run_id (None | str): Agent run ID. - agent_run_status (None | str): Status of the agent run. - agent_step_id (None | str): Step identifier. - agent_step_run_id (None | str): Agent step run ID. - agent_step_type (None | str): Type of the step. - score (float): Similarity score (0-1, higher is better). - text (str): Matching text chunk. - title (None | str): Title of the indexed entry. - """ - - agent_id: None | str - agent_run_id: None | str - agent_run_status: None | str - agent_step_id: None | str - agent_step_run_id: None | str - agent_step_type: None | str - score: float - text: str - title: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_id: None | str - agent_id = self.agent_id - - agent_run_id: None | str - agent_run_id = self.agent_run_id - - agent_run_status: None | str - agent_run_status = self.agent_run_status - - agent_step_id: None | str - agent_step_id = self.agent_step_id - - agent_step_run_id: None | str - agent_step_run_id = self.agent_step_run_id - - agent_step_type: None | str - agent_step_type = self.agent_step_type - - score = self.score - - text = self.text - - title: None | str - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_id": agent_id, - "agent_run_id": agent_run_id, - "agent_run_status": agent_run_status, - "agent_step_id": agent_step_id, - "agent_step_run_id": agent_step_run_id, - "agent_step_type": agent_step_type, - "score": score, - "text": text, - "title": title, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_agent_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - agent_id = _parse_agent_id(d.pop("agent_id")) - - def _parse_agent_run_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - agent_run_id = _parse_agent_run_id(d.pop("agent_run_id")) - - def _parse_agent_run_status(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - agent_run_status = _parse_agent_run_status(d.pop("agent_run_status")) - - def _parse_agent_step_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - agent_step_id = _parse_agent_step_id(d.pop("agent_step_id")) - - def _parse_agent_step_run_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - agent_step_run_id = _parse_agent_step_run_id(d.pop("agent_step_run_id")) - - def _parse_agent_step_type(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - agent_step_type = _parse_agent_step_type(d.pop("agent_step_type")) - - score = d.pop("score") - - text = d.pop("text") - - def _parse_title(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - title = _parse_title(d.pop("title")) - - agent_trace_match_response = cls( - agent_id=agent_id, - agent_run_id=agent_run_id, - agent_run_status=agent_run_status, - agent_step_id=agent_step_id, - agent_step_run_id=agent_step_run_id, - agent_step_type=agent_step_type, - score=score, - text=text, - title=title, - ) - - agent_trace_match_response.additional_properties = d - return agent_trace_match_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/seclai/_generated/models/agent_trace_search_request.py b/seclai/_generated/models/agent_trace_search_request.py deleted file mode 100644 index 0bf0d6f..0000000 --- a/seclai/_generated/models/agent_trace_search_request.py +++ /dev/null @@ -1,132 +0,0 @@ -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="AgentTraceSearchRequest") - - -@_attrs_define -class AgentTraceSearchRequest: - """ - Attributes: - query (str): Search query text. - agent_id (None | str | Unset): Filter by agent ID. - run_status (None | str | Unset): Filter by run status. - step_type (None | str | Unset): Filter by step type. - top_n (int | Unset): Maximum number of results. Default: 10. - """ - - query: str - agent_id: None | str | Unset = UNSET - run_status: None | str | Unset = UNSET - step_type: None | str | Unset = UNSET - top_n: int | Unset = 10 - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - query = self.query - - agent_id: None | str | Unset - if isinstance(self.agent_id, Unset): - agent_id = UNSET - else: - agent_id = self.agent_id - - run_status: None | str | Unset - if isinstance(self.run_status, Unset): - run_status = UNSET - else: - run_status = self.run_status - - step_type: None | str | Unset - if isinstance(self.step_type, Unset): - step_type = UNSET - else: - step_type = self.step_type - - top_n = self.top_n - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "query": query, - } - ) - if agent_id is not UNSET: - field_dict["agent_id"] = agent_id - if run_status is not UNSET: - field_dict["run_status"] = run_status - if step_type is not UNSET: - field_dict["step_type"] = step_type - if top_n is not UNSET: - field_dict["top_n"] = top_n - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - query = d.pop("query") - - def _parse_agent_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_id = _parse_agent_id(d.pop("agent_id", UNSET)) - - def _parse_run_status(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - run_status = _parse_run_status(d.pop("run_status", UNSET)) - - def _parse_step_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - step_type = _parse_step_type(d.pop("step_type", UNSET)) - - top_n = d.pop("top_n", UNSET) - - agent_trace_search_request = cls( - query=query, - agent_id=agent_id, - run_status=run_status, - step_type=step_type, - top_n=top_n, - ) - - agent_trace_search_request.additional_properties = d - return agent_trace_search_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/seclai/_generated/models/agent_trace_search_response.py b/seclai/_generated/models/agent_trace_search_response.py deleted file mode 100644 index 42fbd60..0000000 --- a/seclai/_generated/models/agent_trace_search_response.py +++ /dev/null @@ -1,83 +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.agent_trace_match_response import AgentTraceMatchResponse - - -T = TypeVar("T", bound="AgentTraceSearchResponse") - - -@_attrs_define -class AgentTraceSearchResponse: - """ - Attributes: - matches (list[AgentTraceMatchResponse]): List of matching entries. - total (int): Number of matches returned. - """ - - matches: list[AgentTraceMatchResponse] - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - matches = [] - for matches_item_data in self.matches: - matches_item = matches_item_data.to_dict() - matches.append(matches_item) - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "matches": matches, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_trace_match_response import AgentTraceMatchResponse - - d = dict(src_dict) - matches = [] - _matches = d.pop("matches") - for matches_item_data in _matches: - matches_item = AgentTraceMatchResponse.from_dict(matches_item_data) - - matches.append(matches_item) - - total = d.pop("total") - - agent_trace_search_response = cls( - matches=matches, - total=total, - ) - - agent_trace_search_response.additional_properties = d - return agent_trace_search_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/seclai/_generated/models/ai_assistant_accept_request.py b/seclai/_generated/models/ai_assistant_accept_request.py deleted file mode 100644 index 67594d9..0000000 --- a/seclai/_generated/models/ai_assistant_accept_request.py +++ /dev/null @@ -1,106 +0,0 @@ -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="AiAssistantAcceptRequest") - - -@_attrs_define -class AiAssistantAcceptRequest: - """Request body for accepting a proposed plan. - - Attributes: - confirm_deletions (bool | Unset): Must be true when the plan contains destructive actions Default: False. - solution_description (None | str | Unset): When running in standalone mode (no pre-existing solution), provide a - description for the auto-created solution. - solution_name (None | str | Unset): When running in standalone mode (no pre-existing solution), provide a name - to auto-create a solution and link resources. - """ - - confirm_deletions: bool | Unset = False - solution_description: None | str | Unset = UNSET - solution_name: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - confirm_deletions = self.confirm_deletions - - solution_description: None | str | Unset - if isinstance(self.solution_description, Unset): - solution_description = UNSET - else: - solution_description = self.solution_description - - solution_name: None | str | Unset - if isinstance(self.solution_name, Unset): - solution_name = UNSET - else: - solution_name = self.solution_name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if confirm_deletions is not UNSET: - field_dict["confirm_deletions"] = confirm_deletions - if solution_description is not UNSET: - field_dict["solution_description"] = solution_description - if solution_name is not UNSET: - field_dict["solution_name"] = solution_name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - confirm_deletions = d.pop("confirm_deletions", UNSET) - - def _parse_solution_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - solution_description = _parse_solution_description( - d.pop("solution_description", UNSET) - ) - - def _parse_solution_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - solution_name = _parse_solution_name(d.pop("solution_name", UNSET)) - - ai_assistant_accept_request = cls( - confirm_deletions=confirm_deletions, - solution_description=solution_description, - solution_name=solution_name, - ) - - ai_assistant_accept_request.additional_properties = d - return ai_assistant_accept_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/seclai/_generated/models/ai_assistant_accept_response.py b/seclai/_generated/models/ai_assistant_accept_response.py deleted file mode 100644 index c9253ca..0000000 --- a/seclai/_generated/models/ai_assistant_accept_response.py +++ /dev/null @@ -1,148 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.executed_action_response import ExecutedActionResponse - - -T = TypeVar("T", bound="AiAssistantAcceptResponse") - - -@_attrs_define -class AiAssistantAcceptResponse: - """Response from accepting and executing a plan. - - Attributes: - conversation_id (UUID): Conversation ID. - executed_actions (list[ExecutedActionResponse]): Results of each executed action. - error (None | str | Unset): Error message if failed. - solution_id (None | Unset | UUID): Solution ID when a new solution was auto-created. - success (bool | Unset): Whether execution succeeded. Default: True. - """ - - conversation_id: UUID - executed_actions: list[ExecutedActionResponse] - error: None | str | Unset = UNSET - solution_id: None | Unset | UUID = UNSET - success: bool | Unset = True - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - conversation_id = str(self.conversation_id) - - executed_actions = [] - for executed_actions_item_data in self.executed_actions: - executed_actions_item = executed_actions_item_data.to_dict() - executed_actions.append(executed_actions_item) - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - solution_id: None | str | Unset - if isinstance(self.solution_id, Unset): - solution_id = UNSET - elif isinstance(self.solution_id, UUID): - solution_id = str(self.solution_id) - else: - solution_id = self.solution_id - - success = self.success - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "conversation_id": conversation_id, - "executed_actions": executed_actions, - } - ) - if error is not UNSET: - field_dict["error"] = error - if solution_id is not UNSET: - field_dict["solution_id"] = solution_id - if success is not UNSET: - field_dict["success"] = success - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.executed_action_response import ExecutedActionResponse - - d = dict(src_dict) - conversation_id = UUID(d.pop("conversation_id")) - - executed_actions = [] - _executed_actions = d.pop("executed_actions") - for executed_actions_item_data in _executed_actions: - executed_actions_item = ExecutedActionResponse.from_dict( - executed_actions_item_data - ) - - executed_actions.append(executed_actions_item) - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_solution_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() - solution_id_type_0 = UUID(data) - - return solution_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - solution_id = _parse_solution_id(d.pop("solution_id", UNSET)) - - success = d.pop("success", UNSET) - - ai_assistant_accept_response = cls( - conversation_id=conversation_id, - executed_actions=executed_actions, - error=error, - solution_id=solution_id, - success=success, - ) - - ai_assistant_accept_response.additional_properties = d - return ai_assistant_accept_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/seclai/_generated/models/ai_assistant_feedback_request.py b/seclai/_generated/models/ai_assistant_feedback_request.py deleted file mode 100644 index 0bf4264..0000000 --- a/seclai/_generated/models/ai_assistant_feedback_request.py +++ /dev/null @@ -1,231 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.ai_assistant_feedback_request_context_type_0 import ( - AiAssistantFeedbackRequestContextType0, - ) - - -T = TypeVar("T", bound="AiAssistantFeedbackRequest") - - -@_attrs_define -class AiAssistantFeedbackRequest: - """Request body for submitting AI assistant feedback. - - Attributes: - feature (str): Feature name (e.g. 'source', 'solution'). - rating (str): Rating: 'thumbs_up' or 'thumbs_down'. - agent_conversation_id (None | Unset | UUID): Agent conversation ID, if applicable. - comment (None | str | Unset): Optional comment. - context (AiAssistantFeedbackRequestContextType0 | None | Unset): Additional context. - conversation_id (None | Unset | UUID): Conversation ID for the interaction. - prompt_call_id (None | Unset | UUID): Prompt call ID for credit tracking. - """ - - feature: str - rating: str - agent_conversation_id: None | Unset | UUID = UNSET - comment: None | str | Unset = UNSET - context: AiAssistantFeedbackRequestContextType0 | None | Unset = UNSET - conversation_id: None | Unset | UUID = UNSET - prompt_call_id: None | Unset | UUID = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.ai_assistant_feedback_request_context_type_0 import ( - AiAssistantFeedbackRequestContextType0, - ) - - feature = self.feature - - rating = self.rating - - agent_conversation_id: None | str | Unset - if isinstance(self.agent_conversation_id, Unset): - agent_conversation_id = UNSET - elif isinstance(self.agent_conversation_id, UUID): - agent_conversation_id = str(self.agent_conversation_id) - else: - agent_conversation_id = self.agent_conversation_id - - comment: None | str | Unset - if isinstance(self.comment, Unset): - comment = UNSET - else: - comment = self.comment - - context: dict[str, Any] | None | Unset - if isinstance(self.context, Unset): - context = UNSET - elif isinstance(self.context, AiAssistantFeedbackRequestContextType0): - context = self.context.to_dict() - else: - context = self.context - - conversation_id: None | str | Unset - if isinstance(self.conversation_id, Unset): - conversation_id = UNSET - elif isinstance(self.conversation_id, UUID): - conversation_id = str(self.conversation_id) - else: - conversation_id = self.conversation_id - - prompt_call_id: None | str | Unset - if isinstance(self.prompt_call_id, Unset): - prompt_call_id = UNSET - elif isinstance(self.prompt_call_id, UUID): - prompt_call_id = str(self.prompt_call_id) - else: - prompt_call_id = self.prompt_call_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "feature": feature, - "rating": rating, - } - ) - if agent_conversation_id is not UNSET: - field_dict["agent_conversation_id"] = agent_conversation_id - if comment is not UNSET: - field_dict["comment"] = comment - if context is not UNSET: - field_dict["context"] = context - if conversation_id is not UNSET: - field_dict["conversation_id"] = conversation_id - if prompt_call_id is not UNSET: - field_dict["prompt_call_id"] = prompt_call_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.ai_assistant_feedback_request_context_type_0 import ( - AiAssistantFeedbackRequestContextType0, - ) - - d = dict(src_dict) - feature = d.pop("feature") - - rating = d.pop("rating") - - def _parse_agent_conversation_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() - agent_conversation_id_type_0 = UUID(data) - - return agent_conversation_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - agent_conversation_id = _parse_agent_conversation_id( - d.pop("agent_conversation_id", UNSET) - ) - - def _parse_comment(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - comment = _parse_comment(d.pop("comment", UNSET)) - - def _parse_context( - data: object, - ) -> AiAssistantFeedbackRequestContextType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - context_type_0 = AiAssistantFeedbackRequestContextType0.from_dict(data) - - return context_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AiAssistantFeedbackRequestContextType0 | None | Unset, data) - - context = _parse_context(d.pop("context", UNSET)) - - def _parse_conversation_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() - conversation_id_type_0 = UUID(data) - - return conversation_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - conversation_id = _parse_conversation_id(d.pop("conversation_id", UNSET)) - - def _parse_prompt_call_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() - prompt_call_id_type_0 = UUID(data) - - return prompt_call_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - prompt_call_id = _parse_prompt_call_id(d.pop("prompt_call_id", UNSET)) - - ai_assistant_feedback_request = cls( - feature=feature, - rating=rating, - agent_conversation_id=agent_conversation_id, - comment=comment, - context=context, - conversation_id=conversation_id, - prompt_call_id=prompt_call_id, - ) - - ai_assistant_feedback_request.additional_properties = d - return ai_assistant_feedback_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/seclai/_generated/models/ai_assistant_feedback_request_context_type_0.py b/seclai/_generated/models/ai_assistant_feedback_request_context_type_0.py deleted file mode 100644 index e584ecb..0000000 --- a/seclai/_generated/models/ai_assistant_feedback_request_context_type_0.py +++ /dev/null @@ -1,46 +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="AiAssistantFeedbackRequestContextType0") - - -@_attrs_define -class AiAssistantFeedbackRequestContextType0: - """ """ - - additional_properties: dict[str, Any] = _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) - ai_assistant_feedback_request_context_type_0 = cls() - - ai_assistant_feedback_request_context_type_0.additional_properties = d - return ai_assistant_feedback_request_context_type_0 - - @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/seclai/_generated/models/ai_assistant_feedback_response.py b/seclai/_generated/models/ai_assistant_feedback_response.py deleted file mode 100644 index 58adeee..0000000 --- a/seclai/_generated/models/ai_assistant_feedback_response.py +++ /dev/null @@ -1,93 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, 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="AiAssistantFeedbackResponse") - - -@_attrs_define -class AiAssistantFeedbackResponse: - """Response after submitting feedback. - - Attributes: - feedback_id (UUID): - flagged (bool): - flag_reason (None | str | Unset): - """ - - feedback_id: UUID - flagged: bool - flag_reason: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - feedback_id = str(self.feedback_id) - - flagged = self.flagged - - flag_reason: None | str | Unset - if isinstance(self.flag_reason, Unset): - flag_reason = UNSET - else: - flag_reason = self.flag_reason - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "feedback_id": feedback_id, - "flagged": flagged, - } - ) - if flag_reason is not UNSET: - field_dict["flag_reason"] = flag_reason - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - feedback_id = UUID(d.pop("feedback_id")) - - flagged = d.pop("flagged") - - def _parse_flag_reason(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - flag_reason = _parse_flag_reason(d.pop("flag_reason", UNSET)) - - ai_assistant_feedback_response = cls( - feedback_id=feedback_id, - flagged=flagged, - flag_reason=flag_reason, - ) - - ai_assistant_feedback_response.additional_properties = d - return ai_assistant_feedback_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/seclai/_generated/models/ai_assistant_generate_request.py b/seclai/_generated/models/ai_assistant_generate_request.py deleted file mode 100644 index d506cd1..0000000 --- a/seclai/_generated/models/ai_assistant_generate_request.py +++ /dev/null @@ -1,98 +0,0 @@ -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 dateutil.parser import isoparse - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AiAssistantGenerateRequest") - - -@_attrs_define -class AiAssistantGenerateRequest: - """Request body for AI assistant generate endpoints. - - Attributes: - user_input (str): User input describing what to do - history_since (datetime.datetime | None | Unset): Optional ISO 8601 timestamp. When set, only conversation - turns created at or after this timestamp are loaded as context, scoping history to the current session so the - assistant remembers earlier turns in a create flow. - """ - - user_input: str - history_since: datetime.datetime | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - user_input = self.user_input - - history_since: None | str | Unset - if isinstance(self.history_since, Unset): - history_since = UNSET - elif isinstance(self.history_since, datetime.datetime): - history_since = self.history_since.isoformat() - else: - history_since = self.history_since - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "user_input": user_input, - } - ) - if history_since is not UNSET: - field_dict["history_since"] = history_since - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - user_input = d.pop("user_input") - - def _parse_history_since(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() - history_since_type_0 = isoparse(data) - - return history_since_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - history_since = _parse_history_since(d.pop("history_since", UNSET)) - - ai_assistant_generate_request = cls( - user_input=user_input, - history_since=history_since, - ) - - ai_assistant_generate_request.additional_properties = d - return ai_assistant_generate_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/seclai/_generated/models/ai_assistant_generate_response.py b/seclai/_generated/models/ai_assistant_generate_response.py deleted file mode 100644 index bd0c016..0000000 --- a/seclai/_generated/models/ai_assistant_generate_response.py +++ /dev/null @@ -1,142 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.example_prompt import ExamplePrompt - from ..models.proposed_action_response import ProposedActionResponse - - -T = TypeVar("T", bound="AiAssistantGenerateResponse") - - -@_attrs_define -class AiAssistantGenerateResponse: - """Response from an AI assistant generate endpoint. - - Attributes: - conversation_id (UUID): Conversation ID for accept/decline. - note (str): AI-generated note about the plan. - proposed_actions (list[ProposedActionResponse]): List of proposed actions. - example_prompts (list[ExamplePrompt] | Unset): Example natural-language prompts that demonstrate the - capabilities of this AI assistant. - requires_delete_confirmation (bool | Unset): Whether destructive actions require explicit confirmation. Default: - False. - success (bool | Unset): Whether plan generation succeeded. Default: False. - """ - - conversation_id: UUID - note: str - proposed_actions: list[ProposedActionResponse] - example_prompts: list[ExamplePrompt] | Unset = UNSET - requires_delete_confirmation: bool | Unset = False - success: bool | Unset = False - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - conversation_id = str(self.conversation_id) - - note = self.note - - proposed_actions = [] - for proposed_actions_item_data in self.proposed_actions: - proposed_actions_item = proposed_actions_item_data.to_dict() - proposed_actions.append(proposed_actions_item) - - example_prompts: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.example_prompts, Unset): - example_prompts = [] - for example_prompts_item_data in self.example_prompts: - example_prompts_item = example_prompts_item_data.to_dict() - example_prompts.append(example_prompts_item) - - requires_delete_confirmation = self.requires_delete_confirmation - - success = self.success - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "conversation_id": conversation_id, - "note": note, - "proposed_actions": proposed_actions, - } - ) - if example_prompts is not UNSET: - field_dict["example_prompts"] = example_prompts - if requires_delete_confirmation is not UNSET: - field_dict["requires_delete_confirmation"] = requires_delete_confirmation - if success is not UNSET: - field_dict["success"] = success - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.example_prompt import ExamplePrompt - from ..models.proposed_action_response import ProposedActionResponse - - d = dict(src_dict) - conversation_id = UUID(d.pop("conversation_id")) - - note = d.pop("note") - - proposed_actions = [] - _proposed_actions = d.pop("proposed_actions") - for proposed_actions_item_data in _proposed_actions: - proposed_actions_item = ProposedActionResponse.from_dict( - proposed_actions_item_data - ) - - proposed_actions.append(proposed_actions_item) - - _example_prompts = d.pop("example_prompts", UNSET) - example_prompts: list[ExamplePrompt] | Unset = UNSET - if _example_prompts is not UNSET: - example_prompts = [] - for example_prompts_item_data in _example_prompts: - example_prompts_item = ExamplePrompt.from_dict( - example_prompts_item_data - ) - - example_prompts.append(example_prompts_item) - - requires_delete_confirmation = d.pop("requires_delete_confirmation", UNSET) - - success = d.pop("success", UNSET) - - ai_assistant_generate_response = cls( - conversation_id=conversation_id, - note=note, - proposed_actions=proposed_actions, - example_prompts=example_prompts, - requires_delete_confirmation=requires_delete_confirmation, - success=success, - ) - - ai_assistant_generate_response.additional_properties = d - return ai_assistant_generate_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/seclai/_generated/models/ai_conversation_history_response.py b/seclai/_generated/models/ai_conversation_history_response.py deleted file mode 100644 index 3c63b63..0000000 --- a/seclai/_generated/models/ai_conversation_history_response.py +++ /dev/null @@ -1,83 +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.ai_conversation_turn_response import AiConversationTurnResponse - - -T = TypeVar("T", bound="AiConversationHistoryResponse") - - -@_attrs_define -class AiConversationHistoryResponse: - """ - Attributes: - total (int): Total number of conversation turns available. - turns (list[AiConversationTurnResponse]): Conversation turns, ordered oldest first. - """ - - total: int - turns: list[AiConversationTurnResponse] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - total = self.total - - turns = [] - for turns_item_data in self.turns: - turns_item = turns_item_data.to_dict() - turns.append(turns_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "total": total, - "turns": turns, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.ai_conversation_turn_response import AiConversationTurnResponse - - d = dict(src_dict) - total = d.pop("total") - - turns = [] - _turns = d.pop("turns") - for turns_item_data in _turns: - turns_item = AiConversationTurnResponse.from_dict(turns_item_data) - - turns.append(turns_item) - - ai_conversation_history_response = cls( - total=total, - turns=turns, - ) - - ai_conversation_history_response.additional_properties = d - return ai_conversation_history_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/seclai/_generated/models/ai_conversation_turn_response.py b/seclai/_generated/models/ai_conversation_turn_response.py deleted file mode 100644 index c944173..0000000 --- a/seclai/_generated/models/ai_conversation_turn_response.py +++ /dev/null @@ -1,172 +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 - -if TYPE_CHECKING: - from ..models.ai_conversation_turn_response_resulting_config_type_0 import ( - AiConversationTurnResponseResultingConfigType0, - ) - - -T = TypeVar("T", bound="AiConversationTurnResponse") - - -@_attrs_define -class AiConversationTurnResponse: - """ - Attributes: - accepted (bool | None): Whether the user accepted this proposal (null if pending). - ai_note (None | str): AI explanation from this turn. - conversation_id (str): Unique conversation turn ID. - resulting_config (AiConversationTurnResponseResultingConfigType0 | None): The proposed configuration from this - turn. - step_id (None | str): Step ID for this conversation. - step_type (None | str): Step type for this conversation. - user_input (str): User input for this turn. - """ - - accepted: bool | None - ai_note: None | str - conversation_id: str - resulting_config: AiConversationTurnResponseResultingConfigType0 | None - step_id: None | str - step_type: None | str - user_input: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.ai_conversation_turn_response_resulting_config_type_0 import ( - AiConversationTurnResponseResultingConfigType0, - ) - - accepted: bool | None - accepted = self.accepted - - ai_note: None | str - ai_note = self.ai_note - - conversation_id = self.conversation_id - - resulting_config: dict[str, Any] | None - if isinstance( - self.resulting_config, AiConversationTurnResponseResultingConfigType0 - ): - resulting_config = self.resulting_config.to_dict() - else: - resulting_config = self.resulting_config - - step_id: None | str - step_id = self.step_id - - step_type: None | str - step_type = self.step_type - - user_input = self.user_input - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "accepted": accepted, - "ai_note": ai_note, - "conversation_id": conversation_id, - "resulting_config": resulting_config, - "step_id": step_id, - "step_type": step_type, - "user_input": user_input, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.ai_conversation_turn_response_resulting_config_type_0 import ( - AiConversationTurnResponseResultingConfigType0, - ) - - d = dict(src_dict) - - def _parse_accepted(data: object) -> bool | None: - if data is None: - return data - return cast(bool | None, data) - - accepted = _parse_accepted(d.pop("accepted")) - - def _parse_ai_note(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - ai_note = _parse_ai_note(d.pop("ai_note")) - - conversation_id = d.pop("conversation_id") - - def _parse_resulting_config( - data: object, - ) -> AiConversationTurnResponseResultingConfigType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - resulting_config_type_0 = ( - AiConversationTurnResponseResultingConfigType0.from_dict(data) - ) - - return resulting_config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AiConversationTurnResponseResultingConfigType0 | None, data) - - resulting_config = _parse_resulting_config(d.pop("resulting_config")) - - def _parse_step_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - step_id = _parse_step_id(d.pop("step_id")) - - def _parse_step_type(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - step_type = _parse_step_type(d.pop("step_type")) - - user_input = d.pop("user_input") - - ai_conversation_turn_response = cls( - accepted=accepted, - ai_note=ai_note, - conversation_id=conversation_id, - resulting_config=resulting_config, - step_id=step_id, - step_type=step_type, - user_input=user_input, - ) - - ai_conversation_turn_response.additional_properties = d - return ai_conversation_turn_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/seclai/_generated/models/ai_conversation_turn_response_resulting_config_type_0.py b/seclai/_generated/models/ai_conversation_turn_response_resulting_config_type_0.py deleted file mode 100644 index 99a4182..0000000 --- a/seclai/_generated/models/ai_conversation_turn_response_resulting_config_type_0.py +++ /dev/null @@ -1,46 +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="AiConversationTurnResponseResultingConfigType0") - - -@_attrs_define -class AiConversationTurnResponseResultingConfigType0: - """ """ - - additional_properties: dict[str, Any] = _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) - ai_conversation_turn_response_resulting_config_type_0 = cls() - - ai_conversation_turn_response_resulting_config_type_0.additional_properties = d - return ai_conversation_turn_response_resulting_config_type_0 - - @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/seclai/_generated/models/alert_comment_response.py b/seclai/_generated/models/alert_comment_response.py deleted file mode 100644 index 97ec857..0000000 --- a/seclai/_generated/models/alert_comment_response.py +++ /dev/null @@ -1,105 +0,0 @@ -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 - -T = TypeVar("T", bound="AlertCommentResponse") - - -@_attrs_define -class AlertCommentResponse: - """ - Attributes: - body (str): - created_at (None | str): - id (str): - user_id (str): - user_name (None | str): - """ - - body: str - created_at: None | str - id: str - user_id: str - user_name: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - body = self.body - - created_at: None | str - created_at = self.created_at - - id = self.id - - user_id = self.user_id - - user_name: None | str - user_name = self.user_name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "body": body, - "created_at": created_at, - "id": id, - "user_id": user_id, - "user_name": user_name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - body = d.pop("body") - - def _parse_created_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - created_at = _parse_created_at(d.pop("created_at")) - - id = d.pop("id") - - user_id = d.pop("user_id") - - def _parse_user_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - user_name = _parse_user_name(d.pop("user_name")) - - alert_comment_response = cls( - body=body, - created_at=created_at, - id=id, - user_id=user_id, - user_name=user_name, - ) - - alert_comment_response.additional_properties = d - return alert_comment_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/seclai/_generated/models/alert_config_list_response.py b/seclai/_generated/models/alert_config_list_response.py deleted file mode 100644 index 9dc6993..0000000 --- a/seclai/_generated/models/alert_config_list_response.py +++ /dev/null @@ -1,88 +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.alert_config_response import AlertConfigResponse - - -T = TypeVar("T", bound="AlertConfigListResponse") - - -@_attrs_define -class AlertConfigListResponse: - """``GET /alerts/configs`` legacy/default shape (header-less clients). - - ``Seclai-Version: 2026-07-27+`` clients receive the canonical - ``{data, pagination}`` envelope instead (the handler returns a ``JSONResponse`` - that bypasses this ``response_model``); this documents the default shape. - - Attributes: - configs (list[AlertConfigResponse]): - total (int): - """ - - configs: list[AlertConfigResponse] - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - configs = [] - for configs_item_data in self.configs: - configs_item = configs_item_data.to_dict() - configs.append(configs_item) - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "configs": configs, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.alert_config_response import AlertConfigResponse - - d = dict(src_dict) - configs = [] - _configs = d.pop("configs") - for configs_item_data in _configs: - configs_item = AlertConfigResponse.from_dict(configs_item_data) - - configs.append(configs_item) - - total = d.pop("total") - - alert_config_list_response = cls( - configs=configs, - total=total, - ) - - alert_config_list_response.additional_properties = d - return alert_config_list_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/seclai/_generated/models/alert_config_response.py b/seclai/_generated/models/alert_config_response.py deleted file mode 100644 index ce1961b..0000000 --- a/seclai/_generated/models/alert_config_response.py +++ /dev/null @@ -1,220 +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 - -if TYPE_CHECKING: - from ..models.alert_config_response_threshold_type_0 import ( - AlertConfigResponseThresholdType0, - ) - - -T = TypeVar("T", bound="AlertConfigResponse") - - -@_attrs_define -class AlertConfigResponse: - """ - Attributes: - account_id (str): - agent_id (None | str): - alert_type (str): - cooldown_minutes (int): - created_at (None | str): - distribution_type (str): - enabled (bool): - id (str): - last_alerted_at (None | str): - recipient_user_ids (list[str]): - source_connection_id (None | str): - threshold (AlertConfigResponseThresholdType0 | None): - updated_at (None | str): - """ - - account_id: str - agent_id: None | str - alert_type: str - cooldown_minutes: int - created_at: None | str - distribution_type: str - enabled: bool - id: str - last_alerted_at: None | str - recipient_user_ids: list[str] - source_connection_id: None | str - threshold: AlertConfigResponseThresholdType0 | None - updated_at: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.alert_config_response_threshold_type_0 import ( - AlertConfigResponseThresholdType0, - ) - - account_id = self.account_id - - agent_id: None | str - agent_id = self.agent_id - - alert_type = self.alert_type - - cooldown_minutes = self.cooldown_minutes - - created_at: None | str - created_at = self.created_at - - distribution_type = self.distribution_type - - enabled = self.enabled - - id = self.id - - last_alerted_at: None | str - last_alerted_at = self.last_alerted_at - - recipient_user_ids = self.recipient_user_ids - - source_connection_id: None | str - source_connection_id = self.source_connection_id - - threshold: dict[str, Any] | None - if isinstance(self.threshold, AlertConfigResponseThresholdType0): - threshold = self.threshold.to_dict() - else: - threshold = self.threshold - - updated_at: None | str - updated_at = self.updated_at - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_id": account_id, - "agent_id": agent_id, - "alert_type": alert_type, - "cooldown_minutes": cooldown_minutes, - "created_at": created_at, - "distribution_type": distribution_type, - "enabled": enabled, - "id": id, - "last_alerted_at": last_alerted_at, - "recipient_user_ids": recipient_user_ids, - "source_connection_id": source_connection_id, - "threshold": threshold, - "updated_at": updated_at, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.alert_config_response_threshold_type_0 import ( - AlertConfigResponseThresholdType0, - ) - - d = dict(src_dict) - account_id = d.pop("account_id") - - def _parse_agent_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - agent_id = _parse_agent_id(d.pop("agent_id")) - - alert_type = d.pop("alert_type") - - cooldown_minutes = d.pop("cooldown_minutes") - - def _parse_created_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - created_at = _parse_created_at(d.pop("created_at")) - - distribution_type = d.pop("distribution_type") - - enabled = d.pop("enabled") - - id = d.pop("id") - - def _parse_last_alerted_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - last_alerted_at = _parse_last_alerted_at(d.pop("last_alerted_at")) - - recipient_user_ids = cast(list[str], d.pop("recipient_user_ids")) - - def _parse_source_connection_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - source_connection_id = _parse_source_connection_id( - d.pop("source_connection_id") - ) - - def _parse_threshold(data: object) -> AlertConfigResponseThresholdType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - threshold_type_0 = AlertConfigResponseThresholdType0.from_dict(data) - - return threshold_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AlertConfigResponseThresholdType0 | None, data) - - threshold = _parse_threshold(d.pop("threshold")) - - def _parse_updated_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - updated_at = _parse_updated_at(d.pop("updated_at")) - - alert_config_response = cls( - account_id=account_id, - agent_id=agent_id, - alert_type=alert_type, - cooldown_minutes=cooldown_minutes, - created_at=created_at, - distribution_type=distribution_type, - enabled=enabled, - id=id, - last_alerted_at=last_alerted_at, - recipient_user_ids=recipient_user_ids, - source_connection_id=source_connection_id, - threshold=threshold, - updated_at=updated_at, - ) - - alert_config_response.additional_properties = d - return alert_config_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/seclai/_generated/models/alert_config_response_threshold_type_0.py b/seclai/_generated/models/alert_config_response_threshold_type_0.py deleted file mode 100644 index 491467b..0000000 --- a/seclai/_generated/models/alert_config_response_threshold_type_0.py +++ /dev/null @@ -1,46 +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="AlertConfigResponseThresholdType0") - - -@_attrs_define -class AlertConfigResponseThresholdType0: - """ """ - - additional_properties: dict[str, Any] = _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) - alert_config_response_threshold_type_0 = cls() - - alert_config_response_threshold_type_0.additional_properties = d - return alert_config_response_threshold_type_0 - - @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/seclai/_generated/models/alert_detail_response.py b/seclai/_generated/models/alert_detail_response.py deleted file mode 100644 index 9392ca7..0000000 --- a/seclai/_generated/models/alert_detail_response.py +++ /dev/null @@ -1,121 +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.alert_comment_response import AlertCommentResponse - from ..models.alert_history_entry_response import AlertHistoryEntryResponse - from ..models.alert_response import AlertResponse - from ..models.alert_subscriber_response import AlertSubscriberResponse - - -T = TypeVar("T", bound="AlertDetailResponse") - - -@_attrs_define -class AlertDetailResponse: - """ - Attributes: - alert (AlertResponse): - comments (list[AlertCommentResponse]): - history (list[AlertHistoryEntryResponse]): - subscribers (list[AlertSubscriberResponse]): - """ - - alert: AlertResponse - comments: list[AlertCommentResponse] - history: list[AlertHistoryEntryResponse] - subscribers: list[AlertSubscriberResponse] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - alert = self.alert.to_dict() - - comments = [] - for comments_item_data in self.comments: - comments_item = comments_item_data.to_dict() - comments.append(comments_item) - - history = [] - for history_item_data in self.history: - history_item = history_item_data.to_dict() - history.append(history_item) - - subscribers = [] - for subscribers_item_data in self.subscribers: - subscribers_item = subscribers_item_data.to_dict() - subscribers.append(subscribers_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "alert": alert, - "comments": comments, - "history": history, - "subscribers": subscribers, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.alert_comment_response import AlertCommentResponse - from ..models.alert_history_entry_response import AlertHistoryEntryResponse - from ..models.alert_response import AlertResponse - from ..models.alert_subscriber_response import AlertSubscriberResponse - - d = dict(src_dict) - alert = AlertResponse.from_dict(d.pop("alert")) - - comments = [] - _comments = d.pop("comments") - for comments_item_data in _comments: - comments_item = AlertCommentResponse.from_dict(comments_item_data) - - comments.append(comments_item) - - history = [] - _history = d.pop("history") - for history_item_data in _history: - history_item = AlertHistoryEntryResponse.from_dict(history_item_data) - - history.append(history_item) - - subscribers = [] - _subscribers = d.pop("subscribers") - for subscribers_item_data in _subscribers: - subscribers_item = AlertSubscriberResponse.from_dict(subscribers_item_data) - - subscribers.append(subscribers_item) - - alert_detail_response = cls( - alert=alert, - comments=comments, - history=history, - subscribers=subscribers, - ) - - alert_detail_response.additional_properties = d - return alert_detail_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/seclai/_generated/models/alert_history_entry_response.py b/seclai/_generated/models/alert_history_entry_response.py deleted file mode 100644 index a1aa1ba..0000000 --- a/seclai/_generated/models/alert_history_entry_response.py +++ /dev/null @@ -1,140 +0,0 @@ -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 - -T = TypeVar("T", bound="AlertHistoryEntryResponse") - - -@_attrs_define -class AlertHistoryEntryResponse: - """ - Attributes: - changed_by_name (None | str): - changed_by_user_id (None | str): - created_at (None | str): - id (str): - new_status (str): - note (None | str): - previous_status (None | str): - """ - - changed_by_name: None | str - changed_by_user_id: None | str - created_at: None | str - id: str - new_status: str - note: None | str - previous_status: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - changed_by_name: None | str - changed_by_name = self.changed_by_name - - changed_by_user_id: None | str - changed_by_user_id = self.changed_by_user_id - - created_at: None | str - created_at = self.created_at - - id = self.id - - new_status = self.new_status - - note: None | str - note = self.note - - previous_status: None | str - previous_status = self.previous_status - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "changed_by_name": changed_by_name, - "changed_by_user_id": changed_by_user_id, - "created_at": created_at, - "id": id, - "new_status": new_status, - "note": note, - "previous_status": previous_status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_changed_by_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - changed_by_name = _parse_changed_by_name(d.pop("changed_by_name")) - - def _parse_changed_by_user_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - changed_by_user_id = _parse_changed_by_user_id(d.pop("changed_by_user_id")) - - def _parse_created_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - created_at = _parse_created_at(d.pop("created_at")) - - id = d.pop("id") - - new_status = d.pop("new_status") - - def _parse_note(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - note = _parse_note(d.pop("note")) - - def _parse_previous_status(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - previous_status = _parse_previous_status(d.pop("previous_status")) - - alert_history_entry_response = cls( - changed_by_name=changed_by_name, - changed_by_user_id=changed_by_user_id, - created_at=created_at, - id=id, - new_status=new_status, - note=note, - previous_status=previous_status, - ) - - alert_history_entry_response.additional_properties = d - return alert_history_entry_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/seclai/_generated/models/alert_list_response.py b/seclai/_generated/models/alert_list_response.py deleted file mode 100644 index f7ffa08..0000000 --- a/seclai/_generated/models/alert_list_response.py +++ /dev/null @@ -1,86 +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.alert_response import AlertResponse - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="AlertListResponse") - - -@_attrs_define -class AlertListResponse: - """``GET /alerts`` — always the canonical ``{data, pagination}`` envelope. - - Attributes: - data (list[AlertResponse]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[AlertResponse] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.alert_response import AlertResponse - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = AlertResponse.from_dict(data_item_data) - - data.append(data_item) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - alert_list_response = cls( - data=data, - pagination=pagination, - ) - - alert_list_response.additional_properties = d - return alert_list_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/seclai/_generated/models/alert_response.py b/seclai/_generated/models/alert_response.py deleted file mode 100644 index 702916f..0000000 --- a/seclai/_generated/models/alert_response.py +++ /dev/null @@ -1,258 +0,0 @@ -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="AlertResponse") - - -@_attrs_define -class AlertResponse: - """ - Attributes: - account_id (str): - agent_id (None | str): - agent_run_id (None | str): - alert_config_id (None | str): - alert_type (str): - comment_count (int): - created_at (None | str): - description (None | str): - id (str): - is_subscribed (bool): - mcp_client_id (None | str): - source_connection_id (None | str): - source_connection_pull_id (None | str): - status (str): - subscriber_count (int): - title (str): - updated_at (None | str): - details (Any | Unset): - """ - - account_id: str - agent_id: None | str - agent_run_id: None | str - alert_config_id: None | str - alert_type: str - comment_count: int - created_at: None | str - description: None | str - id: str - is_subscribed: bool - mcp_client_id: None | str - source_connection_id: None | str - source_connection_pull_id: None | str - status: str - subscriber_count: int - title: str - updated_at: None | str - details: Any | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - agent_id: None | str - agent_id = self.agent_id - - agent_run_id: None | str - agent_run_id = self.agent_run_id - - alert_config_id: None | str - alert_config_id = self.alert_config_id - - alert_type = self.alert_type - - comment_count = self.comment_count - - created_at: None | str - created_at = self.created_at - - description: None | str - description = self.description - - id = self.id - - is_subscribed = self.is_subscribed - - mcp_client_id: None | str - mcp_client_id = self.mcp_client_id - - source_connection_id: None | str - source_connection_id = self.source_connection_id - - source_connection_pull_id: None | str - source_connection_pull_id = self.source_connection_pull_id - - status = self.status - - subscriber_count = self.subscriber_count - - title = self.title - - updated_at: None | str - updated_at = self.updated_at - - details = self.details - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_id": account_id, - "agent_id": agent_id, - "agent_run_id": agent_run_id, - "alert_config_id": alert_config_id, - "alert_type": alert_type, - "comment_count": comment_count, - "created_at": created_at, - "description": description, - "id": id, - "is_subscribed": is_subscribed, - "mcp_client_id": mcp_client_id, - "source_connection_id": source_connection_id, - "source_connection_pull_id": source_connection_pull_id, - "status": status, - "subscriber_count": subscriber_count, - "title": title, - "updated_at": updated_at, - } - ) - if details is not UNSET: - field_dict["details"] = details - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("account_id") - - def _parse_agent_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - agent_id = _parse_agent_id(d.pop("agent_id")) - - def _parse_agent_run_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - agent_run_id = _parse_agent_run_id(d.pop("agent_run_id")) - - def _parse_alert_config_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - alert_config_id = _parse_alert_config_id(d.pop("alert_config_id")) - - alert_type = d.pop("alert_type") - - comment_count = d.pop("comment_count") - - def _parse_created_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - created_at = _parse_created_at(d.pop("created_at")) - - def _parse_description(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - description = _parse_description(d.pop("description")) - - id = d.pop("id") - - is_subscribed = d.pop("is_subscribed") - - def _parse_mcp_client_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - mcp_client_id = _parse_mcp_client_id(d.pop("mcp_client_id")) - - def _parse_source_connection_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - source_connection_id = _parse_source_connection_id( - d.pop("source_connection_id") - ) - - def _parse_source_connection_pull_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - source_connection_pull_id = _parse_source_connection_pull_id( - d.pop("source_connection_pull_id") - ) - - status = d.pop("status") - - subscriber_count = d.pop("subscriber_count") - - title = d.pop("title") - - def _parse_updated_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - updated_at = _parse_updated_at(d.pop("updated_at")) - - details = d.pop("details", UNSET) - - alert_response = cls( - account_id=account_id, - agent_id=agent_id, - agent_run_id=agent_run_id, - alert_config_id=alert_config_id, - alert_type=alert_type, - comment_count=comment_count, - created_at=created_at, - description=description, - id=id, - is_subscribed=is_subscribed, - mcp_client_id=mcp_client_id, - source_connection_id=source_connection_id, - source_connection_pull_id=source_connection_pull_id, - status=status, - subscriber_count=subscriber_count, - title=title, - updated_at=updated_at, - details=details, - ) - - alert_response.additional_properties = d - return alert_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/seclai/_generated/models/alert_subscriber_response.py b/seclai/_generated/models/alert_subscriber_response.py deleted file mode 100644 index 9cbf3ea..0000000 --- a/seclai/_generated/models/alert_subscriber_response.py +++ /dev/null @@ -1,98 +0,0 @@ -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 - -T = TypeVar("T", bound="AlertSubscriberResponse") - - -@_attrs_define -class AlertSubscriberResponse: - """ - Attributes: - created_at (None | str): - id (str): - user_id (str): - user_name (None | str): - """ - - created_at: None | str - id: str - user_id: str - user_name: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - created_at: None | str - created_at = self.created_at - - id = self.id - - user_id = self.user_id - - user_name: None | str - user_name = self.user_name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "created_at": created_at, - "id": id, - "user_id": user_id, - "user_name": user_name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_created_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - created_at = _parse_created_at(d.pop("created_at")) - - id = d.pop("id") - - user_id = d.pop("user_id") - - def _parse_user_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - user_name = _parse_user_name(d.pop("user_name")) - - alert_subscriber_response = cls( - created_at=created_at, - id=id, - user_id=user_id, - user_name=user_name, - ) - - alert_subscriber_response.additional_properties = d - return alert_subscriber_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/seclai/_generated/models/api_version_response.py b/seclai/_generated/models/api_version_response.py deleted file mode 100644 index 8e5e420..0000000 --- a/seclai/_generated/models/api_version_response.py +++ /dev/null @@ -1,100 +0,0 @@ -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 - -T = TypeVar("T", bound="ApiVersionResponse") - - -@_attrs_define -class ApiVersionResponse: - """ - Attributes: - default_version (str): Baseline for an unpinned, header-less caller. - effective_version (str): The version THIS request resolved to (header > pin > default). - known_versions (list[str]): All dated versions, oldest first. - latest_version (str): Newest version the server knows about. - pinned_version (None | str): The account's sticky pinned version, or null when unpinned (the account resolves to - the default). Applies to header-less requests. - """ - - default_version: str - effective_version: str - known_versions: list[str] - latest_version: str - pinned_version: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - default_version = self.default_version - - effective_version = self.effective_version - - known_versions = self.known_versions - - latest_version = self.latest_version - - pinned_version: None | str - pinned_version = self.pinned_version - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "default_version": default_version, - "effective_version": effective_version, - "known_versions": known_versions, - "latest_version": latest_version, - "pinned_version": pinned_version, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - default_version = d.pop("default_version") - - effective_version = d.pop("effective_version") - - known_versions = cast(list[str], d.pop("known_versions")) - - latest_version = d.pop("latest_version") - - def _parse_pinned_version(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - pinned_version = _parse_pinned_version(d.pop("pinned_version")) - - api_version_response = cls( - default_version=default_version, - effective_version=effective_version, - known_versions=known_versions, - latest_version=latest_version, - pinned_version=pinned_version, - ) - - api_version_response.additional_properties = d - return api_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/seclai/_generated/models/applied_action_response.py b/seclai/_generated/models/applied_action_response.py deleted file mode 100644 index c2be996..0000000 --- a/seclai/_generated/models/applied_action_response.py +++ /dev/null @@ -1,120 +0,0 @@ -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="AppliedActionResponse") - - -@_attrs_define -class AppliedActionResponse: - """Result of a single executed governance action. - - Attributes: - action_type (str): Type of action that was executed. - description (str): Human-readable description of the executed action. - success (bool): Whether this individual action succeeded. - error (None | str | Unset): Error message if this action failed, or null. - policy_id (None | str | Unset): ID of the policy that was created or modified, or null. - """ - - action_type: str - description: str - success: bool - error: None | str | Unset = UNSET - policy_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - action_type = self.action_type - - description = self.description - - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - policy_id: None | str | Unset - if isinstance(self.policy_id, Unset): - policy_id = UNSET - else: - policy_id = self.policy_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "action_type": action_type, - "description": description, - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - if policy_id is not UNSET: - field_dict["policy_id"] = policy_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - action_type = d.pop("action_type") - - description = d.pop("description") - - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_policy_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - policy_id = _parse_policy_id(d.pop("policy_id", UNSET)) - - applied_action_response = cls( - action_type=action_type, - description=description, - success=success, - error=error, - policy_id=policy_id, - ) - - applied_action_response.additional_properties = d - return applied_action_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/seclai/_generated/models/attachment_refs_source_api_summary.py b/seclai/_generated/models/attachment_refs_source_api_summary.py deleted file mode 100644 index 270e504..0000000 --- a/seclai/_generated/models/attachment_refs_source_api_summary.py +++ /dev/null @@ -1,106 +0,0 @@ -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="AttachmentRefsSourceApiSummary") - - -@_attrs_define -class AttachmentRefsSourceApiSummary: - """Per-source attachment-reference summary. - - Attributes: - exact_names (list[str] | Unset): - indexes_max (int | None | Unset): - kinds (list[str] | Unset): - patterns (list[str] | Unset): - """ - - exact_names: list[str] | Unset = UNSET - indexes_max: int | None | Unset = UNSET - kinds: list[str] | Unset = UNSET - patterns: list[str] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - exact_names: list[str] | Unset = UNSET - if not isinstance(self.exact_names, Unset): - exact_names = self.exact_names - - indexes_max: int | None | Unset - if isinstance(self.indexes_max, Unset): - indexes_max = UNSET - else: - indexes_max = self.indexes_max - - kinds: list[str] | Unset = UNSET - if not isinstance(self.kinds, Unset): - kinds = self.kinds - - patterns: list[str] | Unset = UNSET - if not isinstance(self.patterns, Unset): - patterns = self.patterns - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if exact_names is not UNSET: - field_dict["exact_names"] = exact_names - if indexes_max is not UNSET: - field_dict["indexes_max"] = indexes_max - if kinds is not UNSET: - field_dict["kinds"] = kinds - if patterns is not UNSET: - field_dict["patterns"] = patterns - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - exact_names = cast(list[str], d.pop("exact_names", UNSET)) - - def _parse_indexes_max(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - indexes_max = _parse_indexes_max(d.pop("indexes_max", UNSET)) - - kinds = cast(list[str], d.pop("kinds", UNSET)) - - patterns = cast(list[str], d.pop("patterns", UNSET)) - - attachment_refs_source_api_summary = cls( - exact_names=exact_names, - indexes_max=indexes_max, - kinds=kinds, - patterns=patterns, - ) - - attachment_refs_source_api_summary.additional_properties = d - return attachment_refs_source_api_summary - - @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/seclai/_generated/models/block_email_sender_request.py b/seclai/_generated/models/block_email_sender_request.py deleted file mode 100644 index 9d5d86b..0000000 --- a/seclai/_generated/models/block_email_sender_request.py +++ /dev/null @@ -1,93 +0,0 @@ -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="BlockEmailSenderRequest") - - -@_attrs_define -class BlockEmailSenderRequest: - """Add one sender/domain to the account blocklist (shared REST request). - - Attributes: - sender_email (str): - match_type (str | Unset): Default: 'address'. - note (None | str | Unset): - """ - - sender_email: str - match_type: str | Unset = "address" - note: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - sender_email = self.sender_email - - match_type = self.match_type - - note: None | str | Unset - if isinstance(self.note, Unset): - note = UNSET - else: - note = self.note - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "sender_email": sender_email, - } - ) - if match_type is not UNSET: - field_dict["match_type"] = match_type - if note is not UNSET: - field_dict["note"] = note - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - sender_email = d.pop("sender_email") - - match_type = d.pop("match_type", UNSET) - - def _parse_note(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - note = _parse_note(d.pop("note", UNSET)) - - block_email_sender_request = cls( - sender_email=sender_email, - match_type=match_type, - note=note, - ) - - block_email_sender_request.additional_properties = d - return block_email_sender_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/seclai/_generated/models/blocked_email_sender_list_response.py b/seclai/_generated/models/blocked_email_sender_list_response.py deleted file mode 100644 index 9b009e8..0000000 --- a/seclai/_generated/models/blocked_email_sender_list_response.py +++ /dev/null @@ -1,92 +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.blocked_email_sender_response import BlockedEmailSenderResponse - - -T = TypeVar("T", bound="BlockedEmailSenderListResponse") - - -@_attrs_define -class BlockedEmailSenderListResponse: - """A page of blocked senders + the account's auto-block mode. - - Attributes: - auto_block_mode (str): - items (list[BlockedEmailSenderResponse]): - total (int): - """ - - auto_block_mode: str - items: list[BlockedEmailSenderResponse] - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - auto_block_mode = self.auto_block_mode - - items = [] - for items_item_data in self.items: - items_item = items_item_data.to_dict() - items.append(items_item) - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "auto_block_mode": auto_block_mode, - "items": items, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.blocked_email_sender_response import BlockedEmailSenderResponse - - d = dict(src_dict) - auto_block_mode = d.pop("auto_block_mode") - - items = [] - _items = d.pop("items") - for items_item_data in _items: - items_item = BlockedEmailSenderResponse.from_dict(items_item_data) - - items.append(items_item) - - total = d.pop("total") - - blocked_email_sender_list_response = cls( - auto_block_mode=auto_block_mode, - items=items, - total=total, - ) - - blocked_email_sender_list_response.additional_properties = d - return blocked_email_sender_list_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/seclai/_generated/models/blocked_email_sender_response.py b/seclai/_generated/models/blocked_email_sender_response.py deleted file mode 100644 index 8fdb67a..0000000 --- a/seclai/_generated/models/blocked_email_sender_response.py +++ /dev/null @@ -1,109 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="BlockedEmailSenderResponse") - - -@_attrs_define -class BlockedEmailSenderResponse: - """A single blocked inbound email sender. - - Attributes: - created_at (str): - id (UUID): - match_type (str): - note (None | str): - sender_email (str): - source (str): - """ - - created_at: str - id: UUID - match_type: str - note: None | str - sender_email: str - source: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at - - id = str(self.id) - - match_type = self.match_type - - note: None | str - note = self.note - - sender_email = self.sender_email - - source = self.source - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "created_at": created_at, - "id": id, - "match_type": match_type, - "note": note, - "sender_email": sender_email, - "source": source, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created_at = d.pop("created_at") - - id = UUID(d.pop("id")) - - match_type = d.pop("match_type") - - def _parse_note(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - note = _parse_note(d.pop("note")) - - sender_email = d.pop("sender_email") - - source = d.pop("source") - - blocked_email_sender_response = cls( - created_at=created_at, - id=id, - match_type=match_type, - note=note, - sender_email=sender_email, - source=source, - ) - - blocked_email_sender_response.additional_properties = d - return blocked_email_sender_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/seclai/_generated/models/body_upload_file_to_content_api_contents_source_connection_content_version_upload_post.py b/seclai/_generated/models/body_upload_file_to_content_api_contents_source_connection_content_version_upload_post.py deleted file mode 100644 index bcd002e..0000000 --- a/seclai/_generated/models/body_upload_file_to_content_api_contents_source_connection_content_version_upload_post.py +++ /dev/null @@ -1,124 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from io import BytesIO -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from .. import types -from ..types import UNSET, File, Unset - -T = TypeVar( - "T", - bound="BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost", -) - - -@_attrs_define -class BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost: - """ - Attributes: - file (File): File to upload - metadata (None | str | Unset): Optional JSON object string of metadata. Example: - `{"category":"docs","author":"Ada"}`. `title` will be merged into this dictionary as `metadata.title` if it is - not already present. - title (str | Unset): Optional title for the content - """ - - file: File - metadata: None | str | Unset = UNSET - title: str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - file = self.file.to_tuple() - - metadata: None | str | Unset - if isinstance(self.metadata, Unset): - metadata = UNSET - else: - metadata = self.metadata - - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "file": file, - } - ) - if metadata is not UNSET: - field_dict["metadata"] = metadata - if title is not UNSET: - field_dict["title"] = title - - return field_dict - - def to_multipart(self) -> types.RequestFiles: - files: types.RequestFiles = [] - - files.append(("file", self.file.to_tuple())) - - if not isinstance(self.metadata, Unset): - if isinstance(self.metadata, str): - files.append( - ("metadata", (None, str(self.metadata).encode(), "text/plain")) - ) - else: - files.append( - ("metadata", (None, str(self.metadata).encode(), "text/plain")) - ) - - if not isinstance(self.title, Unset): - files.append(("title", (None, str(self.title).encode(), "text/plain"))) - - for prop_name, prop in self.additional_properties.items(): - files.append((prop_name, (None, str(prop).encode(), "text/plain"))) - - return files - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - file = File(payload=BytesIO(d.pop("file"))) - - def _parse_metadata(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metadata = _parse_metadata(d.pop("metadata", UNSET)) - - title = d.pop("title", UNSET) - - body_upload_file_to_content_api_contents_source_connection_content_version_upload_post = cls( - file=file, - metadata=metadata, - title=title, - ) - - body_upload_file_to_content_api_contents_source_connection_content_version_upload_post.additional_properties = ( - d - ) - return body_upload_file_to_content_api_contents_source_connection_content_version_upload_post - - @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/seclai/_generated/models/body_upload_file_to_source_api_sources_source_connection_id_upload_post.py b/seclai/_generated/models/body_upload_file_to_source_api_sources_source_connection_id_upload_post.py deleted file mode 100644 index 41d224f..0000000 --- a/seclai/_generated/models/body_upload_file_to_source_api_sources_source_connection_id_upload_post.py +++ /dev/null @@ -1,121 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from io import BytesIO -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from .. import types -from ..types import UNSET, File, Unset - -T = TypeVar("T", bound="BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost") - - -@_attrs_define -class BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost: - """ - Attributes: - file (File): File to upload - metadata (None | str | Unset): Optional JSON object string of metadata. Example: - `{"author":"Ada","category":"docs"}`. `title` will be merged into this dictionary as `metadata.title` if it is - not already present. - title (str | Unset): Optional title for the content - """ - - file: File - metadata: None | str | Unset = UNSET - title: str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - file = self.file.to_tuple() - - metadata: None | str | Unset - if isinstance(self.metadata, Unset): - metadata = UNSET - else: - metadata = self.metadata - - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "file": file, - } - ) - if metadata is not UNSET: - field_dict["metadata"] = metadata - if title is not UNSET: - field_dict["title"] = title - - return field_dict - - def to_multipart(self) -> types.RequestFiles: - files: types.RequestFiles = [] - - files.append(("file", self.file.to_tuple())) - - if not isinstance(self.metadata, Unset): - if isinstance(self.metadata, str): - files.append( - ("metadata", (None, str(self.metadata).encode(), "text/plain")) - ) - else: - files.append( - ("metadata", (None, str(self.metadata).encode(), "text/plain")) - ) - - if not isinstance(self.title, Unset): - files.append(("title", (None, str(self.title).encode(), "text/plain"))) - - for prop_name, prop in self.additional_properties.items(): - files.append((prop_name, (None, str(prop).encode(), "text/plain"))) - - return files - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - file = File(payload=BytesIO(d.pop("file"))) - - def _parse_metadata(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - metadata = _parse_metadata(d.pop("metadata", UNSET)) - - title = d.pop("title", UNSET) - - body_upload_file_to_source_api_sources_source_connection_id_upload_post = cls( - file=file, - metadata=metadata, - title=title, - ) - - body_upload_file_to_source_api_sources_source_connection_id_upload_post.additional_properties = ( - d - ) - return body_upload_file_to_source_api_sources_source_connection_id_upload_post - - @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/seclai/_generated/models/cancel_experiment_response.py b/seclai/_generated/models/cancel_experiment_response.py deleted file mode 100644 index 7b962a4..0000000 --- a/seclai/_generated/models/cancel_experiment_response.py +++ /dev/null @@ -1,61 +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="CancelExperimentResponse") - - -@_attrs_define -class CancelExperimentResponse: - """ - Attributes: - status (str): - """ - - status: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - status = self.status - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - status = d.pop("status") - - cancel_experiment_response = cls( - status=status, - ) - - cancel_experiment_response.additional_properties = d - return cancel_experiment_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/seclai/_generated/models/cancel_queued_runs_response.py b/seclai/_generated/models/cancel_queued_runs_response.py deleted file mode 100644 index 7b4ddeb..0000000 --- a/seclai/_generated/models/cancel_queued_runs_response.py +++ /dev/null @@ -1,61 +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="CancelQueuedRunsResponse") - - -@_attrs_define -class CancelQueuedRunsResponse: - """ - Attributes: - cancelled (int): - """ - - cancelled: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - cancelled = self.cancelled - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "cancelled": cancelled, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancelled = d.pop("cancelled") - - cancel_queued_runs_response = cls( - cancelled=cancelled, - ) - - cancel_queued_runs_response.additional_properties = d - return cancel_queued_runs_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/seclai/_generated/models/change_status_request.py b/seclai/_generated/models/change_status_request.py deleted file mode 100644 index cccac3e..0000000 --- a/seclai/_generated/models/change_status_request.py +++ /dev/null @@ -1,83 +0,0 @@ -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="ChangeStatusRequest") - - -@_attrs_define -class ChangeStatusRequest: - """ - Attributes: - status (str): New alert status - note (None | str | Unset): Optional note - """ - - status: str - note: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - status = self.status - - note: None | str | Unset - if isinstance(self.note, Unset): - note = UNSET - else: - note = self.note - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "status": status, - } - ) - if note is not UNSET: - field_dict["note"] = note - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - status = d.pop("status") - - def _parse_note(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - note = _parse_note(d.pop("note", UNSET)) - - change_status_request = cls( - status=status, - note=note, - ) - - change_status_request.additional_properties = d - return change_status_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/seclai/_generated/models/compaction_evaluation_model.py b/seclai/_generated/models/compaction_evaluation_model.py deleted file mode 100644 index b40409f..0000000 --- a/seclai/_generated/models/compaction_evaluation_model.py +++ /dev/null @@ -1,78 +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="CompactionEvaluationModel") - - -@_attrs_define -class CompactionEvaluationModel: - """Structured LLM-as-judge evaluation result. - - Attributes: - reasoning (str): Explanation of the evaluation. - score (int): Quality score from 1 to 5. - verdict (str): 'pass' or 'fail'. - """ - - reasoning: str - score: int - verdict: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - reasoning = self.reasoning - - score = self.score - - verdict = self.verdict - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "reasoning": reasoning, - "score": score, - "verdict": verdict, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - reasoning = d.pop("reasoning") - - score = d.pop("score") - - verdict = d.pop("verdict") - - compaction_evaluation_model = cls( - reasoning=reasoning, - score=score, - verdict=verdict, - ) - - compaction_evaluation_model.additional_properties = d - return compaction_evaluation_model - - @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/seclai/_generated/models/compaction_scheduled_response.py b/seclai/_generated/models/compaction_scheduled_response.py deleted file mode 100644 index 5a84010..0000000 --- a/seclai/_generated/models/compaction_scheduled_response.py +++ /dev/null @@ -1,70 +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="CompactionScheduledResponse") - - -@_attrs_define -class CompactionScheduledResponse: - """Acknowledgement that an on-demand compaction run was scheduled. - - Attributes: - memory_bank_id (str): - status (str): - """ - - memory_bank_id: str - status: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - memory_bank_id = self.memory_bank_id - - status = self.status - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "memory_bank_id": memory_bank_id, - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - memory_bank_id = d.pop("memory_bank_id") - - status = d.pop("status") - - compaction_scheduled_response = cls( - memory_bank_id=memory_bank_id, - status=status, - ) - - compaction_scheduled_response.additional_properties = d - return compaction_scheduled_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/seclai/_generated/models/compaction_test_response_model.py b/seclai/_generated/models/compaction_test_response_model.py deleted file mode 100644 index 4f56a0e..0000000 --- a/seclai/_generated/models/compaction_test_response_model.py +++ /dev/null @@ -1,107 +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 - -if TYPE_CHECKING: - from ..models.compaction_evaluation_model import CompactionEvaluationModel - - -T = TypeVar("T", bound="CompactionTestResponseModel") - - -@_attrs_define -class CompactionTestResponseModel: - """Response from a compaction prompt test. - - Attributes: - compaction_summary (None | str): The generated compaction summary. - evaluation (CompactionEvaluationModel): Structured LLM-as-judge evaluation result. - generated (bool): True when entries were LLM-generated rather than real. - original_entries (list[str]): Entries fed into the compactor. - surviving_entries (list[str]): Entries that survived after compaction. - """ - - compaction_summary: None | str - evaluation: CompactionEvaluationModel - generated: bool - original_entries: list[str] - surviving_entries: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - compaction_summary: None | str - compaction_summary = self.compaction_summary - - evaluation = self.evaluation.to_dict() - - generated = self.generated - - original_entries = self.original_entries - - surviving_entries = self.surviving_entries - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "compaction_summary": compaction_summary, - "evaluation": evaluation, - "generated": generated, - "original_entries": original_entries, - "surviving_entries": surviving_entries, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.compaction_evaluation_model import CompactionEvaluationModel - - d = dict(src_dict) - - def _parse_compaction_summary(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - compaction_summary = _parse_compaction_summary(d.pop("compaction_summary")) - - evaluation = CompactionEvaluationModel.from_dict(d.pop("evaluation")) - - generated = d.pop("generated") - - original_entries = cast(list[str], d.pop("original_entries")) - - surviving_entries = cast(list[str], d.pop("surviving_entries")) - - compaction_test_response_model = cls( - compaction_summary=compaction_summary, - evaluation=evaluation, - generated=generated, - original_entries=original_entries, - surviving_entries=surviving_entries, - ) - - compaction_test_response_model.additional_properties = d - return compaction_test_response_model - - @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/seclai/_generated/models/compatible_run_list_response.py b/seclai/_generated/models/compatible_run_list_response.py deleted file mode 100644 index 9901b90..0000000 --- a/seclai/_generated/models/compatible_run_list_response.py +++ /dev/null @@ -1,100 +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.compatible_run_response import CompatibleRunResponse - - -T = TypeVar("T", bound="CompatibleRunListResponse") - - -@_attrs_define -class CompatibleRunListResponse: - """Paginated list of compatible runs. - - Attributes: - data (list[CompatibleRunResponse]): - limit (int): - page (int): - total (int): - """ - - data: list[CompatibleRunResponse] - limit: int - page: int - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - limit = self.limit - - page = self.page - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "limit": limit, - "page": page, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.compatible_run_response import CompatibleRunResponse - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = CompatibleRunResponse.from_dict(data_item_data) - - data.append(data_item) - - limit = d.pop("limit") - - page = d.pop("page") - - total = d.pop("total") - - compatible_run_list_response = cls( - data=data, - limit=limit, - page=page, - total=total, - ) - - compatible_run_list_response.additional_properties = d - return compatible_run_list_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/seclai/_generated/models/compatible_run_response.py b/seclai/_generated/models/compatible_run_response.py deleted file mode 100644 index 5274568..0000000 --- a/seclai/_generated/models/compatible_run_response.py +++ /dev/null @@ -1,161 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, 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="CompatibleRunResponse") - - -@_attrs_define -class CompatibleRunResponse: - """A run that has a completed step matching a criteria's step_id. - - Attributes: - agent_run_id (UUID): - agent_step_run_id (UUID): - completed_at (None | str): - output_storage_key (None | str): - input_preview (None | str | Unset): - run_status (None | str | Unset): - started_at (None | str | Unset): - """ - - agent_run_id: UUID - agent_step_run_id: UUID - completed_at: None | str - output_storage_key: None | str - input_preview: None | str | Unset = UNSET - run_status: None | str | Unset = UNSET - started_at: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_run_id = str(self.agent_run_id) - - agent_step_run_id = str(self.agent_step_run_id) - - completed_at: None | str - completed_at = self.completed_at - - output_storage_key: None | str - output_storage_key = self.output_storage_key - - input_preview: None | str | Unset - if isinstance(self.input_preview, Unset): - input_preview = UNSET - else: - input_preview = self.input_preview - - run_status: None | str | Unset - if isinstance(self.run_status, Unset): - run_status = UNSET - else: - run_status = self.run_status - - started_at: None | str | Unset - if isinstance(self.started_at, Unset): - started_at = UNSET - else: - started_at = self.started_at - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_run_id": agent_run_id, - "agent_step_run_id": agent_step_run_id, - "completed_at": completed_at, - "output_storage_key": output_storage_key, - } - ) - if input_preview is not UNSET: - field_dict["input_preview"] = input_preview - if run_status is not UNSET: - field_dict["run_status"] = run_status - if started_at is not UNSET: - field_dict["started_at"] = started_at - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_run_id = UUID(d.pop("agent_run_id")) - - agent_step_run_id = UUID(d.pop("agent_step_run_id")) - - def _parse_completed_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - completed_at = _parse_completed_at(d.pop("completed_at")) - - def _parse_output_storage_key(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - output_storage_key = _parse_output_storage_key(d.pop("output_storage_key")) - - def _parse_input_preview(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - input_preview = _parse_input_preview(d.pop("input_preview", UNSET)) - - def _parse_run_status(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - run_status = _parse_run_status(d.pop("run_status", UNSET)) - - def _parse_started_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - started_at = _parse_started_at(d.pop("started_at", UNSET)) - - compatible_run_response = cls( - agent_run_id=agent_run_id, - agent_step_run_id=agent_step_run_id, - completed_at=completed_at, - output_storage_key=output_storage_key, - input_preview=input_preview, - run_status=run_status, - started_at=started_at, - ) - - compatible_run_response.additional_properties = d - return compatible_run_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/seclai/_generated/models/content_detail_response.py b/seclai/_generated/models/content_detail_response.py deleted file mode 100644 index 7e5fbff..0000000 --- a/seclai/_generated/models/content_detail_response.py +++ /dev/null @@ -1,325 +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 - -if TYPE_CHECKING: - from ..models.content_detail_response_metadata_type_0_item import ( - ContentDetailResponseMetadataType0Item, - ) - - -T = TypeVar("T", bound="ContentDetailResponse") - - -@_attrs_define -class ContentDetailResponse: - """Response model for content detail. - - Attributes: - content_duration (int | None): Duration of the content in seconds. - content_duration_display (None | str): Display string for content duration. - content_status (str): Status of the content. - content_type (str): Type of the content. - content_type_display (str): Display name of the content type. - content_url (str): URL of the content. - content_word_count (int | None): Word count of the content. - description (None | str): Description of the content. - error (None | str): Error message, if any. - id (str): Unique identifier for the content version. - metadata (list[ContentDetailResponseMetadataType0Item] | None): Metadata associated with the content. - published_at (None | str): Timestamp when the content was published. - pulled_at (str): Timestamp when the content was pulled. - source_connection_content_version_id (str): ID of the source connection content version. - source_connection_id (str): ID of the source connection. - source_name (str): Name of the source. - source_type (str): Type of the source. - text_content (None | str): Text content. - text_content_end (int): End position of the text content. - text_content_start (int): Start position of the text content. - text_content_total_length (int): Total length of the text content. - title (None | str): Title of the content. - """ - - content_duration: int | None - content_duration_display: None | str - content_status: str - content_type: str - content_type_display: str - content_url: str - content_word_count: int | None - description: None | str - error: None | str - id: str - metadata: list[ContentDetailResponseMetadataType0Item] | None - published_at: None | str - pulled_at: str - source_connection_content_version_id: str - source_connection_id: str - source_name: str - source_type: str - text_content: None | str - text_content_end: int - text_content_start: int - text_content_total_length: int - title: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - content_duration: int | None - content_duration = self.content_duration - - content_duration_display: None | str - content_duration_display = self.content_duration_display - - content_status = self.content_status - - content_type = self.content_type - - content_type_display = self.content_type_display - - content_url = self.content_url - - content_word_count: int | None - content_word_count = self.content_word_count - - description: None | str - description = self.description - - error: None | str - error = self.error - - id = self.id - - metadata: list[dict[str, Any]] | None - if isinstance(self.metadata, list): - metadata = [] - for metadata_type_0_item_data in self.metadata: - metadata_type_0_item = metadata_type_0_item_data.to_dict() - metadata.append(metadata_type_0_item) - - else: - metadata = self.metadata - - published_at: None | str - published_at = self.published_at - - pulled_at = self.pulled_at - - source_connection_content_version_id = self.source_connection_content_version_id - - source_connection_id = self.source_connection_id - - source_name = self.source_name - - source_type = self.source_type - - text_content: None | str - text_content = self.text_content - - text_content_end = self.text_content_end - - text_content_start = self.text_content_start - - text_content_total_length = self.text_content_total_length - - title: None | str - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "content_duration": content_duration, - "content_duration_display": content_duration_display, - "content_status": content_status, - "content_type": content_type, - "content_type_display": content_type_display, - "content_url": content_url, - "content_word_count": content_word_count, - "description": description, - "error": error, - "id": id, - "metadata": metadata, - "published_at": published_at, - "pulled_at": pulled_at, - "source_connection_content_version_id": source_connection_content_version_id, - "source_connection_id": source_connection_id, - "source_name": source_name, - "source_type": source_type, - "text_content": text_content, - "text_content_end": text_content_end, - "text_content_start": text_content_start, - "text_content_total_length": text_content_total_length, - "title": title, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.content_detail_response_metadata_type_0_item import ( - ContentDetailResponseMetadataType0Item, - ) - - d = dict(src_dict) - - def _parse_content_duration(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - content_duration = _parse_content_duration(d.pop("content_duration")) - - def _parse_content_duration_display(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - content_duration_display = _parse_content_duration_display( - d.pop("content_duration_display") - ) - - content_status = d.pop("content_status") - - content_type = d.pop("content_type") - - content_type_display = d.pop("content_type_display") - - content_url = d.pop("content_url") - - def _parse_content_word_count(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - content_word_count = _parse_content_word_count(d.pop("content_word_count")) - - def _parse_description(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - description = _parse_description(d.pop("description")) - - def _parse_error(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - error = _parse_error(d.pop("error")) - - id = d.pop("id") - - def _parse_metadata( - data: object, - ) -> list[ContentDetailResponseMetadataType0Item] | None: - if data is None: - return data - try: - if not isinstance(data, list): - raise TypeError() - metadata_type_0 = [] - _metadata_type_0 = data - for metadata_type_0_item_data in _metadata_type_0: - metadata_type_0_item = ( - ContentDetailResponseMetadataType0Item.from_dict( - metadata_type_0_item_data - ) - ) - - metadata_type_0.append(metadata_type_0_item) - - return metadata_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[ContentDetailResponseMetadataType0Item] | None, data) - - metadata = _parse_metadata(d.pop("metadata")) - - def _parse_published_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - published_at = _parse_published_at(d.pop("published_at")) - - pulled_at = d.pop("pulled_at") - - source_connection_content_version_id = d.pop( - "source_connection_content_version_id" - ) - - source_connection_id = d.pop("source_connection_id") - - source_name = d.pop("source_name") - - source_type = d.pop("source_type") - - def _parse_text_content(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - text_content = _parse_text_content(d.pop("text_content")) - - text_content_end = d.pop("text_content_end") - - text_content_start = d.pop("text_content_start") - - text_content_total_length = d.pop("text_content_total_length") - - def _parse_title(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - title = _parse_title(d.pop("title")) - - content_detail_response = cls( - content_duration=content_duration, - content_duration_display=content_duration_display, - content_status=content_status, - content_type=content_type, - content_type_display=content_type_display, - content_url=content_url, - content_word_count=content_word_count, - description=description, - error=error, - id=id, - metadata=metadata, - published_at=published_at, - pulled_at=pulled_at, - source_connection_content_version_id=source_connection_content_version_id, - source_connection_id=source_connection_id, - source_name=source_name, - source_type=source_type, - text_content=text_content, - text_content_end=text_content_end, - text_content_start=text_content_start, - text_content_total_length=text_content_total_length, - title=title, - ) - - content_detail_response.additional_properties = d - return content_detail_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/seclai/_generated/models/content_detail_response_metadata_type_0_item.py b/seclai/_generated/models/content_detail_response_metadata_type_0_item.py deleted file mode 100644 index e7a3413..0000000 --- a/seclai/_generated/models/content_detail_response_metadata_type_0_item.py +++ /dev/null @@ -1,46 +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="ContentDetailResponseMetadataType0Item") - - -@_attrs_define -class ContentDetailResponseMetadataType0Item: - """ """ - - 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) - content_detail_response_metadata_type_0_item = cls() - - content_detail_response_metadata_type_0_item.additional_properties = d - return content_detail_response_metadata_type_0_item - - @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/seclai/_generated/models/content_embedding_response.py b/seclai/_generated/models/content_embedding_response.py deleted file mode 100644 index ea22bf7..0000000 --- a/seclai/_generated/models/content_embedding_response.py +++ /dev/null @@ -1,110 +0,0 @@ -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 - -T = TypeVar("T", bound="ContentEmbeddingResponse") - - -@_attrs_define -class ContentEmbeddingResponse: - """Response model for content embedding. - - Attributes: - batch_duration (float): - batch_size (int): - id (str): - text (str): - text_end (int): - text_start (int): - vector (list[float]): - """ - - batch_duration: float - batch_size: int - id: str - text: str - text_end: int - text_start: int - vector: list[float] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - batch_duration = self.batch_duration - - batch_size = self.batch_size - - id = self.id - - text = self.text - - text_end = self.text_end - - text_start = self.text_start - - vector = self.vector - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "batch_duration": batch_duration, - "batch_size": batch_size, - "id": id, - "text": text, - "text_end": text_end, - "text_start": text_start, - "vector": vector, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - batch_duration = d.pop("batch_duration") - - batch_size = d.pop("batch_size") - - id = d.pop("id") - - text = d.pop("text") - - text_end = d.pop("text_end") - - text_start = d.pop("text_start") - - vector = cast(list[float], d.pop("vector")) - - content_embedding_response = cls( - batch_duration=batch_duration, - batch_size=batch_size, - id=id, - text=text, - text_end=text_end, - text_start=text_start, - vector=vector, - ) - - content_embedding_response.additional_properties = d - return content_embedding_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/seclai/_generated/models/content_embeddings_list_response.py b/seclai/_generated/models/content_embeddings_list_response.py deleted file mode 100644 index 62278fd..0000000 --- a/seclai/_generated/models/content_embeddings_list_response.py +++ /dev/null @@ -1,86 +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.content_embedding_response import ContentEmbeddingResponse - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="ContentEmbeddingsListResponse") - - -@_attrs_define -class ContentEmbeddingsListResponse: - """Response model for paginated content embeddings. - - Attributes: - data (list[ContentEmbeddingResponse]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[ContentEmbeddingResponse] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.content_embedding_response import ContentEmbeddingResponse - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = ContentEmbeddingResponse.from_dict(data_item_data) - - data.append(data_item) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - content_embeddings_list_response = cls( - data=data, - pagination=pagination, - ) - - content_embeddings_list_response.additional_properties = d - return content_embeddings_list_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/seclai/_generated/models/create_agent_request.py b/seclai/_generated/models/create_agent_request.py deleted file mode 100644 index 53a08c1..0000000 --- a/seclai/_generated/models/create_agent_request.py +++ /dev/null @@ -1,209 +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.create_agent_request_agent_definition_type_0 import ( - CreateAgentRequestAgentDefinitionType0, - ) - from ..models.create_agent_request_entity_remap_type_0 import ( - CreateAgentRequestEntityRemapType0, - ) - - -T = TypeVar("T", bound="CreateAgentRequest") - - -@_attrs_define -class CreateAgentRequest: - """ - Attributes: - name (str): Name for the new agent. - agent_definition (CreateAgentRequestAgentDefinitionType0 | None | Unset): Optional payload in the same format - produced by GET /agents/{id}/export. When provided, replaces any template-derived workflow and pre-fills - metadata/trigger fields the request does not specify explicitly. Validation errors include line/column - references against a canonical pretty-printed echo of the supplied payload. - agent_template (None | str | Unset): Template to initialize the agent from. Values: blank, retrieval_example, - simple_qa, summarizer, json_extractor, content_change_notifier, scheduled_report, webhook_pipeline. - description (None | str | Unset): Optional description. - entity_remap (CreateAgentRequestEntityRemapType0 | None | Unset): Optional UUID-substitution map applied to the - imported workflow before save. Each key is a source-account UUID (as returned by /agents/preview-import's - ``unresolved_refs``); each value is the target-account UUID to substitute. Used to relink knowledge bases, - memory banks, source connections, and sub-agents on cross-account imports. - trigger_type (str | Unset): Trigger type: dynamic_input, template_input, schedule, new_content, email_received. - Default: 'dynamic_input'. - """ - - name: str - agent_definition: CreateAgentRequestAgentDefinitionType0 | None | Unset = UNSET - agent_template: None | str | Unset = UNSET - description: None | str | Unset = UNSET - entity_remap: CreateAgentRequestEntityRemapType0 | None | Unset = UNSET - trigger_type: str | Unset = "dynamic_input" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.create_agent_request_agent_definition_type_0 import ( - CreateAgentRequestAgentDefinitionType0, - ) - from ..models.create_agent_request_entity_remap_type_0 import ( - CreateAgentRequestEntityRemapType0, - ) - - name = self.name - - agent_definition: dict[str, Any] | None | Unset - if isinstance(self.agent_definition, Unset): - agent_definition = UNSET - elif isinstance(self.agent_definition, CreateAgentRequestAgentDefinitionType0): - agent_definition = self.agent_definition.to_dict() - else: - agent_definition = self.agent_definition - - agent_template: None | str | Unset - if isinstance(self.agent_template, Unset): - agent_template = UNSET - else: - agent_template = self.agent_template - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - entity_remap: dict[str, Any] | None | Unset - if isinstance(self.entity_remap, Unset): - entity_remap = UNSET - elif isinstance(self.entity_remap, CreateAgentRequestEntityRemapType0): - entity_remap = self.entity_remap.to_dict() - else: - entity_remap = self.entity_remap - - trigger_type = self.trigger_type - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "name": name, - } - ) - if agent_definition is not UNSET: - field_dict["agent_definition"] = agent_definition - if agent_template is not UNSET: - field_dict["agent_template"] = agent_template - if description is not UNSET: - field_dict["description"] = description - if entity_remap is not UNSET: - field_dict["entity_remap"] = entity_remap - if trigger_type is not UNSET: - field_dict["trigger_type"] = trigger_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.create_agent_request_agent_definition_type_0 import ( - CreateAgentRequestAgentDefinitionType0, - ) - from ..models.create_agent_request_entity_remap_type_0 import ( - CreateAgentRequestEntityRemapType0, - ) - - d = dict(src_dict) - name = d.pop("name") - - def _parse_agent_definition( - data: object, - ) -> CreateAgentRequestAgentDefinitionType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - agent_definition_type_0 = ( - CreateAgentRequestAgentDefinitionType0.from_dict(data) - ) - - return agent_definition_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CreateAgentRequestAgentDefinitionType0 | None | Unset, data) - - agent_definition = _parse_agent_definition(d.pop("agent_definition", UNSET)) - - def _parse_agent_template(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_template = _parse_agent_template(d.pop("agent_template", UNSET)) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_entity_remap( - data: object, - ) -> CreateAgentRequestEntityRemapType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - entity_remap_type_0 = CreateAgentRequestEntityRemapType0.from_dict(data) - - return entity_remap_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CreateAgentRequestEntityRemapType0 | None | Unset, data) - - entity_remap = _parse_entity_remap(d.pop("entity_remap", UNSET)) - - trigger_type = d.pop("trigger_type", UNSET) - - create_agent_request = cls( - name=name, - agent_definition=agent_definition, - agent_template=agent_template, - description=description, - entity_remap=entity_remap, - trigger_type=trigger_type, - ) - - create_agent_request.additional_properties = d - return create_agent_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/seclai/_generated/models/create_agent_request_agent_definition_type_0.py b/seclai/_generated/models/create_agent_request_agent_definition_type_0.py deleted file mode 100644 index 97dd852..0000000 --- a/seclai/_generated/models/create_agent_request_agent_definition_type_0.py +++ /dev/null @@ -1,46 +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="CreateAgentRequestAgentDefinitionType0") - - -@_attrs_define -class CreateAgentRequestAgentDefinitionType0: - """ """ - - additional_properties: dict[str, Any] = _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) - create_agent_request_agent_definition_type_0 = cls() - - create_agent_request_agent_definition_type_0.additional_properties = d - return create_agent_request_agent_definition_type_0 - - @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/seclai/_generated/models/create_agent_request_entity_remap_type_0.py b/seclai/_generated/models/create_agent_request_entity_remap_type_0.py deleted file mode 100644 index ff7ec40..0000000 --- a/seclai/_generated/models/create_agent_request_entity_remap_type_0.py +++ /dev/null @@ -1,46 +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="CreateAgentRequestEntityRemapType0") - - -@_attrs_define -class CreateAgentRequestEntityRemapType0: - """ """ - - 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) - create_agent_request_entity_remap_type_0 = cls() - - create_agent_request_entity_remap_type_0.additional_properties = d - return create_agent_request_entity_remap_type_0 - - @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/seclai/_generated/models/create_alert_config_request.py b/seclai/_generated/models/create_alert_config_request.py deleted file mode 100644 index aacc073..0000000 --- a/seclai/_generated/models/create_alert_config_request.py +++ /dev/null @@ -1,213 +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.create_alert_config_request_threshold_type_0 import ( - CreateAlertConfigRequestThresholdType0, - ) - - -T = TypeVar("T", bound="CreateAlertConfigRequest") - - -@_attrs_define -class CreateAlertConfigRequest: - """ - Attributes: - alert_type (str): Alert type - agent_id (None | str | Unset): Agent ID (for agent alerts) - cooldown_minutes (int | Unset): Cooldown period in minutes Default: 60. - distribution_type (str | Unset): Distribution type (owner, owner_admins, selected_members) Default: 'owner'. - enabled (bool | Unset): Whether the alert config is enabled Default: True. - recipient_user_ids (list[str] | None | Unset): User IDs for selected_members distribution - source_connection_id (None | str | Unset): Source connection ID (for source alerts) - threshold (CreateAlertConfigRequestThresholdType0 | None | Unset): Threshold configuration - """ - - alert_type: str - agent_id: None | str | Unset = UNSET - cooldown_minutes: int | Unset = 60 - distribution_type: str | Unset = "owner" - enabled: bool | Unset = True - recipient_user_ids: list[str] | None | Unset = UNSET - source_connection_id: None | str | Unset = UNSET - threshold: CreateAlertConfigRequestThresholdType0 | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.create_alert_config_request_threshold_type_0 import ( - CreateAlertConfigRequestThresholdType0, - ) - - alert_type = self.alert_type - - agent_id: None | str | Unset - if isinstance(self.agent_id, Unset): - agent_id = UNSET - else: - agent_id = self.agent_id - - cooldown_minutes = self.cooldown_minutes - - distribution_type = self.distribution_type - - enabled = self.enabled - - recipient_user_ids: list[str] | None | Unset - if isinstance(self.recipient_user_ids, Unset): - recipient_user_ids = UNSET - elif isinstance(self.recipient_user_ids, list): - recipient_user_ids = self.recipient_user_ids - - else: - recipient_user_ids = self.recipient_user_ids - - source_connection_id: None | str | Unset - if isinstance(self.source_connection_id, Unset): - source_connection_id = UNSET - else: - source_connection_id = self.source_connection_id - - threshold: dict[str, Any] | None | Unset - if isinstance(self.threshold, Unset): - threshold = UNSET - elif isinstance(self.threshold, CreateAlertConfigRequestThresholdType0): - threshold = self.threshold.to_dict() - else: - threshold = self.threshold - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "alert_type": alert_type, - } - ) - if agent_id is not UNSET: - field_dict["agent_id"] = agent_id - if cooldown_minutes is not UNSET: - field_dict["cooldown_minutes"] = cooldown_minutes - if distribution_type is not UNSET: - field_dict["distribution_type"] = distribution_type - if enabled is not UNSET: - field_dict["enabled"] = enabled - if recipient_user_ids is not UNSET: - field_dict["recipient_user_ids"] = recipient_user_ids - if source_connection_id is not UNSET: - field_dict["source_connection_id"] = source_connection_id - if threshold is not UNSET: - field_dict["threshold"] = threshold - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.create_alert_config_request_threshold_type_0 import ( - CreateAlertConfigRequestThresholdType0, - ) - - d = dict(src_dict) - alert_type = d.pop("alert_type") - - def _parse_agent_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_id = _parse_agent_id(d.pop("agent_id", UNSET)) - - cooldown_minutes = d.pop("cooldown_minutes", UNSET) - - distribution_type = d.pop("distribution_type", UNSET) - - enabled = d.pop("enabled", UNSET) - - def _parse_recipient_user_ids(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() - recipient_user_ids_type_0 = cast(list[str], data) - - return recipient_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - recipient_user_ids = _parse_recipient_user_ids( - d.pop("recipient_user_ids", UNSET) - ) - - def _parse_source_connection_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - source_connection_id = _parse_source_connection_id( - d.pop("source_connection_id", UNSET) - ) - - def _parse_threshold( - data: object, - ) -> CreateAlertConfigRequestThresholdType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - threshold_type_0 = CreateAlertConfigRequestThresholdType0.from_dict( - data - ) - - return threshold_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CreateAlertConfigRequestThresholdType0 | None | Unset, data) - - threshold = _parse_threshold(d.pop("threshold", UNSET)) - - create_alert_config_request = cls( - alert_type=alert_type, - agent_id=agent_id, - cooldown_minutes=cooldown_minutes, - distribution_type=distribution_type, - enabled=enabled, - recipient_user_ids=recipient_user_ids, - source_connection_id=source_connection_id, - threshold=threshold, - ) - - create_alert_config_request.additional_properties = d - return create_alert_config_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/seclai/_generated/models/create_alert_config_request_threshold_type_0.py b/seclai/_generated/models/create_alert_config_request_threshold_type_0.py deleted file mode 100644 index d0a52c2..0000000 --- a/seclai/_generated/models/create_alert_config_request_threshold_type_0.py +++ /dev/null @@ -1,46 +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="CreateAlertConfigRequestThresholdType0") - - -@_attrs_define -class CreateAlertConfigRequestThresholdType0: - """ """ - - additional_properties: dict[str, Any] = _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) - create_alert_config_request_threshold_type_0 = cls() - - create_alert_config_request_threshold_type_0.additional_properties = d - return create_alert_config_request_threshold_type_0 - - @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/seclai/_generated/models/create_evaluation_criteria_request.py b/seclai/_generated/models/create_evaluation_criteria_request.py deleted file mode 100644 index 110106f..0000000 --- a/seclai/_generated/models/create_evaluation_criteria_request.py +++ /dev/null @@ -1,216 +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.agent_evaluation_tier import AgentEvaluationTier -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.create_evaluation_criteria_request_expectation_config_type_0 import ( - CreateEvaluationCriteriaRequestExpectationConfigType0, - ) - - -T = TypeVar("T", bound="CreateEvaluationCriteriaRequest") - - -@_attrs_define -class CreateEvaluationCriteriaRequest: - """Request body for creating an evaluation criteria. - - The evaluation mode, retry settings, and sample frequency are set at the - agent level, not per-criteria. - - Attributes: - step_id (str): - description (None | str | Unset): - enabled (bool | Unset): Default: True. - evaluation_prompt (None | str | Unset): - evaluation_tier (AgentEvaluationTier | None | Unset): - expectation_config (CreateEvaluationCriteriaRequestExpectationConfigType0 | None | Unset): - pass_threshold (float | Unset): Default: 0.5. - """ - - step_id: str - description: None | str | Unset = UNSET - enabled: bool | Unset = True - evaluation_prompt: None | str | Unset = UNSET - evaluation_tier: AgentEvaluationTier | None | Unset = UNSET - expectation_config: ( - CreateEvaluationCriteriaRequestExpectationConfigType0 | None | Unset - ) = UNSET - pass_threshold: float | Unset = 0.5 - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.create_evaluation_criteria_request_expectation_config_type_0 import ( - CreateEvaluationCriteriaRequestExpectationConfigType0, - ) - - step_id = self.step_id - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - enabled = self.enabled - - evaluation_prompt: None | str | Unset - if isinstance(self.evaluation_prompt, Unset): - evaluation_prompt = UNSET - else: - evaluation_prompt = self.evaluation_prompt - - evaluation_tier: None | str | Unset - if isinstance(self.evaluation_tier, Unset): - evaluation_tier = UNSET - elif isinstance(self.evaluation_tier, AgentEvaluationTier): - evaluation_tier = self.evaluation_tier.value - else: - evaluation_tier = self.evaluation_tier - - expectation_config: dict[str, Any] | None | Unset - if isinstance(self.expectation_config, Unset): - expectation_config = UNSET - elif isinstance( - self.expectation_config, - CreateEvaluationCriteriaRequestExpectationConfigType0, - ): - expectation_config = self.expectation_config.to_dict() - else: - expectation_config = self.expectation_config - - pass_threshold = self.pass_threshold - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "step_id": step_id, - } - ) - if description is not UNSET: - field_dict["description"] = description - if enabled is not UNSET: - field_dict["enabled"] = enabled - if evaluation_prompt is not UNSET: - field_dict["evaluation_prompt"] = evaluation_prompt - if evaluation_tier is not UNSET: - field_dict["evaluation_tier"] = evaluation_tier - if expectation_config is not UNSET: - field_dict["expectation_config"] = expectation_config - if pass_threshold is not UNSET: - field_dict["pass_threshold"] = pass_threshold - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.create_evaluation_criteria_request_expectation_config_type_0 import ( - CreateEvaluationCriteriaRequestExpectationConfigType0, - ) - - d = dict(src_dict) - step_id = d.pop("step_id") - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - enabled = d.pop("enabled", UNSET) - - def _parse_evaluation_prompt(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - evaluation_prompt = _parse_evaluation_prompt(d.pop("evaluation_prompt", UNSET)) - - def _parse_evaluation_tier(data: object) -> AgentEvaluationTier | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - evaluation_tier_type_0 = AgentEvaluationTier(data) - - return evaluation_tier_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentEvaluationTier | None | Unset, data) - - evaluation_tier = _parse_evaluation_tier(d.pop("evaluation_tier", UNSET)) - - def _parse_expectation_config( - data: object, - ) -> CreateEvaluationCriteriaRequestExpectationConfigType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - expectation_config_type_0 = ( - CreateEvaluationCriteriaRequestExpectationConfigType0.from_dict( - data - ) - ) - - return expectation_config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - CreateEvaluationCriteriaRequestExpectationConfigType0 | None | Unset, - data, - ) - - expectation_config = _parse_expectation_config( - d.pop("expectation_config", UNSET) - ) - - pass_threshold = d.pop("pass_threshold", UNSET) - - create_evaluation_criteria_request = cls( - step_id=step_id, - description=description, - enabled=enabled, - evaluation_prompt=evaluation_prompt, - evaluation_tier=evaluation_tier, - expectation_config=expectation_config, - pass_threshold=pass_threshold, - ) - - create_evaluation_criteria_request.additional_properties = d - return create_evaluation_criteria_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/seclai/_generated/models/create_evaluation_criteria_request_expectation_config_type_0.py b/seclai/_generated/models/create_evaluation_criteria_request_expectation_config_type_0.py deleted file mode 100644 index 342c5e3..0000000 --- a/seclai/_generated/models/create_evaluation_criteria_request_expectation_config_type_0.py +++ /dev/null @@ -1,48 +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="CreateEvaluationCriteriaRequestExpectationConfigType0") - - -@_attrs_define -class CreateEvaluationCriteriaRequestExpectationConfigType0: - """ """ - - additional_properties: dict[str, Any] = _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) - create_evaluation_criteria_request_expectation_config_type_0 = cls() - - create_evaluation_criteria_request_expectation_config_type_0.additional_properties = ( - d - ) - return create_evaluation_criteria_request_expectation_config_type_0 - - @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/seclai/_generated/models/create_evaluation_result_request.py b/seclai/_generated/models/create_evaluation_result_request.py deleted file mode 100644 index 549c9ff..0000000 --- a/seclai/_generated/models/create_evaluation_result_request.py +++ /dev/null @@ -1,199 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.evaluation_status import EvaluationStatus -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.create_evaluation_result_request_details_type_0 import ( - CreateEvaluationResultRequestDetailsType0, - ) - - -T = TypeVar("T", bound="CreateEvaluationResultRequest") - - -@_attrs_define -class CreateEvaluationResultRequest: - """Request body for recording an evaluation result. - - Attributes: - agent_run_id (UUID): - status (EvaluationStatus): Result status of a single evaluation run. - agent_step_run_id (None | Unset | UUID): - details (CreateEvaluationResultRequestDetailsType0 | None | Unset): - flagged (bool | Unset): Default: False. - retry_count (int | Unset): Default: 0. - retry_triggered (bool | Unset): Default: False. - score (float | None | Unset): - """ - - agent_run_id: UUID - status: EvaluationStatus - agent_step_run_id: None | Unset | UUID = UNSET - details: CreateEvaluationResultRequestDetailsType0 | None | Unset = UNSET - flagged: bool | Unset = False - retry_count: int | Unset = 0 - retry_triggered: bool | Unset = False - score: float | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.create_evaluation_result_request_details_type_0 import ( - CreateEvaluationResultRequestDetailsType0, - ) - - agent_run_id = str(self.agent_run_id) - - status = self.status.value - - agent_step_run_id: None | str | Unset - if isinstance(self.agent_step_run_id, Unset): - agent_step_run_id = UNSET - elif isinstance(self.agent_step_run_id, UUID): - agent_step_run_id = str(self.agent_step_run_id) - else: - agent_step_run_id = self.agent_step_run_id - - details: dict[str, Any] | None | Unset - if isinstance(self.details, Unset): - details = UNSET - elif isinstance(self.details, CreateEvaluationResultRequestDetailsType0): - details = self.details.to_dict() - else: - details = self.details - - flagged = self.flagged - - retry_count = self.retry_count - - retry_triggered = self.retry_triggered - - score: float | None | Unset - if isinstance(self.score, Unset): - score = UNSET - else: - score = self.score - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_run_id": agent_run_id, - "status": status, - } - ) - if agent_step_run_id is not UNSET: - field_dict["agent_step_run_id"] = agent_step_run_id - if details is not UNSET: - field_dict["details"] = details - if flagged is not UNSET: - field_dict["flagged"] = flagged - if retry_count is not UNSET: - field_dict["retry_count"] = retry_count - if retry_triggered is not UNSET: - field_dict["retry_triggered"] = retry_triggered - if score is not UNSET: - field_dict["score"] = score - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.create_evaluation_result_request_details_type_0 import ( - CreateEvaluationResultRequestDetailsType0, - ) - - d = dict(src_dict) - agent_run_id = UUID(d.pop("agent_run_id")) - - status = EvaluationStatus(d.pop("status")) - - def _parse_agent_step_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() - agent_step_run_id_type_0 = UUID(data) - - return agent_step_run_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - agent_step_run_id = _parse_agent_step_run_id(d.pop("agent_step_run_id", UNSET)) - - def _parse_details( - data: object, - ) -> CreateEvaluationResultRequestDetailsType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - details_type_0 = CreateEvaluationResultRequestDetailsType0.from_dict( - data - ) - - return details_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CreateEvaluationResultRequestDetailsType0 | None | Unset, data) - - details = _parse_details(d.pop("details", UNSET)) - - flagged = d.pop("flagged", UNSET) - - retry_count = d.pop("retry_count", UNSET) - - retry_triggered = d.pop("retry_triggered", UNSET) - - def _parse_score(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - score = _parse_score(d.pop("score", UNSET)) - - create_evaluation_result_request = cls( - agent_run_id=agent_run_id, - status=status, - agent_step_run_id=agent_step_run_id, - details=details, - flagged=flagged, - retry_count=retry_count, - retry_triggered=retry_triggered, - score=score, - ) - - create_evaluation_result_request.additional_properties = d - return create_evaluation_result_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/seclai/_generated/models/create_evaluation_result_request_details_type_0.py b/seclai/_generated/models/create_evaluation_result_request_details_type_0.py deleted file mode 100644 index ba4470b..0000000 --- a/seclai/_generated/models/create_evaluation_result_request_details_type_0.py +++ /dev/null @@ -1,46 +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="CreateEvaluationResultRequestDetailsType0") - - -@_attrs_define -class CreateEvaluationResultRequestDetailsType0: - """ """ - - additional_properties: dict[str, Any] = _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) - create_evaluation_result_request_details_type_0 = cls() - - create_evaluation_result_request_details_type_0.additional_properties = d - return create_evaluation_result_request_details_type_0 - - @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/seclai/_generated/models/create_experiment_response.py b/seclai/_generated/models/create_experiment_response.py deleted file mode 100644 index c90d91d..0000000 --- a/seclai/_generated/models/create_experiment_response.py +++ /dev/null @@ -1,69 +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="CreateExperimentResponse") - - -@_attrs_define -class CreateExperimentResponse: - """ - Attributes: - experiment_id (str): - status (str): - """ - - experiment_id: str - status: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - experiment_id = self.experiment_id - - status = self.status - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "experiment_id": experiment_id, - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - experiment_id = d.pop("experiment_id") - - status = d.pop("status") - - create_experiment_response = cls( - experiment_id=experiment_id, - status=status, - ) - - create_experiment_response.additional_properties = d - return create_experiment_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/seclai/_generated/models/create_export_request.py b/seclai/_generated/models/create_export_request.py deleted file mode 100644 index ac8b3b5..0000000 --- a/seclai/_generated/models/create_export_request.py +++ /dev/null @@ -1,196 +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 dateutil.parser import isoparse - -from ..models.export_format import ExportFormat -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.create_export_request_metadata_filter_type_0 import ( - CreateExportRequestMetadataFilterType0, - ) - - -T = TypeVar("T", bound="CreateExportRequest") - - -@_attrs_define -class CreateExportRequest: - """Parameters for creating a new export job. - - Attributes: - format_ (ExportFormat): Supported export file formats. - date_from (datetime.datetime | None | Unset): Only include content created on or after this timestamp. - date_to (datetime.datetime | None | Unset): Only include content created on or before this timestamp. - metadata_filter (CreateExportRequestMetadataFilterType0 | None | Unset): JSONB containment filter applied to - content metadata. - query_filter (None | str | Unset): Title substring filter (case-insensitive ILIKE). - """ - - format_: ExportFormat - date_from: datetime.datetime | None | Unset = UNSET - date_to: datetime.datetime | None | Unset = UNSET - metadata_filter: CreateExportRequestMetadataFilterType0 | None | Unset = UNSET - query_filter: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.create_export_request_metadata_filter_type_0 import ( - CreateExportRequestMetadataFilterType0, - ) - - format_ = self.format_.value - - date_from: None | str | Unset - if isinstance(self.date_from, Unset): - date_from = UNSET - elif isinstance(self.date_from, datetime.datetime): - date_from = self.date_from.isoformat() - else: - date_from = self.date_from - - date_to: None | str | Unset - if isinstance(self.date_to, Unset): - date_to = UNSET - elif isinstance(self.date_to, datetime.datetime): - date_to = self.date_to.isoformat() - else: - date_to = self.date_to - - metadata_filter: dict[str, Any] | None | Unset - if isinstance(self.metadata_filter, Unset): - metadata_filter = UNSET - elif isinstance(self.metadata_filter, CreateExportRequestMetadataFilterType0): - metadata_filter = self.metadata_filter.to_dict() - else: - metadata_filter = self.metadata_filter - - query_filter: None | str | Unset - if isinstance(self.query_filter, Unset): - query_filter = UNSET - else: - query_filter = self.query_filter - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "format": format_, - } - ) - if date_from is not UNSET: - field_dict["date_from"] = date_from - if date_to is not UNSET: - field_dict["date_to"] = date_to - if metadata_filter is not UNSET: - field_dict["metadata_filter"] = metadata_filter - if query_filter is not UNSET: - field_dict["query_filter"] = query_filter - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.create_export_request_metadata_filter_type_0 import ( - CreateExportRequestMetadataFilterType0, - ) - - d = dict(src_dict) - format_ = ExportFormat(d.pop("format")) - - def _parse_date_from(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() - date_from_type_0 = isoparse(data) - - return date_from_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - date_from = _parse_date_from(d.pop("date_from", UNSET)) - - def _parse_date_to(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() - date_to_type_0 = isoparse(data) - - return date_to_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - date_to = _parse_date_to(d.pop("date_to", UNSET)) - - def _parse_metadata_filter( - data: object, - ) -> CreateExportRequestMetadataFilterType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_filter_type_0 = ( - CreateExportRequestMetadataFilterType0.from_dict(data) - ) - - return metadata_filter_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CreateExportRequestMetadataFilterType0 | None | Unset, data) - - metadata_filter = _parse_metadata_filter(d.pop("metadata_filter", UNSET)) - - def _parse_query_filter(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - query_filter = _parse_query_filter(d.pop("query_filter", UNSET)) - - create_export_request = cls( - format_=format_, - date_from=date_from, - date_to=date_to, - metadata_filter=metadata_filter, - query_filter=query_filter, - ) - - create_export_request.additional_properties = d - return create_export_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/seclai/_generated/models/create_export_request_metadata_filter_type_0.py b/seclai/_generated/models/create_export_request_metadata_filter_type_0.py deleted file mode 100644 index 9273162..0000000 --- a/seclai/_generated/models/create_export_request_metadata_filter_type_0.py +++ /dev/null @@ -1,46 +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="CreateExportRequestMetadataFilterType0") - - -@_attrs_define -class CreateExportRequestMetadataFilterType0: - """ """ - - additional_properties: dict[str, Any] = _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) - create_export_request_metadata_filter_type_0 = cls() - - create_export_request_metadata_filter_type_0.additional_properties = d - return create_export_request_metadata_filter_type_0 - - @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/seclai/_generated/models/create_knowledge_base_body.py b/seclai/_generated/models/create_knowledge_base_body.py deleted file mode 100644 index ab3e793..0000000 --- a/seclai/_generated/models/create_knowledge_base_body.py +++ /dev/null @@ -1,174 +0,0 @@ -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="CreateKnowledgeBaseBody") - - -@_attrs_define -class CreateKnowledgeBaseBody: - """Request body for creating a knowledge base. - - Attributes: - name (str): Knowledge base name. - source_ids (list[str]): List of source connection IDs to link. - default_score_threshold (float | None | Unset): Default minimum rerank score threshold. - default_top_k (int | None | Unset): Default results after reranking. - default_top_n (int | None | Unset): Default number of results. - description (None | str | Unset): Optional description. - reranker_model (None | str | Unset): Reranker model to use (null for no reranking). - """ - - name: str - source_ids: list[str] - default_score_threshold: float | None | Unset = UNSET - default_top_k: int | None | Unset = UNSET - default_top_n: int | None | Unset = UNSET - description: None | str | Unset = UNSET - reranker_model: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - name = self.name - - source_ids = self.source_ids - - default_score_threshold: float | None | Unset - if isinstance(self.default_score_threshold, Unset): - default_score_threshold = UNSET - else: - default_score_threshold = self.default_score_threshold - - default_top_k: int | None | Unset - if isinstance(self.default_top_k, Unset): - default_top_k = UNSET - else: - default_top_k = self.default_top_k - - default_top_n: int | None | Unset - if isinstance(self.default_top_n, Unset): - default_top_n = UNSET - else: - default_top_n = self.default_top_n - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - reranker_model: None | str | Unset - if isinstance(self.reranker_model, Unset): - reranker_model = UNSET - else: - reranker_model = self.reranker_model - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "name": name, - "source_ids": source_ids, - } - ) - if default_score_threshold is not UNSET: - field_dict["default_score_threshold"] = default_score_threshold - if default_top_k is not UNSET: - field_dict["default_top_k"] = default_top_k - if default_top_n is not UNSET: - field_dict["default_top_n"] = default_top_n - if description is not UNSET: - field_dict["description"] = description - if reranker_model is not UNSET: - field_dict["reranker_model"] = reranker_model - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - source_ids = cast(list[str], d.pop("source_ids")) - - def _parse_default_score_threshold(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - default_score_threshold = _parse_default_score_threshold( - d.pop("default_score_threshold", UNSET) - ) - - def _parse_default_top_k(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - default_top_k = _parse_default_top_k(d.pop("default_top_k", UNSET)) - - def _parse_default_top_n(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - default_top_n = _parse_default_top_n(d.pop("default_top_n", UNSET)) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_reranker_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - reranker_model = _parse_reranker_model(d.pop("reranker_model", UNSET)) - - create_knowledge_base_body = cls( - name=name, - source_ids=source_ids, - default_score_threshold=default_score_threshold, - default_top_k=default_top_k, - default_top_n=default_top_n, - description=description, - reranker_model=reranker_model, - ) - - create_knowledge_base_body.additional_properties = d - return create_knowledge_base_body - - @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/seclai/_generated/models/create_memory_bank_body.py b/seclai/_generated/models/create_memory_bank_body.py deleted file mode 100644 index 9526b45..0000000 --- a/seclai/_generated/models/create_memory_bank_body.py +++ /dev/null @@ -1,288 +0,0 @@ -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="CreateMemoryBankBody") - - -@_attrs_define -class CreateMemoryBankBody: - """Request body for creating a memory bank. - - Attributes: - name (str): Memory bank name. - chunk_overlap (int | None | Unset): Chunk overlap (custom mode only). - chunk_size (int | None | Unset): Chunk size (custom mode only). - compaction_prompt (None | str | Unset): Custom prompt used when compacting older entries. When set, entries that - exceed a threshold are summarized into a new entry before being soft-deleted. - description (None | str | Unset): Optional description of the bank's purpose. - dimensions (int | None | Unset): Embedding dimensions (custom mode only). - embedding_model (None | str | Unset): Custom embedding model (custom mode only). - max_age_days (int | None | Unset): Max entry age in days before compaction. Checked inline after each write and - by the hourly background sweep. - max_size_tokens (int | None | Unset): Max total tokens (per partition) before compaction. Checked inline after - each write and by the hourly background sweep. - max_turns (int | None | Unset): Max conversation turns (per partition) before compaction. Checked inline after - each write and by the hourly background sweep. - mode (str | Unset): Embedding quality / cost trade-off. One of: fast_and_cheap, balanced, slow_and_thorough, - custom. Default: 'fast_and_cheap'. - retention_days (int | None | Unset): Content source retention in days. Default: 30. - type_ (str | Unset): Bank type. 'conversation' for chat-turn data with conversation_key + speaker; 'general' for - flat entries with optional group_key. Default: 'conversation'. - """ - - name: str - chunk_overlap: int | None | Unset = UNSET - chunk_size: int | None | Unset = UNSET - compaction_prompt: None | str | Unset = UNSET - description: None | str | Unset = UNSET - dimensions: int | None | Unset = UNSET - embedding_model: None | str | Unset = UNSET - max_age_days: int | None | Unset = UNSET - max_size_tokens: int | None | Unset = UNSET - max_turns: int | None | Unset = UNSET - mode: str | Unset = "fast_and_cheap" - retention_days: int | None | Unset = 30 - type_: str | Unset = "conversation" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - name = self.name - - chunk_overlap: int | None | Unset - if isinstance(self.chunk_overlap, Unset): - chunk_overlap = UNSET - else: - chunk_overlap = self.chunk_overlap - - chunk_size: int | None | Unset - if isinstance(self.chunk_size, Unset): - chunk_size = UNSET - else: - chunk_size = self.chunk_size - - compaction_prompt: None | str | Unset - if isinstance(self.compaction_prompt, Unset): - compaction_prompt = UNSET - else: - compaction_prompt = self.compaction_prompt - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - dimensions: int | None | Unset - if isinstance(self.dimensions, Unset): - dimensions = UNSET - else: - dimensions = self.dimensions - - embedding_model: None | str | Unset - if isinstance(self.embedding_model, Unset): - embedding_model = UNSET - else: - embedding_model = self.embedding_model - - max_age_days: int | None | Unset - if isinstance(self.max_age_days, Unset): - max_age_days = UNSET - else: - max_age_days = self.max_age_days - - max_size_tokens: int | None | Unset - if isinstance(self.max_size_tokens, Unset): - max_size_tokens = UNSET - else: - max_size_tokens = self.max_size_tokens - - max_turns: int | None | Unset - if isinstance(self.max_turns, Unset): - max_turns = UNSET - else: - max_turns = self.max_turns - - mode = self.mode - - retention_days: int | None | Unset - if isinstance(self.retention_days, Unset): - retention_days = UNSET - else: - retention_days = self.retention_days - - type_ = self.type_ - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "name": name, - } - ) - if chunk_overlap is not UNSET: - field_dict["chunk_overlap"] = chunk_overlap - if chunk_size is not UNSET: - field_dict["chunk_size"] = chunk_size - if compaction_prompt is not UNSET: - field_dict["compaction_prompt"] = compaction_prompt - if description is not UNSET: - field_dict["description"] = description - if dimensions is not UNSET: - field_dict["dimensions"] = dimensions - if embedding_model is not UNSET: - field_dict["embedding_model"] = embedding_model - if max_age_days is not UNSET: - field_dict["max_age_days"] = max_age_days - if max_size_tokens is not UNSET: - field_dict["max_size_tokens"] = max_size_tokens - if max_turns is not UNSET: - field_dict["max_turns"] = max_turns - if mode is not UNSET: - field_dict["mode"] = mode - if retention_days is not UNSET: - field_dict["retention_days"] = retention_days - if type_ is not UNSET: - field_dict["type"] = type_ - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - def _parse_chunk_overlap(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_overlap = _parse_chunk_overlap(d.pop("chunk_overlap", UNSET)) - - def _parse_chunk_size(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_size = _parse_chunk_size(d.pop("chunk_size", UNSET)) - - def _parse_compaction_prompt(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - compaction_prompt = _parse_compaction_prompt(d.pop("compaction_prompt", UNSET)) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_dimensions(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - dimensions = _parse_dimensions(d.pop("dimensions", UNSET)) - - def _parse_embedding_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - embedding_model = _parse_embedding_model(d.pop("embedding_model", UNSET)) - - def _parse_max_age_days(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_age_days = _parse_max_age_days(d.pop("max_age_days", UNSET)) - - def _parse_max_size_tokens(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_size_tokens = _parse_max_size_tokens(d.pop("max_size_tokens", UNSET)) - - def _parse_max_turns(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_turns = _parse_max_turns(d.pop("max_turns", UNSET)) - - mode = d.pop("mode", UNSET) - - def _parse_retention_days(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - retention_days = _parse_retention_days(d.pop("retention_days", UNSET)) - - type_ = d.pop("type", UNSET) - - create_memory_bank_body = cls( - name=name, - chunk_overlap=chunk_overlap, - chunk_size=chunk_size, - compaction_prompt=compaction_prompt, - description=description, - dimensions=dimensions, - embedding_model=embedding_model, - max_age_days=max_age_days, - max_size_tokens=max_size_tokens, - max_turns=max_turns, - mode=mode, - retention_days=retention_days, - type_=type_, - ) - - create_memory_bank_body.additional_properties = d - return create_memory_bank_body - - @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/seclai/_generated/models/create_solution_request.py b/seclai/_generated/models/create_solution_request.py deleted file mode 100644 index 5a6691a..0000000 --- a/seclai/_generated/models/create_solution_request.py +++ /dev/null @@ -1,73 +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 - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateSolutionRequest") - - -@_attrs_define -class CreateSolutionRequest: - """Request model for creating a new solution - - Attributes: - name (str): Name of the solution - description (str | Unset): Description of the solution Default: ''. - """ - - name: str - description: str | Unset = "" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - name = self.name - - description = self.description - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "name": name, - } - ) - 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: - d = dict(src_dict) - name = d.pop("name") - - description = d.pop("description", UNSET) - - create_solution_request = cls( - name=name, - description=description, - ) - - create_solution_request.additional_properties = d - return create_solution_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/seclai/_generated/models/create_source_body.py b/seclai/_generated/models/create_source_body.py deleted file mode 100644 index 41bb672..0000000 --- a/seclai/_generated/models/create_source_body.py +++ /dev/null @@ -1,338 +0,0 @@ -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 ..models.source_index_mode import SourceIndexMode -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateSourceBody") - - -@_attrs_define -class CreateSourceBody: - """Request body for creating a content source. - - Attributes: - name (str): Source name. - source_type (str): Source type: rss, website, or custom_index. The legacy value 'file_uploads' is accepted as an - alias for custom_index. - chunk_overlap (int | None | Unset): Chunk overlap for content processing. - chunk_size (int | None | Unset): Chunk size for content processing. - content_filter (None | str | Unset): Content filter type. - dimensions (int | None | Unset): Embedding dimensions override. - embedding_model (None | str | Unset): Embedding model override. - index_mode (None | SourceIndexMode | Unset): Index mode for custom_index sources: fast_and_cheap (default), - balanced, slow_and_thorough, or custom. - media_types (list[str] | None | Unset): Media kinds to extract from indexed content and embed as multi-modal KB - chunks. Subset of ['images', 'video']. Only kinds the source's embedder can index are honored; unsupported - values are dropped. Omit / [] for text-only. - polling (None | str | Unset): Polling interval (e.g. hourly, daily). - polling_action (None | str | Unset): Polling action. - polling_max_items (int | None | Unset): Max items per poll. - retention (int | None | Unset): Retention period in days. - url_id (None | str | Unset): URL record ID (required for rss/website sources). - """ - - name: str - source_type: str - chunk_overlap: int | None | Unset = UNSET - chunk_size: int | None | Unset = UNSET - content_filter: None | str | Unset = UNSET - dimensions: int | None | Unset = UNSET - embedding_model: None | str | Unset = UNSET - index_mode: None | SourceIndexMode | Unset = UNSET - media_types: list[str] | None | Unset = UNSET - polling: None | str | Unset = UNSET - polling_action: None | str | Unset = UNSET - polling_max_items: int | None | Unset = UNSET - retention: int | None | Unset = UNSET - url_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - name = self.name - - source_type = self.source_type - - chunk_overlap: int | None | Unset - if isinstance(self.chunk_overlap, Unset): - chunk_overlap = UNSET - else: - chunk_overlap = self.chunk_overlap - - chunk_size: int | None | Unset - if isinstance(self.chunk_size, Unset): - chunk_size = UNSET - else: - chunk_size = self.chunk_size - - content_filter: None | str | Unset - if isinstance(self.content_filter, Unset): - content_filter = UNSET - else: - content_filter = self.content_filter - - dimensions: int | None | Unset - if isinstance(self.dimensions, Unset): - dimensions = UNSET - else: - dimensions = self.dimensions - - embedding_model: None | str | Unset - if isinstance(self.embedding_model, Unset): - embedding_model = UNSET - else: - embedding_model = self.embedding_model - - index_mode: None | str | Unset - if isinstance(self.index_mode, Unset): - index_mode = UNSET - elif isinstance(self.index_mode, SourceIndexMode): - index_mode = self.index_mode.value - else: - index_mode = self.index_mode - - media_types: list[str] | None | Unset - if isinstance(self.media_types, Unset): - media_types = UNSET - elif isinstance(self.media_types, list): - media_types = self.media_types - - else: - media_types = self.media_types - - polling: None | str | Unset - if isinstance(self.polling, Unset): - polling = UNSET - else: - polling = self.polling - - polling_action: None | str | Unset - if isinstance(self.polling_action, Unset): - polling_action = UNSET - else: - polling_action = self.polling_action - - polling_max_items: int | None | Unset - if isinstance(self.polling_max_items, Unset): - polling_max_items = UNSET - else: - polling_max_items = self.polling_max_items - - retention: int | None | Unset - if isinstance(self.retention, Unset): - retention = UNSET - else: - retention = self.retention - - url_id: None | str | Unset - if isinstance(self.url_id, Unset): - url_id = UNSET - else: - url_id = self.url_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "name": name, - "source_type": source_type, - } - ) - if chunk_overlap is not UNSET: - field_dict["chunk_overlap"] = chunk_overlap - if chunk_size is not UNSET: - field_dict["chunk_size"] = chunk_size - if content_filter is not UNSET: - field_dict["content_filter"] = content_filter - if dimensions is not UNSET: - field_dict["dimensions"] = dimensions - if embedding_model is not UNSET: - field_dict["embedding_model"] = embedding_model - if index_mode is not UNSET: - field_dict["index_mode"] = index_mode - if media_types is not UNSET: - field_dict["media_types"] = media_types - if polling is not UNSET: - field_dict["polling"] = polling - if polling_action is not UNSET: - field_dict["polling_action"] = polling_action - if polling_max_items is not UNSET: - field_dict["polling_max_items"] = polling_max_items - if retention is not UNSET: - field_dict["retention"] = retention - if url_id is not UNSET: - field_dict["url_id"] = url_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - source_type = d.pop("source_type") - - def _parse_chunk_overlap(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_overlap = _parse_chunk_overlap(d.pop("chunk_overlap", UNSET)) - - def _parse_chunk_size(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_size = _parse_chunk_size(d.pop("chunk_size", UNSET)) - - def _parse_content_filter(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - content_filter = _parse_content_filter(d.pop("content_filter", UNSET)) - - def _parse_dimensions(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - dimensions = _parse_dimensions(d.pop("dimensions", UNSET)) - - def _parse_embedding_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - embedding_model = _parse_embedding_model(d.pop("embedding_model", UNSET)) - - def _parse_index_mode(data: object) -> None | SourceIndexMode | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - index_mode_type_0 = SourceIndexMode(data) - - return index_mode_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SourceIndexMode | Unset, data) - - index_mode = _parse_index_mode(d.pop("index_mode", UNSET)) - - def _parse_media_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() - media_types_type_0 = cast(list[str], data) - - return media_types_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - media_types = _parse_media_types(d.pop("media_types", UNSET)) - - def _parse_polling(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - polling = _parse_polling(d.pop("polling", UNSET)) - - def _parse_polling_action(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - polling_action = _parse_polling_action(d.pop("polling_action", UNSET)) - - def _parse_polling_max_items(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - polling_max_items = _parse_polling_max_items(d.pop("polling_max_items", UNSET)) - - def _parse_retention(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - retention = _parse_retention(d.pop("retention", UNSET)) - - def _parse_url_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - url_id = _parse_url_id(d.pop("url_id", UNSET)) - - create_source_body = cls( - name=name, - source_type=source_type, - chunk_overlap=chunk_overlap, - chunk_size=chunk_size, - content_filter=content_filter, - dimensions=dimensions, - embedding_model=embedding_model, - index_mode=index_mode, - media_types=media_types, - polling=polling, - polling_action=polling_action, - polling_max_items=polling_max_items, - retention=retention, - url_id=url_id, - ) - - create_source_body.additional_properties = d - return create_source_body - - @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/seclai/_generated/models/dmarc_failing_source_response.py b/seclai/_generated/models/dmarc_failing_source_response.py deleted file mode 100644 index 73d4967..0000000 --- a/seclai/_generated/models/dmarc_failing_source_response.py +++ /dev/null @@ -1,91 +0,0 @@ -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="DmarcFailingSourceResponse") - - -@_attrs_define -class DmarcFailingSourceResponse: - """ - Attributes: - failed_count (int): - source_ip (str): - header_from (None | str | Unset): - """ - - failed_count: int - source_ip: str - header_from: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - failed_count = self.failed_count - - source_ip = self.source_ip - - header_from: None | str | Unset - if isinstance(self.header_from, Unset): - header_from = UNSET - else: - header_from = self.header_from - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "failed_count": failed_count, - "source_ip": source_ip, - } - ) - if header_from is not UNSET: - field_dict["header_from"] = header_from - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - failed_count = d.pop("failed_count") - - source_ip = d.pop("source_ip") - - def _parse_header_from(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - header_from = _parse_header_from(d.pop("header_from", UNSET)) - - dmarc_failing_source_response = cls( - failed_count=failed_count, - source_ip=source_ip, - header_from=header_from, - ) - - dmarc_failing_source_response.additional_properties = d - return dmarc_failing_source_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/seclai/_generated/models/dmarc_summary_response.py b/seclai/_generated/models/dmarc_summary_response.py deleted file mode 100644 index 828f819..0000000 --- a/seclai/_generated/models/dmarc_summary_response.py +++ /dev/null @@ -1,175 +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.dmarc_failing_source_response import DmarcFailingSourceResponse - from ..models.dmarc_summary_response_dispositions import ( - DmarcSummaryResponseDispositions, - ) - - -T = TypeVar("T", bound="DmarcSummaryResponse") - - -@_attrs_define -class DmarcSummaryResponse: - """ - Attributes: - failed_messages (int): - passed_messages (int): - report_count (int): - total_messages (int): - window_days (int): - dispositions (DmarcSummaryResponseDispositions | Unset): - monitored (bool | Unset): Default: True. - pass_rate (float | None | Unset): - top_failing_sources (list[DmarcFailingSourceResponse] | Unset): - """ - - failed_messages: int - passed_messages: int - report_count: int - total_messages: int - window_days: int - dispositions: DmarcSummaryResponseDispositions | Unset = UNSET - monitored: bool | Unset = True - pass_rate: float | None | Unset = UNSET - top_failing_sources: list[DmarcFailingSourceResponse] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - failed_messages = self.failed_messages - - passed_messages = self.passed_messages - - report_count = self.report_count - - total_messages = self.total_messages - - window_days = self.window_days - - dispositions: dict[str, Any] | Unset = UNSET - if not isinstance(self.dispositions, Unset): - dispositions = self.dispositions.to_dict() - - monitored = self.monitored - - pass_rate: float | None | Unset - if isinstance(self.pass_rate, Unset): - pass_rate = UNSET - else: - pass_rate = self.pass_rate - - top_failing_sources: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.top_failing_sources, Unset): - top_failing_sources = [] - for top_failing_sources_item_data in self.top_failing_sources: - top_failing_sources_item = top_failing_sources_item_data.to_dict() - top_failing_sources.append(top_failing_sources_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "failed_messages": failed_messages, - "passed_messages": passed_messages, - "report_count": report_count, - "total_messages": total_messages, - "window_days": window_days, - } - ) - if dispositions is not UNSET: - field_dict["dispositions"] = dispositions - if monitored is not UNSET: - field_dict["monitored"] = monitored - if pass_rate is not UNSET: - field_dict["pass_rate"] = pass_rate - if top_failing_sources is not UNSET: - field_dict["top_failing_sources"] = top_failing_sources - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.dmarc_failing_source_response import DmarcFailingSourceResponse - from ..models.dmarc_summary_response_dispositions import ( - DmarcSummaryResponseDispositions, - ) - - d = dict(src_dict) - failed_messages = d.pop("failed_messages") - - passed_messages = d.pop("passed_messages") - - report_count = d.pop("report_count") - - total_messages = d.pop("total_messages") - - window_days = d.pop("window_days") - - _dispositions = d.pop("dispositions", UNSET) - dispositions: DmarcSummaryResponseDispositions | Unset - if isinstance(_dispositions, Unset): - dispositions = UNSET - else: - dispositions = DmarcSummaryResponseDispositions.from_dict(_dispositions) - - monitored = d.pop("monitored", UNSET) - - def _parse_pass_rate(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - pass_rate = _parse_pass_rate(d.pop("pass_rate", UNSET)) - - _top_failing_sources = d.pop("top_failing_sources", UNSET) - top_failing_sources: list[DmarcFailingSourceResponse] | Unset = UNSET - if _top_failing_sources is not UNSET: - top_failing_sources = [] - for top_failing_sources_item_data in _top_failing_sources: - top_failing_sources_item = DmarcFailingSourceResponse.from_dict( - top_failing_sources_item_data - ) - - top_failing_sources.append(top_failing_sources_item) - - dmarc_summary_response = cls( - failed_messages=failed_messages, - passed_messages=passed_messages, - report_count=report_count, - total_messages=total_messages, - window_days=window_days, - dispositions=dispositions, - monitored=monitored, - pass_rate=pass_rate, - top_failing_sources=top_failing_sources, - ) - - dmarc_summary_response.additional_properties = d - return dmarc_summary_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/seclai/_generated/models/dmarc_summary_response_dispositions.py b/seclai/_generated/models/dmarc_summary_response_dispositions.py deleted file mode 100644 index 9468cd6..0000000 --- a/seclai/_generated/models/dmarc_summary_response_dispositions.py +++ /dev/null @@ -1,46 +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="DmarcSummaryResponseDispositions") - - -@_attrs_define -class DmarcSummaryResponseDispositions: - """ """ - - additional_properties: dict[str, int] = _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) - dmarc_summary_response_dispositions = cls() - - dmarc_summary_response_dispositions.additional_properties = d - return dmarc_summary_response_dispositions - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> int: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: int) -> 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/seclai/_generated/models/dns_provider_response.py b/seclai/_generated/models/dns_provider_response.py deleted file mode 100644 index dc98ae2..0000000 --- a/seclai/_generated/models/dns_provider_response.py +++ /dev/null @@ -1,120 +0,0 @@ -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="DnsProviderResponse") - - -@_attrs_define -class DnsProviderResponse: - """ - Attributes: - key (str): - name (str): - dashboard_url (None | str | Unset): - mx_priority_separate (bool | Unset): Default: True. - tips (list[str] | Unset): - txt_quotes (str | Unset): Default: 'strip'. - """ - - key: str - name: str - dashboard_url: None | str | Unset = UNSET - mx_priority_separate: bool | Unset = True - tips: list[str] | Unset = UNSET - txt_quotes: str | Unset = "strip" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - key = self.key - - name = self.name - - dashboard_url: None | str | Unset - if isinstance(self.dashboard_url, Unset): - dashboard_url = UNSET - else: - dashboard_url = self.dashboard_url - - mx_priority_separate = self.mx_priority_separate - - tips: list[str] | Unset = UNSET - if not isinstance(self.tips, Unset): - tips = self.tips - - txt_quotes = self.txt_quotes - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "key": key, - "name": name, - } - ) - if dashboard_url is not UNSET: - field_dict["dashboard_url"] = dashboard_url - if mx_priority_separate is not UNSET: - field_dict["mx_priority_separate"] = mx_priority_separate - if tips is not UNSET: - field_dict["tips"] = tips - if txt_quotes is not UNSET: - field_dict["txt_quotes"] = txt_quotes - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - key = d.pop("key") - - name = d.pop("name") - - def _parse_dashboard_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - dashboard_url = _parse_dashboard_url(d.pop("dashboard_url", UNSET)) - - mx_priority_separate = d.pop("mx_priority_separate", UNSET) - - tips = cast(list[str], d.pop("tips", UNSET)) - - txt_quotes = d.pop("txt_quotes", UNSET) - - dns_provider_response = cls( - key=key, - name=name, - dashboard_url=dashboard_url, - mx_priority_separate=mx_priority_separate, - tips=tips, - txt_quotes=txt_quotes, - ) - - dns_provider_response.additional_properties = d - return dns_provider_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/seclai/_generated/models/dns_record_response.py b/seclai/_generated/models/dns_record_response.py deleted file mode 100644 index ae24425..0000000 --- a/seclai/_generated/models/dns_record_response.py +++ /dev/null @@ -1,163 +0,0 @@ -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="DnsRecordResponse") - - -@_attrs_define -class DnsRecordResponse: - """ - Attributes: - key (str): - name (str): - ok (bool): - relative_name (str): - type_ (str): - value (str): - detail (None | str | Unset): - mx_host (None | str | Unset): - mx_priority (int | None | Unset): - """ - - key: str - name: str - ok: bool - relative_name: str - type_: str - value: str - detail: None | str | Unset = UNSET - mx_host: None | str | Unset = UNSET - mx_priority: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - key = self.key - - name = self.name - - ok = self.ok - - relative_name = self.relative_name - - type_ = self.type_ - - value = self.value - - detail: None | str | Unset - if isinstance(self.detail, Unset): - detail = UNSET - else: - detail = self.detail - - mx_host: None | str | Unset - if isinstance(self.mx_host, Unset): - mx_host = UNSET - else: - mx_host = self.mx_host - - mx_priority: int | None | Unset - if isinstance(self.mx_priority, Unset): - mx_priority = UNSET - else: - mx_priority = self.mx_priority - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "key": key, - "name": name, - "ok": ok, - "relative_name": relative_name, - "type": type_, - "value": value, - } - ) - if detail is not UNSET: - field_dict["detail"] = detail - if mx_host is not UNSET: - field_dict["mx_host"] = mx_host - if mx_priority is not UNSET: - field_dict["mx_priority"] = mx_priority - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - key = d.pop("key") - - name = d.pop("name") - - ok = d.pop("ok") - - relative_name = d.pop("relative_name") - - type_ = d.pop("type") - - value = d.pop("value") - - def _parse_detail(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - detail = _parse_detail(d.pop("detail", UNSET)) - - def _parse_mx_host(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - mx_host = _parse_mx_host(d.pop("mx_host", UNSET)) - - def _parse_mx_priority(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - mx_priority = _parse_mx_priority(d.pop("mx_priority", UNSET)) - - dns_record_response = cls( - key=key, - name=name, - ok=ok, - relative_name=relative_name, - type_=type_, - value=value, - detail=detail, - mx_host=mx_host, - mx_priority=mx_priority, - ) - - dns_record_response.additional_properties = d - return dns_record_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/seclai/_generated/models/docs_search_api_docs_search_get_mode.py b/seclai/_generated/models/docs_search_api_docs_search_get_mode.py deleted file mode 100644 index 8b240e5..0000000 --- a/seclai/_generated/models/docs_search_api_docs_search_get_mode.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class DocsSearchApiDocsSearchGetMode(str, Enum): - KEYWORD = "keyword" - SEMANTIC = "semantic" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/models/docs_search_response.py b/seclai/_generated/models/docs_search_response.py deleted file mode 100644 index 646fe25..0000000 --- a/seclai/_generated/models/docs_search_response.py +++ /dev/null @@ -1,77 +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.docs_search_result_response import DocsSearchResultResponse - - -T = TypeVar("T", bound="DocsSearchResponse") - - -@_attrs_define -class DocsSearchResponse: - """Ranked results, NOT a paginated collection — the ``{results}`` shape is a - deliberate carve-out matching the MCP ``search_docs`` tool. - - Attributes: - results (list[DocsSearchResultResponse]): - """ - - results: list[DocsSearchResultResponse] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - results = [] - for results_item_data in self.results: - results_item = results_item_data.to_dict() - results.append(results_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "results": results, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.docs_search_result_response import DocsSearchResultResponse - - d = dict(src_dict) - results = [] - _results = d.pop("results") - for results_item_data in _results: - results_item = DocsSearchResultResponse.from_dict(results_item_data) - - results.append(results_item) - - docs_search_response = cls( - results=results, - ) - - docs_search_response.additional_properties = d - return docs_search_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/seclai/_generated/models/docs_search_result_response.py b/seclai/_generated/models/docs_search_result_response.py deleted file mode 100644 index 5997ce0..0000000 --- a/seclai/_generated/models/docs_search_result_response.py +++ /dev/null @@ -1,120 +0,0 @@ -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 - -T = TypeVar("T", bound="DocsSearchResultResponse") - - -@_attrs_define -class DocsSearchResultResponse: - """ - Attributes: - anchor (None | str): - doc_slug (str): - highlight (None | str): - score (float): - snippet (None | str): - title (str): - """ - - anchor: None | str - doc_slug: str - highlight: None | str - score: float - snippet: None | str - title: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - anchor: None | str - anchor = self.anchor - - doc_slug = self.doc_slug - - highlight: None | str - highlight = self.highlight - - score = self.score - - snippet: None | str - snippet = self.snippet - - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "anchor": anchor, - "doc_slug": doc_slug, - "highlight": highlight, - "score": score, - "snippet": snippet, - "title": title, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_anchor(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - anchor = _parse_anchor(d.pop("anchor")) - - doc_slug = d.pop("doc_slug") - - def _parse_highlight(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - highlight = _parse_highlight(d.pop("highlight")) - - score = d.pop("score") - - def _parse_snippet(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - snippet = _parse_snippet(d.pop("snippet")) - - title = d.pop("title") - - docs_search_result_response = cls( - anchor=anchor, - doc_slug=doc_slug, - highlight=highlight, - score=score, - snippet=snippet, - title=title, - ) - - docs_search_result_response.additional_properties = d - return docs_search_result_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/seclai/_generated/models/email_domain_response.py b/seclai/_generated/models/email_domain_response.py deleted file mode 100644 index aa54410..0000000 --- a/seclai/_generated/models/email_domain_response.py +++ /dev/null @@ -1,275 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field -from dateutil.parser import isoparse - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.dns_provider_response import DnsProviderResponse - from ..models.dns_record_response import DnsRecordResponse - - -T = TypeVar("T", bound="EmailDomainResponse") - - -@_attrs_define -class EmailDomainResponse: - """ - Attributes: - domain (str): - id (UUID): - is_primary (bool): - kind (str): - status (str): - delegated (bool | Unset): Default: False. - dns_records (list[DnsRecordResponse] | Unset): - error_message (None | str | Unset): - last_checked_at (datetime.datetime | None | Unset): - provider (DnsProviderResponse | None | Unset): - regressing (bool | Unset): Default: False. - verified (bool | Unset): Default: False. - verified_at (datetime.datetime | None | Unset): - zone_apex (str | Unset): Default: ''. - """ - - domain: str - id: UUID - is_primary: bool - kind: str - status: str - delegated: bool | Unset = False - dns_records: list[DnsRecordResponse] | Unset = UNSET - error_message: None | str | Unset = UNSET - last_checked_at: datetime.datetime | None | Unset = UNSET - provider: DnsProviderResponse | None | Unset = UNSET - regressing: bool | Unset = False - verified: bool | Unset = False - verified_at: datetime.datetime | None | Unset = UNSET - zone_apex: str | Unset = "" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.dns_provider_response import DnsProviderResponse - - domain = self.domain - - id = str(self.id) - - is_primary = self.is_primary - - kind = self.kind - - status = self.status - - delegated = self.delegated - - dns_records: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.dns_records, Unset): - dns_records = [] - for dns_records_item_data in self.dns_records: - dns_records_item = dns_records_item_data.to_dict() - dns_records.append(dns_records_item) - - error_message: None | str | Unset - if isinstance(self.error_message, Unset): - error_message = UNSET - else: - error_message = self.error_message - - last_checked_at: None | str | Unset - if isinstance(self.last_checked_at, Unset): - last_checked_at = UNSET - elif isinstance(self.last_checked_at, datetime.datetime): - last_checked_at = self.last_checked_at.isoformat() - else: - last_checked_at = self.last_checked_at - - provider: dict[str, Any] | None | Unset - if isinstance(self.provider, Unset): - provider = UNSET - elif isinstance(self.provider, DnsProviderResponse): - provider = self.provider.to_dict() - else: - provider = self.provider - - regressing = self.regressing - - verified = self.verified - - verified_at: None | str | Unset - if isinstance(self.verified_at, Unset): - verified_at = UNSET - elif isinstance(self.verified_at, datetime.datetime): - verified_at = self.verified_at.isoformat() - else: - verified_at = self.verified_at - - zone_apex = self.zone_apex - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "domain": domain, - "id": id, - "is_primary": is_primary, - "kind": kind, - "status": status, - } - ) - if delegated is not UNSET: - field_dict["delegated"] = delegated - if dns_records is not UNSET: - field_dict["dns_records"] = dns_records - if error_message is not UNSET: - field_dict["error_message"] = error_message - if last_checked_at is not UNSET: - field_dict["last_checked_at"] = last_checked_at - if provider is not UNSET: - field_dict["provider"] = provider - if regressing is not UNSET: - field_dict["regressing"] = regressing - if verified is not UNSET: - field_dict["verified"] = verified - if verified_at is not UNSET: - field_dict["verified_at"] = verified_at - if zone_apex is not UNSET: - field_dict["zone_apex"] = zone_apex - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.dns_provider_response import DnsProviderResponse - from ..models.dns_record_response import DnsRecordResponse - - d = dict(src_dict) - domain = d.pop("domain") - - id = UUID(d.pop("id")) - - is_primary = d.pop("is_primary") - - kind = d.pop("kind") - - status = d.pop("status") - - delegated = d.pop("delegated", UNSET) - - _dns_records = d.pop("dns_records", UNSET) - dns_records: list[DnsRecordResponse] | Unset = UNSET - if _dns_records is not UNSET: - dns_records = [] - for dns_records_item_data in _dns_records: - dns_records_item = DnsRecordResponse.from_dict(dns_records_item_data) - - dns_records.append(dns_records_item) - - def _parse_error_message(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error_message = _parse_error_message(d.pop("error_message", UNSET)) - - def _parse_last_checked_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() - last_checked_at_type_0 = isoparse(data) - - return last_checked_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - last_checked_at = _parse_last_checked_at(d.pop("last_checked_at", UNSET)) - - def _parse_provider(data: object) -> DnsProviderResponse | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - provider_type_0 = DnsProviderResponse.from_dict(data) - - return provider_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DnsProviderResponse | None | Unset, data) - - provider = _parse_provider(d.pop("provider", UNSET)) - - regressing = d.pop("regressing", UNSET) - - verified = d.pop("verified", UNSET) - - def _parse_verified_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() - verified_at_type_0 = isoparse(data) - - return verified_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - verified_at = _parse_verified_at(d.pop("verified_at", UNSET)) - - zone_apex = d.pop("zone_apex", UNSET) - - email_domain_response = cls( - domain=domain, - id=id, - is_primary=is_primary, - kind=kind, - status=status, - delegated=delegated, - dns_records=dns_records, - error_message=error_message, - last_checked_at=last_checked_at, - provider=provider, - regressing=regressing, - verified=verified, - verified_at=verified_at, - zone_apex=zone_apex, - ) - - email_domain_response.additional_properties = d - return email_domain_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/seclai/_generated/models/email_domains_list_response.py b/seclai/_generated/models/email_domains_list_response.py deleted file mode 100644 index 2f1a8d6..0000000 --- a/seclai/_generated/models/email_domains_list_response.py +++ /dev/null @@ -1,137 +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.email_domain_response import EmailDomainResponse - - -T = TypeVar("T", bound="EmailDomainsListResponse") - - -@_attrs_define -class EmailDomainsListResponse: - """ - Attributes: - can_add_custom (bool | Unset): Default: False. - can_add_vanity (bool | Unset): Default: False. - custom_plan_names (list[str] | Unset): - domains (list[EmailDomainResponse] | Unset): - has_custom (bool | Unset): Default: False. - has_vanity (bool | Unset): Default: False. - vanity_plan_names (list[str] | Unset): - """ - - can_add_custom: bool | Unset = False - can_add_vanity: bool | Unset = False - custom_plan_names: list[str] | Unset = UNSET - domains: list[EmailDomainResponse] | Unset = UNSET - has_custom: bool | Unset = False - has_vanity: bool | Unset = False - vanity_plan_names: list[str] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - can_add_custom = self.can_add_custom - - can_add_vanity = self.can_add_vanity - - custom_plan_names: list[str] | Unset = UNSET - if not isinstance(self.custom_plan_names, Unset): - custom_plan_names = self.custom_plan_names - - domains: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.domains, Unset): - domains = [] - for domains_item_data in self.domains: - domains_item = domains_item_data.to_dict() - domains.append(domains_item) - - has_custom = self.has_custom - - has_vanity = self.has_vanity - - vanity_plan_names: list[str] | Unset = UNSET - if not isinstance(self.vanity_plan_names, Unset): - vanity_plan_names = self.vanity_plan_names - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if can_add_custom is not UNSET: - field_dict["can_add_custom"] = can_add_custom - if can_add_vanity is not UNSET: - field_dict["can_add_vanity"] = can_add_vanity - if custom_plan_names is not UNSET: - field_dict["custom_plan_names"] = custom_plan_names - if domains is not UNSET: - field_dict["domains"] = domains - if has_custom is not UNSET: - field_dict["has_custom"] = has_custom - if has_vanity is not UNSET: - field_dict["has_vanity"] = has_vanity - if vanity_plan_names is not UNSET: - field_dict["vanity_plan_names"] = vanity_plan_names - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.email_domain_response import EmailDomainResponse - - d = dict(src_dict) - can_add_custom = d.pop("can_add_custom", UNSET) - - can_add_vanity = d.pop("can_add_vanity", UNSET) - - custom_plan_names = cast(list[str], d.pop("custom_plan_names", UNSET)) - - _domains = d.pop("domains", UNSET) - domains: list[EmailDomainResponse] | Unset = UNSET - if _domains is not UNSET: - domains = [] - for domains_item_data in _domains: - domains_item = EmailDomainResponse.from_dict(domains_item_data) - - domains.append(domains_item) - - has_custom = d.pop("has_custom", UNSET) - - has_vanity = d.pop("has_vanity", UNSET) - - vanity_plan_names = cast(list[str], d.pop("vanity_plan_names", UNSET)) - - email_domains_list_response = cls( - can_add_custom=can_add_custom, - can_add_vanity=can_add_vanity, - custom_plan_names=custom_plan_names, - domains=domains, - has_custom=has_custom, - has_vanity=has_vanity, - vanity_plan_names=vanity_plan_names, - ) - - email_domains_list_response.additional_properties = d - return email_domains_list_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/seclai/_generated/models/email_trigger_config_response.py b/seclai/_generated/models/email_trigger_config_response.py deleted file mode 100644 index b2996e6..0000000 --- a/seclai/_generated/models/email_trigger_config_response.py +++ /dev/null @@ -1,172 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, 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="EmailTriggerConfigResponse") - - -@_attrs_define -class EmailTriggerConfigResponse: - """An EMAIL_RECEIVED trigger's resolved address(es) and config. - - Attributes: - agent_id (UUID): - trigger_id (UUID): - trigger_type (str): - email_addresses (list[str] | Unset): - email_alias (None | str | Unset): - email_allowed_senders (list[str] | None | Unset): - email_ignore_auto_generated (bool | Unset): Default: True. - email_queue_on_quota (bool | Unset): Default: False. - email_require_sender_auth (bool | Unset): Default: True. - """ - - agent_id: UUID - trigger_id: UUID - trigger_type: str - email_addresses: list[str] | Unset = UNSET - email_alias: None | str | Unset = UNSET - email_allowed_senders: list[str] | None | Unset = UNSET - email_ignore_auto_generated: bool | Unset = True - email_queue_on_quota: bool | Unset = False - email_require_sender_auth: bool | Unset = True - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_id = str(self.agent_id) - - trigger_id = str(self.trigger_id) - - trigger_type = self.trigger_type - - email_addresses: list[str] | Unset = UNSET - if not isinstance(self.email_addresses, Unset): - email_addresses = self.email_addresses - - email_alias: None | str | Unset - if isinstance(self.email_alias, Unset): - email_alias = UNSET - else: - email_alias = self.email_alias - - email_allowed_senders: list[str] | None | Unset - if isinstance(self.email_allowed_senders, Unset): - email_allowed_senders = UNSET - elif isinstance(self.email_allowed_senders, list): - email_allowed_senders = self.email_allowed_senders - - else: - email_allowed_senders = self.email_allowed_senders - - email_ignore_auto_generated = self.email_ignore_auto_generated - - email_queue_on_quota = self.email_queue_on_quota - - email_require_sender_auth = self.email_require_sender_auth - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_id": agent_id, - "trigger_id": trigger_id, - "trigger_type": trigger_type, - } - ) - if email_addresses is not UNSET: - field_dict["email_addresses"] = email_addresses - if email_alias is not UNSET: - field_dict["email_alias"] = email_alias - if email_allowed_senders is not UNSET: - field_dict["email_allowed_senders"] = email_allowed_senders - if email_ignore_auto_generated is not UNSET: - field_dict["email_ignore_auto_generated"] = email_ignore_auto_generated - if email_queue_on_quota is not UNSET: - field_dict["email_queue_on_quota"] = email_queue_on_quota - if email_require_sender_auth is not UNSET: - field_dict["email_require_sender_auth"] = email_require_sender_auth - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_id = UUID(d.pop("agent_id")) - - trigger_id = UUID(d.pop("trigger_id")) - - trigger_type = d.pop("trigger_type") - - email_addresses = cast(list[str], d.pop("email_addresses", UNSET)) - - def _parse_email_alias(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - email_alias = _parse_email_alias(d.pop("email_alias", UNSET)) - - def _parse_email_allowed_senders(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() - email_allowed_senders_type_0 = cast(list[str], data) - - return email_allowed_senders_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - email_allowed_senders = _parse_email_allowed_senders( - d.pop("email_allowed_senders", UNSET) - ) - - email_ignore_auto_generated = d.pop("email_ignore_auto_generated", UNSET) - - email_queue_on_quota = d.pop("email_queue_on_quota", UNSET) - - email_require_sender_auth = d.pop("email_require_sender_auth", UNSET) - - email_trigger_config_response = cls( - agent_id=agent_id, - trigger_id=trigger_id, - trigger_type=trigger_type, - email_addresses=email_addresses, - email_alias=email_alias, - email_allowed_senders=email_allowed_senders, - email_ignore_auto_generated=email_ignore_auto_generated, - email_queue_on_quota=email_queue_on_quota, - email_require_sender_auth=email_require_sender_auth, - ) - - email_trigger_config_response.additional_properties = d - return email_trigger_config_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/seclai/_generated/models/estimate_export_request.py b/seclai/_generated/models/estimate_export_request.py deleted file mode 100644 index 0283300..0000000 --- a/seclai/_generated/models/estimate_export_request.py +++ /dev/null @@ -1,196 +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 dateutil.parser import isoparse - -from ..models.export_format import ExportFormat -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.estimate_export_request_metadata_filter_type_0 import ( - EstimateExportRequestMetadataFilterType0, - ) - - -T = TypeVar("T", bound="EstimateExportRequest") - - -@_attrs_define -class EstimateExportRequest: - """Parameters for estimating export size. - - Attributes: - format_ (ExportFormat): Supported export file formats. - date_from (datetime.datetime | None | Unset): Only include content created on or after this timestamp. - date_to (datetime.datetime | None | Unset): Only include content created on or before this timestamp. - metadata_filter (EstimateExportRequestMetadataFilterType0 | None | Unset): JSONB containment filter applied to - content metadata. - query_filter (None | str | Unset): Title substring filter (case-insensitive ILIKE). - """ - - format_: ExportFormat - date_from: datetime.datetime | None | Unset = UNSET - date_to: datetime.datetime | None | Unset = UNSET - metadata_filter: EstimateExportRequestMetadataFilterType0 | None | Unset = UNSET - query_filter: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.estimate_export_request_metadata_filter_type_0 import ( - EstimateExportRequestMetadataFilterType0, - ) - - format_ = self.format_.value - - date_from: None | str | Unset - if isinstance(self.date_from, Unset): - date_from = UNSET - elif isinstance(self.date_from, datetime.datetime): - date_from = self.date_from.isoformat() - else: - date_from = self.date_from - - date_to: None | str | Unset - if isinstance(self.date_to, Unset): - date_to = UNSET - elif isinstance(self.date_to, datetime.datetime): - date_to = self.date_to.isoformat() - else: - date_to = self.date_to - - metadata_filter: dict[str, Any] | None | Unset - if isinstance(self.metadata_filter, Unset): - metadata_filter = UNSET - elif isinstance(self.metadata_filter, EstimateExportRequestMetadataFilterType0): - metadata_filter = self.metadata_filter.to_dict() - else: - metadata_filter = self.metadata_filter - - query_filter: None | str | Unset - if isinstance(self.query_filter, Unset): - query_filter = UNSET - else: - query_filter = self.query_filter - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "format": format_, - } - ) - if date_from is not UNSET: - field_dict["date_from"] = date_from - if date_to is not UNSET: - field_dict["date_to"] = date_to - if metadata_filter is not UNSET: - field_dict["metadata_filter"] = metadata_filter - if query_filter is not UNSET: - field_dict["query_filter"] = query_filter - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.estimate_export_request_metadata_filter_type_0 import ( - EstimateExportRequestMetadataFilterType0, - ) - - d = dict(src_dict) - format_ = ExportFormat(d.pop("format")) - - def _parse_date_from(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() - date_from_type_0 = isoparse(data) - - return date_from_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - date_from = _parse_date_from(d.pop("date_from", UNSET)) - - def _parse_date_to(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() - date_to_type_0 = isoparse(data) - - return date_to_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - date_to = _parse_date_to(d.pop("date_to", UNSET)) - - def _parse_metadata_filter( - data: object, - ) -> EstimateExportRequestMetadataFilterType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_filter_type_0 = ( - EstimateExportRequestMetadataFilterType0.from_dict(data) - ) - - return metadata_filter_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(EstimateExportRequestMetadataFilterType0 | None | Unset, data) - - metadata_filter = _parse_metadata_filter(d.pop("metadata_filter", UNSET)) - - def _parse_query_filter(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - query_filter = _parse_query_filter(d.pop("query_filter", UNSET)) - - estimate_export_request = cls( - format_=format_, - date_from=date_from, - date_to=date_to, - metadata_filter=metadata_filter, - query_filter=query_filter, - ) - - estimate_export_request.additional_properties = d - return estimate_export_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/seclai/_generated/models/estimate_export_request_metadata_filter_type_0.py b/seclai/_generated/models/estimate_export_request_metadata_filter_type_0.py deleted file mode 100644 index 726cf8e..0000000 --- a/seclai/_generated/models/estimate_export_request_metadata_filter_type_0.py +++ /dev/null @@ -1,46 +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="EstimateExportRequestMetadataFilterType0") - - -@_attrs_define -class EstimateExportRequestMetadataFilterType0: - """ """ - - additional_properties: dict[str, Any] = _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) - estimate_export_request_metadata_filter_type_0 = cls() - - estimate_export_request_metadata_filter_type_0.additional_properties = d - return estimate_export_request_metadata_filter_type_0 - - @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/seclai/_generated/models/estimate_export_response.py b/seclai/_generated/models/estimate_export_response.py deleted file mode 100644 index 35c199e..0000000 --- a/seclai/_generated/models/estimate_export_response.py +++ /dev/null @@ -1,70 +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="EstimateExportResponse") - - -@_attrs_define -class EstimateExportResponse: - """Rough size estimate for a potential export. - - Attributes: - estimated_size_bytes (int): Estimated export file size in bytes. - source_connection_id (str): Source connection ID. - """ - - estimated_size_bytes: int - source_connection_id: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - estimated_size_bytes = self.estimated_size_bytes - - source_connection_id = self.source_connection_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "estimated_size_bytes": estimated_size_bytes, - "source_connection_id": source_connection_id, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - estimated_size_bytes = d.pop("estimated_size_bytes") - - source_connection_id = d.pop("source_connection_id") - - estimate_export_response = cls( - estimated_size_bytes=estimated_size_bytes, - source_connection_id=source_connection_id, - ) - - estimate_export_response.additional_properties = d - return estimate_export_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/seclai/_generated/models/evaluation_criteria_response.py b/seclai/_generated/models/evaluation_criteria_response.py deleted file mode 100644 index ca56eee..0000000 --- a/seclai/_generated/models/evaluation_criteria_response.py +++ /dev/null @@ -1,253 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.evaluation_criteria_response_expectation_config_type_0 import ( - EvaluationCriteriaResponseExpectationConfigType0, - ) - from ..models.evaluation_criteria_response_result_summary import ( - EvaluationCriteriaResponseResultSummary, - ) - - -T = TypeVar("T", bound="EvaluationCriteriaResponse") - - -@_attrs_define -class EvaluationCriteriaResponse: - """Response schema for evaluation criteria. - - Attributes: - account_id (UUID): - agent_id (UUID): - created_at (str): - description (None | str): - enabled (bool): - evaluation_mode (str): Runtime behavior mode. output_expectation (manual validation), eval_and_retry (every run - + retry), sample_and_flag (sampled monitoring). - evaluation_prompt (None | str): - evaluation_tier (None | str): - expectation_config (EvaluationCriteriaResponseExpectationConfigType0 | None): - id (UUID): - max_retries (int): - pass_threshold (float): Score cutoff for pass/fail, inclusive (0.0 to 1.0). - result_summary (EvaluationCriteriaResponseResultSummary): - retry_on_failure (bool): - step_id (None | str): - updated_at (str): - """ - - account_id: UUID - agent_id: UUID - created_at: str - description: None | str - enabled: bool - evaluation_mode: str - evaluation_prompt: None | str - evaluation_tier: None | str - expectation_config: EvaluationCriteriaResponseExpectationConfigType0 | None - id: UUID - max_retries: int - pass_threshold: float - result_summary: EvaluationCriteriaResponseResultSummary - retry_on_failure: bool - step_id: None | str - updated_at: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.evaluation_criteria_response_expectation_config_type_0 import ( - EvaluationCriteriaResponseExpectationConfigType0, - ) - - account_id = str(self.account_id) - - agent_id = str(self.agent_id) - - created_at = self.created_at - - description: None | str - description = self.description - - enabled = self.enabled - - evaluation_mode = self.evaluation_mode - - evaluation_prompt: None | str - evaluation_prompt = self.evaluation_prompt - - evaluation_tier: None | str - evaluation_tier = self.evaluation_tier - - expectation_config: dict[str, Any] | None - if isinstance( - self.expectation_config, EvaluationCriteriaResponseExpectationConfigType0 - ): - expectation_config = self.expectation_config.to_dict() - else: - expectation_config = self.expectation_config - - id = str(self.id) - - max_retries = self.max_retries - - pass_threshold = self.pass_threshold - - result_summary = self.result_summary.to_dict() - - retry_on_failure = self.retry_on_failure - - step_id: None | str - step_id = self.step_id - - updated_at = self.updated_at - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_id": account_id, - "agent_id": agent_id, - "created_at": created_at, - "description": description, - "enabled": enabled, - "evaluation_mode": evaluation_mode, - "evaluation_prompt": evaluation_prompt, - "evaluation_tier": evaluation_tier, - "expectation_config": expectation_config, - "id": id, - "max_retries": max_retries, - "pass_threshold": pass_threshold, - "result_summary": result_summary, - "retry_on_failure": retry_on_failure, - "step_id": step_id, - "updated_at": updated_at, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.evaluation_criteria_response_expectation_config_type_0 import ( - EvaluationCriteriaResponseExpectationConfigType0, - ) - from ..models.evaluation_criteria_response_result_summary import ( - EvaluationCriteriaResponseResultSummary, - ) - - d = dict(src_dict) - account_id = UUID(d.pop("account_id")) - - agent_id = UUID(d.pop("agent_id")) - - created_at = d.pop("created_at") - - def _parse_description(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - description = _parse_description(d.pop("description")) - - enabled = d.pop("enabled") - - evaluation_mode = d.pop("evaluation_mode") - - def _parse_evaluation_prompt(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - evaluation_prompt = _parse_evaluation_prompt(d.pop("evaluation_prompt")) - - def _parse_evaluation_tier(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - evaluation_tier = _parse_evaluation_tier(d.pop("evaluation_tier")) - - def _parse_expectation_config( - data: object, - ) -> EvaluationCriteriaResponseExpectationConfigType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - expectation_config_type_0 = ( - EvaluationCriteriaResponseExpectationConfigType0.from_dict(data) - ) - - return expectation_config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(EvaluationCriteriaResponseExpectationConfigType0 | None, data) - - expectation_config = _parse_expectation_config(d.pop("expectation_config")) - - id = UUID(d.pop("id")) - - max_retries = d.pop("max_retries") - - pass_threshold = d.pop("pass_threshold") - - result_summary = EvaluationCriteriaResponseResultSummary.from_dict( - d.pop("result_summary") - ) - - retry_on_failure = d.pop("retry_on_failure") - - def _parse_step_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - step_id = _parse_step_id(d.pop("step_id")) - - updated_at = d.pop("updated_at") - - evaluation_criteria_response = cls( - account_id=account_id, - agent_id=agent_id, - created_at=created_at, - description=description, - enabled=enabled, - evaluation_mode=evaluation_mode, - evaluation_prompt=evaluation_prompt, - evaluation_tier=evaluation_tier, - expectation_config=expectation_config, - id=id, - max_retries=max_retries, - pass_threshold=pass_threshold, - result_summary=result_summary, - retry_on_failure=retry_on_failure, - step_id=step_id, - updated_at=updated_at, - ) - - evaluation_criteria_response.additional_properties = d - return evaluation_criteria_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/seclai/_generated/models/evaluation_criteria_response_expectation_config_type_0.py b/seclai/_generated/models/evaluation_criteria_response_expectation_config_type_0.py deleted file mode 100644 index 7c16940..0000000 --- a/seclai/_generated/models/evaluation_criteria_response_expectation_config_type_0.py +++ /dev/null @@ -1,46 +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="EvaluationCriteriaResponseExpectationConfigType0") - - -@_attrs_define -class EvaluationCriteriaResponseExpectationConfigType0: - """ """ - - additional_properties: dict[str, Any] = _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) - evaluation_criteria_response_expectation_config_type_0 = cls() - - evaluation_criteria_response_expectation_config_type_0.additional_properties = d - return evaluation_criteria_response_expectation_config_type_0 - - @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/seclai/_generated/models/evaluation_criteria_response_result_summary.py b/seclai/_generated/models/evaluation_criteria_response_result_summary.py deleted file mode 100644 index 1ad881c..0000000 --- a/seclai/_generated/models/evaluation_criteria_response_result_summary.py +++ /dev/null @@ -1,46 +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="EvaluationCriteriaResponseResultSummary") - - -@_attrs_define -class EvaluationCriteriaResponseResultSummary: - """ """ - - additional_properties: dict[str, int] = _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) - evaluation_criteria_response_result_summary = cls() - - evaluation_criteria_response_result_summary.additional_properties = d - return evaluation_criteria_response_result_summary - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> int: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: int) -> 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/seclai/_generated/models/evaluation_result_list_response.py b/seclai/_generated/models/evaluation_result_list_response.py deleted file mode 100644 index 8dff281..0000000 --- a/seclai/_generated/models/evaluation_result_list_response.py +++ /dev/null @@ -1,100 +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.evaluation_result_response import EvaluationResultResponse - - -T = TypeVar("T", bound="EvaluationResultListResponse") - - -@_attrs_define -class EvaluationResultListResponse: - """Paginated list of evaluation results. - - Attributes: - data (list[EvaluationResultResponse]): - limit (int): - page (int): - total (int): - """ - - data: list[EvaluationResultResponse] - limit: int - page: int - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - limit = self.limit - - page = self.page - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "limit": limit, - "page": page, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.evaluation_result_response import EvaluationResultResponse - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = EvaluationResultResponse.from_dict(data_item_data) - - data.append(data_item) - - limit = d.pop("limit") - - page = d.pop("page") - - total = d.pop("total") - - evaluation_result_list_response = cls( - data=data, - limit=limit, - page=page, - total=total, - ) - - evaluation_result_list_response.additional_properties = d - return evaluation_result_list_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/seclai/_generated/models/evaluation_result_response.py b/seclai/_generated/models/evaluation_result_response.py deleted file mode 100644 index fc9e029..0000000 --- a/seclai/_generated/models/evaluation_result_response.py +++ /dev/null @@ -1,221 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.evaluation_result_response_details_type_0 import ( - EvaluationResultResponseDetailsType0, - ) - - -T = TypeVar("T", bound="EvaluationResultResponse") - - -@_attrs_define -class EvaluationResultResponse: - """Response schema for a single evaluation result. - - Attributes: - agent_run_id (UUID): - agent_step_run_id (None | UUID): - created_at (str): - criteria_id (UUID): - evaluated_at (str): - flagged (bool): True when the result was flagged for human review. - id (UUID): - retry_count (int): - retry_triggered (bool): - status (str): Outcome status: pending, passed, failed, skipped, or error. - details (EvaluationResultResponseDetailsType0 | None | Unset): Evaluation details including explanation and raw - LLM response. - score (float | None | Unset): LLM-assigned quality score between 0.0 (worst) and 1.0 (best). - """ - - agent_run_id: UUID - agent_step_run_id: None | UUID - created_at: str - criteria_id: UUID - evaluated_at: str - flagged: bool - id: UUID - retry_count: int - retry_triggered: bool - status: str - details: EvaluationResultResponseDetailsType0 | None | Unset = UNSET - score: float | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.evaluation_result_response_details_type_0 import ( - EvaluationResultResponseDetailsType0, - ) - - agent_run_id = str(self.agent_run_id) - - agent_step_run_id: None | str - if isinstance(self.agent_step_run_id, UUID): - agent_step_run_id = str(self.agent_step_run_id) - else: - agent_step_run_id = self.agent_step_run_id - - created_at = self.created_at - - criteria_id = str(self.criteria_id) - - evaluated_at = self.evaluated_at - - flagged = self.flagged - - id = str(self.id) - - retry_count = self.retry_count - - retry_triggered = self.retry_triggered - - status = self.status - - details: dict[str, Any] | None | Unset - if isinstance(self.details, Unset): - details = UNSET - elif isinstance(self.details, EvaluationResultResponseDetailsType0): - details = self.details.to_dict() - else: - details = self.details - - score: float | None | Unset - if isinstance(self.score, Unset): - score = UNSET - else: - score = self.score - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_run_id": agent_run_id, - "agent_step_run_id": agent_step_run_id, - "created_at": created_at, - "criteria_id": criteria_id, - "evaluated_at": evaluated_at, - "flagged": flagged, - "id": id, - "retry_count": retry_count, - "retry_triggered": retry_triggered, - "status": status, - } - ) - if details is not UNSET: - field_dict["details"] = details - if score is not UNSET: - field_dict["score"] = score - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.evaluation_result_response_details_type_0 import ( - EvaluationResultResponseDetailsType0, - ) - - d = dict(src_dict) - agent_run_id = UUID(d.pop("agent_run_id")) - - def _parse_agent_step_run_id(data: object) -> None | UUID: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - agent_step_run_id_type_0 = UUID(data) - - return agent_step_run_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UUID, data) - - agent_step_run_id = _parse_agent_step_run_id(d.pop("agent_step_run_id")) - - created_at = d.pop("created_at") - - criteria_id = UUID(d.pop("criteria_id")) - - evaluated_at = d.pop("evaluated_at") - - flagged = d.pop("flagged") - - id = UUID(d.pop("id")) - - retry_count = d.pop("retry_count") - - retry_triggered = d.pop("retry_triggered") - - status = d.pop("status") - - def _parse_details( - data: object, - ) -> EvaluationResultResponseDetailsType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - details_type_0 = EvaluationResultResponseDetailsType0.from_dict(data) - - return details_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(EvaluationResultResponseDetailsType0 | None | Unset, data) - - details = _parse_details(d.pop("details", UNSET)) - - def _parse_score(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - score = _parse_score(d.pop("score", UNSET)) - - evaluation_result_response = cls( - agent_run_id=agent_run_id, - agent_step_run_id=agent_step_run_id, - created_at=created_at, - criteria_id=criteria_id, - evaluated_at=evaluated_at, - flagged=flagged, - id=id, - retry_count=retry_count, - retry_triggered=retry_triggered, - status=status, - details=details, - score=score, - ) - - evaluation_result_response.additional_properties = d - return evaluation_result_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/seclai/_generated/models/evaluation_result_response_details_type_0.py b/seclai/_generated/models/evaluation_result_response_details_type_0.py deleted file mode 100644 index b44abc0..0000000 --- a/seclai/_generated/models/evaluation_result_response_details_type_0.py +++ /dev/null @@ -1,46 +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="EvaluationResultResponseDetailsType0") - - -@_attrs_define -class EvaluationResultResponseDetailsType0: - """ """ - - additional_properties: dict[str, Any] = _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) - evaluation_result_response_details_type_0 = cls() - - evaluation_result_response_details_type_0.additional_properties = d - return evaluation_result_response_details_type_0 - - @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/seclai/_generated/models/evaluation_result_summary_response.py b/seclai/_generated/models/evaluation_result_summary_response.py deleted file mode 100644 index da5ef4e..0000000 --- a/seclai/_generated/models/evaluation_result_summary_response.py +++ /dev/null @@ -1,116 +0,0 @@ -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="EvaluationResultSummaryResponse") - - -@_attrs_define -class EvaluationResultSummaryResponse: - """Aggregated pass/fail/error counts and average score for a criteria. - - Attributes: - error (int): - failed (int): - flagged (int): - passed (int): - total (int): - average_score (float | None | Unset): Mean score across all evaluated results, or null if none. - """ - - error: int - failed: int - flagged: int - passed: int - total: int - average_score: float | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - error = self.error - - failed = self.failed - - flagged = self.flagged - - passed = self.passed - - total = self.total - - average_score: float | None | Unset - if isinstance(self.average_score, Unset): - average_score = UNSET - else: - average_score = self.average_score - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "error": error, - "failed": failed, - "flagged": flagged, - "passed": passed, - "total": total, - } - ) - if average_score is not UNSET: - field_dict["average_score"] = average_score - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - error = d.pop("error") - - failed = d.pop("failed") - - flagged = d.pop("flagged") - - passed = d.pop("passed") - - total = d.pop("total") - - def _parse_average_score(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - average_score = _parse_average_score(d.pop("average_score", UNSET)) - - evaluation_result_summary_response = cls( - error=error, - failed=failed, - flagged=flagged, - passed=passed, - total=total, - average_score=average_score, - ) - - evaluation_result_summary_response.additional_properties = d - return evaluation_result_summary_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/seclai/_generated/models/evaluation_result_with_criteria_list_response.py b/seclai/_generated/models/evaluation_result_with_criteria_list_response.py deleted file mode 100644 index dd9c896..0000000 --- a/seclai/_generated/models/evaluation_result_with_criteria_list_response.py +++ /dev/null @@ -1,104 +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.evaluation_result_with_criteria_response import ( - EvaluationResultWithCriteriaResponse, - ) - - -T = TypeVar("T", bound="EvaluationResultWithCriteriaListResponse") - - -@_attrs_define -class EvaluationResultWithCriteriaListResponse: - """Paginated list of evaluation results with criteria context. - - Attributes: - data (list[EvaluationResultWithCriteriaResponse]): - limit (int): - page (int): - total (int): - """ - - data: list[EvaluationResultWithCriteriaResponse] - limit: int - page: int - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - limit = self.limit - - page = self.page - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "limit": limit, - "page": page, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.evaluation_result_with_criteria_response import ( - EvaluationResultWithCriteriaResponse, - ) - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = EvaluationResultWithCriteriaResponse.from_dict(data_item_data) - - data.append(data_item) - - limit = d.pop("limit") - - page = d.pop("page") - - total = d.pop("total") - - evaluation_result_with_criteria_list_response = cls( - data=data, - limit=limit, - page=page, - total=total, - ) - - evaluation_result_with_criteria_list_response.additional_properties = d - return evaluation_result_with_criteria_list_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/seclai/_generated/models/evaluation_result_with_criteria_response.py b/seclai/_generated/models/evaluation_result_with_criteria_response.py deleted file mode 100644 index 0f3ce13..0000000 --- a/seclai/_generated/models/evaluation_result_with_criteria_response.py +++ /dev/null @@ -1,255 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.evaluation_result_with_criteria_response_details_type_0 import ( - EvaluationResultWithCriteriaResponseDetailsType0, - ) - - -T = TypeVar("T", bound="EvaluationResultWithCriteriaResponse") - - -@_attrs_define -class EvaluationResultWithCriteriaResponse: - """Evaluation result including criteria context for aggregated listing. - - Attributes: - agent_run_id (UUID): - agent_step_run_id (None | UUID): - created_at (str): - criteria_description (None | str): - criteria_id (UUID): - evaluated_at (str): - flagged (bool): True when the result was flagged for human review. - id (UUID): - retry_count (int): - retry_triggered (bool): - status (str): Outcome status: pending, passed, failed, skipped, or error. - step_id (None | str): - details (EvaluationResultWithCriteriaResponseDetailsType0 | None | Unset): Evaluation details including - explanation and raw LLM response. - score (float | None | Unset): LLM-assigned quality score between 0.0 (worst) and 1.0 (best). - """ - - agent_run_id: UUID - agent_step_run_id: None | UUID - created_at: str - criteria_description: None | str - criteria_id: UUID - evaluated_at: str - flagged: bool - id: UUID - retry_count: int - retry_triggered: bool - status: str - step_id: None | str - details: EvaluationResultWithCriteriaResponseDetailsType0 | None | Unset = UNSET - score: float | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.evaluation_result_with_criteria_response_details_type_0 import ( - EvaluationResultWithCriteriaResponseDetailsType0, - ) - - agent_run_id = str(self.agent_run_id) - - agent_step_run_id: None | str - if isinstance(self.agent_step_run_id, UUID): - agent_step_run_id = str(self.agent_step_run_id) - else: - agent_step_run_id = self.agent_step_run_id - - created_at = self.created_at - - criteria_description: None | str - criteria_description = self.criteria_description - - criteria_id = str(self.criteria_id) - - evaluated_at = self.evaluated_at - - flagged = self.flagged - - id = str(self.id) - - retry_count = self.retry_count - - retry_triggered = self.retry_triggered - - status = self.status - - step_id: None | str - step_id = self.step_id - - details: dict[str, Any] | None | Unset - if isinstance(self.details, Unset): - details = UNSET - elif isinstance(self.details, EvaluationResultWithCriteriaResponseDetailsType0): - details = self.details.to_dict() - else: - details = self.details - - score: float | None | Unset - if isinstance(self.score, Unset): - score = UNSET - else: - score = self.score - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_run_id": agent_run_id, - "agent_step_run_id": agent_step_run_id, - "created_at": created_at, - "criteria_description": criteria_description, - "criteria_id": criteria_id, - "evaluated_at": evaluated_at, - "flagged": flagged, - "id": id, - "retry_count": retry_count, - "retry_triggered": retry_triggered, - "status": status, - "step_id": step_id, - } - ) - if details is not UNSET: - field_dict["details"] = details - if score is not UNSET: - field_dict["score"] = score - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.evaluation_result_with_criteria_response_details_type_0 import ( - EvaluationResultWithCriteriaResponseDetailsType0, - ) - - d = dict(src_dict) - agent_run_id = UUID(d.pop("agent_run_id")) - - def _parse_agent_step_run_id(data: object) -> None | UUID: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - agent_step_run_id_type_0 = UUID(data) - - return agent_step_run_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UUID, data) - - agent_step_run_id = _parse_agent_step_run_id(d.pop("agent_step_run_id")) - - created_at = d.pop("created_at") - - def _parse_criteria_description(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - criteria_description = _parse_criteria_description( - d.pop("criteria_description") - ) - - criteria_id = UUID(d.pop("criteria_id")) - - evaluated_at = d.pop("evaluated_at") - - flagged = d.pop("flagged") - - id = UUID(d.pop("id")) - - retry_count = d.pop("retry_count") - - retry_triggered = d.pop("retry_triggered") - - status = d.pop("status") - - def _parse_step_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - step_id = _parse_step_id(d.pop("step_id")) - - def _parse_details( - data: object, - ) -> EvaluationResultWithCriteriaResponseDetailsType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - details_type_0 = ( - EvaluationResultWithCriteriaResponseDetailsType0.from_dict(data) - ) - - return details_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - EvaluationResultWithCriteriaResponseDetailsType0 | None | Unset, data - ) - - details = _parse_details(d.pop("details", UNSET)) - - def _parse_score(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - score = _parse_score(d.pop("score", UNSET)) - - evaluation_result_with_criteria_response = cls( - agent_run_id=agent_run_id, - agent_step_run_id=agent_step_run_id, - created_at=created_at, - criteria_description=criteria_description, - criteria_id=criteria_id, - evaluated_at=evaluated_at, - flagged=flagged, - id=id, - retry_count=retry_count, - retry_triggered=retry_triggered, - status=status, - step_id=step_id, - details=details, - score=score, - ) - - evaluation_result_with_criteria_response.additional_properties = d - return evaluation_result_with_criteria_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/seclai/_generated/models/evaluation_result_with_criteria_response_details_type_0.py b/seclai/_generated/models/evaluation_result_with_criteria_response_details_type_0.py deleted file mode 100644 index c5a5e1c..0000000 --- a/seclai/_generated/models/evaluation_result_with_criteria_response_details_type_0.py +++ /dev/null @@ -1,48 +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="EvaluationResultWithCriteriaResponseDetailsType0") - - -@_attrs_define -class EvaluationResultWithCriteriaResponseDetailsType0: - """ """ - - additional_properties: dict[str, Any] = _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) - evaluation_result_with_criteria_response_details_type_0 = cls() - - evaluation_result_with_criteria_response_details_type_0.additional_properties = ( - d - ) - return evaluation_result_with_criteria_response_details_type_0 - - @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/seclai/_generated/models/evaluation_run_summary_list_response.py b/seclai/_generated/models/evaluation_run_summary_list_response.py deleted file mode 100644 index 6eef1fe..0000000 --- a/seclai/_generated/models/evaluation_run_summary_list_response.py +++ /dev/null @@ -1,102 +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.evaluation_run_summary_response import EvaluationRunSummaryResponse - - -T = TypeVar("T", bound="EvaluationRunSummaryListResponse") - - -@_attrs_define -class EvaluationRunSummaryListResponse: - """Paginated list of per-run evaluation summaries. - - Attributes: - data (list[EvaluationRunSummaryResponse]): - limit (int): - page (int): - total (int): - """ - - data: list[EvaluationRunSummaryResponse] - limit: int - page: int - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - limit = self.limit - - page = self.page - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "limit": limit, - "page": page, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.evaluation_run_summary_response import ( - EvaluationRunSummaryResponse, - ) - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = EvaluationRunSummaryResponse.from_dict(data_item_data) - - data.append(data_item) - - limit = d.pop("limit") - - page = d.pop("page") - - total = d.pop("total") - - evaluation_run_summary_list_response = cls( - data=data, - limit=limit, - page=page, - total=total, - ) - - evaluation_run_summary_list_response.additional_properties = d - return evaluation_run_summary_list_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/seclai/_generated/models/evaluation_run_summary_response.py b/seclai/_generated/models/evaluation_run_summary_response.py deleted file mode 100644 index f8f3163..0000000 --- a/seclai/_generated/models/evaluation_run_summary_response.py +++ /dev/null @@ -1,127 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="EvaluationRunSummaryResponse") - - -@_attrs_define -class EvaluationRunSummaryResponse: - """Per-run evaluation summary with pass/fail/error breakdown. - - Attributes: - agent_run_id (UUID): - error_count (int): - failed_count (int): - flagged_count (int): - passed_count (int): - run_created_at (str): - run_status (str): Status of the agent run (processing, completed, failed). - skipped_count (int): - total_evaluations (int): - """ - - agent_run_id: UUID - error_count: int - failed_count: int - flagged_count: int - passed_count: int - run_created_at: str - run_status: str - skipped_count: int - total_evaluations: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_run_id = str(self.agent_run_id) - - error_count = self.error_count - - failed_count = self.failed_count - - flagged_count = self.flagged_count - - passed_count = self.passed_count - - run_created_at = self.run_created_at - - run_status = self.run_status - - skipped_count = self.skipped_count - - total_evaluations = self.total_evaluations - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_run_id": agent_run_id, - "error_count": error_count, - "failed_count": failed_count, - "flagged_count": flagged_count, - "passed_count": passed_count, - "run_created_at": run_created_at, - "run_status": run_status, - "skipped_count": skipped_count, - "total_evaluations": total_evaluations, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_run_id = UUID(d.pop("agent_run_id")) - - error_count = d.pop("error_count") - - failed_count = d.pop("failed_count") - - flagged_count = d.pop("flagged_count") - - passed_count = d.pop("passed_count") - - run_created_at = d.pop("run_created_at") - - run_status = d.pop("run_status") - - skipped_count = d.pop("skipped_count") - - total_evaluations = d.pop("total_evaluations") - - evaluation_run_summary_response = cls( - agent_run_id=agent_run_id, - error_count=error_count, - failed_count=failed_count, - flagged_count=flagged_count, - passed_count=passed_count, - run_created_at=run_created_at, - run_status=run_status, - skipped_count=skipped_count, - total_evaluations=total_evaluations, - ) - - evaluation_run_summary_response.additional_properties = d - return evaluation_run_summary_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/seclai/_generated/models/evaluation_status.py b/seclai/_generated/models/evaluation_status.py deleted file mode 100644 index 39a9c8c..0000000 --- a/seclai/_generated/models/evaluation_status.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class EvaluationStatus(str, Enum): - ERROR = "error" - FAILED = "failed" - PASSED = "passed" - PENDING = "pending" - SKIPPED = "skipped" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/models/example_prompt.py b/seclai/_generated/models/example_prompt.py deleted file mode 100644 index 2923aea..0000000 --- a/seclai/_generated/models/example_prompt.py +++ /dev/null @@ -1,46 +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="ExamplePrompt") - - -@_attrs_define -class ExamplePrompt: - """ """ - - 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) - example_prompt = cls() - - example_prompt.additional_properties = d - return example_prompt - - @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/seclai/_generated/models/executed_action_response.py b/seclai/_generated/models/executed_action_response.py deleted file mode 100644 index 5feb976..0000000 --- a/seclai/_generated/models/executed_action_response.py +++ /dev/null @@ -1,151 +0,0 @@ -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="ExecutedActionResponse") - - -@_attrs_define -class ExecutedActionResponse: - """A single executed action result. - - Attributes: - action_type (str): Type of the executed action. - description (str): Human-readable description. - error (None | str | Unset): Error message if failed. - needs_clarification (bool | Unset): True when the action paused for a clarifying question rather than failing. - The created resource is kept and the question is in ``description``/``error``. Default: False. - resource_id (None | str | Unset): ID of the affected resource. - resource_type (None | str | Unset): Type of the affected resource. - success (bool | Unset): Whether the action succeeded. Default: True. - """ - - action_type: str - description: str - error: None | str | Unset = UNSET - needs_clarification: bool | Unset = False - resource_id: None | str | Unset = UNSET - resource_type: None | str | Unset = UNSET - success: bool | Unset = True - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - action_type = self.action_type - - description = self.description - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - needs_clarification = self.needs_clarification - - resource_id: None | str | Unset - if isinstance(self.resource_id, Unset): - resource_id = UNSET - else: - resource_id = self.resource_id - - resource_type: None | str | Unset - if isinstance(self.resource_type, Unset): - resource_type = UNSET - else: - resource_type = self.resource_type - - success = self.success - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "action_type": action_type, - "description": description, - } - ) - if error is not UNSET: - field_dict["error"] = error - if needs_clarification is not UNSET: - field_dict["needs_clarification"] = needs_clarification - if resource_id is not UNSET: - field_dict["resource_id"] = resource_id - if resource_type is not UNSET: - field_dict["resource_type"] = resource_type - if success is not UNSET: - field_dict["success"] = success - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - action_type = d.pop("action_type") - - description = d.pop("description") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - needs_clarification = d.pop("needs_clarification", UNSET) - - def _parse_resource_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - resource_id = _parse_resource_id(d.pop("resource_id", UNSET)) - - def _parse_resource_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - resource_type = _parse_resource_type(d.pop("resource_type", UNSET)) - - success = d.pop("success", UNSET) - - executed_action_response = cls( - action_type=action_type, - description=description, - error=error, - needs_clarification=needs_clarification, - resource_id=resource_id, - resource_type=resource_type, - success=success, - ) - - executed_action_response.additional_properties = d - return executed_action_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/seclai/_generated/models/experiment_detail_response.py b/seclai/_generated/models/experiment_detail_response.py deleted file mode 100644 index 61004e5..0000000 --- a/seclai/_generated/models/experiment_detail_response.py +++ /dev/null @@ -1,297 +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 - -if TYPE_CHECKING: - from ..models.experiment_detail_response_result_data_type_0 import ( - ExperimentDetailResponseResultDataType0, - ) - - -T = TypeVar("T", bound="ExperimentDetailResponse") - - -@_attrs_define -class ExperimentDetailResponse: - """ - Attributes: - completed_at (None | str): - created_at (str): - error_message (None | str): - evaluation_complexity (str): - evaluation_mode (str): - evaluator_model_id (None | str): - id (str): - include_step_output_in_evaluation (bool): - json_template (None | str): - progress_current (int | None): - progress_message (None | str): - progress_total (int | None): - prompt (str): - result_data (ExperimentDetailResponseResultDataType0 | None): - selected_model_ids (list[str]): - selected_step_output (None | str): - started_at (None | str): - status (str): - system_prompt (str): - """ - - completed_at: None | str - created_at: str - error_message: None | str - evaluation_complexity: str - evaluation_mode: str - evaluator_model_id: None | str - id: str - include_step_output_in_evaluation: bool - json_template: None | str - progress_current: int | None - progress_message: None | str - progress_total: int | None - prompt: str - result_data: ExperimentDetailResponseResultDataType0 | None - selected_model_ids: list[str] - selected_step_output: None | str - started_at: None | str - status: str - system_prompt: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.experiment_detail_response_result_data_type_0 import ( - ExperimentDetailResponseResultDataType0, - ) - - completed_at: None | str - completed_at = self.completed_at - - created_at = self.created_at - - error_message: None | str - error_message = self.error_message - - evaluation_complexity = self.evaluation_complexity - - evaluation_mode = self.evaluation_mode - - evaluator_model_id: None | str - evaluator_model_id = self.evaluator_model_id - - id = self.id - - include_step_output_in_evaluation = self.include_step_output_in_evaluation - - json_template: None | str - json_template = self.json_template - - progress_current: int | None - progress_current = self.progress_current - - progress_message: None | str - progress_message = self.progress_message - - progress_total: int | None - progress_total = self.progress_total - - prompt = self.prompt - - result_data: dict[str, Any] | None - if isinstance(self.result_data, ExperimentDetailResponseResultDataType0): - result_data = self.result_data.to_dict() - else: - result_data = self.result_data - - selected_model_ids = self.selected_model_ids - - selected_step_output: None | str - selected_step_output = self.selected_step_output - - started_at: None | str - started_at = self.started_at - - status = self.status - - system_prompt = self.system_prompt - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "completed_at": completed_at, - "created_at": created_at, - "error_message": error_message, - "evaluation_complexity": evaluation_complexity, - "evaluation_mode": evaluation_mode, - "evaluator_model_id": evaluator_model_id, - "id": id, - "include_step_output_in_evaluation": include_step_output_in_evaluation, - "json_template": json_template, - "progress_current": progress_current, - "progress_message": progress_message, - "progress_total": progress_total, - "prompt": prompt, - "result_data": result_data, - "selected_model_ids": selected_model_ids, - "selected_step_output": selected_step_output, - "started_at": started_at, - "status": status, - "system_prompt": system_prompt, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.experiment_detail_response_result_data_type_0 import ( - ExperimentDetailResponseResultDataType0, - ) - - d = dict(src_dict) - - def _parse_completed_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - completed_at = _parse_completed_at(d.pop("completed_at")) - - created_at = d.pop("created_at") - - def _parse_error_message(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - error_message = _parse_error_message(d.pop("error_message")) - - evaluation_complexity = d.pop("evaluation_complexity") - - evaluation_mode = d.pop("evaluation_mode") - - def _parse_evaluator_model_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - evaluator_model_id = _parse_evaluator_model_id(d.pop("evaluator_model_id")) - - id = d.pop("id") - - include_step_output_in_evaluation = d.pop("include_step_output_in_evaluation") - - def _parse_json_template(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - json_template = _parse_json_template(d.pop("json_template")) - - def _parse_progress_current(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - progress_current = _parse_progress_current(d.pop("progress_current")) - - def _parse_progress_message(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - progress_message = _parse_progress_message(d.pop("progress_message")) - - def _parse_progress_total(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - progress_total = _parse_progress_total(d.pop("progress_total")) - - prompt = d.pop("prompt") - - def _parse_result_data( - data: object, - ) -> ExperimentDetailResponseResultDataType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - result_data_type_0 = ExperimentDetailResponseResultDataType0.from_dict( - data - ) - - return result_data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(ExperimentDetailResponseResultDataType0 | None, data) - - result_data = _parse_result_data(d.pop("result_data")) - - selected_model_ids = cast(list[str], d.pop("selected_model_ids")) - - def _parse_selected_step_output(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - selected_step_output = _parse_selected_step_output( - d.pop("selected_step_output") - ) - - def _parse_started_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - started_at = _parse_started_at(d.pop("started_at")) - - status = d.pop("status") - - system_prompt = d.pop("system_prompt") - - experiment_detail_response = cls( - completed_at=completed_at, - created_at=created_at, - error_message=error_message, - evaluation_complexity=evaluation_complexity, - evaluation_mode=evaluation_mode, - evaluator_model_id=evaluator_model_id, - id=id, - include_step_output_in_evaluation=include_step_output_in_evaluation, - json_template=json_template, - progress_current=progress_current, - progress_message=progress_message, - progress_total=progress_total, - prompt=prompt, - result_data=result_data, - selected_model_ids=selected_model_ids, - selected_step_output=selected_step_output, - started_at=started_at, - status=status, - system_prompt=system_prompt, - ) - - experiment_detail_response.additional_properties = d - return experiment_detail_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/seclai/_generated/models/experiment_detail_response_result_data_type_0.py b/seclai/_generated/models/experiment_detail_response_result_data_type_0.py deleted file mode 100644 index e3995c8..0000000 --- a/seclai/_generated/models/experiment_detail_response_result_data_type_0.py +++ /dev/null @@ -1,46 +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="ExperimentDetailResponseResultDataType0") - - -@_attrs_define -class ExperimentDetailResponseResultDataType0: - """ """ - - additional_properties: dict[str, Any] = _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) - experiment_detail_response_result_data_type_0 = cls() - - experiment_detail_response_result_data_type_0.additional_properties = d - return experiment_detail_response_result_data_type_0 - - @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/seclai/_generated/models/experiment_list_response.py b/seclai/_generated/models/experiment_list_response.py deleted file mode 100644 index 0eac360..0000000 --- a/seclai/_generated/models/experiment_list_response.py +++ /dev/null @@ -1,87 +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.experiment_summary_response import ExperimentSummaryResponse - - -T = TypeVar("T", bound="ExperimentListResponse") - - -@_attrs_define -class ExperimentListResponse: - """``GET /models/playground/experiments`` legacy/default shape; 2026-07-27+ - clients get the canonical ``{data, pagination}`` envelope. - - Attributes: - experiments (list[ExperimentSummaryResponse]): - total (int): - """ - - experiments: list[ExperimentSummaryResponse] - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - experiments = [] - for experiments_item_data in self.experiments: - experiments_item = experiments_item_data.to_dict() - experiments.append(experiments_item) - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "experiments": experiments, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.experiment_summary_response import ExperimentSummaryResponse - - d = dict(src_dict) - experiments = [] - _experiments = d.pop("experiments") - for experiments_item_data in _experiments: - experiments_item = ExperimentSummaryResponse.from_dict( - experiments_item_data - ) - - experiments.append(experiments_item) - - total = d.pop("total") - - experiment_list_response = cls( - experiments=experiments, - total=total, - ) - - experiment_list_response.additional_properties = d - return experiment_list_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/seclai/_generated/models/experiment_summary_response.py b/seclai/_generated/models/experiment_summary_response.py deleted file mode 100644 index bcb0661..0000000 --- a/seclai/_generated/models/experiment_summary_response.py +++ /dev/null @@ -1,101 +0,0 @@ -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 - -T = TypeVar("T", bound="ExperimentSummaryResponse") - - -@_attrs_define -class ExperimentSummaryResponse: - """ - Attributes: - created_at (str): - evaluation_complexity (str): - evaluation_mode (str): - id (str): - selected_model_ids (list[str]): - status (str): - """ - - created_at: str - evaluation_complexity: str - evaluation_mode: str - id: str - selected_model_ids: list[str] - status: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at - - evaluation_complexity = self.evaluation_complexity - - evaluation_mode = self.evaluation_mode - - id = self.id - - selected_model_ids = self.selected_model_ids - - status = self.status - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "created_at": created_at, - "evaluation_complexity": evaluation_complexity, - "evaluation_mode": evaluation_mode, - "id": id, - "selected_model_ids": selected_model_ids, - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created_at = d.pop("created_at") - - evaluation_complexity = d.pop("evaluation_complexity") - - evaluation_mode = d.pop("evaluation_mode") - - id = d.pop("id") - - selected_model_ids = cast(list[str], d.pop("selected_model_ids")) - - status = d.pop("status") - - experiment_summary_response = cls( - created_at=created_at, - evaluation_complexity=evaluation_complexity, - evaluation_mode=evaluation_mode, - id=id, - selected_model_ids=selected_model_ids, - status=status, - ) - - experiment_summary_response.additional_properties = d - return experiment_summary_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/seclai/_generated/models/export_format.py b/seclai/_generated/models/export_format.py deleted file mode 100644 index b19f1bb..0000000 --- a/seclai/_generated/models/export_format.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class ExportFormat(str, Enum): - CSV = "csv" - JSONL = "jsonl" - PARQUET = "parquet" - ZIP = "zip" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/models/export_list_response.py b/seclai/_generated/models/export_list_response.py deleted file mode 100644 index d9f0788..0000000 --- a/seclai/_generated/models/export_list_response.py +++ /dev/null @@ -1,76 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="ExportListResponse") - - -@_attrs_define -class ExportListResponse: - """Paginated list of export jobs. - - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - export_list_response = cls( - data=data, - pagination=pagination, - ) - - export_list_response.additional_properties = d - return export_list_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/seclai/_generated/models/export_response.py b/seclai/_generated/models/export_response.py deleted file mode 100644 index fa0a4c1..0000000 --- a/seclai/_generated/models/export_response.py +++ /dev/null @@ -1,474 +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.export_response_metadata_filter_type_0 import ( - ExportResponseMetadataFilterType0, - ) - - -T = TypeVar("T", bound="ExportResponse") - - -@_attrs_define -class ExportResponse: - """Status and metadata for a content source export job. - - Attributes: - account_id (str): Owning account ID. - created_at (str): Creation time. - destination (str): Storage destination. - format_ (str): Output format. - id (str): Export job ID. - source_connection_id (str): Source connection ID. - status (str): Job status. - updated_at (str): Last update time. - completed_at (None | str | Unset): Completion time. - date_from (None | str | Unset): Date-from filter applied to this export. - date_to (None | str | Unset): Date-to filter applied to this export. - error (None | str | Unset): Error message if failed. - estimated_size_bytes (int | None | Unset): Pre-run size estimate. - expires_at (None | str | Unset): Download expiry time. - file_size_bytes (int | None | Unset): File size in bytes. - item_count (int | None | Unset): Items exported. - metadata_filter (ExportResponseMetadataFilterType0 | None | Unset): Metadata filter applied to this export. - progress_current (int | None | Unset): Items processed so far. - progress_total (int | None | Unset): Total items to process. - query_filter (None | str | Unset): Query filter applied to this export. - requested_by_user_id (None | str | Unset): ID of the user who requested this export. - requested_by_user_name (None | str | Unset): Name of the user who requested this export. - started_at (None | str | Unset): Processing start time. - storage_key (None | str | Unset): S3 key of exported file. - """ - - account_id: str - created_at: str - destination: str - format_: str - id: str - source_connection_id: str - status: str - updated_at: str - completed_at: None | str | Unset = UNSET - date_from: None | str | Unset = UNSET - date_to: None | str | Unset = UNSET - error: None | str | Unset = UNSET - estimated_size_bytes: int | None | Unset = UNSET - expires_at: None | str | Unset = UNSET - file_size_bytes: int | None | Unset = UNSET - item_count: int | None | Unset = UNSET - metadata_filter: ExportResponseMetadataFilterType0 | None | Unset = UNSET - progress_current: int | None | Unset = UNSET - progress_total: int | None | Unset = UNSET - query_filter: None | str | Unset = UNSET - requested_by_user_id: None | str | Unset = UNSET - requested_by_user_name: None | str | Unset = UNSET - started_at: None | str | Unset = UNSET - storage_key: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.export_response_metadata_filter_type_0 import ( - ExportResponseMetadataFilterType0, - ) - - account_id = self.account_id - - created_at = self.created_at - - destination = self.destination - - format_ = self.format_ - - id = self.id - - source_connection_id = self.source_connection_id - - status = self.status - - updated_at = self.updated_at - - completed_at: None | str | Unset - if isinstance(self.completed_at, Unset): - completed_at = UNSET - else: - completed_at = self.completed_at - - date_from: None | str | Unset - if isinstance(self.date_from, Unset): - date_from = UNSET - else: - date_from = self.date_from - - date_to: None | str | Unset - if isinstance(self.date_to, Unset): - date_to = UNSET - else: - date_to = self.date_to - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - estimated_size_bytes: int | None | Unset - if isinstance(self.estimated_size_bytes, Unset): - estimated_size_bytes = UNSET - else: - estimated_size_bytes = self.estimated_size_bytes - - expires_at: None | str | Unset - if isinstance(self.expires_at, Unset): - expires_at = UNSET - else: - expires_at = self.expires_at - - file_size_bytes: int | None | Unset - if isinstance(self.file_size_bytes, Unset): - file_size_bytes = UNSET - else: - file_size_bytes = self.file_size_bytes - - item_count: int | None | Unset - if isinstance(self.item_count, Unset): - item_count = UNSET - else: - item_count = self.item_count - - metadata_filter: dict[str, Any] | None | Unset - if isinstance(self.metadata_filter, Unset): - metadata_filter = UNSET - elif isinstance(self.metadata_filter, ExportResponseMetadataFilterType0): - metadata_filter = self.metadata_filter.to_dict() - else: - metadata_filter = self.metadata_filter - - progress_current: int | None | Unset - if isinstance(self.progress_current, Unset): - progress_current = UNSET - else: - progress_current = self.progress_current - - progress_total: int | None | Unset - if isinstance(self.progress_total, Unset): - progress_total = UNSET - else: - progress_total = self.progress_total - - query_filter: None | str | Unset - if isinstance(self.query_filter, Unset): - query_filter = UNSET - else: - query_filter = self.query_filter - - requested_by_user_id: None | str | Unset - if isinstance(self.requested_by_user_id, Unset): - requested_by_user_id = UNSET - else: - requested_by_user_id = self.requested_by_user_id - - requested_by_user_name: None | str | Unset - if isinstance(self.requested_by_user_name, Unset): - requested_by_user_name = UNSET - else: - requested_by_user_name = self.requested_by_user_name - - started_at: None | str | Unset - if isinstance(self.started_at, Unset): - started_at = UNSET - else: - started_at = self.started_at - - storage_key: None | str | Unset - if isinstance(self.storage_key, Unset): - storage_key = UNSET - else: - storage_key = self.storage_key - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_id": account_id, - "created_at": created_at, - "destination": destination, - "format": format_, - "id": id, - "source_connection_id": source_connection_id, - "status": status, - "updated_at": updated_at, - } - ) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if date_from is not UNSET: - field_dict["date_from"] = date_from - if date_to is not UNSET: - field_dict["date_to"] = date_to - if error is not UNSET: - field_dict["error"] = error - if estimated_size_bytes is not UNSET: - field_dict["estimated_size_bytes"] = estimated_size_bytes - if expires_at is not UNSET: - field_dict["expires_at"] = expires_at - if file_size_bytes is not UNSET: - field_dict["file_size_bytes"] = file_size_bytes - if item_count is not UNSET: - field_dict["item_count"] = item_count - if metadata_filter is not UNSET: - field_dict["metadata_filter"] = metadata_filter - if progress_current is not UNSET: - field_dict["progress_current"] = progress_current - if progress_total is not UNSET: - field_dict["progress_total"] = progress_total - if query_filter is not UNSET: - field_dict["query_filter"] = query_filter - if requested_by_user_id is not UNSET: - field_dict["requested_by_user_id"] = requested_by_user_id - if requested_by_user_name is not UNSET: - field_dict["requested_by_user_name"] = requested_by_user_name - if started_at is not UNSET: - field_dict["started_at"] = started_at - if storage_key is not UNSET: - field_dict["storage_key"] = storage_key - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.export_response_metadata_filter_type_0 import ( - ExportResponseMetadataFilterType0, - ) - - d = dict(src_dict) - account_id = d.pop("account_id") - - created_at = d.pop("created_at") - - destination = d.pop("destination") - - format_ = d.pop("format") - - id = d.pop("id") - - source_connection_id = d.pop("source_connection_id") - - status = d.pop("status") - - updated_at = d.pop("updated_at") - - def _parse_completed_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) - - def _parse_date_from(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - date_from = _parse_date_from(d.pop("date_from", UNSET)) - - def _parse_date_to(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - date_to = _parse_date_to(d.pop("date_to", UNSET)) - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_estimated_size_bytes(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - estimated_size_bytes = _parse_estimated_size_bytes( - d.pop("estimated_size_bytes", UNSET) - ) - - def _parse_expires_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) - - def _parse_file_size_bytes(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - file_size_bytes = _parse_file_size_bytes(d.pop("file_size_bytes", UNSET)) - - def _parse_item_count(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - item_count = _parse_item_count(d.pop("item_count", UNSET)) - - def _parse_metadata_filter( - data: object, - ) -> ExportResponseMetadataFilterType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_filter_type_0 = ExportResponseMetadataFilterType0.from_dict( - data - ) - - return metadata_filter_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(ExportResponseMetadataFilterType0 | None | Unset, data) - - metadata_filter = _parse_metadata_filter(d.pop("metadata_filter", UNSET)) - - def _parse_progress_current(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - progress_current = _parse_progress_current(d.pop("progress_current", UNSET)) - - def _parse_progress_total(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - progress_total = _parse_progress_total(d.pop("progress_total", UNSET)) - - def _parse_query_filter(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - query_filter = _parse_query_filter(d.pop("query_filter", UNSET)) - - def _parse_requested_by_user_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - requested_by_user_id = _parse_requested_by_user_id( - d.pop("requested_by_user_id", UNSET) - ) - - def _parse_requested_by_user_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - requested_by_user_name = _parse_requested_by_user_name( - d.pop("requested_by_user_name", UNSET) - ) - - def _parse_started_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - started_at = _parse_started_at(d.pop("started_at", UNSET)) - - def _parse_storage_key(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - storage_key = _parse_storage_key(d.pop("storage_key", UNSET)) - - export_response = cls( - account_id=account_id, - created_at=created_at, - destination=destination, - format_=format_, - id=id, - source_connection_id=source_connection_id, - status=status, - updated_at=updated_at, - completed_at=completed_at, - date_from=date_from, - date_to=date_to, - error=error, - estimated_size_bytes=estimated_size_bytes, - expires_at=expires_at, - file_size_bytes=file_size_bytes, - item_count=item_count, - metadata_filter=metadata_filter, - progress_current=progress_current, - progress_total=progress_total, - query_filter=query_filter, - requested_by_user_id=requested_by_user_id, - requested_by_user_name=requested_by_user_name, - started_at=started_at, - storage_key=storage_key, - ) - - export_response.additional_properties = d - return export_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/seclai/_generated/models/export_response_metadata_filter_type_0.py b/seclai/_generated/models/export_response_metadata_filter_type_0.py deleted file mode 100644 index a12d8a7..0000000 --- a/seclai/_generated/models/export_response_metadata_filter_type_0.py +++ /dev/null @@ -1,46 +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="ExportResponseMetadataFilterType0") - - -@_attrs_define -class ExportResponseMetadataFilterType0: - """ """ - - additional_properties: dict[str, Any] = _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) - export_response_metadata_filter_type_0 = cls() - - export_response_metadata_filter_type_0.additional_properties = d - return export_response_metadata_filter_type_0 - - @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/seclai/_generated/models/file_upload_response.py b/seclai/_generated/models/file_upload_response.py deleted file mode 100644 index 3d58165..0000000 --- a/seclai/_generated/models/file_upload_response.py +++ /dev/null @@ -1,103 +0,0 @@ -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 - -T = TypeVar("T", bound="FileUploadResponse") - - -@_attrs_define -class FileUploadResponse: - """Response model for content file replacement upload. - - Attributes: - content_version_id (None | str): ID of the content version being replaced - filename (str): Original filename - source_connection_content_version_id (None | str): ID of the source connection content version - status (str): Processing status - """ - - content_version_id: None | str - filename: str - source_connection_content_version_id: None | str - status: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - content_version_id: None | str - content_version_id = self.content_version_id - - filename = self.filename - - source_connection_content_version_id: None | str - source_connection_content_version_id = self.source_connection_content_version_id - - status = self.status - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "content_version_id": content_version_id, - "filename": filename, - "source_connection_content_version_id": source_connection_content_version_id, - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_content_version_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - content_version_id = _parse_content_version_id(d.pop("content_version_id")) - - filename = d.pop("filename") - - def _parse_source_connection_content_version_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - source_connection_content_version_id = ( - _parse_source_connection_content_version_id( - d.pop("source_connection_content_version_id") - ) - ) - - status = d.pop("status") - - file_upload_response = cls( - content_version_id=content_version_id, - filename=filename, - source_connection_content_version_id=source_connection_content_version_id, - status=status, - ) - - file_upload_response.additional_properties = d - return file_upload_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/seclai/_generated/models/generate_agent_steps_request.py b/seclai/_generated/models/generate_agent_steps_request.py deleted file mode 100644 index 7302739..0000000 --- a/seclai/_generated/models/generate_agent_steps_request.py +++ /dev/null @@ -1,173 +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.generate_agent_steps_request_agent_steps_type_0_item import ( - GenerateAgentStepsRequestAgentStepsType0Item, - ) - - -T = TypeVar("T", bound="GenerateAgentStepsRequest") - - -@_attrs_define -class GenerateAgentStepsRequest: - """ - Attributes: - user_input (str): Natural language description of the desired agent workflow. - agent_description (None | str | Unset): Agent description for additional AI context. - agent_steps (list[GenerateAgentStepsRequestAgentStepsType0Item] | None | Unset): Current agent step hierarchy - for context when modifying. - mode (str | Unset): 'generate_full' to create from scratch, 'modify_workflow' to refine. Default: - 'generate_full'. - trigger_type (None | str | Unset): Agent trigger type for context (e.g. 'dynamic_input', 'content_added'). - """ - - user_input: str - agent_description: None | str | Unset = UNSET - agent_steps: list[GenerateAgentStepsRequestAgentStepsType0Item] | None | Unset = ( - UNSET - ) - mode: str | Unset = "generate_full" - trigger_type: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - user_input = self.user_input - - agent_description: None | str | Unset - if isinstance(self.agent_description, Unset): - agent_description = UNSET - else: - agent_description = self.agent_description - - agent_steps: list[dict[str, Any]] | None | Unset - if isinstance(self.agent_steps, Unset): - agent_steps = UNSET - elif isinstance(self.agent_steps, list): - agent_steps = [] - for agent_steps_type_0_item_data in self.agent_steps: - agent_steps_type_0_item = agent_steps_type_0_item_data.to_dict() - agent_steps.append(agent_steps_type_0_item) - - else: - agent_steps = self.agent_steps - - mode = self.mode - - trigger_type: None | str | Unset - if isinstance(self.trigger_type, Unset): - trigger_type = UNSET - else: - trigger_type = self.trigger_type - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "user_input": user_input, - } - ) - if agent_description is not UNSET: - field_dict["agent_description"] = agent_description - if agent_steps is not UNSET: - field_dict["agent_steps"] = agent_steps - if mode is not UNSET: - field_dict["mode"] = mode - if trigger_type is not UNSET: - field_dict["trigger_type"] = trigger_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.generate_agent_steps_request_agent_steps_type_0_item import ( - GenerateAgentStepsRequestAgentStepsType0Item, - ) - - d = dict(src_dict) - user_input = d.pop("user_input") - - def _parse_agent_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_description = _parse_agent_description(d.pop("agent_description", UNSET)) - - def _parse_agent_steps( - data: object, - ) -> list[GenerateAgentStepsRequestAgentStepsType0Item] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - agent_steps_type_0 = [] - _agent_steps_type_0 = data - for agent_steps_type_0_item_data in _agent_steps_type_0: - agent_steps_type_0_item = ( - GenerateAgentStepsRequestAgentStepsType0Item.from_dict( - agent_steps_type_0_item_data - ) - ) - - agent_steps_type_0.append(agent_steps_type_0_item) - - return agent_steps_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - list[GenerateAgentStepsRequestAgentStepsType0Item] | None | Unset, data - ) - - agent_steps = _parse_agent_steps(d.pop("agent_steps", UNSET)) - - mode = d.pop("mode", UNSET) - - def _parse_trigger_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trigger_type = _parse_trigger_type(d.pop("trigger_type", UNSET)) - - generate_agent_steps_request = cls( - user_input=user_input, - agent_description=agent_description, - agent_steps=agent_steps, - mode=mode, - trigger_type=trigger_type, - ) - - generate_agent_steps_request.additional_properties = d - return generate_agent_steps_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/seclai/_generated/models/generate_agent_steps_request_agent_steps_type_0_item.py b/seclai/_generated/models/generate_agent_steps_request_agent_steps_type_0_item.py deleted file mode 100644 index d33fe96..0000000 --- a/seclai/_generated/models/generate_agent_steps_request_agent_steps_type_0_item.py +++ /dev/null @@ -1,46 +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="GenerateAgentStepsRequestAgentStepsType0Item") - - -@_attrs_define -class GenerateAgentStepsRequestAgentStepsType0Item: - """ """ - - additional_properties: dict[str, Any] = _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) - generate_agent_steps_request_agent_steps_type_0_item = cls() - - generate_agent_steps_request_agent_steps_type_0_item.additional_properties = d - return generate_agent_steps_request_agent_steps_type_0_item - - @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/seclai/_generated/models/generate_agent_steps_response.py b/seclai/_generated/models/generate_agent_steps_response.py deleted file mode 100644 index 3989e73..0000000 --- a/seclai/_generated/models/generate_agent_steps_response.py +++ /dev/null @@ -1,199 +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.example_prompt import ExamplePrompt - from ..models.generate_agent_steps_response_agent_config_type_0 import ( - GenerateAgentStepsResponseAgentConfigType0, - ) - from ..models.generate_agent_steps_response_steps_item import ( - GenerateAgentStepsResponseStepsItem, - ) - - -T = TypeVar("T", bound="GenerateAgentStepsResponse") - - -@_attrs_define -class GenerateAgentStepsResponse: - """ - Attributes: - conversation_id (str): Conversation turn ID for tracking. - note (str): AI explanation of the proposed workflow. - steps (list[GenerateAgentStepsResponseStepsItem]): Generated agent steps. - success (bool): Whether steps were successfully generated. - agent_config (GenerateAgentStepsResponseAgentConfigType0 | None | Unset): Suggested agent-level configuration, - if any. - example_prompts (list[ExamplePrompt] | Unset): Example natural-language prompts that demonstrate the - capabilities of this AI assistant for the given mode. - intent_assessment (None | str | Unset): How the assistant interpreted the request: 'clear' when steps were - generated, or an ask-path value (e.g. 'ambiguous_output', 'cannot_build') when it returned no steps and put a - clarifying question or blocker in `note`. Mirrors the MCP surface so callers can distinguish a clarification - pause from a hard failure. - """ - - conversation_id: str - note: str - steps: list[GenerateAgentStepsResponseStepsItem] - success: bool - agent_config: GenerateAgentStepsResponseAgentConfigType0 | None | Unset = UNSET - example_prompts: list[ExamplePrompt] | Unset = UNSET - intent_assessment: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.generate_agent_steps_response_agent_config_type_0 import ( - GenerateAgentStepsResponseAgentConfigType0, - ) - - conversation_id = self.conversation_id - - note = self.note - - steps = [] - for steps_item_data in self.steps: - steps_item = steps_item_data.to_dict() - steps.append(steps_item) - - success = self.success - - agent_config: dict[str, Any] | None | Unset - if isinstance(self.agent_config, Unset): - agent_config = UNSET - elif isinstance(self.agent_config, GenerateAgentStepsResponseAgentConfigType0): - agent_config = self.agent_config.to_dict() - else: - agent_config = self.agent_config - - example_prompts: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.example_prompts, Unset): - example_prompts = [] - for example_prompts_item_data in self.example_prompts: - example_prompts_item = example_prompts_item_data.to_dict() - example_prompts.append(example_prompts_item) - - intent_assessment: None | str | Unset - if isinstance(self.intent_assessment, Unset): - intent_assessment = UNSET - else: - intent_assessment = self.intent_assessment - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "conversation_id": conversation_id, - "note": note, - "steps": steps, - "success": success, - } - ) - if agent_config is not UNSET: - field_dict["agent_config"] = agent_config - if example_prompts is not UNSET: - field_dict["example_prompts"] = example_prompts - if intent_assessment is not UNSET: - field_dict["intent_assessment"] = intent_assessment - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.example_prompt import ExamplePrompt - from ..models.generate_agent_steps_response_agent_config_type_0 import ( - GenerateAgentStepsResponseAgentConfigType0, - ) - from ..models.generate_agent_steps_response_steps_item import ( - GenerateAgentStepsResponseStepsItem, - ) - - d = dict(src_dict) - conversation_id = d.pop("conversation_id") - - note = d.pop("note") - - steps = [] - _steps = d.pop("steps") - for steps_item_data in _steps: - steps_item = GenerateAgentStepsResponseStepsItem.from_dict(steps_item_data) - - steps.append(steps_item) - - success = d.pop("success") - - def _parse_agent_config( - data: object, - ) -> GenerateAgentStepsResponseAgentConfigType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - agent_config_type_0 = ( - GenerateAgentStepsResponseAgentConfigType0.from_dict(data) - ) - - return agent_config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(GenerateAgentStepsResponseAgentConfigType0 | None | Unset, data) - - agent_config = _parse_agent_config(d.pop("agent_config", UNSET)) - - _example_prompts = d.pop("example_prompts", UNSET) - example_prompts: list[ExamplePrompt] | Unset = UNSET - if _example_prompts is not UNSET: - example_prompts = [] - for example_prompts_item_data in _example_prompts: - example_prompts_item = ExamplePrompt.from_dict( - example_prompts_item_data - ) - - example_prompts.append(example_prompts_item) - - def _parse_intent_assessment(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - intent_assessment = _parse_intent_assessment(d.pop("intent_assessment", UNSET)) - - generate_agent_steps_response = cls( - conversation_id=conversation_id, - note=note, - steps=steps, - success=success, - agent_config=agent_config, - example_prompts=example_prompts, - intent_assessment=intent_assessment, - ) - - generate_agent_steps_response.additional_properties = d - return generate_agent_steps_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/seclai/_generated/models/generate_agent_steps_response_agent_config_type_0.py b/seclai/_generated/models/generate_agent_steps_response_agent_config_type_0.py deleted file mode 100644 index bfea7a5..0000000 --- a/seclai/_generated/models/generate_agent_steps_response_agent_config_type_0.py +++ /dev/null @@ -1,46 +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="GenerateAgentStepsResponseAgentConfigType0") - - -@_attrs_define -class GenerateAgentStepsResponseAgentConfigType0: - """ """ - - additional_properties: dict[str, Any] = _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) - generate_agent_steps_response_agent_config_type_0 = cls() - - generate_agent_steps_response_agent_config_type_0.additional_properties = d - return generate_agent_steps_response_agent_config_type_0 - - @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/seclai/_generated/models/generate_agent_steps_response_steps_item.py b/seclai/_generated/models/generate_agent_steps_response_steps_item.py deleted file mode 100644 index cfcb2ae..0000000 --- a/seclai/_generated/models/generate_agent_steps_response_steps_item.py +++ /dev/null @@ -1,46 +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="GenerateAgentStepsResponseStepsItem") - - -@_attrs_define -class GenerateAgentStepsResponseStepsItem: - """ """ - - additional_properties: dict[str, Any] = _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) - generate_agent_steps_response_steps_item = cls() - - generate_agent_steps_response_steps_item.additional_properties = d - return generate_agent_steps_response_steps_item - - @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/seclai/_generated/models/generate_step_config_request.py b/seclai/_generated/models/generate_step_config_request.py deleted file mode 100644 index fed5801..0000000 --- a/seclai/_generated/models/generate_step_config_request.py +++ /dev/null @@ -1,201 +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.generate_step_config_request_agent_steps_type_0_item import ( - GenerateStepConfigRequestAgentStepsType0Item, - ) - from ..models.generate_step_config_request_current_config_type_0 import ( - GenerateStepConfigRequestCurrentConfigType0, - ) - - -T = TypeVar("T", bound="GenerateStepConfigRequest") - - -@_attrs_define -class GenerateStepConfigRequest: - """ - Attributes: - step_type (str): The step type to generate config for (e.g. 'regex_replace', 'gate', 'text', 'prompt_call', - 'retrieval'). - user_input (str): Natural language description of what the step should do. - agent_steps (list[GenerateStepConfigRequestAgentStepsType0Item] | None | Unset): Current agent step hierarchy - for context. - current_config (GenerateStepConfigRequestCurrentConfigType0 | None | Unset): Current step configuration to - refine, if any. - step_id (None | str | Unset): ID of the specific step to refine. Omit for new steps. - """ - - step_type: str - user_input: str - agent_steps: list[GenerateStepConfigRequestAgentStepsType0Item] | None | Unset = ( - UNSET - ) - current_config: GenerateStepConfigRequestCurrentConfigType0 | None | Unset = UNSET - step_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.generate_step_config_request_current_config_type_0 import ( - GenerateStepConfigRequestCurrentConfigType0, - ) - - step_type = self.step_type - - user_input = self.user_input - - agent_steps: list[dict[str, Any]] | None | Unset - if isinstance(self.agent_steps, Unset): - agent_steps = UNSET - elif isinstance(self.agent_steps, list): - agent_steps = [] - for agent_steps_type_0_item_data in self.agent_steps: - agent_steps_type_0_item = agent_steps_type_0_item_data.to_dict() - agent_steps.append(agent_steps_type_0_item) - - else: - agent_steps = self.agent_steps - - current_config: dict[str, Any] | None | Unset - if isinstance(self.current_config, Unset): - current_config = UNSET - elif isinstance( - self.current_config, GenerateStepConfigRequestCurrentConfigType0 - ): - current_config = self.current_config.to_dict() - else: - current_config = self.current_config - - step_id: None | str | Unset - if isinstance(self.step_id, Unset): - step_id = UNSET - else: - step_id = self.step_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "step_type": step_type, - "user_input": user_input, - } - ) - if agent_steps is not UNSET: - field_dict["agent_steps"] = agent_steps - if current_config is not UNSET: - field_dict["current_config"] = current_config - if step_id is not UNSET: - field_dict["step_id"] = step_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.generate_step_config_request_agent_steps_type_0_item import ( - GenerateStepConfigRequestAgentStepsType0Item, - ) - from ..models.generate_step_config_request_current_config_type_0 import ( - GenerateStepConfigRequestCurrentConfigType0, - ) - - d = dict(src_dict) - step_type = d.pop("step_type") - - user_input = d.pop("user_input") - - def _parse_agent_steps( - data: object, - ) -> list[GenerateStepConfigRequestAgentStepsType0Item] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - agent_steps_type_0 = [] - _agent_steps_type_0 = data - for agent_steps_type_0_item_data in _agent_steps_type_0: - agent_steps_type_0_item = ( - GenerateStepConfigRequestAgentStepsType0Item.from_dict( - agent_steps_type_0_item_data - ) - ) - - agent_steps_type_0.append(agent_steps_type_0_item) - - return agent_steps_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - list[GenerateStepConfigRequestAgentStepsType0Item] | None | Unset, data - ) - - agent_steps = _parse_agent_steps(d.pop("agent_steps", UNSET)) - - def _parse_current_config( - data: object, - ) -> GenerateStepConfigRequestCurrentConfigType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - current_config_type_0 = ( - GenerateStepConfigRequestCurrentConfigType0.from_dict(data) - ) - - return current_config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - GenerateStepConfigRequestCurrentConfigType0 | None | Unset, data - ) - - current_config = _parse_current_config(d.pop("current_config", UNSET)) - - def _parse_step_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - step_id = _parse_step_id(d.pop("step_id", UNSET)) - - generate_step_config_request = cls( - step_type=step_type, - user_input=user_input, - agent_steps=agent_steps, - current_config=current_config, - step_id=step_id, - ) - - generate_step_config_request.additional_properties = d - return generate_step_config_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/seclai/_generated/models/generate_step_config_request_agent_steps_type_0_item.py b/seclai/_generated/models/generate_step_config_request_agent_steps_type_0_item.py deleted file mode 100644 index e0878d6..0000000 --- a/seclai/_generated/models/generate_step_config_request_agent_steps_type_0_item.py +++ /dev/null @@ -1,46 +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="GenerateStepConfigRequestAgentStepsType0Item") - - -@_attrs_define -class GenerateStepConfigRequestAgentStepsType0Item: - """ """ - - additional_properties: dict[str, Any] = _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) - generate_step_config_request_agent_steps_type_0_item = cls() - - generate_step_config_request_agent_steps_type_0_item.additional_properties = d - return generate_step_config_request_agent_steps_type_0_item - - @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/seclai/_generated/models/generate_step_config_request_current_config_type_0.py b/seclai/_generated/models/generate_step_config_request_current_config_type_0.py deleted file mode 100644 index f01a11e..0000000 --- a/seclai/_generated/models/generate_step_config_request_current_config_type_0.py +++ /dev/null @@ -1,46 +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="GenerateStepConfigRequestCurrentConfigType0") - - -@_attrs_define -class GenerateStepConfigRequestCurrentConfigType0: - """ """ - - additional_properties: dict[str, Any] = _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) - generate_step_config_request_current_config_type_0 = cls() - - generate_step_config_request_current_config_type_0.additional_properties = d - return generate_step_config_request_current_config_type_0 - - @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/seclai/_generated/models/generate_step_config_response.py b/seclai/_generated/models/generate_step_config_response.py deleted file mode 100644 index 8459ef5..0000000 --- a/seclai/_generated/models/generate_step_config_response.py +++ /dev/null @@ -1,168 +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.example_prompt import ExamplePrompt - from ..models.generate_step_config_response_resulting_config_type_0 import ( - GenerateStepConfigResponseResultingConfigType0, - ) - - -T = TypeVar("T", bound="GenerateStepConfigResponse") - - -@_attrs_define -class GenerateStepConfigResponse: - """ - Attributes: - conversation_id (str): Conversation turn ID for tracking. - note (str): AI explanation of the proposed configuration. - step_type (str): The step type that was generated. - success (bool): Whether a valid configuration was generated. - example_prompts (list[ExamplePrompt] | Unset): Example natural-language prompts that demonstrate the - capabilities of this AI assistant for the given step type. - resulting_config (GenerateStepConfigResponseResultingConfigType0 | None | Unset): The proposed step - configuration. - """ - - conversation_id: str - note: str - step_type: str - success: bool - example_prompts: list[ExamplePrompt] | Unset = UNSET - resulting_config: GenerateStepConfigResponseResultingConfigType0 | None | Unset = ( - UNSET - ) - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.generate_step_config_response_resulting_config_type_0 import ( - GenerateStepConfigResponseResultingConfigType0, - ) - - conversation_id = self.conversation_id - - note = self.note - - step_type = self.step_type - - success = self.success - - example_prompts: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.example_prompts, Unset): - example_prompts = [] - for example_prompts_item_data in self.example_prompts: - example_prompts_item = example_prompts_item_data.to_dict() - example_prompts.append(example_prompts_item) - - resulting_config: dict[str, Any] | None | Unset - if isinstance(self.resulting_config, Unset): - resulting_config = UNSET - elif isinstance( - self.resulting_config, GenerateStepConfigResponseResultingConfigType0 - ): - resulting_config = self.resulting_config.to_dict() - else: - resulting_config = self.resulting_config - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "conversation_id": conversation_id, - "note": note, - "step_type": step_type, - "success": success, - } - ) - if example_prompts is not UNSET: - field_dict["example_prompts"] = example_prompts - if resulting_config is not UNSET: - field_dict["resulting_config"] = resulting_config - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.example_prompt import ExamplePrompt - from ..models.generate_step_config_response_resulting_config_type_0 import ( - GenerateStepConfigResponseResultingConfigType0, - ) - - d = dict(src_dict) - conversation_id = d.pop("conversation_id") - - note = d.pop("note") - - step_type = d.pop("step_type") - - success = d.pop("success") - - _example_prompts = d.pop("example_prompts", UNSET) - example_prompts: list[ExamplePrompt] | Unset = UNSET - if _example_prompts is not UNSET: - example_prompts = [] - for example_prompts_item_data in _example_prompts: - example_prompts_item = ExamplePrompt.from_dict( - example_prompts_item_data - ) - - example_prompts.append(example_prompts_item) - - def _parse_resulting_config( - data: object, - ) -> GenerateStepConfigResponseResultingConfigType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - resulting_config_type_0 = ( - GenerateStepConfigResponseResultingConfigType0.from_dict(data) - ) - - return resulting_config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - GenerateStepConfigResponseResultingConfigType0 | None | Unset, data - ) - - resulting_config = _parse_resulting_config(d.pop("resulting_config", UNSET)) - - generate_step_config_response = cls( - conversation_id=conversation_id, - note=note, - step_type=step_type, - success=success, - example_prompts=example_prompts, - resulting_config=resulting_config, - ) - - generate_step_config_response.additional_properties = d - return generate_step_config_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/seclai/_generated/models/generate_step_config_response_resulting_config_type_0.py b/seclai/_generated/models/generate_step_config_response_resulting_config_type_0.py deleted file mode 100644 index 20497e6..0000000 --- a/seclai/_generated/models/generate_step_config_response_resulting_config_type_0.py +++ /dev/null @@ -1,46 +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="GenerateStepConfigResponseResultingConfigType0") - - -@_attrs_define -class GenerateStepConfigResponseResultingConfigType0: - """ """ - - additional_properties: dict[str, Any] = _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) - generate_step_config_response_resulting_config_type_0 = cls() - - generate_step_config_response_resulting_config_type_0.additional_properties = d - return generate_step_config_response_resulting_config_type_0 - - @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/seclai/_generated/models/generation_tier_list_response.py b/seclai/_generated/models/generation_tier_list_response.py deleted file mode 100644 index b16e398..0000000 --- a/seclai/_generated/models/generation_tier_list_response.py +++ /dev/null @@ -1,77 +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.generation_tier_response import GenerationTierResponse - - -T = TypeVar("T", bound="GenerationTierListResponse") - - -@_attrs_define -class GenerationTierListResponse: - """``GET /models/generation-tiers`` legacy/default shape; 2026-07-27+ clients - get the canonical ``{data, pagination}`` envelope. - - Attributes: - tiers (list[GenerationTierResponse]): - """ - - tiers: list[GenerationTierResponse] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - tiers = [] - for tiers_item_data in self.tiers: - tiers_item = tiers_item_data.to_dict() - tiers.append(tiers_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "tiers": tiers, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.generation_tier_response import GenerationTierResponse - - d = dict(src_dict) - tiers = [] - _tiers = d.pop("tiers") - for tiers_item_data in _tiers: - tiers_item = GenerationTierResponse.from_dict(tiers_item_data) - - tiers.append(tiers_item) - - generation_tier_list_response = cls( - tiers=tiers, - ) - - generation_tier_list_response.additional_properties = d - return generation_tier_list_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/seclai/_generated/models/generation_tier_response.py b/seclai/_generated/models/generation_tier_response.py deleted file mode 100644 index 89060ea..0000000 --- a/seclai/_generated/models/generation_tier_response.py +++ /dev/null @@ -1,128 +0,0 @@ -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 - -T = TypeVar("T", bound="GenerationTierResponse") - - -@_attrs_define -class GenerationTierResponse: - """ - Attributes: - credits_per_unit (int | None): - modality (str): - model_id (str): - model_name (str): - price_label (None | str): - tier (str): - unit_label (None | str): - """ - - credits_per_unit: int | None - modality: str - model_id: str - model_name: str - price_label: None | str - tier: str - unit_label: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - credits_per_unit: int | None - credits_per_unit = self.credits_per_unit - - modality = self.modality - - model_id = self.model_id - - model_name = self.model_name - - price_label: None | str - price_label = self.price_label - - tier = self.tier - - unit_label: None | str - unit_label = self.unit_label - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "credits_per_unit": credits_per_unit, - "modality": modality, - "model_id": model_id, - "model_name": model_name, - "price_label": price_label, - "tier": tier, - "unit_label": unit_label, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_credits_per_unit(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - credits_per_unit = _parse_credits_per_unit(d.pop("credits_per_unit")) - - modality = d.pop("modality") - - model_id = d.pop("model_id") - - model_name = d.pop("model_name") - - def _parse_price_label(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - price_label = _parse_price_label(d.pop("price_label")) - - tier = d.pop("tier") - - def _parse_unit_label(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - unit_label = _parse_unit_label(d.pop("unit_label")) - - generation_tier_response = cls( - credits_per_unit=credits_per_unit, - modality=modality, - model_id=model_id, - model_name=model_name, - price_label=price_label, - tier=tier, - unit_label=unit_label, - ) - - generation_tier_response.additional_properties = d - return generation_tier_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/seclai/_generated/models/get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get_response_get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get.py b/seclai/_generated/models/get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get_response_get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get.py deleted file mode 100644 index ca17f73..0000000 --- a/seclai/_generated/models/get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get_response_get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get.py +++ /dev/null @@ -1,53 +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="GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet", -) - - -@_attrs_define -class GetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGetResponseGetMemoryBankEntryStatsApiMemoryBanksMemoryBankIdStatsGet: - """ """ - - additional_properties: dict[str, Any] = _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) - get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get_response_get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get = ( - cls() - ) - - get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get_response_get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get.additional_properties = ( - d - ) - return get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get_response_get_memory_bank_entry_stats_api_memory_banks_memory_bank_id_stats_get - - @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/seclai/_generated/models/governance_ai_accept_response.py b/seclai/_generated/models/governance_ai_accept_response.py deleted file mode 100644 index 19323d5..0000000 --- a/seclai/_generated/models/governance_ai_accept_response.py +++ /dev/null @@ -1,116 +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.applied_action_response import AppliedActionResponse - - -T = TypeVar("T", bound="GovernanceAiAcceptResponse") - - -@_attrs_define -class GovernanceAiAcceptResponse: - """Response from accepting a governance AI assistant plan. - - Attributes: - actions_applied (list[AppliedActionResponse]): Results of each action that was executed. - conversation_id (str): Conversation ID that was accepted. - success (bool): Whether all actions were applied successfully. - error (None | str | Unset): Overall error message if the plan failed, or null. - """ - - actions_applied: list[AppliedActionResponse] - conversation_id: str - success: bool - error: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - actions_applied = [] - for actions_applied_item_data in self.actions_applied: - actions_applied_item = actions_applied_item_data.to_dict() - actions_applied.append(actions_applied_item) - - conversation_id = self.conversation_id - - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "actions_applied": actions_applied, - "conversation_id": conversation_id, - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.applied_action_response import AppliedActionResponse - - d = dict(src_dict) - actions_applied = [] - _actions_applied = d.pop("actions_applied") - for actions_applied_item_data in _actions_applied: - actions_applied_item = AppliedActionResponse.from_dict( - actions_applied_item_data - ) - - actions_applied.append(actions_applied_item) - - conversation_id = d.pop("conversation_id") - - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - governance_ai_accept_response = cls( - actions_applied=actions_applied, - conversation_id=conversation_id, - success=success, - error=error, - ) - - governance_ai_accept_response.additional_properties = d - return governance_ai_accept_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/seclai/_generated/models/governance_ai_assistant_request.py b/seclai/_generated/models/governance_ai_assistant_request.py deleted file mode 100644 index 89edb06..0000000 --- a/seclai/_generated/models/governance_ai_assistant_request.py +++ /dev/null @@ -1,62 +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="GovernanceAiAssistantRequest") - - -@_attrs_define -class GovernanceAiAssistantRequest: - """Request body for the governance AI assistant. - - Attributes: - user_input (str): Natural-language request for the governance AI assistant. - """ - - user_input: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - user_input = self.user_input - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "user_input": user_input, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - user_input = d.pop("user_input") - - governance_ai_assistant_request = cls( - user_input=user_input, - ) - - governance_ai_assistant_request.additional_properties = d - return governance_ai_assistant_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/seclai/_generated/models/governance_ai_assistant_response.py b/seclai/_generated/models/governance_ai_assistant_response.py deleted file mode 100644 index 6cf38d3..0000000 --- a/seclai/_generated/models/governance_ai_assistant_response.py +++ /dev/null @@ -1,153 +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.example_prompt import ExamplePrompt - from ..models.proposed_policy_action_response import ProposedPolicyActionResponse - - -T = TypeVar("T", bound="GovernanceAiAssistantResponse") - - -@_attrs_define -class GovernanceAiAssistantResponse: - """Response from the governance AI assistant generate endpoint. - - Attributes: - conversation_id (str): Conversation ID to accept or decline this plan. - note (str): AI-generated summary of the proposed changes. - proposed_actions (list[ProposedPolicyActionResponse]): Ordered list of policy actions the AI proposes to - execute. - success (bool): Whether the plan was generated successfully. - example_prompts (list[ExamplePrompt] | Unset): Example natural-language prompts that demonstrate the - capabilities of the governance AI assistant. - prompt_call_id (None | str | Unset): Prompt call ID for credit tracking, or null. - """ - - conversation_id: str - note: str - proposed_actions: list[ProposedPolicyActionResponse] - success: bool - example_prompts: list[ExamplePrompt] | Unset = UNSET - prompt_call_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - conversation_id = self.conversation_id - - note = self.note - - proposed_actions = [] - for proposed_actions_item_data in self.proposed_actions: - proposed_actions_item = proposed_actions_item_data.to_dict() - proposed_actions.append(proposed_actions_item) - - success = self.success - - example_prompts: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.example_prompts, Unset): - example_prompts = [] - for example_prompts_item_data in self.example_prompts: - example_prompts_item = example_prompts_item_data.to_dict() - example_prompts.append(example_prompts_item) - - prompt_call_id: None | str | Unset - if isinstance(self.prompt_call_id, Unset): - prompt_call_id = UNSET - else: - prompt_call_id = self.prompt_call_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "conversation_id": conversation_id, - "note": note, - "proposed_actions": proposed_actions, - "success": success, - } - ) - if example_prompts is not UNSET: - field_dict["example_prompts"] = example_prompts - if prompt_call_id is not UNSET: - field_dict["prompt_call_id"] = prompt_call_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.example_prompt import ExamplePrompt - from ..models.proposed_policy_action_response import ( - ProposedPolicyActionResponse, - ) - - d = dict(src_dict) - conversation_id = d.pop("conversation_id") - - note = d.pop("note") - - proposed_actions = [] - _proposed_actions = d.pop("proposed_actions") - for proposed_actions_item_data in _proposed_actions: - proposed_actions_item = ProposedPolicyActionResponse.from_dict( - proposed_actions_item_data - ) - - proposed_actions.append(proposed_actions_item) - - success = d.pop("success") - - _example_prompts = d.pop("example_prompts", UNSET) - example_prompts: list[ExamplePrompt] | Unset = UNSET - if _example_prompts is not UNSET: - example_prompts = [] - for example_prompts_item_data in _example_prompts: - example_prompts_item = ExamplePrompt.from_dict( - example_prompts_item_data - ) - - example_prompts.append(example_prompts_item) - - def _parse_prompt_call_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - prompt_call_id = _parse_prompt_call_id(d.pop("prompt_call_id", UNSET)) - - governance_ai_assistant_response = cls( - conversation_id=conversation_id, - note=note, - proposed_actions=proposed_actions, - success=success, - example_prompts=example_prompts, - prompt_call_id=prompt_call_id, - ) - - governance_ai_assistant_response.additional_properties = d - return governance_ai_assistant_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/seclai/_generated/models/governance_conversation_response.py b/seclai/_generated/models/governance_conversation_response.py deleted file mode 100644 index 818faa7..0000000 --- a/seclai/_generated/models/governance_conversation_response.py +++ /dev/null @@ -1,152 +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 - -if TYPE_CHECKING: - from ..models.governance_conversation_response_proposed_actions_type_0 import ( - GovernanceConversationResponseProposedActionsType0, - ) - - -T = TypeVar("T", bound="GovernanceConversationResponse") - - -@_attrs_define -class GovernanceConversationResponse: - """A governance AI assistant conversation entry. - - Attributes: - accepted (bool | None): True if accepted, false if declined, null if pending. - ai_response (None | str): The AI assistant's response note, or null. - created_at (str): ISO 8601 creation timestamp. - id (str): Conversation ID. - proposed_actions (GovernanceConversationResponseProposedActionsType0 | None): JSON of proposed actions, or null. - user_input (str): The original user request. - """ - - accepted: bool | None - ai_response: None | str - created_at: str - id: str - proposed_actions: GovernanceConversationResponseProposedActionsType0 | None - user_input: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.governance_conversation_response_proposed_actions_type_0 import ( - GovernanceConversationResponseProposedActionsType0, - ) - - accepted: bool | None - accepted = self.accepted - - ai_response: None | str - ai_response = self.ai_response - - created_at = self.created_at - - id = self.id - - proposed_actions: dict[str, Any] | None - if isinstance( - self.proposed_actions, GovernanceConversationResponseProposedActionsType0 - ): - proposed_actions = self.proposed_actions.to_dict() - else: - proposed_actions = self.proposed_actions - - user_input = self.user_input - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "accepted": accepted, - "ai_response": ai_response, - "created_at": created_at, - "id": id, - "proposed_actions": proposed_actions, - "user_input": user_input, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.governance_conversation_response_proposed_actions_type_0 import ( - GovernanceConversationResponseProposedActionsType0, - ) - - d = dict(src_dict) - - def _parse_accepted(data: object) -> bool | None: - if data is None: - return data - return cast(bool | None, data) - - accepted = _parse_accepted(d.pop("accepted")) - - def _parse_ai_response(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - ai_response = _parse_ai_response(d.pop("ai_response")) - - created_at = d.pop("created_at") - - id = d.pop("id") - - def _parse_proposed_actions( - data: object, - ) -> GovernanceConversationResponseProposedActionsType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - proposed_actions_type_0 = ( - GovernanceConversationResponseProposedActionsType0.from_dict(data) - ) - - return proposed_actions_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(GovernanceConversationResponseProposedActionsType0 | None, data) - - proposed_actions = _parse_proposed_actions(d.pop("proposed_actions")) - - user_input = d.pop("user_input") - - governance_conversation_response = cls( - accepted=accepted, - ai_response=ai_response, - created_at=created_at, - id=id, - proposed_actions=proposed_actions, - user_input=user_input, - ) - - governance_conversation_response.additional_properties = d - return governance_conversation_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/seclai/_generated/models/governance_conversation_response_proposed_actions_type_0.py b/seclai/_generated/models/governance_conversation_response_proposed_actions_type_0.py deleted file mode 100644 index b6f23c5..0000000 --- a/seclai/_generated/models/governance_conversation_response_proposed_actions_type_0.py +++ /dev/null @@ -1,48 +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="GovernanceConversationResponseProposedActionsType0") - - -@_attrs_define -class GovernanceConversationResponseProposedActionsType0: - """ """ - - additional_properties: dict[str, Any] = _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) - governance_conversation_response_proposed_actions_type_0 = cls() - - governance_conversation_response_proposed_actions_type_0.additional_properties = ( - d - ) - return governance_conversation_response_proposed_actions_type_0 - - @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/seclai/_generated/models/governance_policy_ref_response.py b/seclai/_generated/models/governance_policy_ref_response.py deleted file mode 100644 index 6877f33..0000000 --- a/seclai/_generated/models/governance_policy_ref_response.py +++ /dev/null @@ -1,85 +0,0 @@ -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="GovernancePolicyRefResponse") - - -@_attrs_define -class GovernancePolicyRefResponse: - """Reference to a governance policy by id and name. - - Attributes: - policy_id (str): Governance policy identifier. - policy_name (None | str | Unset): Display name of the policy at evaluation time. May be null when the policy has - been deleted. - """ - - policy_id: str - policy_name: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - policy_id = self.policy_id - - policy_name: None | str | Unset - if isinstance(self.policy_name, Unset): - policy_name = UNSET - else: - policy_name = self.policy_name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "policy_id": policy_id, - } - ) - if policy_name is not UNSET: - field_dict["policy_name"] = policy_name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - policy_id = d.pop("policy_id") - - def _parse_policy_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - policy_name = _parse_policy_name(d.pop("policy_name", UNSET)) - - governance_policy_ref_response = cls( - policy_id=policy_id, - policy_name=policy_name, - ) - - governance_policy_ref_response.additional_properties = d - return governance_policy_ref_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/seclai/_generated/models/http_validation_error.py b/seclai/_generated/models/http_validation_error.py deleted file mode 100644 index 195e5a7..0000000 --- a/seclai/_generated/models/http_validation_error.py +++ /dev/null @@ -1,79 +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 - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.validation_error import ValidationError - - -T = TypeVar("T", bound="HTTPValidationError") - - -@_attrs_define -class HTTPValidationError: - """ - Attributes: - detail (list[ValidationError] | Unset): - """ - - detail: list[ValidationError] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - detail: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.detail, Unset): - detail = [] - for detail_item_data in self.detail: - detail_item = detail_item_data.to_dict() - detail.append(detail_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if detail is not UNSET: - field_dict["detail"] = detail - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.validation_error import ValidationError - - d = dict(src_dict) - _detail = d.pop("detail", UNSET) - detail: list[ValidationError] | Unset = UNSET - if _detail is not UNSET: - detail = [] - for detail_item_data in _detail: - detail_item = ValidationError.from_dict(detail_item_data) - - detail.append(detail_item) - - http_validation_error = cls( - detail=detail, - ) - - http_validation_error.additional_properties = d - return http_validation_error - - @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/seclai/_generated/models/import_field_error_model.py b/seclai/_generated/models/import_field_error_model.py deleted file mode 100644 index 4b184a0..0000000 --- a/seclai/_generated/models/import_field_error_model.py +++ /dev/null @@ -1,86 +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="ImportFieldErrorModel") - - -@_attrs_define -class ImportFieldErrorModel: - """Single agent_definition validation error with source position. - - Attributes: - column (int): 1-indexed column in `source`. - line (int): 1-indexed line in `source`. - message (str): Human-readable description of the problem. - path (str): Dotted path of the offending field, e.g. `agent.definition.child_steps[0].step_type`. - """ - - column: int - line: int - message: str - path: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - column = self.column - - line = self.line - - message = self.message - - path = self.path - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "column": column, - "line": line, - "message": message, - "path": path, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - column = d.pop("column") - - line = d.pop("line") - - message = d.pop("message") - - path = d.pop("path") - - import_field_error_model = cls( - column=column, - line=line, - message=message, - path=path, - ) - - import_field_error_model.additional_properties = d - return import_field_error_model - - @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/seclai/_generated/models/import_skip_response.py b/seclai/_generated/models/import_skip_response.py deleted file mode 100644 index 14b6230..0000000 --- a/seclai/_generated/models/import_skip_response.py +++ /dev/null @@ -1,105 +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 - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.import_skip_response_details import ImportSkipResponseDetails - - -T = TypeVar("T", bound="ImportSkipResponse") - - -@_attrs_define -class ImportSkipResponse: - """One item that was not applied during an agent import. - - Used as the element type for ``import_warnings`` on every - response model that accepts an ``agent_definition`` payload. - See ``services.agent_definition_import.AgentImportSkip`` for the - full category list. - - Lives here (not on each router) so the authenticated and public - API responses share one definition — keeping the shape that - clients (UI modal, MCP, OpenAPI consumers) depend on aligned. - - Attributes: - category (str): The kind of item that was skipped or substituted: 'schedule', 'evaluation_criteria', - 'alert_config', 'alert_recipient', 'governance_policy', 'governance_kb_link', 'solution_link'. - message (str): Human-readable explanation of what was skipped and why. - details (ImportSkipResponseDetails | Unset): Category-specific identifiers for the skipped item (step_id, - alert_type, kb_name, etc.). Stable keys per category; absent keys are simply not applicable. - """ - - category: str - message: str - details: ImportSkipResponseDetails | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - category = self.category - - message = self.message - - details: dict[str, Any] | Unset = UNSET - if not isinstance(self.details, Unset): - details = self.details.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "category": category, - "message": message, - } - ) - if details is not UNSET: - field_dict["details"] = details - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.import_skip_response_details import ImportSkipResponseDetails - - d = dict(src_dict) - category = d.pop("category") - - message = d.pop("message") - - _details = d.pop("details", UNSET) - details: ImportSkipResponseDetails | Unset - if isinstance(_details, Unset): - details = UNSET - else: - details = ImportSkipResponseDetails.from_dict(_details) - - import_skip_response = cls( - category=category, - message=message, - details=details, - ) - - import_skip_response.additional_properties = d - return import_skip_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/seclai/_generated/models/import_skip_response_details.py b/seclai/_generated/models/import_skip_response_details.py deleted file mode 100644 index 364cd8b..0000000 --- a/seclai/_generated/models/import_skip_response_details.py +++ /dev/null @@ -1,49 +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="ImportSkipResponseDetails") - - -@_attrs_define -class ImportSkipResponseDetails: - """Category-specific identifiers for the skipped item (step_id, alert_type, kb_name, etc.). Stable keys per category; - absent keys are simply not applicable. - - """ - - additional_properties: dict[str, Any] = _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) - import_skip_response_details = cls() - - import_skip_response_details.additional_properties = d - return import_skip_response_details - - @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/seclai/_generated/models/inbound_email_rejection_response.py b/seclai/_generated/models/inbound_email_rejection_response.py deleted file mode 100644 index 0cba533..0000000 --- a/seclai/_generated/models/inbound_email_rejection_response.py +++ /dev/null @@ -1,163 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="InboundEmailRejectionResponse") - - -@_attrs_define -class InboundEmailRejectionResponse: - """An inbound email that was discarded without running an agent. - - Attributes: - agent_id (None | UUID): - created_at (str): - id (UUID): - message_id (None | str): - reason (str): - recipient (str): - sender (str): - sender_ip (None | str): - subject (None | str): - """ - - agent_id: None | UUID - created_at: str - id: UUID - message_id: None | str - reason: str - recipient: str - sender: str - sender_ip: None | str - subject: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_id: None | str - if isinstance(self.agent_id, UUID): - agent_id = str(self.agent_id) - else: - agent_id = self.agent_id - - created_at = self.created_at - - id = str(self.id) - - message_id: None | str - message_id = self.message_id - - reason = self.reason - - recipient = self.recipient - - sender = self.sender - - sender_ip: None | str - sender_ip = self.sender_ip - - subject: None | str - subject = self.subject - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_id": agent_id, - "created_at": created_at, - "id": id, - "message_id": message_id, - "reason": reason, - "recipient": recipient, - "sender": sender, - "sender_ip": sender_ip, - "subject": subject, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_agent_id(data: object) -> None | UUID: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - agent_id_type_0 = UUID(data) - - return agent_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UUID, data) - - agent_id = _parse_agent_id(d.pop("agent_id")) - - created_at = d.pop("created_at") - - id = UUID(d.pop("id")) - - def _parse_message_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - message_id = _parse_message_id(d.pop("message_id")) - - reason = d.pop("reason") - - recipient = d.pop("recipient") - - sender = d.pop("sender") - - def _parse_sender_ip(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - sender_ip = _parse_sender_ip(d.pop("sender_ip")) - - def _parse_subject(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - subject = _parse_subject(d.pop("subject")) - - inbound_email_rejection_response = cls( - agent_id=agent_id, - created_at=created_at, - id=id, - message_id=message_id, - reason=reason, - recipient=recipient, - sender=sender, - sender_ip=sender_ip, - subject=subject, - ) - - inbound_email_rejection_response.additional_properties = d - return inbound_email_rejection_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/seclai/_generated/models/inbound_email_status_response.py b/seclai/_generated/models/inbound_email_status_response.py deleted file mode 100644 index 98f25df..0000000 --- a/seclai/_generated/models/inbound_email_status_response.py +++ /dev/null @@ -1,69 +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="InboundEmailStatusResponse") - - -@_attrs_define -class InboundEmailStatusResponse: - """ - Attributes: - paused (bool): - queued_backlog (int): - """ - - paused: bool - queued_backlog: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - paused = self.paused - - queued_backlog = self.queued_backlog - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "paused": paused, - "queued_backlog": queued_backlog, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - paused = d.pop("paused") - - queued_backlog = d.pop("queued_backlog") - - inbound_email_status_response = cls( - paused=paused, - queued_backlog=queued_backlog, - ) - - inbound_email_status_response.additional_properties = d - return inbound_email_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/seclai/_generated/models/inline_text_replace_request.py b/seclai/_generated/models/inline_text_replace_request.py deleted file mode 100644 index e47e25c..0000000 --- a/seclai/_generated/models/inline_text_replace_request.py +++ /dev/null @@ -1,150 +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.inline_text_replace_request_metadata_type_0 import ( - InlineTextReplaceRequestMetadataType0, - ) - - -T = TypeVar("T", bound="InlineTextReplaceRequest") - - -@_attrs_define -class InlineTextReplaceRequest: - """Request model for inline text content replacement. - - Attributes: - text (str): Text content to upload - content_type (None | str | Unset): MIME type for the text content Default: 'text/plain'. - metadata (InlineTextReplaceRequestMetadataType0 | None | Unset): Optional metadata object - title (None | str | Unset): Optional title - """ - - text: str - content_type: None | str | Unset = "text/plain" - metadata: InlineTextReplaceRequestMetadataType0 | None | Unset = UNSET - title: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.inline_text_replace_request_metadata_type_0 import ( - InlineTextReplaceRequestMetadataType0, - ) - - text = self.text - - content_type: None | str | Unset - if isinstance(self.content_type, Unset): - content_type = UNSET - else: - content_type = self.content_type - - metadata: dict[str, Any] | None | Unset - if isinstance(self.metadata, Unset): - metadata = UNSET - elif isinstance(self.metadata, InlineTextReplaceRequestMetadataType0): - metadata = self.metadata.to_dict() - else: - metadata = self.metadata - - title: None | str | Unset - if isinstance(self.title, Unset): - title = UNSET - else: - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "text": text, - } - ) - if content_type is not UNSET: - field_dict["content_type"] = content_type - if metadata is not UNSET: - field_dict["metadata"] = metadata - if title is not UNSET: - field_dict["title"] = title - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.inline_text_replace_request_metadata_type_0 import ( - InlineTextReplaceRequestMetadataType0, - ) - - d = dict(src_dict) - text = d.pop("text") - - def _parse_content_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - content_type = _parse_content_type(d.pop("content_type", UNSET)) - - def _parse_metadata( - data: object, - ) -> InlineTextReplaceRequestMetadataType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_type_0 = InlineTextReplaceRequestMetadataType0.from_dict(data) - - return metadata_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(InlineTextReplaceRequestMetadataType0 | None | Unset, data) - - metadata = _parse_metadata(d.pop("metadata", UNSET)) - - def _parse_title(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - title = _parse_title(d.pop("title", UNSET)) - - inline_text_replace_request = cls( - text=text, - content_type=content_type, - metadata=metadata, - title=title, - ) - - inline_text_replace_request.additional_properties = d - return inline_text_replace_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/seclai/_generated/models/inline_text_replace_request_metadata_type_0.py b/seclai/_generated/models/inline_text_replace_request_metadata_type_0.py deleted file mode 100644 index 927d87f..0000000 --- a/seclai/_generated/models/inline_text_replace_request_metadata_type_0.py +++ /dev/null @@ -1,46 +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="InlineTextReplaceRequestMetadataType0") - - -@_attrs_define -class InlineTextReplaceRequestMetadataType0: - """ """ - - additional_properties: dict[str, Any] = _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) - inline_text_replace_request_metadata_type_0 = cls() - - inline_text_replace_request_metadata_type_0.additional_properties = d - return inline_text_replace_request_metadata_type_0 - - @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/seclai/_generated/models/inline_text_upload_request.py b/seclai/_generated/models/inline_text_upload_request.py deleted file mode 100644 index 64f19db..0000000 --- a/seclai/_generated/models/inline_text_upload_request.py +++ /dev/null @@ -1,150 +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.inline_text_upload_request_metadata_type_0 import ( - InlineTextUploadRequestMetadataType0, - ) - - -T = TypeVar("T", bound="InlineTextUploadRequest") - - -@_attrs_define -class InlineTextUploadRequest: - """Request model for inline text uploads. - - Attributes: - text (str): Text content to upload - content_type (None | str | Unset): MIME type for the text content Default: 'text/plain'. - metadata (InlineTextUploadRequestMetadataType0 | None | Unset): Optional metadata object - title (None | str | Unset): Optional title - """ - - text: str - content_type: None | str | Unset = "text/plain" - metadata: InlineTextUploadRequestMetadataType0 | None | Unset = UNSET - title: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.inline_text_upload_request_metadata_type_0 import ( - InlineTextUploadRequestMetadataType0, - ) - - text = self.text - - content_type: None | str | Unset - if isinstance(self.content_type, Unset): - content_type = UNSET - else: - content_type = self.content_type - - metadata: dict[str, Any] | None | Unset - if isinstance(self.metadata, Unset): - metadata = UNSET - elif isinstance(self.metadata, InlineTextUploadRequestMetadataType0): - metadata = self.metadata.to_dict() - else: - metadata = self.metadata - - title: None | str | Unset - if isinstance(self.title, Unset): - title = UNSET - else: - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "text": text, - } - ) - if content_type is not UNSET: - field_dict["content_type"] = content_type - if metadata is not UNSET: - field_dict["metadata"] = metadata - if title is not UNSET: - field_dict["title"] = title - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.inline_text_upload_request_metadata_type_0 import ( - InlineTextUploadRequestMetadataType0, - ) - - d = dict(src_dict) - text = d.pop("text") - - def _parse_content_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - content_type = _parse_content_type(d.pop("content_type", UNSET)) - - def _parse_metadata( - data: object, - ) -> InlineTextUploadRequestMetadataType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_type_0 = InlineTextUploadRequestMetadataType0.from_dict(data) - - return metadata_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(InlineTextUploadRequestMetadataType0 | None | Unset, data) - - metadata = _parse_metadata(d.pop("metadata", UNSET)) - - def _parse_title(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - title = _parse_title(d.pop("title", UNSET)) - - inline_text_upload_request = cls( - text=text, - content_type=content_type, - metadata=metadata, - title=title, - ) - - inline_text_upload_request.additional_properties = d - return inline_text_upload_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/seclai/_generated/models/inline_text_upload_request_metadata_type_0.py b/seclai/_generated/models/inline_text_upload_request_metadata_type_0.py deleted file mode 100644 index 1d33a4f..0000000 --- a/seclai/_generated/models/inline_text_upload_request_metadata_type_0.py +++ /dev/null @@ -1,46 +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="InlineTextUploadRequestMetadataType0") - - -@_attrs_define -class InlineTextUploadRequestMetadataType0: - """ """ - - additional_properties: dict[str, Any] = _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) - inline_text_upload_request_metadata_type_0 = cls() - - inline_text_upload_request_metadata_type_0.additional_properties = d - return inline_text_upload_request_metadata_type_0 - - @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/seclai/_generated/models/insufficient_credits_detail.py b/seclai/_generated/models/insufficient_credits_detail.py deleted file mode 100644 index ad64030..0000000 --- a/seclai/_generated/models/insufficient_credits_detail.py +++ /dev/null @@ -1,82 +0,0 @@ -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 - -T = TypeVar("T", bound="InsufficientCreditsDetail") - - -@_attrs_define -class InsufficientCreditsDetail: - """``detail`` body for a 402 ``insufficient_credits`` response. - - Attributes: - account_id (str): UUID of the account that ran out of credits. - error (Literal['insufficient_credits']): Stable machine-readable error code. - message (str): Human-readable explanation. - """ - - account_id: str - error: Literal["insufficient_credits"] - message: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - error = self.error - - message = self.message - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_id": account_id, - "error": error, - "message": message, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("account_id") - - error = cast(Literal["insufficient_credits"], d.pop("error")) - if error != "insufficient_credits": - raise ValueError( - f"error must match const 'insufficient_credits', got '{error}'" - ) - - message = d.pop("message") - - insufficient_credits_detail = cls( - account_id=account_id, - error=error, - message=message, - ) - - insufficient_credits_detail.additional_properties = d - return insufficient_credits_detail - - @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/seclai/_generated/models/insufficient_credits_response.py b/seclai/_generated/models/insufficient_credits_response.py deleted file mode 100644 index da8b9cb..0000000 --- a/seclai/_generated/models/insufficient_credits_response.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.insufficient_credits_detail import InsufficientCreditsDetail - - -T = TypeVar("T", bound="InsufficientCreditsResponse") - - -@_attrs_define -class InsufficientCreditsResponse: - """402 envelope returned when the account has exhausted its credits. - - Attributes: - detail (InsufficientCreditsDetail): ``detail`` body for a 402 ``insufficient_credits`` response. - """ - - detail: InsufficientCreditsDetail - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - detail = self.detail.to_dict() - - 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: - from ..models.insufficient_credits_detail import InsufficientCreditsDetail - - d = dict(src_dict) - detail = InsufficientCreditsDetail.from_dict(d.pop("detail")) - - insufficient_credits_response = cls( - detail=detail, - ) - - insufficient_credits_response.additional_properties = d - return insufficient_credits_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/seclai/_generated/models/knowledge_base.py b/seclai/_generated/models/knowledge_base.py deleted file mode 100644 index a2dfc00..0000000 --- a/seclai/_generated/models/knowledge_base.py +++ /dev/null @@ -1,230 +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.source_connection_response_model import SourceConnectionResponseModel - - -T = TypeVar("T", bound="KnowledgeBase") - - -@_attrs_define -class KnowledgeBase: - """Response model for a single knowledge base. - - Attributes: - created_at (str): ISO-8601 creation timestamp. - id (str): Unique knowledge base identifier. - name (str): Human-readable name. - updated_at (str): ISO-8601 last-update timestamp. - default_score_threshold (float | None | Unset): Default minimum rerank score. - default_top_k (int | None | Unset): Default results after reranking. - default_top_n (int | None | Unset): Default number of results to return. - description (None | str | Unset): Optional description. - readonly (bool | Unset): Whether the knowledge base is read-only. Default: False. - reranker_model (None | str | Unset): Reranker model in use. - sources (list[SourceConnectionResponseModel] | Unset): Linked source connections. - """ - - created_at: str - id: str - name: str - updated_at: str - default_score_threshold: float | None | Unset = UNSET - default_top_k: int | None | Unset = UNSET - default_top_n: int | None | Unset = UNSET - description: None | str | Unset = UNSET - readonly: bool | Unset = False - reranker_model: None | str | Unset = UNSET - sources: list[SourceConnectionResponseModel] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at - - id = self.id - - name = self.name - - updated_at = self.updated_at - - default_score_threshold: float | None | Unset - if isinstance(self.default_score_threshold, Unset): - default_score_threshold = UNSET - else: - default_score_threshold = self.default_score_threshold - - default_top_k: int | None | Unset - if isinstance(self.default_top_k, Unset): - default_top_k = UNSET - else: - default_top_k = self.default_top_k - - default_top_n: int | None | Unset - if isinstance(self.default_top_n, Unset): - default_top_n = UNSET - else: - default_top_n = self.default_top_n - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - readonly = self.readonly - - reranker_model: None | str | Unset - if isinstance(self.reranker_model, Unset): - reranker_model = UNSET - else: - reranker_model = self.reranker_model - - sources: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.sources, Unset): - sources = [] - for sources_item_data in self.sources: - sources_item = sources_item_data.to_dict() - sources.append(sources_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "created_at": created_at, - "id": id, - "name": name, - "updated_at": updated_at, - } - ) - if default_score_threshold is not UNSET: - field_dict["default_score_threshold"] = default_score_threshold - if default_top_k is not UNSET: - field_dict["default_top_k"] = default_top_k - if default_top_n is not UNSET: - field_dict["default_top_n"] = default_top_n - if description is not UNSET: - field_dict["description"] = description - if readonly is not UNSET: - field_dict["readonly"] = readonly - if reranker_model is not UNSET: - field_dict["reranker_model"] = reranker_model - if sources is not UNSET: - field_dict["sources"] = sources - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.source_connection_response_model import ( - SourceConnectionResponseModel, - ) - - d = dict(src_dict) - created_at = d.pop("created_at") - - id = d.pop("id") - - name = d.pop("name") - - updated_at = d.pop("updated_at") - - def _parse_default_score_threshold(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - default_score_threshold = _parse_default_score_threshold( - d.pop("default_score_threshold", UNSET) - ) - - def _parse_default_top_k(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - default_top_k = _parse_default_top_k(d.pop("default_top_k", UNSET)) - - def _parse_default_top_n(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - default_top_n = _parse_default_top_n(d.pop("default_top_n", UNSET)) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - readonly = d.pop("readonly", UNSET) - - def _parse_reranker_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - reranker_model = _parse_reranker_model(d.pop("reranker_model", UNSET)) - - _sources = d.pop("sources", UNSET) - sources: list[SourceConnectionResponseModel] | Unset = UNSET - if _sources is not UNSET: - sources = [] - for sources_item_data in _sources: - sources_item = SourceConnectionResponseModel.from_dict( - sources_item_data - ) - - sources.append(sources_item) - - knowledge_base = cls( - created_at=created_at, - id=id, - name=name, - updated_at=updated_at, - default_score_threshold=default_score_threshold, - default_top_k=default_top_k, - default_top_n=default_top_n, - description=description, - readonly=readonly, - reranker_model=reranker_model, - sources=sources, - ) - - knowledge_base.additional_properties = d - return knowledge_base - - @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/seclai/_generated/models/knowledge_base_list_response_model.py b/seclai/_generated/models/knowledge_base_list_response_model.py deleted file mode 100644 index b2936b5..0000000 --- a/seclai/_generated/models/knowledge_base_list_response_model.py +++ /dev/null @@ -1,100 +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.knowledge_base import KnowledgeBase - - -T = TypeVar("T", bound="KnowledgeBaseListResponseModel") - - -@_attrs_define -class KnowledgeBaseListResponseModel: - """Paginated list of knowledge bases. - - Attributes: - knowledge_bases (list[KnowledgeBase]): List of knowledge bases on this page. - limit (int): Items per page. - page (int): Current page number (1-based). - total (int): Total number of knowledge bases. - """ - - knowledge_bases: list[KnowledgeBase] - limit: int - page: int - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - knowledge_bases = [] - for knowledge_bases_item_data in self.knowledge_bases: - knowledge_bases_item = knowledge_bases_item_data.to_dict() - knowledge_bases.append(knowledge_bases_item) - - limit = self.limit - - page = self.page - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "knowledge_bases": knowledge_bases, - "limit": limit, - "page": page, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.knowledge_base import KnowledgeBase - - d = dict(src_dict) - knowledge_bases = [] - _knowledge_bases = d.pop("knowledge_bases") - for knowledge_bases_item_data in _knowledge_bases: - knowledge_bases_item = KnowledgeBase.from_dict(knowledge_bases_item_data) - - knowledge_bases.append(knowledge_bases_item) - - limit = d.pop("limit") - - page = d.pop("page") - - total = d.pop("total") - - knowledge_base_list_response_model = cls( - knowledge_bases=knowledge_bases, - limit=limit, - page=page, - total=total, - ) - - knowledge_base_list_response_model.additional_properties = d - return knowledge_base_list_response_model - - @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/seclai/_generated/models/link_resources_request.py b/seclai/_generated/models/link_resources_request.py deleted file mode 100644 index 0b3de03..0000000 --- a/seclai/_generated/models/link_resources_request.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="LinkResourcesRequest") - - -@_attrs_define -class LinkResourcesRequest: - """ - Attributes: - ids (list[UUID]): Resource IDs to link - """ - - ids: list[UUID] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - ids = [] - for ids_item_data in self.ids: - ids_item = str(ids_item_data) - ids.append(ids_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "ids": ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - ids = [] - _ids = d.pop("ids") - for ids_item_data in _ids: - ids_item = UUID(ids_item_data) - - ids.append(ids_item) - - link_resources_request = cls( - ids=ids, - ) - - link_resources_request.additional_properties = d - return link_resources_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/seclai/_generated/models/mark_ai_suggestion_request.py b/seclai/_generated/models/mark_ai_suggestion_request.py deleted file mode 100644 index 6542bd2..0000000 --- a/seclai/_generated/models/mark_ai_suggestion_request.py +++ /dev/null @@ -1,61 +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="MarkAiSuggestionRequest") - - -@_attrs_define -class MarkAiSuggestionRequest: - """ - Attributes: - accepted (bool): True to accept the suggestion, false to decline it. - """ - - accepted: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - accepted = self.accepted - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "accepted": accepted, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - accepted = d.pop("accepted") - - mark_ai_suggestion_request = cls( - accepted=accepted, - ) - - mark_ai_suggestion_request.additional_properties = d - return mark_ai_suggestion_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/seclai/_generated/models/mark_conversation_turn_request.py b/seclai/_generated/models/mark_conversation_turn_request.py deleted file mode 100644 index e311978..0000000 --- a/seclai/_generated/models/mark_conversation_turn_request.py +++ /dev/null @@ -1,61 +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="MarkConversationTurnRequest") - - -@_attrs_define -class MarkConversationTurnRequest: - """ - Attributes: - accepted (bool): Whether the suggestion was accepted - """ - - accepted: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - accepted = self.accepted - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "accepted": accepted, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - accepted = d.pop("accepted") - - mark_conversation_turn_request = cls( - accepted=accepted, - ) - - mark_conversation_turn_request.additional_properties = d - return mark_conversation_turn_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/seclai/_generated/models/me_response.py b/seclai/_generated/models/me_response.py deleted file mode 100644 index 00e8caa..0000000 --- a/seclai/_generated/models/me_response.py +++ /dev/null @@ -1,86 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.organization_info_response import OrganizationInfoResponse - - -T = TypeVar("T", bound="MeResponse") - - -@_attrs_define -class MeResponse: - """ - Attributes: - account_id (UUID): - organizations (list[OrganizationInfoResponse]): - """ - - account_id: UUID - organizations: list[OrganizationInfoResponse] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - account_id = str(self.account_id) - - organizations = [] - for organizations_item_data in self.organizations: - organizations_item = organizations_item_data.to_dict() - organizations.append(organizations_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_id": account_id, - "organizations": organizations, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.organization_info_response import OrganizationInfoResponse - - d = dict(src_dict) - account_id = UUID(d.pop("account_id")) - - organizations = [] - _organizations = d.pop("organizations") - for organizations_item_data in _organizations: - organizations_item = OrganizationInfoResponse.from_dict( - organizations_item_data - ) - - organizations.append(organizations_item) - - me_response = cls( - account_id=account_id, - organizations=organizations, - ) - - me_response.additional_properties = d - return me_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/seclai/_generated/models/memory_bank.py b/seclai/_generated/models/memory_bank.py deleted file mode 100644 index e420e28..0000000 --- a/seclai/_generated/models/memory_bank.py +++ /dev/null @@ -1,330 +0,0 @@ -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="MemoryBank") - - -@_attrs_define -class MemoryBank: - """Response model for a single memory bank. - - Attributes: - created_at (str): ISO-8601 creation timestamp. - id (str): Unique memory bank identifier. - mode (str): Embedding mode: fast_and_cheap, balanced, slow_and_thorough, or custom. - name (str): Human-readable name. - type_ (str): Bank type: conversation (chat-turn with speaker) or general (flat entries). - updated_at (str): ISO-8601 last-update timestamp. - chunk_overlap (int | None | Unset): Character overlap between chunks. - chunk_size (int | None | Unset): Characters per chunk. - compaction_prompt (None | str | Unset): Custom prompt used when compacting older entries. When set, entries that - exceed a threshold are summarized into a new entry before being soft-deleted. - description (None | str | Unset): Optional description of the memory bank's purpose. - dimensions (int | None | Unset): Vector embedding dimensions. - embedding_model (None | str | Unset): Embedding model identifier. - max_age_days (int | None | Unset): Max entry age in days before compaction. Checked both inline after each write - and by the hourly background sweep. - max_size_tokens (int | None | Unset): Max total tokens (per partition) before compaction. Checked both inline - after each write and by the hourly background sweep. - max_turns (int | None | Unset): Max conversation turns (per partition) before compaction. Checked both inline - after each write and by the hourly background sweep. - retention_days (int | None | Unset): Content retention period in days (null = indefinite). - source_connection_id (None | str | Unset): Linked content source ID (null if not yet provisioned). - """ - - created_at: str - id: str - mode: str - name: str - type_: str - updated_at: str - chunk_overlap: int | None | Unset = UNSET - chunk_size: int | None | Unset = UNSET - compaction_prompt: None | str | Unset = UNSET - description: None | str | Unset = UNSET - dimensions: int | None | Unset = UNSET - embedding_model: None | str | Unset = UNSET - max_age_days: int | None | Unset = UNSET - max_size_tokens: int | None | Unset = UNSET - max_turns: int | None | Unset = UNSET - retention_days: int | None | Unset = UNSET - source_connection_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at - - id = self.id - - mode = self.mode - - name = self.name - - type_ = self.type_ - - updated_at = self.updated_at - - chunk_overlap: int | None | Unset - if isinstance(self.chunk_overlap, Unset): - chunk_overlap = UNSET - else: - chunk_overlap = self.chunk_overlap - - chunk_size: int | None | Unset - if isinstance(self.chunk_size, Unset): - chunk_size = UNSET - else: - chunk_size = self.chunk_size - - compaction_prompt: None | str | Unset - if isinstance(self.compaction_prompt, Unset): - compaction_prompt = UNSET - else: - compaction_prompt = self.compaction_prompt - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - dimensions: int | None | Unset - if isinstance(self.dimensions, Unset): - dimensions = UNSET - else: - dimensions = self.dimensions - - embedding_model: None | str | Unset - if isinstance(self.embedding_model, Unset): - embedding_model = UNSET - else: - embedding_model = self.embedding_model - - max_age_days: int | None | Unset - if isinstance(self.max_age_days, Unset): - max_age_days = UNSET - else: - max_age_days = self.max_age_days - - max_size_tokens: int | None | Unset - if isinstance(self.max_size_tokens, Unset): - max_size_tokens = UNSET - else: - max_size_tokens = self.max_size_tokens - - max_turns: int | None | Unset - if isinstance(self.max_turns, Unset): - max_turns = UNSET - else: - max_turns = self.max_turns - - retention_days: int | None | Unset - if isinstance(self.retention_days, Unset): - retention_days = UNSET - else: - retention_days = self.retention_days - - source_connection_id: None | str | Unset - if isinstance(self.source_connection_id, Unset): - source_connection_id = UNSET - else: - source_connection_id = self.source_connection_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "created_at": created_at, - "id": id, - "mode": mode, - "name": name, - "type": type_, - "updated_at": updated_at, - } - ) - if chunk_overlap is not UNSET: - field_dict["chunk_overlap"] = chunk_overlap - if chunk_size is not UNSET: - field_dict["chunk_size"] = chunk_size - if compaction_prompt is not UNSET: - field_dict["compaction_prompt"] = compaction_prompt - if description is not UNSET: - field_dict["description"] = description - if dimensions is not UNSET: - field_dict["dimensions"] = dimensions - if embedding_model is not UNSET: - field_dict["embedding_model"] = embedding_model - if max_age_days is not UNSET: - field_dict["max_age_days"] = max_age_days - if max_size_tokens is not UNSET: - field_dict["max_size_tokens"] = max_size_tokens - if max_turns is not UNSET: - field_dict["max_turns"] = max_turns - if retention_days is not UNSET: - field_dict["retention_days"] = retention_days - if source_connection_id is not UNSET: - field_dict["source_connection_id"] = source_connection_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created_at = d.pop("created_at") - - id = d.pop("id") - - mode = d.pop("mode") - - name = d.pop("name") - - type_ = d.pop("type") - - updated_at = d.pop("updated_at") - - def _parse_chunk_overlap(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_overlap = _parse_chunk_overlap(d.pop("chunk_overlap", UNSET)) - - def _parse_chunk_size(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_size = _parse_chunk_size(d.pop("chunk_size", UNSET)) - - def _parse_compaction_prompt(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - compaction_prompt = _parse_compaction_prompt(d.pop("compaction_prompt", UNSET)) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_dimensions(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - dimensions = _parse_dimensions(d.pop("dimensions", UNSET)) - - def _parse_embedding_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - embedding_model = _parse_embedding_model(d.pop("embedding_model", UNSET)) - - def _parse_max_age_days(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_age_days = _parse_max_age_days(d.pop("max_age_days", UNSET)) - - def _parse_max_size_tokens(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_size_tokens = _parse_max_size_tokens(d.pop("max_size_tokens", UNSET)) - - def _parse_max_turns(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_turns = _parse_max_turns(d.pop("max_turns", UNSET)) - - def _parse_retention_days(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - retention_days = _parse_retention_days(d.pop("retention_days", UNSET)) - - def _parse_source_connection_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - source_connection_id = _parse_source_connection_id( - d.pop("source_connection_id", UNSET) - ) - - memory_bank = cls( - created_at=created_at, - id=id, - mode=mode, - name=name, - type_=type_, - updated_at=updated_at, - chunk_overlap=chunk_overlap, - chunk_size=chunk_size, - compaction_prompt=compaction_prompt, - description=description, - dimensions=dimensions, - embedding_model=embedding_model, - max_age_days=max_age_days, - max_size_tokens=max_size_tokens, - max_turns=max_turns, - retention_days=retention_days, - source_connection_id=source_connection_id, - ) - - memory_bank.additional_properties = d - return memory_bank - - @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/seclai/_generated/models/memory_bank_accept_request.py b/seclai/_generated/models/memory_bank_accept_request.py deleted file mode 100644 index 30308a9..0000000 --- a/seclai/_generated/models/memory_bank_accept_request.py +++ /dev/null @@ -1,62 +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="MemoryBankAcceptRequest") - - -@_attrs_define -class MemoryBankAcceptRequest: - """Accept or decline a memory bank AI suggestion. - - Attributes: - accepted (bool): Whether the user accepted the proposed configuration. - """ - - accepted: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - accepted = self.accepted - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "accepted": accepted, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - accepted = d.pop("accepted") - - memory_bank_accept_request = cls( - accepted=accepted, - ) - - memory_bank_accept_request.additional_properties = d - return memory_bank_accept_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/seclai/_generated/models/memory_bank_ai_assistant_request.py b/seclai/_generated/models/memory_bank_ai_assistant_request.py deleted file mode 100644 index a39b1b0..0000000 --- a/seclai/_generated/models/memory_bank_ai_assistant_request.py +++ /dev/null @@ -1,153 +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 dateutil.parser import isoparse - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.memory_bank_ai_assistant_request_current_config_type_0 import ( - MemoryBankAiAssistantRequestCurrentConfigType0, - ) - - -T = TypeVar("T", bound="MemoryBankAiAssistantRequest") - - -@_attrs_define -class MemoryBankAiAssistantRequest: - """Request body for the memory bank AI assistant. - - Attributes: - user_input (str): Natural-language description of the memory bank. - current_config (MemoryBankAiAssistantRequestCurrentConfigType0 | None | Unset): Current configuration to refine, - if any. - history_since (datetime.datetime | None | Unset): Optional ISO 8601 timestamp. When set, only conversation - turns created at or after this timestamp are loaded as context, scoping history to the current session so the - assistant remembers earlier turns in a multi-turn refinement. - """ - - user_input: str - current_config: MemoryBankAiAssistantRequestCurrentConfigType0 | None | Unset = ( - UNSET - ) - history_since: datetime.datetime | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.memory_bank_ai_assistant_request_current_config_type_0 import ( - MemoryBankAiAssistantRequestCurrentConfigType0, - ) - - user_input = self.user_input - - current_config: dict[str, Any] | None | Unset - if isinstance(self.current_config, Unset): - current_config = UNSET - elif isinstance( - self.current_config, MemoryBankAiAssistantRequestCurrentConfigType0 - ): - current_config = self.current_config.to_dict() - else: - current_config = self.current_config - - history_since: None | str | Unset - if isinstance(self.history_since, Unset): - history_since = UNSET - elif isinstance(self.history_since, datetime.datetime): - history_since = self.history_since.isoformat() - else: - history_since = self.history_since - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "user_input": user_input, - } - ) - if current_config is not UNSET: - field_dict["current_config"] = current_config - if history_since is not UNSET: - field_dict["history_since"] = history_since - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.memory_bank_ai_assistant_request_current_config_type_0 import ( - MemoryBankAiAssistantRequestCurrentConfigType0, - ) - - d = dict(src_dict) - user_input = d.pop("user_input") - - def _parse_current_config( - data: object, - ) -> MemoryBankAiAssistantRequestCurrentConfigType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - current_config_type_0 = ( - MemoryBankAiAssistantRequestCurrentConfigType0.from_dict(data) - ) - - return current_config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - MemoryBankAiAssistantRequestCurrentConfigType0 | None | Unset, data - ) - - current_config = _parse_current_config(d.pop("current_config", UNSET)) - - def _parse_history_since(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() - history_since_type_0 = isoparse(data) - - return history_since_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - history_since = _parse_history_since(d.pop("history_since", UNSET)) - - memory_bank_ai_assistant_request = cls( - user_input=user_input, - current_config=current_config, - history_since=history_since, - ) - - memory_bank_ai_assistant_request.additional_properties = d - return memory_bank_ai_assistant_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/seclai/_generated/models/memory_bank_ai_assistant_request_current_config_type_0.py b/seclai/_generated/models/memory_bank_ai_assistant_request_current_config_type_0.py deleted file mode 100644 index e33ab51..0000000 --- a/seclai/_generated/models/memory_bank_ai_assistant_request_current_config_type_0.py +++ /dev/null @@ -1,46 +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="MemoryBankAiAssistantRequestCurrentConfigType0") - - -@_attrs_define -class MemoryBankAiAssistantRequestCurrentConfigType0: - """ """ - - additional_properties: dict[str, Any] = _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) - memory_bank_ai_assistant_request_current_config_type_0 = cls() - - memory_bank_ai_assistant_request_current_config_type_0.additional_properties = d - return memory_bank_ai_assistant_request_current_config_type_0 - - @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/seclai/_generated/models/memory_bank_ai_assistant_response.py b/seclai/_generated/models/memory_bank_ai_assistant_response.py deleted file mode 100644 index 586f602..0000000 --- a/seclai/_generated/models/memory_bank_ai_assistant_response.py +++ /dev/null @@ -1,165 +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.example_prompt import ExamplePrompt - from ..models.memory_bank_config_response import MemoryBankConfigResponse - - -T = TypeVar("T", bound="MemoryBankAiAssistantResponse") - - -@_attrs_define -class MemoryBankAiAssistantResponse: - """Response from the memory bank AI assistant. - - Attributes: - conversation_id (str): Conversation ID for follow-up. - note (str): AI-generated explanation. - config (MemoryBankConfigResponse | None | Unset): Proposed configuration, or null. - example_prompts (list[ExamplePrompt] | Unset): Example natural-language prompts that demonstrate the - capabilities of the memory bank AI assistant. - prompt_call_id (None | str | Unset): Prompt call ID for credit tracking. - success (bool | Unset): Whether generation succeeded. Default: False. - """ - - conversation_id: str - note: str - config: MemoryBankConfigResponse | None | Unset = UNSET - example_prompts: list[ExamplePrompt] | Unset = UNSET - prompt_call_id: None | str | Unset = UNSET - success: bool | Unset = False - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.memory_bank_config_response import MemoryBankConfigResponse - - conversation_id = self.conversation_id - - note = self.note - - config: dict[str, Any] | None | Unset - if isinstance(self.config, Unset): - config = UNSET - elif isinstance(self.config, MemoryBankConfigResponse): - config = self.config.to_dict() - else: - config = self.config - - example_prompts: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.example_prompts, Unset): - example_prompts = [] - for example_prompts_item_data in self.example_prompts: - example_prompts_item = example_prompts_item_data.to_dict() - example_prompts.append(example_prompts_item) - - prompt_call_id: None | str | Unset - if isinstance(self.prompt_call_id, Unset): - prompt_call_id = UNSET - else: - prompt_call_id = self.prompt_call_id - - success = self.success - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "conversation_id": conversation_id, - "note": note, - } - ) - if config is not UNSET: - field_dict["config"] = config - if example_prompts is not UNSET: - field_dict["example_prompts"] = example_prompts - if prompt_call_id is not UNSET: - field_dict["prompt_call_id"] = prompt_call_id - if success is not UNSET: - field_dict["success"] = success - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.example_prompt import ExamplePrompt - from ..models.memory_bank_config_response import MemoryBankConfigResponse - - d = dict(src_dict) - conversation_id = d.pop("conversation_id") - - note = d.pop("note") - - def _parse_config(data: object) -> MemoryBankConfigResponse | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - config_type_0 = MemoryBankConfigResponse.from_dict(data) - - return config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(MemoryBankConfigResponse | None | Unset, data) - - config = _parse_config(d.pop("config", UNSET)) - - _example_prompts = d.pop("example_prompts", UNSET) - example_prompts: list[ExamplePrompt] | Unset = UNSET - if _example_prompts is not UNSET: - example_prompts = [] - for example_prompts_item_data in _example_prompts: - example_prompts_item = ExamplePrompt.from_dict( - example_prompts_item_data - ) - - example_prompts.append(example_prompts_item) - - def _parse_prompt_call_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - prompt_call_id = _parse_prompt_call_id(d.pop("prompt_call_id", UNSET)) - - success = d.pop("success", UNSET) - - memory_bank_ai_assistant_response = cls( - conversation_id=conversation_id, - note=note, - config=config, - example_prompts=example_prompts, - prompt_call_id=prompt_call_id, - success=success, - ) - - memory_bank_ai_assistant_response.additional_properties = d - return memory_bank_ai_assistant_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/seclai/_generated/models/memory_bank_config_response.py b/seclai/_generated/models/memory_bank_config_response.py deleted file mode 100644 index 246cdfa..0000000 --- a/seclai/_generated/models/memory_bank_config_response.py +++ /dev/null @@ -1,200 +0,0 @@ -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="MemoryBankConfigResponse") - - -@_attrs_define -class MemoryBankConfigResponse: - """Suggested memory bank configuration from the AI assistant. - - Attributes: - mode (str): Memory bank mode. - name (str): Suggested name. - type_ (str): Memory bank type: conversation or general. - compaction_prompt (None | str | Unset): Suggested compaction prompt. - description (None | str | Unset): Suggested description. - max_age_days (int | None | Unset): Max age in days. - max_size_tokens (int | None | Unset): Max size in tokens. - max_turns (int | None | Unset): Max conversation turns. - retention_days (int | None | Unset): Retention in days. - """ - - mode: str - name: str - type_: str - compaction_prompt: None | str | Unset = UNSET - description: None | str | Unset = UNSET - max_age_days: int | None | Unset = UNSET - max_size_tokens: int | None | Unset = UNSET - max_turns: int | None | Unset = UNSET - retention_days: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - mode = self.mode - - name = self.name - - type_ = self.type_ - - compaction_prompt: None | str | Unset - if isinstance(self.compaction_prompt, Unset): - compaction_prompt = UNSET - else: - compaction_prompt = self.compaction_prompt - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - max_age_days: int | None | Unset - if isinstance(self.max_age_days, Unset): - max_age_days = UNSET - else: - max_age_days = self.max_age_days - - max_size_tokens: int | None | Unset - if isinstance(self.max_size_tokens, Unset): - max_size_tokens = UNSET - else: - max_size_tokens = self.max_size_tokens - - max_turns: int | None | Unset - if isinstance(self.max_turns, Unset): - max_turns = UNSET - else: - max_turns = self.max_turns - - retention_days: int | None | Unset - if isinstance(self.retention_days, Unset): - retention_days = UNSET - else: - retention_days = self.retention_days - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "mode": mode, - "name": name, - "type": type_, - } - ) - if compaction_prompt is not UNSET: - field_dict["compaction_prompt"] = compaction_prompt - if description is not UNSET: - field_dict["description"] = description - if max_age_days is not UNSET: - field_dict["max_age_days"] = max_age_days - if max_size_tokens is not UNSET: - field_dict["max_size_tokens"] = max_size_tokens - if max_turns is not UNSET: - field_dict["max_turns"] = max_turns - if retention_days is not UNSET: - field_dict["retention_days"] = retention_days - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - mode = d.pop("mode") - - name = d.pop("name") - - type_ = d.pop("type") - - def _parse_compaction_prompt(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - compaction_prompt = _parse_compaction_prompt(d.pop("compaction_prompt", UNSET)) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_max_age_days(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_age_days = _parse_max_age_days(d.pop("max_age_days", UNSET)) - - def _parse_max_size_tokens(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_size_tokens = _parse_max_size_tokens(d.pop("max_size_tokens", UNSET)) - - def _parse_max_turns(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_turns = _parse_max_turns(d.pop("max_turns", UNSET)) - - def _parse_retention_days(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - retention_days = _parse_retention_days(d.pop("retention_days", UNSET)) - - memory_bank_config_response = cls( - mode=mode, - name=name, - type_=type_, - compaction_prompt=compaction_prompt, - description=description, - max_age_days=max_age_days, - max_size_tokens=max_size_tokens, - max_turns=max_turns, - retention_days=retention_days, - ) - - memory_bank_config_response.additional_properties = d - return memory_bank_config_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/seclai/_generated/models/memory_bank_conversation_turn_response.py b/seclai/_generated/models/memory_bank_conversation_turn_response.py deleted file mode 100644 index afb879e..0000000 --- a/seclai/_generated/models/memory_bank_conversation_turn_response.py +++ /dev/null @@ -1,171 +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.memory_bank_conversation_turn_response_resulting_config_type_0 import ( - MemoryBankConversationTurnResponseResultingConfigType0, - ) - - -T = TypeVar("T", bound="MemoryBankConversationTurnResponse") - - -@_attrs_define -class MemoryBankConversationTurnResponse: - """A single turn of memory bank AI assistant conversation. - - Attributes: - conversation_id (str): Unique ID for this conversation turn. - user_input (str): User input for this turn. - accepted (bool | None | Unset): Whether the user accepted this proposal. - ai_note (None | str | Unset): AI note from this turn. - resulting_config (MemoryBankConversationTurnResponseResultingConfigType0 | None | Unset): The proposed - configuration from this turn. - """ - - conversation_id: str - user_input: str - accepted: bool | None | Unset = UNSET - ai_note: None | str | Unset = UNSET - resulting_config: ( - MemoryBankConversationTurnResponseResultingConfigType0 | None | Unset - ) = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.memory_bank_conversation_turn_response_resulting_config_type_0 import ( - MemoryBankConversationTurnResponseResultingConfigType0, - ) - - conversation_id = self.conversation_id - - user_input = self.user_input - - accepted: bool | None | Unset - if isinstance(self.accepted, Unset): - accepted = UNSET - else: - accepted = self.accepted - - ai_note: None | str | Unset - if isinstance(self.ai_note, Unset): - ai_note = UNSET - else: - ai_note = self.ai_note - - resulting_config: dict[str, Any] | None | Unset - if isinstance(self.resulting_config, Unset): - resulting_config = UNSET - elif isinstance( - self.resulting_config, - MemoryBankConversationTurnResponseResultingConfigType0, - ): - resulting_config = self.resulting_config.to_dict() - else: - resulting_config = self.resulting_config - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "conversation_id": conversation_id, - "user_input": user_input, - } - ) - if accepted is not UNSET: - field_dict["accepted"] = accepted - if ai_note is not UNSET: - field_dict["ai_note"] = ai_note - if resulting_config is not UNSET: - field_dict["resulting_config"] = resulting_config - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.memory_bank_conversation_turn_response_resulting_config_type_0 import ( - MemoryBankConversationTurnResponseResultingConfigType0, - ) - - d = dict(src_dict) - conversation_id = d.pop("conversation_id") - - user_input = d.pop("user_input") - - def _parse_accepted(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - accepted = _parse_accepted(d.pop("accepted", UNSET)) - - def _parse_ai_note(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - ai_note = _parse_ai_note(d.pop("ai_note", UNSET)) - - def _parse_resulting_config( - data: object, - ) -> MemoryBankConversationTurnResponseResultingConfigType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - resulting_config_type_0 = ( - MemoryBankConversationTurnResponseResultingConfigType0.from_dict( - data - ) - ) - - return resulting_config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - MemoryBankConversationTurnResponseResultingConfigType0 | None | Unset, - data, - ) - - resulting_config = _parse_resulting_config(d.pop("resulting_config", UNSET)) - - memory_bank_conversation_turn_response = cls( - conversation_id=conversation_id, - user_input=user_input, - accepted=accepted, - ai_note=ai_note, - resulting_config=resulting_config, - ) - - memory_bank_conversation_turn_response.additional_properties = d - return memory_bank_conversation_turn_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/seclai/_generated/models/memory_bank_conversation_turn_response_resulting_config_type_0.py b/seclai/_generated/models/memory_bank_conversation_turn_response_resulting_config_type_0.py deleted file mode 100644 index fb3e5bf..0000000 --- a/seclai/_generated/models/memory_bank_conversation_turn_response_resulting_config_type_0.py +++ /dev/null @@ -1,48 +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="MemoryBankConversationTurnResponseResultingConfigType0") - - -@_attrs_define -class MemoryBankConversationTurnResponseResultingConfigType0: - """ """ - - additional_properties: dict[str, Any] = _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) - memory_bank_conversation_turn_response_resulting_config_type_0 = cls() - - memory_bank_conversation_turn_response_resulting_config_type_0.additional_properties = ( - d - ) - return memory_bank_conversation_turn_response_resulting_config_type_0 - - @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/seclai/_generated/models/memory_bank_last_conversation_response.py b/seclai/_generated/models/memory_bank_last_conversation_response.py deleted file mode 100644 index 70fbd1e..0000000 --- a/seclai/_generated/models/memory_bank_last_conversation_response.py +++ /dev/null @@ -1,156 +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.memory_bank_conversation_turn_response import ( - MemoryBankConversationTurnResponse, - ) - - -T = TypeVar("T", bound="MemoryBankLastConversationResponse") - - -@_attrs_define -class MemoryBankLastConversationResponse: - """Response for fetching memory bank conversation history. - - Attributes: - accepted (bool | None | Unset): Whether the user accepted the last proposal. - ai_note (None | str | Unset): AI note from the most recent turn. - total (int | Unset): Total conversation turns. Default: 0. - turns (list[MemoryBankConversationTurnResponse] | Unset): Recent conversation turns (oldest first). - user_input (None | str | Unset): Most recent user input. - """ - - accepted: bool | None | Unset = UNSET - ai_note: None | str | Unset = UNSET - total: int | Unset = 0 - turns: list[MemoryBankConversationTurnResponse] | Unset = UNSET - user_input: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - accepted: bool | None | Unset - if isinstance(self.accepted, Unset): - accepted = UNSET - else: - accepted = self.accepted - - ai_note: None | str | Unset - if isinstance(self.ai_note, Unset): - ai_note = UNSET - else: - ai_note = self.ai_note - - total = self.total - - turns: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.turns, Unset): - turns = [] - for turns_item_data in self.turns: - turns_item = turns_item_data.to_dict() - turns.append(turns_item) - - user_input: None | str | Unset - if isinstance(self.user_input, Unset): - user_input = UNSET - else: - user_input = self.user_input - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if accepted is not UNSET: - field_dict["accepted"] = accepted - if ai_note is not UNSET: - field_dict["ai_note"] = ai_note - if total is not UNSET: - field_dict["total"] = total - if turns is not UNSET: - field_dict["turns"] = turns - if user_input is not UNSET: - field_dict["user_input"] = user_input - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.memory_bank_conversation_turn_response import ( - MemoryBankConversationTurnResponse, - ) - - d = dict(src_dict) - - def _parse_accepted(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - accepted = _parse_accepted(d.pop("accepted", UNSET)) - - def _parse_ai_note(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - ai_note = _parse_ai_note(d.pop("ai_note", UNSET)) - - total = d.pop("total", UNSET) - - _turns = d.pop("turns", UNSET) - turns: list[MemoryBankConversationTurnResponse] | Unset = UNSET - if _turns is not UNSET: - turns = [] - for turns_item_data in _turns: - turns_item = MemoryBankConversationTurnResponse.from_dict( - turns_item_data - ) - - turns.append(turns_item) - - def _parse_user_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - user_input = _parse_user_input(d.pop("user_input", UNSET)) - - memory_bank_last_conversation_response = cls( - accepted=accepted, - ai_note=ai_note, - total=total, - turns=turns, - user_input=user_input, - ) - - memory_bank_last_conversation_response.additional_properties = d - return memory_bank_last_conversation_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/seclai/_generated/models/memory_bank_list_response_model.py b/seclai/_generated/models/memory_bank_list_response_model.py deleted file mode 100644 index 58c9d5c..0000000 --- a/seclai/_generated/models/memory_bank_list_response_model.py +++ /dev/null @@ -1,100 +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.memory_bank import MemoryBank - - -T = TypeVar("T", bound="MemoryBankListResponseModel") - - -@_attrs_define -class MemoryBankListResponseModel: - """Paginated list of memory banks. - - Attributes: - limit (int): Items per page. - memory_banks (list[MemoryBank]): List of memory banks on this page. - page (int): Current page number (1-based). - total (int): Total number of memory banks. - """ - - limit: int - memory_banks: list[MemoryBank] - page: int - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - limit = self.limit - - memory_banks = [] - for memory_banks_item_data in self.memory_banks: - memory_banks_item = memory_banks_item_data.to_dict() - memory_banks.append(memory_banks_item) - - page = self.page - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "limit": limit, - "memory_banks": memory_banks, - "page": page, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.memory_bank import MemoryBank - - d = dict(src_dict) - limit = d.pop("limit") - - memory_banks = [] - _memory_banks = d.pop("memory_banks") - for memory_banks_item_data in _memory_banks: - memory_banks_item = MemoryBank.from_dict(memory_banks_item_data) - - memory_banks.append(memory_banks_item) - - page = d.pop("page") - - total = d.pop("total") - - memory_bank_list_response_model = cls( - limit=limit, - memory_banks=memory_banks, - page=page, - total=total, - ) - - memory_bank_list_response_model.additional_properties = d - return memory_bank_list_response_model - - @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/seclai/_generated/models/modality_rate_response.py b/seclai/_generated/models/modality_rate_response.py deleted file mode 100644 index a2737ed..0000000 --- a/seclai/_generated/models/modality_rate_response.py +++ /dev/null @@ -1,116 +0,0 @@ -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="ModalityRateResponse") - - -@_attrs_define -class ModalityRateResponse: - """Per-modality rate for an LLM that prices image/audio/video output - (or input) at a rate distinct from the default text rate. - - Example: Gemini 3.1 Flash Image charges $3/1M output tokens for - text but $60/1M output tokens for generated images. The image rate - surfaces here with ``modality="image"`` and ``output_credits_per_1000_tokens`` - set; the default text rate stays on the parent model fields. - - Attributes: - modality (str): - input_credits_per_1000_tokens (float | None | Unset): - output_credits_per_1000_tokens (float | None | Unset): - """ - - modality: str - input_credits_per_1000_tokens: float | None | Unset = UNSET - output_credits_per_1000_tokens: float | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - modality = self.modality - - input_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_credits_per_1000_tokens, Unset): - input_credits_per_1000_tokens = UNSET - else: - input_credits_per_1000_tokens = self.input_credits_per_1000_tokens - - output_credits_per_1000_tokens: float | None | Unset - if isinstance(self.output_credits_per_1000_tokens, Unset): - output_credits_per_1000_tokens = UNSET - else: - output_credits_per_1000_tokens = self.output_credits_per_1000_tokens - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "modality": modality, - } - ) - if input_credits_per_1000_tokens is not UNSET: - field_dict["input_credits_per_1000_tokens"] = input_credits_per_1000_tokens - if output_credits_per_1000_tokens is not UNSET: - field_dict["output_credits_per_1000_tokens"] = ( - output_credits_per_1000_tokens - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - modality = d.pop("modality") - - def _parse_input_credits_per_1000_tokens(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_credits_per_1000_tokens = _parse_input_credits_per_1000_tokens( - d.pop("input_credits_per_1000_tokens", UNSET) - ) - - def _parse_output_credits_per_1000_tokens(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - output_credits_per_1000_tokens = _parse_output_credits_per_1000_tokens( - d.pop("output_credits_per_1000_tokens", UNSET) - ) - - modality_rate_response = cls( - modality=modality, - input_credits_per_1000_tokens=input_credits_per_1000_tokens, - output_credits_per_1000_tokens=output_credits_per_1000_tokens, - ) - - modality_rate_response.additional_properties = d - return modality_rate_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/seclai/_generated/models/model_alert_list_response.py b/seclai/_generated/models/model_alert_list_response.py deleted file mode 100644 index 671d829..0000000 --- a/seclai/_generated/models/model_alert_list_response.py +++ /dev/null @@ -1,85 +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.model_alert_response import ModelAlertResponse - - -T = TypeVar("T", bound="ModelAlertListResponse") - - -@_attrs_define -class ModelAlertListResponse: - """``GET /models/alerts`` legacy/default shape; 2026-07-27+ clients get the - canonical ``{data, pagination}`` envelope (bypasses this ``response_model``). - - Attributes: - alerts (list[ModelAlertResponse]): - total (int): - """ - - alerts: list[ModelAlertResponse] - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - alerts = [] - for alerts_item_data in self.alerts: - alerts_item = alerts_item_data.to_dict() - alerts.append(alerts_item) - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "alerts": alerts, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.model_alert_response import ModelAlertResponse - - d = dict(src_dict) - alerts = [] - _alerts = d.pop("alerts") - for alerts_item_data in _alerts: - alerts_item = ModelAlertResponse.from_dict(alerts_item_data) - - alerts.append(alerts_item) - - total = d.pop("total") - - model_alert_list_response = cls( - alerts=alerts, - total=total, - ) - - model_alert_list_response.additional_properties = d - return model_alert_list_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/seclai/_generated/models/model_alert_response.py b/seclai/_generated/models/model_alert_response.py deleted file mode 100644 index a1b0f34..0000000 --- a/seclai/_generated/models/model_alert_response.py +++ /dev/null @@ -1,153 +0,0 @@ -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 - -T = TypeVar("T", bound="ModelAlertResponse") - - -@_attrs_define -class ModelAlertResponse: - """ - Attributes: - account_id (str): - agent_id (None | str): - alert_type (str): - created_at (str): - id (str): - message (str): - model_name (str): - prompt_model_id (str): - read_at (None | str): - successor_model_name (None | str): - """ - - account_id: str - agent_id: None | str - alert_type: str - created_at: str - id: str - message: str - model_name: str - prompt_model_id: str - read_at: None | str - successor_model_name: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - agent_id: None | str - agent_id = self.agent_id - - alert_type = self.alert_type - - created_at = self.created_at - - id = self.id - - message = self.message - - model_name = self.model_name - - prompt_model_id = self.prompt_model_id - - read_at: None | str - read_at = self.read_at - - successor_model_name: None | str - successor_model_name = self.successor_model_name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_id": account_id, - "agent_id": agent_id, - "alert_type": alert_type, - "created_at": created_at, - "id": id, - "message": message, - "model_name": model_name, - "prompt_model_id": prompt_model_id, - "read_at": read_at, - "successor_model_name": successor_model_name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("account_id") - - def _parse_agent_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - agent_id = _parse_agent_id(d.pop("agent_id")) - - alert_type = d.pop("alert_type") - - created_at = d.pop("created_at") - - id = d.pop("id") - - message = d.pop("message") - - model_name = d.pop("model_name") - - prompt_model_id = d.pop("prompt_model_id") - - def _parse_read_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - read_at = _parse_read_at(d.pop("read_at")) - - def _parse_successor_model_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - successor_model_name = _parse_successor_model_name( - d.pop("successor_model_name") - ) - - model_alert_response = cls( - account_id=account_id, - agent_id=agent_id, - alert_type=alert_type, - created_at=created_at, - id=id, - message=message, - model_name=model_name, - prompt_model_id=prompt_model_id, - read_at=read_at, - successor_model_name=successor_model_name, - ) - - model_alert_response.additional_properties = d - return model_alert_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/seclai/_generated/models/model_recommendation_response.py b/seclai/_generated/models/model_recommendation_response.py deleted file mode 100644 index 0334ec7..0000000 --- a/seclai/_generated/models/model_recommendation_response.py +++ /dev/null @@ -1,267 +0,0 @@ -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="ModelRecommendationResponse") - - -@_attrs_define -class ModelRecommendationResponse: - """ - Attributes: - description (str): - id (str): - max_context_tokens (int): - max_output_tokens (int): - model_id (str): - name (str): - provider (str): - reason (str): - recommendation_type (str): - supports_openai_arguments (bool): - supports_streaming (bool): - supports_structured_output (bool): - supports_thinking (bool): - supports_tool_use (bool): - deprecated_at (None | str | Unset): - family (None | str | Unset): - family_generation (float | None | Unset): - released_at (None | str | Unset): - sunset_at (None | str | Unset): - """ - - description: str - id: str - max_context_tokens: int - max_output_tokens: int - model_id: str - name: str - provider: str - reason: str - recommendation_type: str - supports_openai_arguments: bool - supports_streaming: bool - supports_structured_output: bool - supports_thinking: bool - supports_tool_use: bool - deprecated_at: None | str | Unset = UNSET - family: None | str | Unset = UNSET - family_generation: float | None | Unset = UNSET - released_at: None | str | Unset = UNSET - sunset_at: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - description = self.description - - id = self.id - - max_context_tokens = self.max_context_tokens - - max_output_tokens = self.max_output_tokens - - model_id = self.model_id - - name = self.name - - provider = self.provider - - reason = self.reason - - recommendation_type = self.recommendation_type - - supports_openai_arguments = self.supports_openai_arguments - - supports_streaming = self.supports_streaming - - supports_structured_output = self.supports_structured_output - - supports_thinking = self.supports_thinking - - supports_tool_use = self.supports_tool_use - - deprecated_at: None | str | Unset - if isinstance(self.deprecated_at, Unset): - deprecated_at = UNSET - else: - deprecated_at = self.deprecated_at - - family: None | str | Unset - if isinstance(self.family, Unset): - family = UNSET - else: - family = self.family - - family_generation: float | None | Unset - if isinstance(self.family_generation, Unset): - family_generation = UNSET - else: - family_generation = self.family_generation - - released_at: None | str | Unset - if isinstance(self.released_at, Unset): - released_at = UNSET - else: - released_at = self.released_at - - sunset_at: None | str | Unset - if isinstance(self.sunset_at, Unset): - sunset_at = UNSET - else: - sunset_at = self.sunset_at - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "description": description, - "id": id, - "max_context_tokens": max_context_tokens, - "max_output_tokens": max_output_tokens, - "model_id": model_id, - "name": name, - "provider": provider, - "reason": reason, - "recommendation_type": recommendation_type, - "supports_openai_arguments": supports_openai_arguments, - "supports_streaming": supports_streaming, - "supports_structured_output": supports_structured_output, - "supports_thinking": supports_thinking, - "supports_tool_use": supports_tool_use, - } - ) - if deprecated_at is not UNSET: - field_dict["deprecated_at"] = deprecated_at - if family is not UNSET: - field_dict["family"] = family - if family_generation is not UNSET: - field_dict["family_generation"] = family_generation - if released_at is not UNSET: - field_dict["released_at"] = released_at - if sunset_at is not UNSET: - field_dict["sunset_at"] = sunset_at - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - description = d.pop("description") - - id = d.pop("id") - - max_context_tokens = d.pop("max_context_tokens") - - max_output_tokens = d.pop("max_output_tokens") - - model_id = d.pop("model_id") - - name = d.pop("name") - - provider = d.pop("provider") - - reason = d.pop("reason") - - recommendation_type = d.pop("recommendation_type") - - supports_openai_arguments = d.pop("supports_openai_arguments") - - supports_streaming = d.pop("supports_streaming") - - supports_structured_output = d.pop("supports_structured_output") - - supports_thinking = d.pop("supports_thinking") - - supports_tool_use = d.pop("supports_tool_use") - - def _parse_deprecated_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - deprecated_at = _parse_deprecated_at(d.pop("deprecated_at", UNSET)) - - def _parse_family(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - family = _parse_family(d.pop("family", UNSET)) - - def _parse_family_generation(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - family_generation = _parse_family_generation(d.pop("family_generation", UNSET)) - - def _parse_released_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - released_at = _parse_released_at(d.pop("released_at", UNSET)) - - def _parse_sunset_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - sunset_at = _parse_sunset_at(d.pop("sunset_at", UNSET)) - - model_recommendation_response = cls( - description=description, - id=id, - max_context_tokens=max_context_tokens, - max_output_tokens=max_output_tokens, - model_id=model_id, - name=name, - provider=provider, - reason=reason, - recommendation_type=recommendation_type, - supports_openai_arguments=supports_openai_arguments, - supports_streaming=supports_streaming, - supports_structured_output=supports_structured_output, - supports_thinking=supports_thinking, - supports_tool_use=supports_tool_use, - deprecated_at=deprecated_at, - family=family, - family_generation=family_generation, - released_at=released_at, - sunset_at=sunset_at, - ) - - model_recommendation_response.additional_properties = d - return model_recommendation_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/seclai/_generated/models/model_recommendations_response.py b/seclai/_generated/models/model_recommendations_response.py deleted file mode 100644 index e345c5d..0000000 --- a/seclai/_generated/models/model_recommendations_response.py +++ /dev/null @@ -1,163 +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.model_recommendation_response import ModelRecommendationResponse - - -T = TypeVar("T", bound="ModelRecommendationsResponse") - - -@_attrs_define -class ModelRecommendationsResponse: - """ - Attributes: - alternatives (list[ModelRecommendationResponse]): - current_model_id (str): - current_model_name (str): - same_provider (list[ModelRecommendationResponse]): - upgrades (list[ModelRecommendationResponse]): - successor (ModelRecommendationResponse | None | Unset): - """ - - alternatives: list[ModelRecommendationResponse] - current_model_id: str - current_model_name: str - same_provider: list[ModelRecommendationResponse] - upgrades: list[ModelRecommendationResponse] - successor: ModelRecommendationResponse | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.model_recommendation_response import ModelRecommendationResponse - - alternatives = [] - for alternatives_item_data in self.alternatives: - alternatives_item = alternatives_item_data.to_dict() - alternatives.append(alternatives_item) - - current_model_id = self.current_model_id - - current_model_name = self.current_model_name - - same_provider = [] - for same_provider_item_data in self.same_provider: - same_provider_item = same_provider_item_data.to_dict() - same_provider.append(same_provider_item) - - upgrades = [] - for upgrades_item_data in self.upgrades: - upgrades_item = upgrades_item_data.to_dict() - upgrades.append(upgrades_item) - - successor: dict[str, Any] | None | Unset - if isinstance(self.successor, Unset): - successor = UNSET - elif isinstance(self.successor, ModelRecommendationResponse): - successor = self.successor.to_dict() - else: - successor = self.successor - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "alternatives": alternatives, - "current_model_id": current_model_id, - "current_model_name": current_model_name, - "same_provider": same_provider, - "upgrades": upgrades, - } - ) - if successor is not UNSET: - field_dict["successor"] = successor - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.model_recommendation_response import ModelRecommendationResponse - - d = dict(src_dict) - alternatives = [] - _alternatives = d.pop("alternatives") - for alternatives_item_data in _alternatives: - alternatives_item = ModelRecommendationResponse.from_dict( - alternatives_item_data - ) - - alternatives.append(alternatives_item) - - current_model_id = d.pop("current_model_id") - - current_model_name = d.pop("current_model_name") - - same_provider = [] - _same_provider = d.pop("same_provider") - for same_provider_item_data in _same_provider: - same_provider_item = ModelRecommendationResponse.from_dict( - same_provider_item_data - ) - - same_provider.append(same_provider_item) - - upgrades = [] - _upgrades = d.pop("upgrades") - for upgrades_item_data in _upgrades: - upgrades_item = ModelRecommendationResponse.from_dict(upgrades_item_data) - - upgrades.append(upgrades_item) - - def _parse_successor( - data: object, - ) -> ModelRecommendationResponse | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - successor_type_0 = ModelRecommendationResponse.from_dict(data) - - return successor_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(ModelRecommendationResponse | None | Unset, data) - - successor = _parse_successor(d.pop("successor", UNSET)) - - model_recommendations_response = cls( - alternatives=alternatives, - current_model_id=current_model_id, - current_model_name=current_model_name, - same_provider=same_provider, - upgrades=upgrades, - successor=successor, - ) - - model_recommendations_response.additional_properties = d - return model_recommendations_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/seclai/_generated/models/non_manual_evaluation_mode_stat_response.py b/seclai/_generated/models/non_manual_evaluation_mode_stat_response.py deleted file mode 100644 index e811d5f..0000000 --- a/seclai/_generated/models/non_manual_evaluation_mode_stat_response.py +++ /dev/null @@ -1,110 +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="NonManualEvaluationModeStatResponse") - - -@_attrs_define -class NonManualEvaluationModeStatResponse: - """Per-mode rollup for evaluation activity. - - Attributes: - failed (int): - failure_rate (float): - flagged (int): - mode (str): - pass_rate (float): - passed (int): - total (int): - """ - - failed: int - failure_rate: float - flagged: int - mode: str - pass_rate: float - passed: int - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - failed = self.failed - - failure_rate = self.failure_rate - - flagged = self.flagged - - mode = self.mode - - pass_rate = self.pass_rate - - passed = self.passed - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "failed": failed, - "failure_rate": failure_rate, - "flagged": flagged, - "mode": mode, - "pass_rate": pass_rate, - "passed": passed, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - failed = d.pop("failed") - - failure_rate = d.pop("failure_rate") - - flagged = d.pop("flagged") - - mode = d.pop("mode") - - pass_rate = d.pop("pass_rate") - - passed = d.pop("passed") - - total = d.pop("total") - - non_manual_evaluation_mode_stat_response = cls( - failed=failed, - failure_rate=failure_rate, - flagged=flagged, - mode=mode, - pass_rate=pass_rate, - passed=passed, - total=total, - ) - - non_manual_evaluation_mode_stat_response.additional_properties = d - return non_manual_evaluation_mode_stat_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/seclai/_generated/models/non_manual_evaluation_summary_response.py b/seclai/_generated/models/non_manual_evaluation_summary_response.py deleted file mode 100644 index d760e08..0000000 --- a/seclai/_generated/models/non_manual_evaluation_summary_response.py +++ /dev/null @@ -1,130 +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.non_manual_evaluation_mode_stat_response import ( - NonManualEvaluationModeStatResponse, - ) - - -T = TypeVar("T", bound="NonManualEvaluationSummaryResponse") - - -@_attrs_define -class NonManualEvaluationSummaryResponse: - """Account-level summary for evaluations. - - Attributes: - by_mode (list[NonManualEvaluationModeStatResponse]): - failed (int): - failure_rate (float): - flagged (int): - pass_rate (float): - passed (int): - total (int): - """ - - by_mode: list[NonManualEvaluationModeStatResponse] - failed: int - failure_rate: float - flagged: int - pass_rate: float - passed: int - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - by_mode = [] - for by_mode_item_data in self.by_mode: - by_mode_item = by_mode_item_data.to_dict() - by_mode.append(by_mode_item) - - failed = self.failed - - failure_rate = self.failure_rate - - flagged = self.flagged - - pass_rate = self.pass_rate - - passed = self.passed - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "by_mode": by_mode, - "failed": failed, - "failure_rate": failure_rate, - "flagged": flagged, - "pass_rate": pass_rate, - "passed": passed, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.non_manual_evaluation_mode_stat_response import ( - NonManualEvaluationModeStatResponse, - ) - - d = dict(src_dict) - by_mode = [] - _by_mode = d.pop("by_mode") - for by_mode_item_data in _by_mode: - by_mode_item = NonManualEvaluationModeStatResponse.from_dict( - by_mode_item_data - ) - - by_mode.append(by_mode_item) - - failed = d.pop("failed") - - failure_rate = d.pop("failure_rate") - - flagged = d.pop("flagged") - - pass_rate = d.pop("pass_rate") - - passed = d.pop("passed") - - total = d.pop("total") - - non_manual_evaluation_summary_response = cls( - by_mode=by_mode, - failed=failed, - failure_rate=failure_rate, - flagged=flagged, - pass_rate=pass_rate, - passed=passed, - total=total, - ) - - non_manual_evaluation_summary_response.additional_properties = d - return non_manual_evaluation_summary_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/seclai/_generated/models/ok_response.py b/seclai/_generated/models/ok_response.py deleted file mode 100644 index 8b21f84..0000000 --- a/seclai/_generated/models/ok_response.py +++ /dev/null @@ -1,63 +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="OkResponse") - - -@_attrs_define -class OkResponse: - """A minimal ``{"ok": true}`` acknowledgement for state-mutating actions - that have no richer resource to return (e.g. accept/decline a suggestion). - - Attributes: - ok (bool): - """ - - ok: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - ok = self.ok - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "ok": ok, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - ok = d.pop("ok") - - ok_response = cls( - ok=ok, - ) - - ok_response.additional_properties = d - return ok_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/seclai/_generated/models/organization_alert_preference_list_response.py b/seclai/_generated/models/organization_alert_preference_list_response.py deleted file mode 100644 index 63a2215..0000000 --- a/seclai/_generated/models/organization_alert_preference_list_response.py +++ /dev/null @@ -1,89 +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.organization_alert_preference_response import ( - OrganizationAlertPreferenceResponse, - ) - - -T = TypeVar("T", bound="OrganizationAlertPreferenceListResponse") - - -@_attrs_define -class OrganizationAlertPreferenceListResponse: - """ - Attributes: - preferences (list[OrganizationAlertPreferenceResponse]): - total (int): - """ - - preferences: list[OrganizationAlertPreferenceResponse] - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - preferences = [] - for preferences_item_data in self.preferences: - preferences_item = preferences_item_data.to_dict() - preferences.append(preferences_item) - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "preferences": preferences, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.organization_alert_preference_response import ( - OrganizationAlertPreferenceResponse, - ) - - d = dict(src_dict) - preferences = [] - _preferences = d.pop("preferences") - for preferences_item_data in _preferences: - preferences_item = OrganizationAlertPreferenceResponse.from_dict( - preferences_item_data - ) - - preferences.append(preferences_item) - - total = d.pop("total") - - organization_alert_preference_list_response = cls( - preferences=preferences, - total=total, - ) - - organization_alert_preference_list_response.additional_properties = d - return organization_alert_preference_list_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/seclai/_generated/models/organization_alert_preference_response.py b/seclai/_generated/models/organization_alert_preference_response.py deleted file mode 100644 index 1a8fdd4..0000000 --- a/seclai/_generated/models/organization_alert_preference_response.py +++ /dev/null @@ -1,85 +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="OrganizationAlertPreferenceResponse") - - -@_attrs_define -class OrganizationAlertPreferenceResponse: - """ - Attributes: - alert_type (str): - is_override (bool): - organization_id (str): - subscribed (bool): - """ - - alert_type: str - is_override: bool - organization_id: str - subscribed: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - alert_type = self.alert_type - - is_override = self.is_override - - organization_id = self.organization_id - - subscribed = self.subscribed - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "alert_type": alert_type, - "is_override": is_override, - "organization_id": organization_id, - "subscribed": subscribed, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - alert_type = d.pop("alert_type") - - is_override = d.pop("is_override") - - organization_id = d.pop("organization_id") - - subscribed = d.pop("subscribed") - - organization_alert_preference_response = cls( - alert_type=alert_type, - is_override=is_override, - organization_id=organization_id, - subscribed=subscribed, - ) - - organization_alert_preference_response.additional_properties = d - return organization_alert_preference_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/seclai/_generated/models/organization_info_response.py b/seclai/_generated/models/organization_info_response.py deleted file mode 100644 index 4a8ece7..0000000 --- a/seclai/_generated/models/organization_info_response.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrganizationInfoResponse") - - -@_attrs_define -class OrganizationInfoResponse: - """ - Attributes: - account_id (UUID): - id (UUID): - name (str): - """ - - account_id: UUID - id: UUID - name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - account_id = str(self.account_id) - - id = str(self.id) - - name = self.name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_id": account_id, - "id": id, - "name": name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = UUID(d.pop("account_id")) - - id = UUID(d.pop("id")) - - name = d.pop("name") - - organization_info_response = cls( - account_id=account_id, - id=id, - name=name, - ) - - organization_info_response.additional_properties = d - return organization_info_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/seclai/_generated/models/pagination_response.py b/seclai/_generated/models/pagination_response.py deleted file mode 100644 index 62234c4..0000000 --- a/seclai/_generated/models/pagination_response.py +++ /dev/null @@ -1,102 +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="PaginationResponse") - - -@_attrs_define -class PaginationResponse: - """Pagination information. - - Attributes: - has_next (bool): - has_prev (bool): - limit (int): - page (int): - pages (int): - total (int): - """ - - has_next: bool - has_prev: bool - limit: int - page: int - pages: int - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - has_next = self.has_next - - has_prev = self.has_prev - - limit = self.limit - - page = self.page - - pages = self.pages - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "has_next": has_next, - "has_prev": has_prev, - "limit": limit, - "page": page, - "pages": pages, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - has_next = d.pop("has_next") - - has_prev = d.pop("has_prev") - - limit = d.pop("limit") - - page = d.pop("page") - - pages = d.pop("pages") - - total = d.pop("total") - - pagination_response = cls( - has_next=has_next, - has_prev=has_prev, - limit=limit, - page=page, - pages=pages, - total=total, - ) - - pagination_response.additional_properties = d - return pagination_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/seclai/_generated/models/pending_processing_completed_failed_status.py b/seclai/_generated/models/pending_processing_completed_failed_status.py deleted file mode 100644 index 690e4f0..0000000 --- a/seclai/_generated/models/pending_processing_completed_failed_status.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - - -class PendingProcessingCompletedFailedStatus(str, Enum): - COMPLETED = "completed" - FAILED = "failed" - PENDING = "pending" - PROCESSING = "processing" - QUEUED = "queued" - WAITING_HUMAN = "waiting_human" - WAITING_SCHEDULED = "waiting_scheduled" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/models/playground_create_request.py b/seclai/_generated/models/playground_create_request.py deleted file mode 100644 index f94c14e..0000000 --- a/seclai/_generated/models/playground_create_request.py +++ /dev/null @@ -1,205 +0,0 @@ -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 ..models.playground_create_request_evaluation_complexity import ( - PlaygroundCreateRequestEvaluationComplexity, -) -from ..models.playground_create_request_evaluation_mode import ( - PlaygroundCreateRequestEvaluationMode, -) -from ..types import UNSET, Unset - -T = TypeVar("T", bound="PlaygroundCreateRequest") - - -@_attrs_define -class PlaygroundCreateRequest: - """Create a model playground experiment via the public API. - - Attributes: - model_ids (list[str]): Selected model IDs (1-10). - prompt (str): Prompt text for the experiment. - evaluation_complexity (PlaygroundCreateRequestEvaluationComplexity | Unset): simple, medium, or complex Default: - PlaygroundCreateRequestEvaluationComplexity.MEDIUM. - evaluation_mode (PlaygroundCreateRequestEvaluationMode | Unset): manual or prompt Default: - PlaygroundCreateRequestEvaluationMode.MANUAL. - evaluator_model_id (None | str | Unset): Evaluator model ID when evaluation_mode is prompt. - include_step_output_in_evaluation (bool | Unset): Whether to include selected step output as evaluator context. - Default: False. - json_template (None | str | Unset): Optional JSON template for advanced mode. - selected_step_output (None | str | Unset): Optional step output text for evaluator context. - system_prompt (str | Unset): Optional system prompt. Default: ''. - """ - - model_ids: list[str] - prompt: str - evaluation_complexity: PlaygroundCreateRequestEvaluationComplexity | Unset = ( - PlaygroundCreateRequestEvaluationComplexity.MEDIUM - ) - evaluation_mode: PlaygroundCreateRequestEvaluationMode | Unset = ( - PlaygroundCreateRequestEvaluationMode.MANUAL - ) - evaluator_model_id: None | str | Unset = UNSET - include_step_output_in_evaluation: bool | Unset = False - json_template: None | str | Unset = UNSET - selected_step_output: None | str | Unset = UNSET - system_prompt: str | Unset = "" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - model_ids = self.model_ids - - prompt = self.prompt - - evaluation_complexity: str | Unset = UNSET - if not isinstance(self.evaluation_complexity, Unset): - evaluation_complexity = self.evaluation_complexity.value - - evaluation_mode: str | Unset = UNSET - if not isinstance(self.evaluation_mode, Unset): - evaluation_mode = self.evaluation_mode.value - - evaluator_model_id: None | str | Unset - if isinstance(self.evaluator_model_id, Unset): - evaluator_model_id = UNSET - else: - evaluator_model_id = self.evaluator_model_id - - include_step_output_in_evaluation = self.include_step_output_in_evaluation - - json_template: None | str | Unset - if isinstance(self.json_template, Unset): - json_template = UNSET - else: - json_template = self.json_template - - selected_step_output: None | str | Unset - if isinstance(self.selected_step_output, Unset): - selected_step_output = UNSET - else: - selected_step_output = self.selected_step_output - - system_prompt = self.system_prompt - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "model_ids": model_ids, - "prompt": prompt, - } - ) - if evaluation_complexity is not UNSET: - field_dict["evaluation_complexity"] = evaluation_complexity - if evaluation_mode is not UNSET: - field_dict["evaluation_mode"] = evaluation_mode - if evaluator_model_id is not UNSET: - field_dict["evaluator_model_id"] = evaluator_model_id - if include_step_output_in_evaluation is not UNSET: - field_dict["include_step_output_in_evaluation"] = ( - include_step_output_in_evaluation - ) - if json_template is not UNSET: - field_dict["json_template"] = json_template - if selected_step_output is not UNSET: - field_dict["selected_step_output"] = selected_step_output - if system_prompt is not UNSET: - field_dict["system_prompt"] = system_prompt - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - model_ids = cast(list[str], d.pop("model_ids")) - - prompt = d.pop("prompt") - - _evaluation_complexity = d.pop("evaluation_complexity", UNSET) - evaluation_complexity: PlaygroundCreateRequestEvaluationComplexity | Unset - if isinstance(_evaluation_complexity, Unset): - evaluation_complexity = UNSET - else: - evaluation_complexity = PlaygroundCreateRequestEvaluationComplexity( - _evaluation_complexity - ) - - _evaluation_mode = d.pop("evaluation_mode", UNSET) - evaluation_mode: PlaygroundCreateRequestEvaluationMode | Unset - if isinstance(_evaluation_mode, Unset): - evaluation_mode = UNSET - else: - evaluation_mode = PlaygroundCreateRequestEvaluationMode(_evaluation_mode) - - def _parse_evaluator_model_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - evaluator_model_id = _parse_evaluator_model_id( - d.pop("evaluator_model_id", UNSET) - ) - - include_step_output_in_evaluation = d.pop( - "include_step_output_in_evaluation", UNSET - ) - - def _parse_json_template(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - json_template = _parse_json_template(d.pop("json_template", UNSET)) - - def _parse_selected_step_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - selected_step_output = _parse_selected_step_output( - d.pop("selected_step_output", UNSET) - ) - - system_prompt = d.pop("system_prompt", UNSET) - - playground_create_request = cls( - model_ids=model_ids, - prompt=prompt, - evaluation_complexity=evaluation_complexity, - evaluation_mode=evaluation_mode, - evaluator_model_id=evaluator_model_id, - include_step_output_in_evaluation=include_step_output_in_evaluation, - json_template=json_template, - selected_step_output=selected_step_output, - system_prompt=system_prompt, - ) - - playground_create_request.additional_properties = d - return playground_create_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/seclai/_generated/models/playground_create_request_evaluation_complexity.py b/seclai/_generated/models/playground_create_request_evaluation_complexity.py deleted file mode 100644 index 6d02650..0000000 --- a/seclai/_generated/models/playground_create_request_evaluation_complexity.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class PlaygroundCreateRequestEvaluationComplexity(str, Enum): - COMPLEX = "complex" - MEDIUM = "medium" - SIMPLE = "simple" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/models/playground_create_request_evaluation_mode.py b/seclai/_generated/models/playground_create_request_evaluation_mode.py deleted file mode 100644 index dd698fb..0000000 --- a/seclai/_generated/models/playground_create_request_evaluation_mode.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class PlaygroundCreateRequestEvaluationMode(str, Enum): - MANUAL = "manual" - PROMPT = "prompt" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/models/prompt_model_auto_upgrade_strategy.py b/seclai/_generated/models/prompt_model_auto_upgrade_strategy.py deleted file mode 100644 index 24b8327..0000000 --- a/seclai/_generated/models/prompt_model_auto_upgrade_strategy.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class PromptModelAutoUpgradeStrategy(str, Enum): - CAUTIOUS_ADOPTER = "cautious_adopter" - EARLY_ADOPTER = "early_adopter" - MIDDLE_OF_ROAD = "middle_of_road" - NONE = "none" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/models/prompt_model_response.py b/seclai/_generated/models/prompt_model_response.py deleted file mode 100644 index 62954d0..0000000 --- a/seclai/_generated/models/prompt_model_response.py +++ /dev/null @@ -1,1001 +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 dateutil.parser import isoparse - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.modality_rate_response import ModalityRateResponse - from ..models.prompt_model_response_generation_params_type_0 import ( - PromptModelResponseGenerationParamsType0, - ) - from ..models.prompt_model_response_payload_schema_type_0 import ( - PromptModelResponsePayloadSchemaType0, - ) - from ..models.prompt_tool_response import PromptToolResponse - from ..models.variant_category_response import VariantCategoryResponse - - -T = TypeVar("T", bound="PromptModelResponse") - - -@_attrs_define -class PromptModelResponse: - """Response model for prompt model data - - Attributes: - default (bool): - description (str): - enabled (bool): - id (str): - max_context_tokens (int): - max_conversation_length (int): - max_output_tokens (int): - model_id (str): - name (str): - provider (str): - deprecated_at (datetime.datetime | None | Unset): - family (None | str | Unset): - family_generation (float | None | Unset): - generation_credits_per_unit (float | None | Unset): Per-unit credit cost for a dedicated media-generation model, - in the unit named by ``generation_params.pricing_unit`` (per image / per second / per character / per output - token). Multiply by the produced unit count (images, seconds, characters) for the run cost. None for token- - billed (non-generation) models. - generation_params (None | PromptModelResponseGenerationParamsType0 | Unset): Media-generation descriptor - (modality, pricing_unit, and modality-specific constraints). NULL for text LLMs; present for image/audio/video - generation models. See schemas.generation_params. - generation_unit_label (None | str | Unset): Human suffix for the per-unit generation rate (e.g. ``/image``, - ``/second``, ``/1k chars``, ``/1k tokens``) — single-sourced from the pricing unit so clients render cost - without re-deriving the mapping. None for non-generation models. Char/token rates are shown per 1,000 (the ``/1k - …`` suffix), so scale ``generation_credits_per_unit`` accordingly for those units. - image_generation_tool_credits_per_image (float | None | Unset): Per-image credit cost of using the built-in - image_generation tool (it runs gpt-image-1). Set only for models that actually support the tool (tool-use - capable); None otherwise. - input_1h_cache_write_credits_per_1000_tokens (float | None | Unset): - input_5m_cache_write_credits_per_1000_tokens (float | None | Unset): - input_cache_hit_credits_per_1000_tokens (float | None | Unset): - input_credits_per_1000_tokens (float | None | Unset): - is_new (bool | Unset): Default: False. - last_used (bool | Unset): Default: False. - output_credits_per_1000_tokens (float | None | Unset): - payload_schema (None | PromptModelResponsePayloadSchemaType0 | Unset): Model-specific JSON schema for advanced - prompt_call json_template payloads. - payload_schema_source_url (None | str | Unset): Source URL used to derive payload_schema guidance for this - model. - per_modality_rates (list[ModalityRateResponse] | Unset): - released_at (datetime.datetime | None | Unset): - schema_documentation_url (None | str | Unset): Model documentation URL with request/response payload details. - schema_notes (None | str | Unset): Human-readable notes about request payload compatibility. - successor_model_id (None | str | Unset): - sunset_at (datetime.datetime | None | Unset): - supported_input_media (list[str] | None | Unset): - supported_languages (list[str] | None | Unset): - supported_output_media (list[str] | None | Unset): - supports_openai_arguments (bool | Unset): Default: False. - supports_streaming (bool | Unset): Default: False. - supports_structured_output (bool | Unset): Default: True. - supports_thinking (bool | Unset): Default: False. - supports_tool_use (bool | Unset): Default: True. - tools_disabled (list[PromptToolResponse] | Unset): - tools_enabled (list[PromptToolResponse] | Unset): - training_cutoff_at (datetime.datetime | None | Unset): - url (None | str | Unset): - variants (list[VariantCategoryResponse] | None | Unset): - """ - - default: bool - description: str - enabled: bool - id: str - max_context_tokens: int - max_conversation_length: int - max_output_tokens: int - model_id: str - name: str - provider: str - deprecated_at: datetime.datetime | None | Unset = UNSET - family: None | str | Unset = UNSET - family_generation: float | None | Unset = UNSET - generation_credits_per_unit: float | None | Unset = UNSET - generation_params: None | PromptModelResponseGenerationParamsType0 | Unset = UNSET - generation_unit_label: None | str | Unset = UNSET - image_generation_tool_credits_per_image: float | None | Unset = UNSET - input_1h_cache_write_credits_per_1000_tokens: float | None | Unset = UNSET - input_5m_cache_write_credits_per_1000_tokens: float | None | Unset = UNSET - input_cache_hit_credits_per_1000_tokens: float | None | Unset = UNSET - input_credits_per_1000_tokens: float | None | Unset = UNSET - is_new: bool | Unset = False - last_used: bool | Unset = False - output_credits_per_1000_tokens: float | None | Unset = UNSET - payload_schema: None | PromptModelResponsePayloadSchemaType0 | Unset = UNSET - payload_schema_source_url: None | str | Unset = UNSET - per_modality_rates: list[ModalityRateResponse] | Unset = UNSET - released_at: datetime.datetime | None | Unset = UNSET - schema_documentation_url: None | str | Unset = UNSET - schema_notes: None | str | Unset = UNSET - successor_model_id: None | str | Unset = UNSET - sunset_at: datetime.datetime | None | Unset = UNSET - supported_input_media: list[str] | None | Unset = UNSET - supported_languages: list[str] | None | Unset = UNSET - supported_output_media: list[str] | None | Unset = UNSET - supports_openai_arguments: bool | Unset = False - supports_streaming: bool | Unset = False - supports_structured_output: bool | Unset = True - supports_thinking: bool | Unset = False - supports_tool_use: bool | Unset = True - tools_disabled: list[PromptToolResponse] | Unset = UNSET - tools_enabled: list[PromptToolResponse] | Unset = UNSET - training_cutoff_at: datetime.datetime | None | Unset = UNSET - url: None | str | Unset = UNSET - variants: list[VariantCategoryResponse] | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.prompt_model_response_generation_params_type_0 import ( - PromptModelResponseGenerationParamsType0, - ) - from ..models.prompt_model_response_payload_schema_type_0 import ( - PromptModelResponsePayloadSchemaType0, - ) - - default = self.default - - description = self.description - - enabled = self.enabled - - id = self.id - - max_context_tokens = self.max_context_tokens - - max_conversation_length = self.max_conversation_length - - max_output_tokens = self.max_output_tokens - - model_id = self.model_id - - name = self.name - - provider = self.provider - - deprecated_at: None | str | Unset - if isinstance(self.deprecated_at, Unset): - deprecated_at = UNSET - elif isinstance(self.deprecated_at, datetime.datetime): - deprecated_at = self.deprecated_at.isoformat() - else: - deprecated_at = self.deprecated_at - - family: None | str | Unset - if isinstance(self.family, Unset): - family = UNSET - else: - family = self.family - - family_generation: float | None | Unset - if isinstance(self.family_generation, Unset): - family_generation = UNSET - else: - family_generation = self.family_generation - - generation_credits_per_unit: float | None | Unset - if isinstance(self.generation_credits_per_unit, Unset): - generation_credits_per_unit = UNSET - else: - generation_credits_per_unit = self.generation_credits_per_unit - - generation_params: dict[str, Any] | None | Unset - if isinstance(self.generation_params, Unset): - generation_params = UNSET - elif isinstance( - self.generation_params, PromptModelResponseGenerationParamsType0 - ): - generation_params = self.generation_params.to_dict() - else: - generation_params = self.generation_params - - generation_unit_label: None | str | Unset - if isinstance(self.generation_unit_label, Unset): - generation_unit_label = UNSET - else: - generation_unit_label = self.generation_unit_label - - image_generation_tool_credits_per_image: float | None | Unset - if isinstance(self.image_generation_tool_credits_per_image, Unset): - image_generation_tool_credits_per_image = UNSET - else: - image_generation_tool_credits_per_image = ( - self.image_generation_tool_credits_per_image - ) - - input_1h_cache_write_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_1h_cache_write_credits_per_1000_tokens, Unset): - input_1h_cache_write_credits_per_1000_tokens = UNSET - else: - input_1h_cache_write_credits_per_1000_tokens = ( - self.input_1h_cache_write_credits_per_1000_tokens - ) - - input_5m_cache_write_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_5m_cache_write_credits_per_1000_tokens, Unset): - input_5m_cache_write_credits_per_1000_tokens = UNSET - else: - input_5m_cache_write_credits_per_1000_tokens = ( - self.input_5m_cache_write_credits_per_1000_tokens - ) - - input_cache_hit_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_cache_hit_credits_per_1000_tokens, Unset): - input_cache_hit_credits_per_1000_tokens = UNSET - else: - input_cache_hit_credits_per_1000_tokens = ( - self.input_cache_hit_credits_per_1000_tokens - ) - - input_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_credits_per_1000_tokens, Unset): - input_credits_per_1000_tokens = UNSET - else: - input_credits_per_1000_tokens = self.input_credits_per_1000_tokens - - is_new = self.is_new - - last_used = self.last_used - - output_credits_per_1000_tokens: float | None | Unset - if isinstance(self.output_credits_per_1000_tokens, Unset): - output_credits_per_1000_tokens = UNSET - else: - output_credits_per_1000_tokens = self.output_credits_per_1000_tokens - - payload_schema: dict[str, Any] | None | Unset - if isinstance(self.payload_schema, Unset): - payload_schema = UNSET - elif isinstance(self.payload_schema, PromptModelResponsePayloadSchemaType0): - payload_schema = self.payload_schema.to_dict() - else: - payload_schema = self.payload_schema - - payload_schema_source_url: None | str | Unset - if isinstance(self.payload_schema_source_url, Unset): - payload_schema_source_url = UNSET - else: - payload_schema_source_url = self.payload_schema_source_url - - per_modality_rates: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.per_modality_rates, Unset): - per_modality_rates = [] - for per_modality_rates_item_data in self.per_modality_rates: - per_modality_rates_item = per_modality_rates_item_data.to_dict() - per_modality_rates.append(per_modality_rates_item) - - released_at: None | str | Unset - if isinstance(self.released_at, Unset): - released_at = UNSET - elif isinstance(self.released_at, datetime.datetime): - released_at = self.released_at.isoformat() - else: - released_at = self.released_at - - schema_documentation_url: None | str | Unset - if isinstance(self.schema_documentation_url, Unset): - schema_documentation_url = UNSET - else: - schema_documentation_url = self.schema_documentation_url - - schema_notes: None | str | Unset - if isinstance(self.schema_notes, Unset): - schema_notes = UNSET - else: - schema_notes = self.schema_notes - - successor_model_id: None | str | Unset - if isinstance(self.successor_model_id, Unset): - successor_model_id = UNSET - else: - successor_model_id = self.successor_model_id - - sunset_at: None | str | Unset - if isinstance(self.sunset_at, Unset): - sunset_at = UNSET - elif isinstance(self.sunset_at, datetime.datetime): - sunset_at = self.sunset_at.isoformat() - else: - sunset_at = self.sunset_at - - supported_input_media: list[str] | None | Unset - if isinstance(self.supported_input_media, Unset): - supported_input_media = UNSET - elif isinstance(self.supported_input_media, list): - supported_input_media = self.supported_input_media - - else: - supported_input_media = self.supported_input_media - - supported_languages: list[str] | None | Unset - if isinstance(self.supported_languages, Unset): - supported_languages = UNSET - elif isinstance(self.supported_languages, list): - supported_languages = self.supported_languages - - else: - supported_languages = self.supported_languages - - supported_output_media: list[str] | None | Unset - if isinstance(self.supported_output_media, Unset): - supported_output_media = UNSET - elif isinstance(self.supported_output_media, list): - supported_output_media = self.supported_output_media - - else: - supported_output_media = self.supported_output_media - - supports_openai_arguments = self.supports_openai_arguments - - supports_streaming = self.supports_streaming - - supports_structured_output = self.supports_structured_output - - supports_thinking = self.supports_thinking - - supports_tool_use = self.supports_tool_use - - tools_disabled: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.tools_disabled, Unset): - tools_disabled = [] - for tools_disabled_item_data in self.tools_disabled: - tools_disabled_item = tools_disabled_item_data.to_dict() - tools_disabled.append(tools_disabled_item) - - tools_enabled: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.tools_enabled, Unset): - tools_enabled = [] - for tools_enabled_item_data in self.tools_enabled: - tools_enabled_item = tools_enabled_item_data.to_dict() - tools_enabled.append(tools_enabled_item) - - training_cutoff_at: None | str | Unset - if isinstance(self.training_cutoff_at, Unset): - training_cutoff_at = UNSET - elif isinstance(self.training_cutoff_at, datetime.datetime): - training_cutoff_at = self.training_cutoff_at.isoformat() - else: - training_cutoff_at = self.training_cutoff_at - - url: None | str | Unset - if isinstance(self.url, Unset): - url = UNSET - else: - url = self.url - - variants: list[dict[str, Any]] | None | Unset - if isinstance(self.variants, Unset): - variants = UNSET - elif isinstance(self.variants, list): - variants = [] - for variants_type_0_item_data in self.variants: - variants_type_0_item = variants_type_0_item_data.to_dict() - variants.append(variants_type_0_item) - - else: - variants = self.variants - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "default": default, - "description": description, - "enabled": enabled, - "id": id, - "max_context_tokens": max_context_tokens, - "max_conversation_length": max_conversation_length, - "max_output_tokens": max_output_tokens, - "model_id": model_id, - "name": name, - "provider": provider, - } - ) - if deprecated_at is not UNSET: - field_dict["deprecated_at"] = deprecated_at - if family is not UNSET: - field_dict["family"] = family - if family_generation is not UNSET: - field_dict["family_generation"] = family_generation - if generation_credits_per_unit is not UNSET: - field_dict["generation_credits_per_unit"] = generation_credits_per_unit - if generation_params is not UNSET: - field_dict["generation_params"] = generation_params - if generation_unit_label is not UNSET: - field_dict["generation_unit_label"] = generation_unit_label - if image_generation_tool_credits_per_image is not UNSET: - field_dict["image_generation_tool_credits_per_image"] = ( - image_generation_tool_credits_per_image - ) - if input_1h_cache_write_credits_per_1000_tokens is not UNSET: - field_dict["input_1h_cache_write_credits_per_1000_tokens"] = ( - input_1h_cache_write_credits_per_1000_tokens - ) - if input_5m_cache_write_credits_per_1000_tokens is not UNSET: - field_dict["input_5m_cache_write_credits_per_1000_tokens"] = ( - input_5m_cache_write_credits_per_1000_tokens - ) - if input_cache_hit_credits_per_1000_tokens is not UNSET: - field_dict["input_cache_hit_credits_per_1000_tokens"] = ( - input_cache_hit_credits_per_1000_tokens - ) - if input_credits_per_1000_tokens is not UNSET: - field_dict["input_credits_per_1000_tokens"] = input_credits_per_1000_tokens - if is_new is not UNSET: - field_dict["is_new"] = is_new - if last_used is not UNSET: - field_dict["last_used"] = last_used - if output_credits_per_1000_tokens is not UNSET: - field_dict["output_credits_per_1000_tokens"] = ( - output_credits_per_1000_tokens - ) - if payload_schema is not UNSET: - field_dict["payload_schema"] = payload_schema - if payload_schema_source_url is not UNSET: - field_dict["payload_schema_source_url"] = payload_schema_source_url - if per_modality_rates is not UNSET: - field_dict["per_modality_rates"] = per_modality_rates - if released_at is not UNSET: - field_dict["released_at"] = released_at - if schema_documentation_url is not UNSET: - field_dict["schema_documentation_url"] = schema_documentation_url - if schema_notes is not UNSET: - field_dict["schema_notes"] = schema_notes - if successor_model_id is not UNSET: - field_dict["successor_model_id"] = successor_model_id - if sunset_at is not UNSET: - field_dict["sunset_at"] = sunset_at - if supported_input_media is not UNSET: - field_dict["supported_input_media"] = supported_input_media - if supported_languages is not UNSET: - field_dict["supported_languages"] = supported_languages - if supported_output_media is not UNSET: - field_dict["supported_output_media"] = supported_output_media - if supports_openai_arguments is not UNSET: - field_dict["supports_openai_arguments"] = supports_openai_arguments - if supports_streaming is not UNSET: - field_dict["supports_streaming"] = supports_streaming - if supports_structured_output is not UNSET: - field_dict["supports_structured_output"] = supports_structured_output - if supports_thinking is not UNSET: - field_dict["supports_thinking"] = supports_thinking - if supports_tool_use is not UNSET: - field_dict["supports_tool_use"] = supports_tool_use - if tools_disabled is not UNSET: - field_dict["tools_disabled"] = tools_disabled - if tools_enabled is not UNSET: - field_dict["tools_enabled"] = tools_enabled - if training_cutoff_at is not UNSET: - field_dict["training_cutoff_at"] = training_cutoff_at - if url is not UNSET: - field_dict["url"] = url - if variants is not UNSET: - field_dict["variants"] = variants - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.modality_rate_response import ModalityRateResponse - from ..models.prompt_model_response_generation_params_type_0 import ( - PromptModelResponseGenerationParamsType0, - ) - from ..models.prompt_model_response_payload_schema_type_0 import ( - PromptModelResponsePayloadSchemaType0, - ) - from ..models.prompt_tool_response import PromptToolResponse - from ..models.variant_category_response import VariantCategoryResponse - - d = dict(src_dict) - default = d.pop("default") - - description = d.pop("description") - - enabled = d.pop("enabled") - - id = d.pop("id") - - max_context_tokens = d.pop("max_context_tokens") - - max_conversation_length = d.pop("max_conversation_length") - - max_output_tokens = d.pop("max_output_tokens") - - model_id = d.pop("model_id") - - name = d.pop("name") - - provider = d.pop("provider") - - def _parse_deprecated_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() - deprecated_at_type_0 = isoparse(data) - - return deprecated_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - deprecated_at = _parse_deprecated_at(d.pop("deprecated_at", UNSET)) - - def _parse_family(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - family = _parse_family(d.pop("family", UNSET)) - - def _parse_family_generation(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - family_generation = _parse_family_generation(d.pop("family_generation", UNSET)) - - def _parse_generation_credits_per_unit(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - generation_credits_per_unit = _parse_generation_credits_per_unit( - d.pop("generation_credits_per_unit", UNSET) - ) - - def _parse_generation_params( - data: object, - ) -> None | PromptModelResponseGenerationParamsType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - generation_params_type_0 = ( - PromptModelResponseGenerationParamsType0.from_dict(data) - ) - - return generation_params_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PromptModelResponseGenerationParamsType0 | Unset, data) - - generation_params = _parse_generation_params(d.pop("generation_params", UNSET)) - - def _parse_generation_unit_label(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - generation_unit_label = _parse_generation_unit_label( - d.pop("generation_unit_label", UNSET) - ) - - def _parse_image_generation_tool_credits_per_image( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - image_generation_tool_credits_per_image = ( - _parse_image_generation_tool_credits_per_image( - d.pop("image_generation_tool_credits_per_image", UNSET) - ) - ) - - def _parse_input_1h_cache_write_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_1h_cache_write_credits_per_1000_tokens = ( - _parse_input_1h_cache_write_credits_per_1000_tokens( - d.pop("input_1h_cache_write_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_input_5m_cache_write_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_5m_cache_write_credits_per_1000_tokens = ( - _parse_input_5m_cache_write_credits_per_1000_tokens( - d.pop("input_5m_cache_write_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_input_cache_hit_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_cache_hit_credits_per_1000_tokens = ( - _parse_input_cache_hit_credits_per_1000_tokens( - d.pop("input_cache_hit_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_input_credits_per_1000_tokens(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_credits_per_1000_tokens = _parse_input_credits_per_1000_tokens( - d.pop("input_credits_per_1000_tokens", UNSET) - ) - - is_new = d.pop("is_new", UNSET) - - last_used = d.pop("last_used", UNSET) - - def _parse_output_credits_per_1000_tokens(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - output_credits_per_1000_tokens = _parse_output_credits_per_1000_tokens( - d.pop("output_credits_per_1000_tokens", UNSET) - ) - - def _parse_payload_schema( - data: object, - ) -> None | PromptModelResponsePayloadSchemaType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - payload_schema_type_0 = PromptModelResponsePayloadSchemaType0.from_dict( - data - ) - - return payload_schema_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PromptModelResponsePayloadSchemaType0 | Unset, data) - - payload_schema = _parse_payload_schema(d.pop("payload_schema", UNSET)) - - def _parse_payload_schema_source_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - payload_schema_source_url = _parse_payload_schema_source_url( - d.pop("payload_schema_source_url", UNSET) - ) - - _per_modality_rates = d.pop("per_modality_rates", UNSET) - per_modality_rates: list[ModalityRateResponse] | Unset = UNSET - if _per_modality_rates is not UNSET: - per_modality_rates = [] - for per_modality_rates_item_data in _per_modality_rates: - per_modality_rates_item = ModalityRateResponse.from_dict( - per_modality_rates_item_data - ) - - per_modality_rates.append(per_modality_rates_item) - - def _parse_released_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() - released_at_type_0 = isoparse(data) - - return released_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - released_at = _parse_released_at(d.pop("released_at", UNSET)) - - def _parse_schema_documentation_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - schema_documentation_url = _parse_schema_documentation_url( - d.pop("schema_documentation_url", UNSET) - ) - - def _parse_schema_notes(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - schema_notes = _parse_schema_notes(d.pop("schema_notes", UNSET)) - - def _parse_successor_model_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - successor_model_id = _parse_successor_model_id( - d.pop("successor_model_id", UNSET) - ) - - def _parse_sunset_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() - sunset_at_type_0 = isoparse(data) - - return sunset_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - sunset_at = _parse_sunset_at(d.pop("sunset_at", UNSET)) - - def _parse_supported_input_media(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() - supported_input_media_type_0 = cast(list[str], data) - - return supported_input_media_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - supported_input_media = _parse_supported_input_media( - d.pop("supported_input_media", UNSET) - ) - - def _parse_supported_languages(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() - supported_languages_type_0 = cast(list[str], data) - - return supported_languages_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - supported_languages = _parse_supported_languages( - d.pop("supported_languages", UNSET) - ) - - def _parse_supported_output_media(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() - supported_output_media_type_0 = cast(list[str], data) - - return supported_output_media_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - supported_output_media = _parse_supported_output_media( - d.pop("supported_output_media", UNSET) - ) - - supports_openai_arguments = d.pop("supports_openai_arguments", UNSET) - - supports_streaming = d.pop("supports_streaming", UNSET) - - supports_structured_output = d.pop("supports_structured_output", UNSET) - - supports_thinking = d.pop("supports_thinking", UNSET) - - supports_tool_use = d.pop("supports_tool_use", UNSET) - - _tools_disabled = d.pop("tools_disabled", UNSET) - tools_disabled: list[PromptToolResponse] | Unset = UNSET - if _tools_disabled is not UNSET: - tools_disabled = [] - for tools_disabled_item_data in _tools_disabled: - tools_disabled_item = PromptToolResponse.from_dict( - tools_disabled_item_data - ) - - tools_disabled.append(tools_disabled_item) - - _tools_enabled = d.pop("tools_enabled", UNSET) - tools_enabled: list[PromptToolResponse] | Unset = UNSET - if _tools_enabled is not UNSET: - tools_enabled = [] - for tools_enabled_item_data in _tools_enabled: - tools_enabled_item = PromptToolResponse.from_dict( - tools_enabled_item_data - ) - - tools_enabled.append(tools_enabled_item) - - def _parse_training_cutoff_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() - training_cutoff_at_type_0 = isoparse(data) - - return training_cutoff_at_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.datetime | None | Unset, data) - - training_cutoff_at = _parse_training_cutoff_at( - d.pop("training_cutoff_at", UNSET) - ) - - def _parse_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - url = _parse_url(d.pop("url", UNSET)) - - def _parse_variants( - data: object, - ) -> list[VariantCategoryResponse] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - variants_type_0 = [] - _variants_type_0 = data - for variants_type_0_item_data in _variants_type_0: - variants_type_0_item = VariantCategoryResponse.from_dict( - variants_type_0_item_data - ) - - variants_type_0.append(variants_type_0_item) - - return variants_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[VariantCategoryResponse] | None | Unset, data) - - variants = _parse_variants(d.pop("variants", UNSET)) - - prompt_model_response = cls( - default=default, - description=description, - enabled=enabled, - id=id, - max_context_tokens=max_context_tokens, - max_conversation_length=max_conversation_length, - max_output_tokens=max_output_tokens, - model_id=model_id, - name=name, - provider=provider, - deprecated_at=deprecated_at, - family=family, - family_generation=family_generation, - generation_credits_per_unit=generation_credits_per_unit, - generation_params=generation_params, - generation_unit_label=generation_unit_label, - image_generation_tool_credits_per_image=image_generation_tool_credits_per_image, - input_1h_cache_write_credits_per_1000_tokens=input_1h_cache_write_credits_per_1000_tokens, - input_5m_cache_write_credits_per_1000_tokens=input_5m_cache_write_credits_per_1000_tokens, - input_cache_hit_credits_per_1000_tokens=input_cache_hit_credits_per_1000_tokens, - input_credits_per_1000_tokens=input_credits_per_1000_tokens, - is_new=is_new, - last_used=last_used, - output_credits_per_1000_tokens=output_credits_per_1000_tokens, - payload_schema=payload_schema, - payload_schema_source_url=payload_schema_source_url, - per_modality_rates=per_modality_rates, - released_at=released_at, - schema_documentation_url=schema_documentation_url, - schema_notes=schema_notes, - successor_model_id=successor_model_id, - sunset_at=sunset_at, - supported_input_media=supported_input_media, - supported_languages=supported_languages, - supported_output_media=supported_output_media, - supports_openai_arguments=supports_openai_arguments, - supports_streaming=supports_streaming, - supports_structured_output=supports_structured_output, - supports_thinking=supports_thinking, - supports_tool_use=supports_tool_use, - tools_disabled=tools_disabled, - tools_enabled=tools_enabled, - training_cutoff_at=training_cutoff_at, - url=url, - variants=variants, - ) - - prompt_model_response.additional_properties = d - return prompt_model_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/seclai/_generated/models/prompt_model_response_generation_params_type_0.py b/seclai/_generated/models/prompt_model_response_generation_params_type_0.py deleted file mode 100644 index ea79299..0000000 --- a/seclai/_generated/models/prompt_model_response_generation_params_type_0.py +++ /dev/null @@ -1,46 +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="PromptModelResponseGenerationParamsType0") - - -@_attrs_define -class PromptModelResponseGenerationParamsType0: - """ """ - - additional_properties: dict[str, Any] = _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) - prompt_model_response_generation_params_type_0 = cls() - - prompt_model_response_generation_params_type_0.additional_properties = d - return prompt_model_response_generation_params_type_0 - - @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/seclai/_generated/models/prompt_model_response_payload_schema_type_0.py b/seclai/_generated/models/prompt_model_response_payload_schema_type_0.py deleted file mode 100644 index 5a6c534..0000000 --- a/seclai/_generated/models/prompt_model_response_payload_schema_type_0.py +++ /dev/null @@ -1,46 +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="PromptModelResponsePayloadSchemaType0") - - -@_attrs_define -class PromptModelResponsePayloadSchemaType0: - """ """ - - additional_properties: dict[str, Any] = _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) - prompt_model_response_payload_schema_type_0 = cls() - - prompt_model_response_payload_schema_type_0.additional_properties = d - return prompt_model_response_payload_schema_type_0 - - @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/seclai/_generated/models/prompt_tool_response.py b/seclai/_generated/models/prompt_tool_response.py deleted file mode 100644 index 15858b3..0000000 --- a/seclai/_generated/models/prompt_tool_response.py +++ /dev/null @@ -1,246 +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.prompt_tool_response_headers_type_0 import ( - PromptToolResponseHeadersType0, - ) - - -T = TypeVar("T", bound="PromptToolResponse") - - -@_attrs_define -class PromptToolResponse: - """Response model for a prompt tool. - - Attributes: - id (str): - name (str): - tool_type (str): - description (None | str | Unset): - documentation_url (None | str | Unset): - example (None | str | Unset): - headers (None | PromptToolResponseHeadersType0 | Unset): - notes (None | str | Unset): - tool_name (None | str | Unset): - tool_type_pattern (None | str | Unset): - """ - - id: str - name: str - tool_type: str - description: None | str | Unset = UNSET - documentation_url: None | str | Unset = UNSET - example: None | str | Unset = UNSET - headers: None | PromptToolResponseHeadersType0 | Unset = UNSET - notes: None | str | Unset = UNSET - tool_name: None | str | Unset = UNSET - tool_type_pattern: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.prompt_tool_response_headers_type_0 import ( - PromptToolResponseHeadersType0, - ) - - id = self.id - - name = self.name - - tool_type = self.tool_type - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - documentation_url: None | str | Unset - if isinstance(self.documentation_url, Unset): - documentation_url = UNSET - else: - documentation_url = self.documentation_url - - example: None | str | Unset - if isinstance(self.example, Unset): - example = UNSET - else: - example = self.example - - headers: dict[str, Any] | None | Unset - if isinstance(self.headers, Unset): - headers = UNSET - elif isinstance(self.headers, PromptToolResponseHeadersType0): - headers = self.headers.to_dict() - else: - headers = self.headers - - notes: None | str | Unset - if isinstance(self.notes, Unset): - notes = UNSET - else: - notes = self.notes - - tool_name: None | str | Unset - if isinstance(self.tool_name, Unset): - tool_name = UNSET - else: - tool_name = self.tool_name - - tool_type_pattern: None | str | Unset - if isinstance(self.tool_type_pattern, Unset): - tool_type_pattern = UNSET - else: - tool_type_pattern = self.tool_type_pattern - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "id": id, - "name": name, - "tool_type": tool_type, - } - ) - if description is not UNSET: - field_dict["description"] = description - if documentation_url is not UNSET: - field_dict["documentation_url"] = documentation_url - if example is not UNSET: - field_dict["example"] = example - if headers is not UNSET: - field_dict["headers"] = headers - if notes is not UNSET: - field_dict["notes"] = notes - if tool_name is not UNSET: - field_dict["tool_name"] = tool_name - if tool_type_pattern is not UNSET: - field_dict["tool_type_pattern"] = tool_type_pattern - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.prompt_tool_response_headers_type_0 import ( - PromptToolResponseHeadersType0, - ) - - d = dict(src_dict) - id = d.pop("id") - - name = d.pop("name") - - tool_type = d.pop("tool_type") - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_documentation_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - documentation_url = _parse_documentation_url(d.pop("documentation_url", UNSET)) - - def _parse_example(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - example = _parse_example(d.pop("example", UNSET)) - - def _parse_headers( - data: object, - ) -> None | PromptToolResponseHeadersType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - headers_type_0 = PromptToolResponseHeadersType0.from_dict(data) - - return headers_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PromptToolResponseHeadersType0 | Unset, data) - - headers = _parse_headers(d.pop("headers", UNSET)) - - def _parse_notes(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - notes = _parse_notes(d.pop("notes", UNSET)) - - def _parse_tool_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - tool_name = _parse_tool_name(d.pop("tool_name", UNSET)) - - def _parse_tool_type_pattern(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - tool_type_pattern = _parse_tool_type_pattern(d.pop("tool_type_pattern", UNSET)) - - prompt_tool_response = cls( - id=id, - name=name, - tool_type=tool_type, - description=description, - documentation_url=documentation_url, - example=example, - headers=headers, - notes=notes, - tool_name=tool_name, - tool_type_pattern=tool_type_pattern, - ) - - prompt_tool_response.additional_properties = d - return prompt_tool_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/seclai/_generated/models/prompt_tool_response_headers_type_0.py b/seclai/_generated/models/prompt_tool_response_headers_type_0.py deleted file mode 100644 index fa0dd1f..0000000 --- a/seclai/_generated/models/prompt_tool_response_headers_type_0.py +++ /dev/null @@ -1,46 +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="PromptToolResponseHeadersType0") - - -@_attrs_define -class PromptToolResponseHeadersType0: - """ """ - - 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) - prompt_tool_response_headers_type_0 = cls() - - prompt_tool_response_headers_type_0.additional_properties = d - return prompt_tool_response_headers_type_0 - - @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/seclai/_generated/models/proposed_action_response.py b/seclai/_generated/models/proposed_action_response.py deleted file mode 100644 index 651d102..0000000 --- a/seclai/_generated/models/proposed_action_response.py +++ /dev/null @@ -1,145 +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.proposed_action_response_params import ProposedActionResponseParams - from ..models.proposed_action_response_preview_type_0 import ( - ProposedActionResponsePreviewType0, - ) - - -T = TypeVar("T", bound="ProposedActionResponse") - - -@_attrs_define -class ProposedActionResponse: - """A single proposed action. - - Attributes: - action_type (str): Type of the proposed action. - description (str): Human-readable description of the action. - params (ProposedActionResponseParams): Parameters for the action. - is_destructive (bool | Unset): Whether the action is destructive. Default: False. - preview (None | ProposedActionResponsePreviewType0 | Unset): Planning-time dry-run preview attached by the - solution AI assistant for create_agent / update_agent actions. Contains ``steps`` (the generated step tree), - ``step_count``, ``warnings`` (a mix of heuristic structural issues — e.g. brittle JSONPath, pass-through - ``regex_replace``, ``prompt_call`` missing a model — and deterministic resource-usage issues: every pre-bound - knowledge base / memory bank must be referenced by at least one step, and no step may reference an unknown id), - and ``skipped`` / ``skipped_reason`` when preview couldn't run (e.g. the action depends on resources created - earlier in the same plan). ``None`` for non-agent actions or when generation failed. - """ - - action_type: str - description: str - params: ProposedActionResponseParams - is_destructive: bool | Unset = False - preview: None | ProposedActionResponsePreviewType0 | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.proposed_action_response_preview_type_0 import ( - ProposedActionResponsePreviewType0, - ) - - action_type = self.action_type - - description = self.description - - params = self.params.to_dict() - - is_destructive = self.is_destructive - - preview: dict[str, Any] | None | Unset - if isinstance(self.preview, Unset): - preview = UNSET - elif isinstance(self.preview, ProposedActionResponsePreviewType0): - preview = self.preview.to_dict() - else: - preview = self.preview - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "action_type": action_type, - "description": description, - "params": params, - } - ) - if is_destructive is not UNSET: - field_dict["is_destructive"] = is_destructive - if preview is not UNSET: - field_dict["preview"] = preview - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.proposed_action_response_params import ( - ProposedActionResponseParams, - ) - from ..models.proposed_action_response_preview_type_0 import ( - ProposedActionResponsePreviewType0, - ) - - d = dict(src_dict) - action_type = d.pop("action_type") - - description = d.pop("description") - - params = ProposedActionResponseParams.from_dict(d.pop("params")) - - is_destructive = d.pop("is_destructive", UNSET) - - def _parse_preview( - data: object, - ) -> None | ProposedActionResponsePreviewType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - preview_type_0 = ProposedActionResponsePreviewType0.from_dict(data) - - return preview_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ProposedActionResponsePreviewType0 | Unset, data) - - preview = _parse_preview(d.pop("preview", UNSET)) - - proposed_action_response = cls( - action_type=action_type, - description=description, - params=params, - is_destructive=is_destructive, - preview=preview, - ) - - proposed_action_response.additional_properties = d - return proposed_action_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/seclai/_generated/models/proposed_action_response_params.py b/seclai/_generated/models/proposed_action_response_params.py deleted file mode 100644 index 411d7ab..0000000 --- a/seclai/_generated/models/proposed_action_response_params.py +++ /dev/null @@ -1,46 +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="ProposedActionResponseParams") - - -@_attrs_define -class ProposedActionResponseParams: - """Parameters for the action.""" - - additional_properties: dict[str, Any] = _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) - proposed_action_response_params = cls() - - proposed_action_response_params.additional_properties = d - return proposed_action_response_params - - @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/seclai/_generated/models/proposed_action_response_preview_type_0.py b/seclai/_generated/models/proposed_action_response_preview_type_0.py deleted file mode 100644 index cf8e37a..0000000 --- a/seclai/_generated/models/proposed_action_response_preview_type_0.py +++ /dev/null @@ -1,46 +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="ProposedActionResponsePreviewType0") - - -@_attrs_define -class ProposedActionResponsePreviewType0: - """ """ - - additional_properties: dict[str, Any] = _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) - proposed_action_response_preview_type_0 = cls() - - proposed_action_response_preview_type_0.additional_properties = d - return proposed_action_response_preview_type_0 - - @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/seclai/_generated/models/proposed_policy_action_response.py b/seclai/_generated/models/proposed_policy_action_response.py deleted file mode 100644 index 2a67b06..0000000 --- a/seclai/_generated/models/proposed_policy_action_response.py +++ /dev/null @@ -1,88 +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.proposed_policy_action_response_params import ( - ProposedPolicyActionResponseParams, - ) - - -T = TypeVar("T", bound="ProposedPolicyActionResponse") - - -@_attrs_define -class ProposedPolicyActionResponse: - """A single proposed governance policy action. - - Attributes: - action_type (str): Type of action: create, update, delete, enable, or disable. - description (str): Human-readable description of what this action will do. - params (ProposedPolicyActionResponseParams): Parameters for the action (e.g. policy_document_id, thresholds). - """ - - action_type: str - description: str - params: ProposedPolicyActionResponseParams - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - action_type = self.action_type - - description = self.description - - params = self.params.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "action_type": action_type, - "description": description, - "params": params, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.proposed_policy_action_response_params import ( - ProposedPolicyActionResponseParams, - ) - - d = dict(src_dict) - action_type = d.pop("action_type") - - description = d.pop("description") - - params = ProposedPolicyActionResponseParams.from_dict(d.pop("params")) - - proposed_policy_action_response = cls( - action_type=action_type, - description=description, - params=params, - ) - - proposed_policy_action_response.additional_properties = d - return proposed_policy_action_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/seclai/_generated/models/proposed_policy_action_response_params.py b/seclai/_generated/models/proposed_policy_action_response_params.py deleted file mode 100644 index 182db68..0000000 --- a/seclai/_generated/models/proposed_policy_action_response_params.py +++ /dev/null @@ -1,46 +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="ProposedPolicyActionResponseParams") - - -@_attrs_define -class ProposedPolicyActionResponseParams: - """Parameters for the action (e.g. policy_document_id, thresholds).""" - - additional_properties: dict[str, Any] = _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) - proposed_policy_action_response_params = cls() - - proposed_policy_action_response_params.additional_properties = d - return proposed_policy_action_response_params - - @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/seclai/_generated/models/provider_group_response.py b/seclai/_generated/models/provider_group_response.py deleted file mode 100644 index c9c19e3..0000000 --- a/seclai/_generated/models/provider_group_response.py +++ /dev/null @@ -1,84 +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.prompt_model_response import PromptModelResponse - - -T = TypeVar("T", bound="ProviderGroupResponse") - - -@_attrs_define -class ProviderGroupResponse: - """Response model for provider group with models - - Attributes: - models (list[PromptModelResponse]): - provider (str): - """ - - models: list[PromptModelResponse] - provider: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - models = [] - for models_item_data in self.models: - models_item = models_item_data.to_dict() - models.append(models_item) - - provider = self.provider - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "models": models, - "provider": provider, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.prompt_model_response import PromptModelResponse - - d = dict(src_dict) - models = [] - _models = d.pop("models") - for models_item_data in _models: - models_item = PromptModelResponse.from_dict(models_item_data) - - models.append(models_item) - - provider = d.pop("provider") - - provider_group_response = cls( - models=models, - provider=provider, - ) - - provider_group_response.additional_properties = d - return provider_group_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/seclai/_generated/models/remove_email_domain_response.py b/seclai/_generated/models/remove_email_domain_response.py deleted file mode 100644 index c52e04c..0000000 --- a/seclai/_generated/models/remove_email_domain_response.py +++ /dev/null @@ -1,82 +0,0 @@ -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="RemoveEmailDomainResponse") - - -@_attrs_define -class RemoveEmailDomainResponse: - """ - Attributes: - cleanup_note (None | str | Unset): - removed (bool | Unset): Default: True. - """ - - cleanup_note: None | str | Unset = UNSET - removed: bool | Unset = True - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - cleanup_note: None | str | Unset - if isinstance(self.cleanup_note, Unset): - cleanup_note = UNSET - else: - cleanup_note = self.cleanup_note - - removed = self.removed - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if cleanup_note is not UNSET: - field_dict["cleanup_note"] = cleanup_note - if removed is not UNSET: - field_dict["removed"] = removed - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_cleanup_note(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - cleanup_note = _parse_cleanup_note(d.pop("cleanup_note", UNSET)) - - removed = d.pop("removed", UNSET) - - remove_email_domain_response = cls( - cleanup_note=cleanup_note, - removed=removed, - ) - - remove_email_domain_response.additional_properties = d - return remove_email_domain_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/seclai/_generated/models/resume_inbound_response.py b/seclai/_generated/models/resume_inbound_response.py deleted file mode 100644 index c404e2c..0000000 --- a/seclai/_generated/models/resume_inbound_response.py +++ /dev/null @@ -1,61 +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="ResumeInboundResponse") - - -@_attrs_define -class ResumeInboundResponse: - """ - Attributes: - resumed (bool): - """ - - resumed: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - resumed = self.resumed - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "resumed": resumed, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - resumed = d.pop("resumed") - - resume_inbound_response = cls( - resumed=resumed, - ) - - resume_inbound_response.additional_properties = d - return resume_inbound_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/seclai/_generated/models/search_response.py b/seclai/_generated/models/search_response.py deleted file mode 100644 index 1a0e6cb..0000000 --- a/seclai/_generated/models/search_response.py +++ /dev/null @@ -1,77 +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.search_result_response import SearchResultResponse - - -T = TypeVar("T", bound="SearchResponse") - - -@_attrs_define -class SearchResponse: - """Ranked results, NOT a paginated collection — the ``{results}`` shape is a - deliberate carve-out matching the MCP ``search_resources`` tool. - - Attributes: - results (list[SearchResultResponse]): - """ - - results: list[SearchResultResponse] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - results = [] - for results_item_data in self.results: - results_item = results_item_data.to_dict() - results.append(results_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "results": results, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.search_result_response import SearchResultResponse - - d = dict(src_dict) - results = [] - _results = d.pop("results") - for results_item_data in _results: - results_item = SearchResultResponse.from_dict(results_item_data) - - results.append(results_item) - - search_response = cls( - results=results, - ) - - search_response.additional_properties = d - return search_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/seclai/_generated/models/search_result_response.py b/seclai/_generated/models/search_result_response.py deleted file mode 100644 index 85d15ba..0000000 --- a/seclai/_generated/models/search_result_response.py +++ /dev/null @@ -1,92 +0,0 @@ -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 - -T = TypeVar("T", bound="SearchResultResponse") - - -@_attrs_define -class SearchResultResponse: - """ - Attributes: - description (None | str): - entity_type (str): - id (str): - name (str): - """ - - description: None | str - entity_type: str - id: str - name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - description: None | str - description = self.description - - entity_type = self.entity_type - - id = self.id - - name = self.name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "description": description, - "entity_type": entity_type, - "id": id, - "name": name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_description(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - description = _parse_description(d.pop("description")) - - entity_type = d.pop("entity_type") - - id = d.pop("id") - - name = d.pop("name") - - search_result_response = cls( - description=description, - entity_type=entity_type, - id=id, - name=name, - ) - - search_result_response.additional_properties = d - return search_result_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/seclai/_generated/models/send_test_email_response.py b/seclai/_generated/models/send_test_email_response.py deleted file mode 100644 index d3ce45f..0000000 --- a/seclai/_generated/models/send_test_email_response.py +++ /dev/null @@ -1,61 +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 - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="SendTestEmailResponse") - - -@_attrs_define -class SendTestEmailResponse: - """ - Attributes: - sent (bool | Unset): Default: True. - """ - - sent: bool | Unset = True - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - sent = self.sent - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if sent is not UNSET: - field_dict["sent"] = sent - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - sent = d.pop("sent", UNSET) - - send_test_email_response = cls( - sent=sent, - ) - - send_test_email_response.additional_properties = d - return send_test_email_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/seclai/_generated/models/set_auto_block_mode_request.py b/seclai/_generated/models/set_auto_block_mode_request.py deleted file mode 100644 index 965161d..0000000 --- a/seclai/_generated/models/set_auto_block_mode_request.py +++ /dev/null @@ -1,62 +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="SetAutoBlockModeRequest") - - -@_attrs_define -class SetAutoBlockModeRequest: - """Set the account's governance auto-block mode (shared REST request). - - Attributes: - mode (str): - """ - - mode: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - mode = self.mode - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "mode": mode, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - mode = d.pop("mode") - - set_auto_block_mode_request = cls( - mode=mode, - ) - - set_auto_block_mode_request.additional_properties = d - return set_auto_block_mode_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/seclai/_generated/models/set_email_trigger_config_request.py b/seclai/_generated/models/set_email_trigger_config_request.py deleted file mode 100644 index ec192a6..0000000 --- a/seclai/_generated/models/set_email_trigger_config_request.py +++ /dev/null @@ -1,181 +0,0 @@ -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="SetEmailTriggerConfigRequest") - - -@_attrs_define -class SetEmailTriggerConfigRequest: - """Alias and/or sender allowlist for an EMAIL_RECEIVED trigger. - - A field omitted is left unchanged; passing ``null`` (or ``""`` for - ``alias``) clears it. - - Attributes: - alias (None | str | Unset): Custom alias for the address `.@agent.seclai.com` (alphanumeric - plus '+', '.', '-'; 1–32 chars; not starting/ending with '+', '.', '-'; not UUID-shaped). Pass null/empty to - clear. - allowed_senders (list[str] | None | Unset): Allowlist of full sender addresses and/or bare domains (a bare - domain also matches sub-domains). Empty/null accepts any sender. - ignore_auto_generated (bool | None | Unset): When true (default for new triggers), machine-generated inbound - mail (auto-replies, bulk/list mail, bounces) is dropped before a run to prevent auto-reply loops. Set false to - process automated mail. - queue_on_quota (bool | None | Unset): When true (default false), inbound mail that exceeds the account's hourly - email-trigger rate is parked in a QUEUED run and drained later by the catch-up sweep instead of being failed; - when false, over-rate mail fails immediately. - require_sender_auth (bool | None | Unset): When true (default for new triggers), the envelope sender must pass - SPF or DMARC even on an open inbox (no allowlist); unauthenticated, spoofable mail is rejected. Set false to - accept fully unauthenticated mail on an open inbox. - """ - - alias: None | str | Unset = UNSET - allowed_senders: list[str] | None | Unset = UNSET - ignore_auto_generated: bool | None | Unset = UNSET - queue_on_quota: bool | None | Unset = UNSET - require_sender_auth: bool | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - alias: None | str | Unset - if isinstance(self.alias, Unset): - alias = UNSET - else: - alias = self.alias - - allowed_senders: list[str] | None | Unset - if isinstance(self.allowed_senders, Unset): - allowed_senders = UNSET - elif isinstance(self.allowed_senders, list): - allowed_senders = self.allowed_senders - - else: - allowed_senders = self.allowed_senders - - ignore_auto_generated: bool | None | Unset - if isinstance(self.ignore_auto_generated, Unset): - ignore_auto_generated = UNSET - else: - ignore_auto_generated = self.ignore_auto_generated - - queue_on_quota: bool | None | Unset - if isinstance(self.queue_on_quota, Unset): - queue_on_quota = UNSET - else: - queue_on_quota = self.queue_on_quota - - require_sender_auth: bool | None | Unset - if isinstance(self.require_sender_auth, Unset): - require_sender_auth = UNSET - else: - require_sender_auth = self.require_sender_auth - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if alias is not UNSET: - field_dict["alias"] = alias - if allowed_senders is not UNSET: - field_dict["allowed_senders"] = allowed_senders - if ignore_auto_generated is not UNSET: - field_dict["ignore_auto_generated"] = ignore_auto_generated - if queue_on_quota is not UNSET: - field_dict["queue_on_quota"] = queue_on_quota - if require_sender_auth is not UNSET: - field_dict["require_sender_auth"] = require_sender_auth - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_alias(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - alias = _parse_alias(d.pop("alias", UNSET)) - - def _parse_allowed_senders(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() - allowed_senders_type_0 = cast(list[str], data) - - return allowed_senders_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - allowed_senders = _parse_allowed_senders(d.pop("allowed_senders", UNSET)) - - def _parse_ignore_auto_generated(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - ignore_auto_generated = _parse_ignore_auto_generated( - d.pop("ignore_auto_generated", UNSET) - ) - - def _parse_queue_on_quota(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - queue_on_quota = _parse_queue_on_quota(d.pop("queue_on_quota", UNSET)) - - def _parse_require_sender_auth(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - require_sender_auth = _parse_require_sender_auth( - d.pop("require_sender_auth", UNSET) - ) - - set_email_trigger_config_request = cls( - alias=alias, - allowed_senders=allowed_senders, - ignore_auto_generated=ignore_auto_generated, - queue_on_quota=queue_on_quota, - require_sender_auth=require_sender_auth, - ) - - set_email_trigger_config_request.additional_properties = d - return set_email_trigger_config_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/seclai/_generated/models/solution_agent_response.py b/seclai/_generated/models/solution_agent_response.py deleted file mode 100644 index f2cc973..0000000 --- a/seclai/_generated/models/solution_agent_response.py +++ /dev/null @@ -1,93 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -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="SolutionAgentResponse") - - -@_attrs_define -class SolutionAgentResponse: - """ - Attributes: - id (UUID): - name (str): - knowledge_base_ids (list[UUID] | Unset): Knowledge base IDs connected to this agent via triggers. - """ - - id: UUID - name: str - knowledge_base_ids: list[UUID] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - id = str(self.id) - - name = self.name - - knowledge_base_ids: list[str] | Unset = UNSET - if not isinstance(self.knowledge_base_ids, Unset): - knowledge_base_ids = [] - for knowledge_base_ids_item_data in self.knowledge_base_ids: - knowledge_base_ids_item = str(knowledge_base_ids_item_data) - knowledge_base_ids.append(knowledge_base_ids_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "id": id, - "name": name, - } - ) - if knowledge_base_ids is not UNSET: - field_dict["knowledge_base_ids"] = knowledge_base_ids - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id = UUID(d.pop("id")) - - name = d.pop("name") - - _knowledge_base_ids = d.pop("knowledge_base_ids", UNSET) - knowledge_base_ids: list[UUID] | Unset = UNSET - if _knowledge_base_ids is not UNSET: - knowledge_base_ids = [] - for knowledge_base_ids_item_data in _knowledge_base_ids: - knowledge_base_ids_item = UUID(knowledge_base_ids_item_data) - - knowledge_base_ids.append(knowledge_base_ids_item) - - solution_agent_response = cls( - id=id, - name=name, - knowledge_base_ids=knowledge_base_ids, - ) - - solution_agent_response.additional_properties = d - return solution_agent_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/seclai/_generated/models/solution_conversation_response.py b/seclai/_generated/models/solution_conversation_response.py deleted file mode 100644 index f383d0b..0000000 --- a/seclai/_generated/models/solution_conversation_response.py +++ /dev/null @@ -1,153 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.solution_conversation_response_actions_taken_type_0 import ( - SolutionConversationResponseActionsTakenType0, - ) - - -T = TypeVar("T", bound="SolutionConversationResponse") - - -@_attrs_define -class SolutionConversationResponse: - """Response model for a conversation turn. - - Attributes: - accepted (bool | None): Whether the suggestion was accepted or declined. - actions_taken (None | SolutionConversationResponseActionsTakenType0): Actions taken by the AI. - ai_response (None | str): AI response text. - created_at (str): Timestamp when the conversation was created. - id (UUID): Unique identifier for the conversation turn. - user_input (str): User input text. - """ - - accepted: bool | None - actions_taken: None | SolutionConversationResponseActionsTakenType0 - ai_response: None | str - created_at: str - id: UUID - user_input: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.solution_conversation_response_actions_taken_type_0 import ( - SolutionConversationResponseActionsTakenType0, - ) - - accepted: bool | None - accepted = self.accepted - - actions_taken: dict[str, Any] | None - if isinstance( - self.actions_taken, SolutionConversationResponseActionsTakenType0 - ): - actions_taken = self.actions_taken.to_dict() - else: - actions_taken = self.actions_taken - - ai_response: None | str - ai_response = self.ai_response - - created_at = self.created_at - - id = str(self.id) - - user_input = self.user_input - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "accepted": accepted, - "actions_taken": actions_taken, - "ai_response": ai_response, - "created_at": created_at, - "id": id, - "user_input": user_input, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.solution_conversation_response_actions_taken_type_0 import ( - SolutionConversationResponseActionsTakenType0, - ) - - d = dict(src_dict) - - def _parse_accepted(data: object) -> bool | None: - if data is None: - return data - return cast(bool | None, data) - - accepted = _parse_accepted(d.pop("accepted")) - - def _parse_actions_taken( - data: object, - ) -> None | SolutionConversationResponseActionsTakenType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - actions_taken_type_0 = ( - SolutionConversationResponseActionsTakenType0.from_dict(data) - ) - - return actions_taken_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SolutionConversationResponseActionsTakenType0, data) - - actions_taken = _parse_actions_taken(d.pop("actions_taken")) - - def _parse_ai_response(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - ai_response = _parse_ai_response(d.pop("ai_response")) - - created_at = d.pop("created_at") - - id = UUID(d.pop("id")) - - user_input = d.pop("user_input") - - solution_conversation_response = cls( - accepted=accepted, - actions_taken=actions_taken, - ai_response=ai_response, - created_at=created_at, - id=id, - user_input=user_input, - ) - - solution_conversation_response.additional_properties = d - return solution_conversation_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/seclai/_generated/models/solution_conversation_response_actions_taken_type_0.py b/seclai/_generated/models/solution_conversation_response_actions_taken_type_0.py deleted file mode 100644 index dbbbb93..0000000 --- a/seclai/_generated/models/solution_conversation_response_actions_taken_type_0.py +++ /dev/null @@ -1,46 +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="SolutionConversationResponseActionsTakenType0") - - -@_attrs_define -class SolutionConversationResponseActionsTakenType0: - """ """ - - additional_properties: dict[str, Any] = _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) - solution_conversation_response_actions_taken_type_0 = cls() - - solution_conversation_response_actions_taken_type_0.additional_properties = d - return solution_conversation_response_actions_taken_type_0 - - @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/seclai/_generated/models/solution_knowledge_base_response.py b/seclai/_generated/models/solution_knowledge_base_response.py deleted file mode 100644 index 50c126c..0000000 --- a/seclai/_generated/models/solution_knowledge_base_response.py +++ /dev/null @@ -1,93 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -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="SolutionKnowledgeBaseResponse") - - -@_attrs_define -class SolutionKnowledgeBaseResponse: - """ - Attributes: - id (UUID): - name (str): - source_connection_ids (list[UUID] | Unset): Source connection IDs linked to this knowledge base. - """ - - id: UUID - name: str - source_connection_ids: list[UUID] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - id = str(self.id) - - name = self.name - - source_connection_ids: list[str] | Unset = UNSET - if not isinstance(self.source_connection_ids, Unset): - source_connection_ids = [] - for source_connection_ids_item_data in self.source_connection_ids: - source_connection_ids_item = str(source_connection_ids_item_data) - source_connection_ids.append(source_connection_ids_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "id": id, - "name": name, - } - ) - if source_connection_ids is not UNSET: - field_dict["source_connection_ids"] = source_connection_ids - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id = UUID(d.pop("id")) - - name = d.pop("name") - - _source_connection_ids = d.pop("source_connection_ids", UNSET) - source_connection_ids: list[UUID] | Unset = UNSET - if _source_connection_ids is not UNSET: - source_connection_ids = [] - for source_connection_ids_item_data in _source_connection_ids: - source_connection_ids_item = UUID(source_connection_ids_item_data) - - source_connection_ids.append(source_connection_ids_item) - - solution_knowledge_base_response = cls( - id=id, - name=name, - source_connection_ids=source_connection_ids, - ) - - solution_knowledge_base_response.additional_properties = d - return solution_knowledge_base_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/seclai/_generated/models/solution_list_response.py b/seclai/_generated/models/solution_list_response.py deleted file mode 100644 index a32f88b..0000000 --- a/seclai/_generated/models/solution_list_response.py +++ /dev/null @@ -1,86 +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.pagination_response import PaginationResponse - from ..models.solution_summary_response import SolutionSummaryResponse - - -T = TypeVar("T", bound="SolutionListResponse") - - -@_attrs_define -class SolutionListResponse: - """Response model for paginated solution list. - - Attributes: - data (list[SolutionSummaryResponse]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[SolutionSummaryResponse] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - from ..models.solution_summary_response import SolutionSummaryResponse - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = SolutionSummaryResponse.from_dict(data_item_data) - - data.append(data_item) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - solution_list_response = cls( - data=data, - pagination=pagination, - ) - - solution_list_response.additional_properties = d - return solution_list_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/seclai/_generated/models/solution_response.py b/seclai/_generated/models/solution_response.py deleted file mode 100644 index 5fba4d9..0000000 --- a/seclai/_generated/models/solution_response.py +++ /dev/null @@ -1,163 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.solution_agent_response import SolutionAgentResponse - from ..models.solution_knowledge_base_response import SolutionKnowledgeBaseResponse - from ..models.solution_source_connection_response import ( - SolutionSourceConnectionResponse, - ) - - -T = TypeVar("T", bound="SolutionResponse") - - -@_attrs_define -class SolutionResponse: - """Response model for solution data. - - Attributes: - agents (list[SolutionAgentResponse]): Agents linked to the solution. - created_at (str): Timestamp when the solution was created. - description (str): Description of the solution. - id (UUID): Unique identifier for the solution. - knowledge_bases (list[SolutionKnowledgeBaseResponse]): Knowledge bases linked to the solution. - name (str): Name of the solution. - source_connections (list[SolutionSourceConnectionResponse]): Source connections linked to the solution. - updated_at (str): Timestamp when the solution was last updated. - """ - - agents: list[SolutionAgentResponse] - created_at: str - description: str - id: UUID - knowledge_bases: list[SolutionKnowledgeBaseResponse] - name: str - source_connections: list[SolutionSourceConnectionResponse] - updated_at: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agents = [] - for agents_item_data in self.agents: - agents_item = agents_item_data.to_dict() - agents.append(agents_item) - - created_at = self.created_at - - description = self.description - - id = str(self.id) - - knowledge_bases = [] - for knowledge_bases_item_data in self.knowledge_bases: - knowledge_bases_item = knowledge_bases_item_data.to_dict() - knowledge_bases.append(knowledge_bases_item) - - name = self.name - - source_connections = [] - for source_connections_item_data in self.source_connections: - source_connections_item = source_connections_item_data.to_dict() - source_connections.append(source_connections_item) - - updated_at = self.updated_at - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agents": agents, - "created_at": created_at, - "description": description, - "id": id, - "knowledge_bases": knowledge_bases, - "name": name, - "source_connections": source_connections, - "updated_at": updated_at, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.solution_agent_response import SolutionAgentResponse - from ..models.solution_knowledge_base_response import ( - SolutionKnowledgeBaseResponse, - ) - from ..models.solution_source_connection_response import ( - SolutionSourceConnectionResponse, - ) - - d = dict(src_dict) - agents = [] - _agents = d.pop("agents") - for agents_item_data in _agents: - agents_item = SolutionAgentResponse.from_dict(agents_item_data) - - agents.append(agents_item) - - created_at = d.pop("created_at") - - description = d.pop("description") - - id = UUID(d.pop("id")) - - knowledge_bases = [] - _knowledge_bases = d.pop("knowledge_bases") - for knowledge_bases_item_data in _knowledge_bases: - knowledge_bases_item = SolutionKnowledgeBaseResponse.from_dict( - knowledge_bases_item_data - ) - - knowledge_bases.append(knowledge_bases_item) - - name = d.pop("name") - - source_connections = [] - _source_connections = d.pop("source_connections") - for source_connections_item_data in _source_connections: - source_connections_item = SolutionSourceConnectionResponse.from_dict( - source_connections_item_data - ) - - source_connections.append(source_connections_item) - - updated_at = d.pop("updated_at") - - solution_response = cls( - agents=agents, - created_at=created_at, - description=description, - id=id, - knowledge_bases=knowledge_bases, - name=name, - source_connections=source_connections, - updated_at=updated_at, - ) - - solution_response.additional_properties = d - return solution_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/seclai/_generated/models/solution_source_connection_response.py b/seclai/_generated/models/solution_source_connection_response.py deleted file mode 100644 index 679c190..0000000 --- a/seclai/_generated/models/solution_source_connection_response.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SolutionSourceConnectionResponse") - - -@_attrs_define -class SolutionSourceConnectionResponse: - """ - Attributes: - id (UUID): - name (str): - """ - - id: UUID - name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - id = str(self.id) - - name = self.name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "id": id, - "name": name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id = UUID(d.pop("id")) - - name = d.pop("name") - - solution_source_connection_response = cls( - id=id, - name=name, - ) - - solution_source_connection_response.additional_properties = d - return solution_source_connection_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/seclai/_generated/models/solution_summary_response.py b/seclai/_generated/models/solution_summary_response.py deleted file mode 100644 index 4b6f326..0000000 --- a/seclai/_generated/models/solution_summary_response.py +++ /dev/null @@ -1,127 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SolutionSummaryResponse") - - -@_attrs_define -class SolutionSummaryResponse: - """Response model for solution summary. - - Attributes: - agent_count (int): Number of linked agents. - created_at (str): Timestamp when the solution was created. - description (str): Description of the solution. - id (UUID): Unique identifier for the solution. - knowledge_base_count (int): Number of linked knowledge bases. - memory_bank_count (int): Number of linked memory banks. - name (str): Name of the solution. - source_connection_count (int): Number of linked source connections. - updated_at (str): Timestamp when the solution was last updated. - """ - - agent_count: int - created_at: str - description: str - id: UUID - knowledge_base_count: int - memory_bank_count: int - name: str - source_connection_count: int - updated_at: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_count = self.agent_count - - created_at = self.created_at - - description = self.description - - id = str(self.id) - - knowledge_base_count = self.knowledge_base_count - - memory_bank_count = self.memory_bank_count - - name = self.name - - source_connection_count = self.source_connection_count - - updated_at = self.updated_at - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_count": agent_count, - "created_at": created_at, - "description": description, - "id": id, - "knowledge_base_count": knowledge_base_count, - "memory_bank_count": memory_bank_count, - "name": name, - "source_connection_count": source_connection_count, - "updated_at": updated_at, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_count = d.pop("agent_count") - - created_at = d.pop("created_at") - - description = d.pop("description") - - id = UUID(d.pop("id")) - - knowledge_base_count = d.pop("knowledge_base_count") - - memory_bank_count = d.pop("memory_bank_count") - - name = d.pop("name") - - source_connection_count = d.pop("source_connection_count") - - updated_at = d.pop("updated_at") - - solution_summary_response = cls( - agent_count=agent_count, - created_at=created_at, - description=description, - id=id, - knowledge_base_count=knowledge_base_count, - memory_bank_count=memory_bank_count, - name=name, - source_connection_count=source_connection_count, - updated_at=updated_at, - ) - - solution_summary_response.additional_properties = d - return solution_summary_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/seclai/_generated/models/source_connection_response_model.py b/seclai/_generated/models/source_connection_response_model.py deleted file mode 100644 index 9262d23..0000000 --- a/seclai/_generated/models/source_connection_response_model.py +++ /dev/null @@ -1,108 +0,0 @@ -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="SourceConnectionResponseModel") - - -@_attrs_define -class SourceConnectionResponseModel: - """Nested source connection summary within a knowledge base response. - - Attributes: - id (str): Source connection identifier. - name (str): Source connection name. - source_type (str): Type of source (rss, website, etc.). - url (str): Source URL. - polling (None | str | Unset): Polling configuration. - """ - - id: str - name: str - source_type: str - url: str - polling: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - id = self.id - - name = self.name - - source_type = self.source_type - - url = self.url - - polling: None | str | Unset - if isinstance(self.polling, Unset): - polling = UNSET - else: - polling = self.polling - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "id": id, - "name": name, - "source_type": source_type, - "url": url, - } - ) - if polling is not UNSET: - field_dict["polling"] = polling - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id = d.pop("id") - - name = d.pop("name") - - source_type = d.pop("source_type") - - url = d.pop("url") - - def _parse_polling(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - polling = _parse_polling(d.pop("polling", UNSET)) - - source_connection_response_model = cls( - id=id, - name=name, - source_type=source_type, - url=url, - polling=polling, - ) - - source_connection_response_model.additional_properties = d - return source_connection_response_model - - @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/seclai/_generated/models/source_embedding_migration_response.py b/seclai/_generated/models/source_embedding_migration_response.py deleted file mode 100644 index a5a1c20..0000000 --- a/seclai/_generated/models/source_embedding_migration_response.py +++ /dev/null @@ -1,249 +0,0 @@ -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 - -T = TypeVar("T", bound="SourceEmbeddingMigrationResponse") - - -@_attrs_define -class SourceEmbeddingMigrationResponse: - """Response model for source embedding migration status. - - Attributes: - completed_at (None | str): - created_at (str): - failure_message (None | str): - id (str): - notification_recipients (list[str] | None): - phase (str): - progress_current (int): - progress_message (None | str): - progress_total (int): - source_connection_id (str): - source_id_new (str): - source_id_old (str): - started_at (None | str): - status (str): - target_dimensions (int): - target_embedding_model (str): - task_execution_id (None | str): - updated_at (str): - """ - - completed_at: None | str - created_at: str - failure_message: None | str - id: str - notification_recipients: list[str] | None - phase: str - progress_current: int - progress_message: None | str - progress_total: int - source_connection_id: str - source_id_new: str - source_id_old: str - started_at: None | str - status: str - target_dimensions: int - target_embedding_model: str - task_execution_id: None | str - updated_at: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - completed_at: None | str - completed_at = self.completed_at - - created_at = self.created_at - - failure_message: None | str - failure_message = self.failure_message - - id = self.id - - notification_recipients: list[str] | None - if isinstance(self.notification_recipients, list): - notification_recipients = self.notification_recipients - - else: - notification_recipients = self.notification_recipients - - phase = self.phase - - progress_current = self.progress_current - - progress_message: None | str - progress_message = self.progress_message - - progress_total = self.progress_total - - source_connection_id = self.source_connection_id - - source_id_new = self.source_id_new - - source_id_old = self.source_id_old - - started_at: None | str - started_at = self.started_at - - status = self.status - - target_dimensions = self.target_dimensions - - target_embedding_model = self.target_embedding_model - - task_execution_id: None | str - task_execution_id = self.task_execution_id - - updated_at = self.updated_at - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "completed_at": completed_at, - "created_at": created_at, - "failure_message": failure_message, - "id": id, - "notification_recipients": notification_recipients, - "phase": phase, - "progress_current": progress_current, - "progress_message": progress_message, - "progress_total": progress_total, - "source_connection_id": source_connection_id, - "source_id_new": source_id_new, - "source_id_old": source_id_old, - "started_at": started_at, - "status": status, - "target_dimensions": target_dimensions, - "target_embedding_model": target_embedding_model, - "task_execution_id": task_execution_id, - "updated_at": updated_at, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_completed_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - completed_at = _parse_completed_at(d.pop("completed_at")) - - created_at = d.pop("created_at") - - def _parse_failure_message(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - failure_message = _parse_failure_message(d.pop("failure_message")) - - id = d.pop("id") - - def _parse_notification_recipients(data: object) -> list[str] | None: - if data is None: - return data - try: - if not isinstance(data, list): - raise TypeError() - notification_recipients_type_0 = cast(list[str], data) - - return notification_recipients_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None, data) - - notification_recipients = _parse_notification_recipients( - d.pop("notification_recipients") - ) - - phase = d.pop("phase") - - progress_current = d.pop("progress_current") - - def _parse_progress_message(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - progress_message = _parse_progress_message(d.pop("progress_message")) - - progress_total = d.pop("progress_total") - - source_connection_id = d.pop("source_connection_id") - - source_id_new = d.pop("source_id_new") - - source_id_old = d.pop("source_id_old") - - def _parse_started_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - started_at = _parse_started_at(d.pop("started_at")) - - status = d.pop("status") - - target_dimensions = d.pop("target_dimensions") - - target_embedding_model = d.pop("target_embedding_model") - - def _parse_task_execution_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - task_execution_id = _parse_task_execution_id(d.pop("task_execution_id")) - - updated_at = d.pop("updated_at") - - source_embedding_migration_response = cls( - completed_at=completed_at, - created_at=created_at, - failure_message=failure_message, - id=id, - notification_recipients=notification_recipients, - phase=phase, - progress_current=progress_current, - progress_message=progress_message, - progress_total=progress_total, - source_connection_id=source_connection_id, - source_id_new=source_id_new, - source_id_old=source_id_old, - started_at=started_at, - status=status, - target_dimensions=target_dimensions, - target_embedding_model=target_embedding_model, - task_execution_id=task_execution_id, - updated_at=updated_at, - ) - - source_embedding_migration_response.additional_properties = d - return source_embedding_migration_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/seclai/_generated/models/source_index_mode.py b/seclai/_generated/models/source_index_mode.py deleted file mode 100644 index bcb534c..0000000 --- a/seclai/_generated/models/source_index_mode.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class SourceIndexMode(str, Enum): - BALANCED = "balanced" - CUSTOM = "custom" - FAST_AND_CHEAP = "fast_and_cheap" - SLOW_AND_THOROUGH = "slow_and_thorough" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/models/source_list_response.py b/seclai/_generated/models/source_list_response.py deleted file mode 100644 index b9222c2..0000000 --- a/seclai/_generated/models/source_list_response.py +++ /dev/null @@ -1,86 +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.pagination_response import PaginationResponse - from ..models.source_response import SourceResponse - - -T = TypeVar("T", bound="SourceListResponse") - - -@_attrs_define -class SourceListResponse: - """Response model for paginated source list - - Attributes: - data (list[SourceResponse]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[SourceResponse] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - from ..models.source_response import SourceResponse - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = SourceResponse.from_dict(data_item_data) - - data.append(data_item) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - source_list_response = cls( - data=data, - pagination=pagination, - ) - - source_list_response.additional_properties = d - return source_list_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/seclai/_generated/models/source_response.py b/seclai/_generated/models/source_response.py deleted file mode 100644 index 41dd46f..0000000 --- a/seclai/_generated/models/source_response.py +++ /dev/null @@ -1,522 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.source_index_mode import SourceIndexMode -from ..types import UNSET, Unset - -T = TypeVar("T", bound="SourceResponse") - - -@_attrs_define -class SourceResponse: - """Response model for source data. - - Attributes: - account_id (UUID): Account ID associated with the source. - content_filter (str): Content filter for the source connection. - created_at (str): Timestamp when the source connection was created. - id (str): Unique identifier for the source connection. - name (str): Name of the source connection. - next_poll_at (None | str): Timestamp for the next scheduled poll. - polling (None | str): Polling configuration for the source connection. - polling_action (None | str): Polling action for the source connection. - polling_max_items (int | None): Maximum items to poll for the source connection. - pulled_at (None | str): Timestamp when content was last pulled. - retention (int | None): Retention period for the source connection. - source_type (str): Type of the source connection. - updated_at (str): Timestamp when the source connection was last updated. - url (None | str): URL of the source connection. - avg_episodes_per_month (float | None | Unset): Average number of episodes per month. - avg_words_per_episode (int | None | Unset): Average number of words per episode. - chunk_language (None | str | Unset): Language used for chunking content. - chunk_overlap (int | None | Unset): Chunk overlap for content processing. - chunk_regex_separators (bool | None | Unset): Indicates if chunk separators are regex patterns. - chunk_separators (None | str | Unset): Chunk separators used for content processing. - chunk_size (int | None | Unset): Chunk size for content processing. - content_count (int | Unset): Number of content items associated with the source connection. Default: 0. - dimensions (int | None | Unset): Dimensions of the embedding model. - embedding_model (None | str | Unset): Embedding model used for the source connection. - embedding_model_type (None | str | Unset): Type of the embedding model. - free_retention_days (int | None | Unset): Number of days content is stored for free before billing applies. - has_historical_data (bool | Unset): Indicates if the source connection has historical data. Default: False. - index_mode (None | SourceIndexMode | Unset): Index mode for custom_index sources: fast_and_cheap, balanced, - slow_and_thorough, or custom. - media_types (list[str] | Unset): Media kinds extracted from indexed content and embedded as multi-modal KB - chunks (subset of ['images', 'video']). Empty = text-only. - readonly (bool | Unset): Indicates if the source connection is read-only. Default: False. - system_managed (bool | Unset): Indicates if this source is automatically managed by the system (e.g., agent - traces). Default: False. - """ - - account_id: UUID - content_filter: str - created_at: str - id: str - name: str - next_poll_at: None | str - polling: None | str - polling_action: None | str - polling_max_items: int | None - pulled_at: None | str - retention: int | None - source_type: str - updated_at: str - url: None | str - avg_episodes_per_month: float | None | Unset = UNSET - avg_words_per_episode: int | None | Unset = UNSET - chunk_language: None | str | Unset = UNSET - chunk_overlap: int | None | Unset = UNSET - chunk_regex_separators: bool | None | Unset = UNSET - chunk_separators: None | str | Unset = UNSET - chunk_size: int | None | Unset = UNSET - content_count: int | Unset = 0 - dimensions: int | None | Unset = UNSET - embedding_model: None | str | Unset = UNSET - embedding_model_type: None | str | Unset = UNSET - free_retention_days: int | None | Unset = UNSET - has_historical_data: bool | Unset = False - index_mode: None | SourceIndexMode | Unset = UNSET - media_types: list[str] | Unset = UNSET - readonly: bool | Unset = False - system_managed: bool | Unset = False - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - account_id = str(self.account_id) - - content_filter = self.content_filter - - created_at = self.created_at - - id = self.id - - name = self.name - - next_poll_at: None | str - next_poll_at = self.next_poll_at - - polling: None | str - polling = self.polling - - polling_action: None | str - polling_action = self.polling_action - - polling_max_items: int | None - polling_max_items = self.polling_max_items - - pulled_at: None | str - pulled_at = self.pulled_at - - retention: int | None - retention = self.retention - - source_type = self.source_type - - updated_at = self.updated_at - - url: None | str - url = self.url - - avg_episodes_per_month: float | None | Unset - if isinstance(self.avg_episodes_per_month, Unset): - avg_episodes_per_month = UNSET - else: - avg_episodes_per_month = self.avg_episodes_per_month - - avg_words_per_episode: int | None | Unset - if isinstance(self.avg_words_per_episode, Unset): - avg_words_per_episode = UNSET - else: - avg_words_per_episode = self.avg_words_per_episode - - chunk_language: None | str | Unset - if isinstance(self.chunk_language, Unset): - chunk_language = UNSET - else: - chunk_language = self.chunk_language - - chunk_overlap: int | None | Unset - if isinstance(self.chunk_overlap, Unset): - chunk_overlap = UNSET - else: - chunk_overlap = self.chunk_overlap - - chunk_regex_separators: bool | None | Unset - if isinstance(self.chunk_regex_separators, Unset): - chunk_regex_separators = UNSET - else: - chunk_regex_separators = self.chunk_regex_separators - - chunk_separators: None | str | Unset - if isinstance(self.chunk_separators, Unset): - chunk_separators = UNSET - else: - chunk_separators = self.chunk_separators - - chunk_size: int | None | Unset - if isinstance(self.chunk_size, Unset): - chunk_size = UNSET - else: - chunk_size = self.chunk_size - - content_count = self.content_count - - dimensions: int | None | Unset - if isinstance(self.dimensions, Unset): - dimensions = UNSET - else: - dimensions = self.dimensions - - embedding_model: None | str | Unset - if isinstance(self.embedding_model, Unset): - embedding_model = UNSET - else: - embedding_model = self.embedding_model - - embedding_model_type: None | str | Unset - if isinstance(self.embedding_model_type, Unset): - embedding_model_type = UNSET - else: - embedding_model_type = self.embedding_model_type - - free_retention_days: int | None | Unset - if isinstance(self.free_retention_days, Unset): - free_retention_days = UNSET - else: - free_retention_days = self.free_retention_days - - has_historical_data = self.has_historical_data - - index_mode: None | str | Unset - if isinstance(self.index_mode, Unset): - index_mode = UNSET - elif isinstance(self.index_mode, SourceIndexMode): - index_mode = self.index_mode.value - else: - index_mode = self.index_mode - - media_types: list[str] | Unset = UNSET - if not isinstance(self.media_types, Unset): - media_types = self.media_types - - readonly = self.readonly - - system_managed = self.system_managed - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_id": account_id, - "content_filter": content_filter, - "created_at": created_at, - "id": id, - "name": name, - "next_poll_at": next_poll_at, - "polling": polling, - "polling_action": polling_action, - "polling_max_items": polling_max_items, - "pulled_at": pulled_at, - "retention": retention, - "source_type": source_type, - "updated_at": updated_at, - "url": url, - } - ) - if avg_episodes_per_month is not UNSET: - field_dict["avg_episodes_per_month"] = avg_episodes_per_month - if avg_words_per_episode is not UNSET: - field_dict["avg_words_per_episode"] = avg_words_per_episode - if chunk_language is not UNSET: - field_dict["chunk_language"] = chunk_language - if chunk_overlap is not UNSET: - field_dict["chunk_overlap"] = chunk_overlap - if chunk_regex_separators is not UNSET: - field_dict["chunk_regex_separators"] = chunk_regex_separators - if chunk_separators is not UNSET: - field_dict["chunk_separators"] = chunk_separators - if chunk_size is not UNSET: - field_dict["chunk_size"] = chunk_size - if content_count is not UNSET: - field_dict["content_count"] = content_count - if dimensions is not UNSET: - field_dict["dimensions"] = dimensions - if embedding_model is not UNSET: - field_dict["embedding_model"] = embedding_model - if embedding_model_type is not UNSET: - field_dict["embedding_model_type"] = embedding_model_type - if free_retention_days is not UNSET: - field_dict["free_retention_days"] = free_retention_days - if has_historical_data is not UNSET: - field_dict["has_historical_data"] = has_historical_data - if index_mode is not UNSET: - field_dict["index_mode"] = index_mode - if media_types is not UNSET: - field_dict["media_types"] = media_types - if readonly is not UNSET: - field_dict["readonly"] = readonly - if system_managed is not UNSET: - field_dict["system_managed"] = system_managed - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = UUID(d.pop("account_id")) - - content_filter = d.pop("content_filter") - - created_at = d.pop("created_at") - - id = d.pop("id") - - name = d.pop("name") - - def _parse_next_poll_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - next_poll_at = _parse_next_poll_at(d.pop("next_poll_at")) - - def _parse_polling(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - polling = _parse_polling(d.pop("polling")) - - def _parse_polling_action(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - polling_action = _parse_polling_action(d.pop("polling_action")) - - def _parse_polling_max_items(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - polling_max_items = _parse_polling_max_items(d.pop("polling_max_items")) - - def _parse_pulled_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - pulled_at = _parse_pulled_at(d.pop("pulled_at")) - - def _parse_retention(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - retention = _parse_retention(d.pop("retention")) - - source_type = d.pop("source_type") - - updated_at = d.pop("updated_at") - - def _parse_url(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - url = _parse_url(d.pop("url")) - - def _parse_avg_episodes_per_month(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - avg_episodes_per_month = _parse_avg_episodes_per_month( - d.pop("avg_episodes_per_month", UNSET) - ) - - def _parse_avg_words_per_episode(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - avg_words_per_episode = _parse_avg_words_per_episode( - d.pop("avg_words_per_episode", UNSET) - ) - - def _parse_chunk_language(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - chunk_language = _parse_chunk_language(d.pop("chunk_language", UNSET)) - - def _parse_chunk_overlap(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_overlap = _parse_chunk_overlap(d.pop("chunk_overlap", UNSET)) - - def _parse_chunk_regex_separators(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - chunk_regex_separators = _parse_chunk_regex_separators( - d.pop("chunk_regex_separators", UNSET) - ) - - def _parse_chunk_separators(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - chunk_separators = _parse_chunk_separators(d.pop("chunk_separators", UNSET)) - - def _parse_chunk_size(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_size = _parse_chunk_size(d.pop("chunk_size", UNSET)) - - content_count = d.pop("content_count", UNSET) - - def _parse_dimensions(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - dimensions = _parse_dimensions(d.pop("dimensions", UNSET)) - - def _parse_embedding_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - embedding_model = _parse_embedding_model(d.pop("embedding_model", UNSET)) - - def _parse_embedding_model_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - embedding_model_type = _parse_embedding_model_type( - d.pop("embedding_model_type", UNSET) - ) - - def _parse_free_retention_days(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - free_retention_days = _parse_free_retention_days( - d.pop("free_retention_days", UNSET) - ) - - has_historical_data = d.pop("has_historical_data", UNSET) - - def _parse_index_mode(data: object) -> None | SourceIndexMode | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - index_mode_type_0 = SourceIndexMode(data) - - return index_mode_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SourceIndexMode | Unset, data) - - index_mode = _parse_index_mode(d.pop("index_mode", UNSET)) - - media_types = cast(list[str], d.pop("media_types", UNSET)) - - readonly = d.pop("readonly", UNSET) - - system_managed = d.pop("system_managed", UNSET) - - source_response = cls( - account_id=account_id, - content_filter=content_filter, - created_at=created_at, - id=id, - name=name, - next_poll_at=next_poll_at, - polling=polling, - polling_action=polling_action, - polling_max_items=polling_max_items, - pulled_at=pulled_at, - retention=retention, - source_type=source_type, - updated_at=updated_at, - url=url, - avg_episodes_per_month=avg_episodes_per_month, - avg_words_per_episode=avg_words_per_episode, - chunk_language=chunk_language, - chunk_overlap=chunk_overlap, - chunk_regex_separators=chunk_regex_separators, - chunk_separators=chunk_separators, - chunk_size=chunk_size, - content_count=content_count, - dimensions=dimensions, - embedding_model=embedding_model, - embedding_model_type=embedding_model_type, - free_retention_days=free_retention_days, - has_historical_data=has_historical_data, - index_mode=index_mode, - media_types=media_types, - readonly=readonly, - system_managed=system_managed, - ) - - source_response.additional_properties = d - return source_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/seclai/_generated/models/standalone_test_compaction_request.py b/seclai/_generated/models/standalone_test_compaction_request.py deleted file mode 100644 index b26dad6..0000000 --- a/seclai/_generated/models/standalone_test_compaction_request.py +++ /dev/null @@ -1,141 +0,0 @@ -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="StandaloneTestCompactionRequest") - - -@_attrs_define -class StandaloneTestCompactionRequest: - """Request body for testing a compaction prompt *without* an existing bank. - - Used on the create-memory-bank page where no bank ID exists yet. - ``compaction_prompt`` is required (no bank to fall back to). - Content must come from ``sample_entries`` or ``generate_direction`` - (no existing entries to fetch). - - Attributes: - compaction_prompt (str): Compaction prompt to test. - bank_type (str | Unset): Memory bank type ('conversation' or 'general') — controls the style of generated - entries. Default: 'conversation'. - entry_count (int | Unset): Number of entries to generate when using generate_direction. Default: 5. - generate_direction (None | str | Unset): Direction for the LLM to generate sample entries. - sample_entries (list[str] | None | Unset): Explicit sample entries to compact. - """ - - compaction_prompt: str - bank_type: str | Unset = "conversation" - entry_count: int | Unset = 5 - generate_direction: None | str | Unset = UNSET - sample_entries: list[str] | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - compaction_prompt = self.compaction_prompt - - bank_type = self.bank_type - - entry_count = self.entry_count - - generate_direction: None | str | Unset - if isinstance(self.generate_direction, Unset): - generate_direction = UNSET - else: - generate_direction = self.generate_direction - - sample_entries: list[str] | None | Unset - if isinstance(self.sample_entries, Unset): - sample_entries = UNSET - elif isinstance(self.sample_entries, list): - sample_entries = self.sample_entries - - else: - sample_entries = self.sample_entries - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "compaction_prompt": compaction_prompt, - } - ) - if bank_type is not UNSET: - field_dict["bank_type"] = bank_type - if entry_count is not UNSET: - field_dict["entry_count"] = entry_count - if generate_direction is not UNSET: - field_dict["generate_direction"] = generate_direction - if sample_entries is not UNSET: - field_dict["sample_entries"] = sample_entries - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - compaction_prompt = d.pop("compaction_prompt") - - bank_type = d.pop("bank_type", UNSET) - - entry_count = d.pop("entry_count", UNSET) - - def _parse_generate_direction(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - generate_direction = _parse_generate_direction( - d.pop("generate_direction", UNSET) - ) - - def _parse_sample_entries(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() - sample_entries_type_0 = cast(list[str], data) - - return sample_entries_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - sample_entries = _parse_sample_entries(d.pop("sample_entries", UNSET)) - - standalone_test_compaction_request = cls( - compaction_prompt=compaction_prompt, - bank_type=bank_type, - entry_count=entry_count, - generate_direction=generate_direction, - sample_entries=sample_entries, - ) - - standalone_test_compaction_request.additional_properties = d - return standalone_test_compaction_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/seclai/_generated/models/start_source_embedding_migration_request.py b/seclai/_generated/models/start_source_embedding_migration_request.py deleted file mode 100644 index 74eb819..0000000 --- a/seclai/_generated/models/start_source_embedding_migration_request.py +++ /dev/null @@ -1,207 +0,0 @@ -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="StartSourceEmbeddingMigrationRequest") - - -@_attrs_define -class StartSourceEmbeddingMigrationRequest: - """Request payload to start a source embedding migration. - - Attributes: - target_dimensions (int): Target embedding dimensions - target_embedding_model (str): Target embedding model enum - chunk_language (None | str | Unset): Language-specific chunking language code - chunk_overlap (int | None | Unset): Override chunk overlap (characters) - chunk_regex_separators (bool | None | Unset): Whether chunk separators are regex patterns - chunk_separators (None | str | Unset): Custom chunk separators (JSON-encoded list) - chunk_size (int | None | Unset): Override chunk size (characters per chunk) - notification_recipients (list[str] | None | Unset): Optional notification recipient emails - """ - - target_dimensions: int - target_embedding_model: str - chunk_language: None | str | Unset = UNSET - chunk_overlap: int | None | Unset = UNSET - chunk_regex_separators: bool | None | Unset = UNSET - chunk_separators: None | str | Unset = UNSET - chunk_size: int | None | Unset = UNSET - notification_recipients: list[str] | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - target_dimensions = self.target_dimensions - - target_embedding_model = self.target_embedding_model - - chunk_language: None | str | Unset - if isinstance(self.chunk_language, Unset): - chunk_language = UNSET - else: - chunk_language = self.chunk_language - - chunk_overlap: int | None | Unset - if isinstance(self.chunk_overlap, Unset): - chunk_overlap = UNSET - else: - chunk_overlap = self.chunk_overlap - - chunk_regex_separators: bool | None | Unset - if isinstance(self.chunk_regex_separators, Unset): - chunk_regex_separators = UNSET - else: - chunk_regex_separators = self.chunk_regex_separators - - chunk_separators: None | str | Unset - if isinstance(self.chunk_separators, Unset): - chunk_separators = UNSET - else: - chunk_separators = self.chunk_separators - - chunk_size: int | None | Unset - if isinstance(self.chunk_size, Unset): - chunk_size = UNSET - else: - chunk_size = self.chunk_size - - notification_recipients: list[str] | None | Unset - if isinstance(self.notification_recipients, Unset): - notification_recipients = UNSET - elif isinstance(self.notification_recipients, list): - notification_recipients = self.notification_recipients - - else: - notification_recipients = self.notification_recipients - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "target_dimensions": target_dimensions, - "target_embedding_model": target_embedding_model, - } - ) - if chunk_language is not UNSET: - field_dict["chunk_language"] = chunk_language - if chunk_overlap is not UNSET: - field_dict["chunk_overlap"] = chunk_overlap - if chunk_regex_separators is not UNSET: - field_dict["chunk_regex_separators"] = chunk_regex_separators - if chunk_separators is not UNSET: - field_dict["chunk_separators"] = chunk_separators - if chunk_size is not UNSET: - field_dict["chunk_size"] = chunk_size - if notification_recipients is not UNSET: - field_dict["notification_recipients"] = notification_recipients - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - target_dimensions = d.pop("target_dimensions") - - target_embedding_model = d.pop("target_embedding_model") - - def _parse_chunk_language(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - chunk_language = _parse_chunk_language(d.pop("chunk_language", UNSET)) - - def _parse_chunk_overlap(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_overlap = _parse_chunk_overlap(d.pop("chunk_overlap", UNSET)) - - def _parse_chunk_regex_separators(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - chunk_regex_separators = _parse_chunk_regex_separators( - d.pop("chunk_regex_separators", UNSET) - ) - - def _parse_chunk_separators(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - chunk_separators = _parse_chunk_separators(d.pop("chunk_separators", UNSET)) - - def _parse_chunk_size(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_size = _parse_chunk_size(d.pop("chunk_size", UNSET)) - - def _parse_notification_recipients(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() - notification_recipients_type_0 = cast(list[str], data) - - return notification_recipients_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - notification_recipients = _parse_notification_recipients( - d.pop("notification_recipients", UNSET) - ) - - start_source_embedding_migration_request = cls( - target_dimensions=target_dimensions, - target_embedding_model=target_embedding_model, - chunk_language=chunk_language, - chunk_overlap=chunk_overlap, - chunk_regex_separators=chunk_regex_separators, - chunk_separators=chunk_separators, - chunk_size=chunk_size, - notification_recipients=notification_recipients, - ) - - start_source_embedding_migration_request.additional_properties = d - return start_source_embedding_migration_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/seclai/_generated/models/test_compaction_request.py b/seclai/_generated/models/test_compaction_request.py deleted file mode 100644 index a5abfb9..0000000 --- a/seclai/_generated/models/test_compaction_request.py +++ /dev/null @@ -1,149 +0,0 @@ -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="TestCompactionRequest") - - -@_attrs_define -class TestCompactionRequest: - """Request body for testing a compaction prompt against an existing bank. - - The user may supply a ``compaction_prompt`` to override (or provide when - the bank has none). Content can come from three sources: - - 1. Existing entries in the bank (default when neither field is set). - 2. ``sample_entries`` – caller-provided list of strings. - 3. ``generate_direction`` – an instruction to the LLM to generate sample - memory entries. Useful for trying a prompt before any real data - exists. - - At most one of ``sample_entries`` / ``generate_direction`` may be given. - - Attributes: - compaction_prompt (None | str | Unset): Compaction prompt to test. Falls back to the bank's current prompt when - omitted. - entry_count (int | Unset): Number of entries to generate when using generate_direction. Default: 5. - generate_direction (None | str | Unset): Direction for the LLM to generate sample entries (e.g. 'Generate 5 - entries about a customer support interaction'). - sample_entries (list[str] | None | Unset): Explicit sample entries to compact. - """ - - compaction_prompt: None | str | Unset = UNSET - entry_count: int | Unset = 5 - generate_direction: None | str | Unset = UNSET - sample_entries: list[str] | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - compaction_prompt: None | str | Unset - if isinstance(self.compaction_prompt, Unset): - compaction_prompt = UNSET - else: - compaction_prompt = self.compaction_prompt - - entry_count = self.entry_count - - generate_direction: None | str | Unset - if isinstance(self.generate_direction, Unset): - generate_direction = UNSET - else: - generate_direction = self.generate_direction - - sample_entries: list[str] | None | Unset - if isinstance(self.sample_entries, Unset): - sample_entries = UNSET - elif isinstance(self.sample_entries, list): - sample_entries = self.sample_entries - - else: - sample_entries = self.sample_entries - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if compaction_prompt is not UNSET: - field_dict["compaction_prompt"] = compaction_prompt - if entry_count is not UNSET: - field_dict["entry_count"] = entry_count - if generate_direction is not UNSET: - field_dict["generate_direction"] = generate_direction - if sample_entries is not UNSET: - field_dict["sample_entries"] = sample_entries - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_compaction_prompt(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - compaction_prompt = _parse_compaction_prompt(d.pop("compaction_prompt", UNSET)) - - entry_count = d.pop("entry_count", UNSET) - - def _parse_generate_direction(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - generate_direction = _parse_generate_direction( - d.pop("generate_direction", UNSET) - ) - - def _parse_sample_entries(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() - sample_entries_type_0 = cast(list[str], data) - - return sample_entries_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - sample_entries = _parse_sample_entries(d.pop("sample_entries", UNSET)) - - test_compaction_request = cls( - compaction_prompt=compaction_prompt, - entry_count=entry_count, - generate_direction=generate_direction, - sample_entries=sample_entries, - ) - - test_compaction_request.additional_properties = d - return test_compaction_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/seclai/_generated/models/test_draft_evaluation_request.py b/seclai/_generated/models/test_draft_evaluation_request.py deleted file mode 100644 index 749cc14..0000000 --- a/seclai/_generated/models/test_draft_evaluation_request.py +++ /dev/null @@ -1,246 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.agent_evaluation_tier import AgentEvaluationTier -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.test_draft_evaluation_request_expectation_config_type_0 import ( - TestDraftEvaluationRequestExpectationConfigType0, - ) - - -T = TypeVar("T", bound="TestDraftEvaluationRequest") - - -@_attrs_define -class TestDraftEvaluationRequest: - """Request body for ephemeral (non-persisted) evaluation testing. - - Provide either ``step_output`` (raw text) **or** ``agent_step_run_id`` - (to load output from storage). Exactly one must be supplied. - - Attributes: - agent_input (None | str | Unset): The original agent run input for context. When agent_step_run_id is supplied - this is loaded automatically from the parent run if omitted. - agent_step_run_id (None | Unset | UUID): Load step output from this completed step run instead of supplying - text. - evaluation_prompt (None | str | Unset): - evaluation_tier (AgentEvaluationTier | None | Unset): - expectation_config (None | TestDraftEvaluationRequestExpectationConfigType0 | Unset): - pass_threshold (float | Unset): Default: 0.5. - step_output (None | str | Unset): The step output text to evaluate. Omit if agent_step_run_id is supplied. - """ - - agent_input: None | str | Unset = UNSET - agent_step_run_id: None | Unset | UUID = UNSET - evaluation_prompt: None | str | Unset = UNSET - evaluation_tier: AgentEvaluationTier | None | Unset = UNSET - expectation_config: ( - None | TestDraftEvaluationRequestExpectationConfigType0 | Unset - ) = UNSET - pass_threshold: float | Unset = 0.5 - step_output: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.test_draft_evaluation_request_expectation_config_type_0 import ( - TestDraftEvaluationRequestExpectationConfigType0, - ) - - agent_input: None | str | Unset - if isinstance(self.agent_input, Unset): - agent_input = UNSET - else: - agent_input = self.agent_input - - agent_step_run_id: None | str | Unset - if isinstance(self.agent_step_run_id, Unset): - agent_step_run_id = UNSET - elif isinstance(self.agent_step_run_id, UUID): - agent_step_run_id = str(self.agent_step_run_id) - else: - agent_step_run_id = self.agent_step_run_id - - evaluation_prompt: None | str | Unset - if isinstance(self.evaluation_prompt, Unset): - evaluation_prompt = UNSET - else: - evaluation_prompt = self.evaluation_prompt - - evaluation_tier: None | str | Unset - if isinstance(self.evaluation_tier, Unset): - evaluation_tier = UNSET - elif isinstance(self.evaluation_tier, AgentEvaluationTier): - evaluation_tier = self.evaluation_tier.value - else: - evaluation_tier = self.evaluation_tier - - expectation_config: dict[str, Any] | None | Unset - if isinstance(self.expectation_config, Unset): - expectation_config = UNSET - elif isinstance( - self.expectation_config, TestDraftEvaluationRequestExpectationConfigType0 - ): - expectation_config = self.expectation_config.to_dict() - else: - expectation_config = self.expectation_config - - pass_threshold = self.pass_threshold - - step_output: None | str | Unset - if isinstance(self.step_output, Unset): - step_output = UNSET - else: - step_output = self.step_output - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if agent_input is not UNSET: - field_dict["agent_input"] = agent_input - if agent_step_run_id is not UNSET: - field_dict["agent_step_run_id"] = agent_step_run_id - if evaluation_prompt is not UNSET: - field_dict["evaluation_prompt"] = evaluation_prompt - if evaluation_tier is not UNSET: - field_dict["evaluation_tier"] = evaluation_tier - if expectation_config is not UNSET: - field_dict["expectation_config"] = expectation_config - if pass_threshold is not UNSET: - field_dict["pass_threshold"] = pass_threshold - if step_output is not UNSET: - field_dict["step_output"] = step_output - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.test_draft_evaluation_request_expectation_config_type_0 import ( - TestDraftEvaluationRequestExpectationConfigType0, - ) - - d = dict(src_dict) - - def _parse_agent_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_input = _parse_agent_input(d.pop("agent_input", UNSET)) - - def _parse_agent_step_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() - agent_step_run_id_type_0 = UUID(data) - - return agent_step_run_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - agent_step_run_id = _parse_agent_step_run_id(d.pop("agent_step_run_id", UNSET)) - - def _parse_evaluation_prompt(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - evaluation_prompt = _parse_evaluation_prompt(d.pop("evaluation_prompt", UNSET)) - - def _parse_evaluation_tier(data: object) -> AgentEvaluationTier | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - evaluation_tier_type_0 = AgentEvaluationTier(data) - - return evaluation_tier_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentEvaluationTier | None | Unset, data) - - evaluation_tier = _parse_evaluation_tier(d.pop("evaluation_tier", UNSET)) - - def _parse_expectation_config( - data: object, - ) -> None | TestDraftEvaluationRequestExpectationConfigType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - expectation_config_type_0 = ( - TestDraftEvaluationRequestExpectationConfigType0.from_dict(data) - ) - - return expectation_config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - None | TestDraftEvaluationRequestExpectationConfigType0 | Unset, data - ) - - expectation_config = _parse_expectation_config( - d.pop("expectation_config", UNSET) - ) - - pass_threshold = d.pop("pass_threshold", UNSET) - - def _parse_step_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - step_output = _parse_step_output(d.pop("step_output", UNSET)) - - test_draft_evaluation_request = cls( - agent_input=agent_input, - agent_step_run_id=agent_step_run_id, - evaluation_prompt=evaluation_prompt, - evaluation_tier=evaluation_tier, - expectation_config=expectation_config, - pass_threshold=pass_threshold, - step_output=step_output, - ) - - test_draft_evaluation_request.additional_properties = d - return test_draft_evaluation_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/seclai/_generated/models/test_draft_evaluation_request_expectation_config_type_0.py b/seclai/_generated/models/test_draft_evaluation_request_expectation_config_type_0.py deleted file mode 100644 index 0dce88e..0000000 --- a/seclai/_generated/models/test_draft_evaluation_request_expectation_config_type_0.py +++ /dev/null @@ -1,48 +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="TestDraftEvaluationRequestExpectationConfigType0") - - -@_attrs_define -class TestDraftEvaluationRequestExpectationConfigType0: - """ """ - - additional_properties: dict[str, Any] = _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) - test_draft_evaluation_request_expectation_config_type_0 = cls() - - test_draft_evaluation_request_expectation_config_type_0.additional_properties = ( - d - ) - return test_draft_evaluation_request_expectation_config_type_0 - - @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/seclai/_generated/models/test_draft_evaluation_response.py b/seclai/_generated/models/test_draft_evaluation_response.py deleted file mode 100644 index 6b294fc..0000000 --- a/seclai/_generated/models/test_draft_evaluation_response.py +++ /dev/null @@ -1,85 +0,0 @@ -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 - -T = TypeVar("T", bound="TestDraftEvaluationResponse") - - -@_attrs_define -class TestDraftEvaluationResponse: - """Response for an ephemeral evaluation test. - - Attributes: - explanation (None | str): - passed (bool): - score (float): - """ - - explanation: None | str - passed: bool - score: float - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - explanation: None | str - explanation = self.explanation - - passed = self.passed - - score = self.score - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "explanation": explanation, - "passed": passed, - "score": score, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_explanation(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - explanation = _parse_explanation(d.pop("explanation")) - - passed = d.pop("passed") - - score = d.pop("score") - - test_draft_evaluation_response = cls( - explanation=explanation, - passed=passed, - score=score, - ) - - test_draft_evaluation_response.additional_properties = d - return test_draft_evaluation_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/seclai/_generated/models/unlink_resources_request.py b/seclai/_generated/models/unlink_resources_request.py deleted file mode 100644 index db6dfc2..0000000 --- a/seclai/_generated/models/unlink_resources_request.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="UnlinkResourcesRequest") - - -@_attrs_define -class UnlinkResourcesRequest: - """ - Attributes: - ids (list[UUID]): Resource IDs to unlink - """ - - ids: list[UUID] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - ids = [] - for ids_item_data in self.ids: - ids_item = str(ids_item_data) - ids.append(ids_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "ids": ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - ids = [] - _ids = d.pop("ids") - for ids_item_data in _ids: - ids_item = UUID(ids_item_data) - - ids.append(ids_item) - - unlink_resources_request = cls( - ids=ids, - ) - - unlink_resources_request.additional_properties = d - return unlink_resources_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/seclai/_generated/models/unread_count_response.py b/seclai/_generated/models/unread_count_response.py deleted file mode 100644 index b08f920..0000000 --- a/seclai/_generated/models/unread_count_response.py +++ /dev/null @@ -1,61 +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="UnreadCountResponse") - - -@_attrs_define -class UnreadCountResponse: - """ - Attributes: - count (int): - """ - - count: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - count = self.count - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "count": count, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - count = d.pop("count") - - unread_count_response = cls( - count=count, - ) - - unread_count_response.additional_properties = d - return unread_count_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/seclai/_generated/models/update_agent_definition_request.py b/seclai/_generated/models/update_agent_definition_request.py deleted file mode 100644 index b259795..0000000 --- a/seclai/_generated/models/update_agent_definition_request.py +++ /dev/null @@ -1,84 +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.update_agent_definition_request_definition import ( - UpdateAgentDefinitionRequestDefinition, - ) - - -T = TypeVar("T", bound="UpdateAgentDefinitionRequest") - - -@_attrs_define -class UpdateAgentDefinitionRequest: - """ - Attributes: - definition (UpdateAgentDefinitionRequestDefinition): The full agent definition (name, description, tags, steps). - Steps form a tree workflow. Each step has a `step_type`, `id`, `name`, and type-specific config. Content - enrichment steps (write_metadata, write_content_attachment, load_content_attachment, load_content) require - content-triggered agents. - expected_change_id (str): The change_id from the last GET, for optimistic locking. - """ - - definition: UpdateAgentDefinitionRequestDefinition - expected_change_id: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - definition = self.definition.to_dict() - - expected_change_id = self.expected_change_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "definition": definition, - "expected_change_id": expected_change_id, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_agent_definition_request_definition import ( - UpdateAgentDefinitionRequestDefinition, - ) - - d = dict(src_dict) - definition = UpdateAgentDefinitionRequestDefinition.from_dict( - d.pop("definition") - ) - - expected_change_id = d.pop("expected_change_id") - - update_agent_definition_request = cls( - definition=definition, - expected_change_id=expected_change_id, - ) - - update_agent_definition_request.additional_properties = d - return update_agent_definition_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/seclai/_generated/models/update_agent_definition_request_definition.py b/seclai/_generated/models/update_agent_definition_request_definition.py deleted file mode 100644 index 83e0026..0000000 --- a/seclai/_generated/models/update_agent_definition_request_definition.py +++ /dev/null @@ -1,50 +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="UpdateAgentDefinitionRequestDefinition") - - -@_attrs_define -class UpdateAgentDefinitionRequestDefinition: - """The full agent definition (name, description, tags, steps). Steps form a tree workflow. Each step has a `step_type`, - `id`, `name`, and type-specific config. Content enrichment steps (write_metadata, write_content_attachment, - load_content_attachment, load_content) require content-triggered agents. - - """ - - additional_properties: dict[str, Any] = _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) - update_agent_definition_request_definition = cls() - - update_agent_definition_request_definition.additional_properties = d - return update_agent_definition_request_definition - - @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/seclai/_generated/models/update_agent_request.py b/seclai/_generated/models/update_agent_request.py deleted file mode 100644 index ae34ee8..0000000 --- a/seclai/_generated/models/update_agent_request.py +++ /dev/null @@ -1,467 +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.prompt_model_auto_upgrade_strategy import PromptModelAutoUpgradeStrategy -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.update_agent_request_agent_definition_type_0 import ( - UpdateAgentRequestAgentDefinitionType0, - ) - from ..models.update_agent_request_entity_remap_type_0 import ( - UpdateAgentRequestEntityRemapType0, - ) - from ..models.update_agent_request_sampling_config_type_0 import ( - UpdateAgentRequestSamplingConfigType0, - ) - - -T = TypeVar("T", bound="UpdateAgentRequest") - - -@_attrs_define -class UpdateAgentRequest: - """ - Attributes: - agent_definition (None | Unset | UpdateAgentRequestAgentDefinitionType0): Optional payload in the same format - produced by GET /agents/{id}/export. When provided, agent metadata fields the request does not set explicitly - are taken from the payload, and the agent's workflow is replaced from `agent.definition`. The previous version - is preserved in history. Validation errors include line/column references against a canonical pretty-printed - echo of the supplied payload. - default_evaluation_tier (None | str | Unset): Default evaluation tier: 'fast', 'balanced', or 'thorough'. - description (None | str | Unset): New description for the agent. - entity_remap (None | Unset | UpdateAgentRequestEntityRemapType0): Optional UUID-substitution map applied to the - imported workflow before save (same shape as on POST /agents). - evaluation_mode (None | str | Unset): Evaluation mode: 'output_expectation', 'eval_and_retry', or - 'sample_and_flag'. - max_retries (int | None | Unset): Max retries for eval_and_retry mode (1-10). - name (None | str | Unset): New name for the agent. - prompt_model_auto_rollback_enabled (bool | None | Unset): Enable or disable automatic rollback for upgraded - models. - prompt_model_auto_rollback_triggers (list[str] | None | Unset): Failure signals that trigger rollback: - agent_eval_fail, governance_flag, governance_block, agent_run_failed. - prompt_model_auto_upgrade_strategy (None | PromptModelAutoUpgradeStrategy | Unset): Auto-upgrade strategy: none, - early_adopter, middle_of_road, cautious_adopter. - retry_on_failure (bool | None | Unset): Whether to retry on evaluation failure. - sampling_config (None | Unset | UpdateAgentRequestSamplingConfigType0): Sampling configuration for - sample_and_flag mode. Format: {combinator: 'and'|'or', rules: [...]}. - set_default_evaluation_tier (bool | Unset): When true and default_evaluation_tier is omitted, clears the tier to - null (system default). Default: False. - set_prompt_model_auto_rollback_triggers (bool | Unset): When true and prompt_model_auto_rollback_triggers is - omitted, clears the list to null (revert to system defaults). Default: False. - set_sampling_config (bool | Unset): When true and sampling_config is omitted, clears the config to null. - Default: False. - """ - - agent_definition: None | Unset | UpdateAgentRequestAgentDefinitionType0 = UNSET - default_evaluation_tier: None | str | Unset = UNSET - description: None | str | Unset = UNSET - entity_remap: None | Unset | UpdateAgentRequestEntityRemapType0 = UNSET - evaluation_mode: None | str | Unset = UNSET - max_retries: int | None | Unset = UNSET - name: None | str | Unset = UNSET - prompt_model_auto_rollback_enabled: bool | None | Unset = UNSET - prompt_model_auto_rollback_triggers: list[str] | None | Unset = UNSET - prompt_model_auto_upgrade_strategy: ( - None | PromptModelAutoUpgradeStrategy | Unset - ) = UNSET - retry_on_failure: bool | None | Unset = UNSET - sampling_config: None | Unset | UpdateAgentRequestSamplingConfigType0 = UNSET - set_default_evaluation_tier: bool | Unset = False - set_prompt_model_auto_rollback_triggers: bool | Unset = False - set_sampling_config: bool | Unset = False - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.update_agent_request_agent_definition_type_0 import ( - UpdateAgentRequestAgentDefinitionType0, - ) - from ..models.update_agent_request_entity_remap_type_0 import ( - UpdateAgentRequestEntityRemapType0, - ) - from ..models.update_agent_request_sampling_config_type_0 import ( - UpdateAgentRequestSamplingConfigType0, - ) - - agent_definition: dict[str, Any] | None | Unset - if isinstance(self.agent_definition, Unset): - agent_definition = UNSET - elif isinstance(self.agent_definition, UpdateAgentRequestAgentDefinitionType0): - agent_definition = self.agent_definition.to_dict() - else: - agent_definition = self.agent_definition - - default_evaluation_tier: None | str | Unset - if isinstance(self.default_evaluation_tier, Unset): - default_evaluation_tier = UNSET - else: - default_evaluation_tier = self.default_evaluation_tier - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - entity_remap: dict[str, Any] | None | Unset - if isinstance(self.entity_remap, Unset): - entity_remap = UNSET - elif isinstance(self.entity_remap, UpdateAgentRequestEntityRemapType0): - entity_remap = self.entity_remap.to_dict() - else: - entity_remap = self.entity_remap - - evaluation_mode: None | str | Unset - if isinstance(self.evaluation_mode, Unset): - evaluation_mode = UNSET - else: - evaluation_mode = self.evaluation_mode - - max_retries: int | None | Unset - if isinstance(self.max_retries, Unset): - max_retries = UNSET - else: - max_retries = self.max_retries - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - prompt_model_auto_rollback_enabled: bool | None | Unset - if isinstance(self.prompt_model_auto_rollback_enabled, Unset): - prompt_model_auto_rollback_enabled = UNSET - else: - prompt_model_auto_rollback_enabled = self.prompt_model_auto_rollback_enabled - - prompt_model_auto_rollback_triggers: list[str] | None | Unset - if isinstance(self.prompt_model_auto_rollback_triggers, Unset): - prompt_model_auto_rollback_triggers = UNSET - elif isinstance(self.prompt_model_auto_rollback_triggers, list): - prompt_model_auto_rollback_triggers = ( - self.prompt_model_auto_rollback_triggers - ) - - else: - prompt_model_auto_rollback_triggers = ( - self.prompt_model_auto_rollback_triggers - ) - - prompt_model_auto_upgrade_strategy: None | str | Unset - if isinstance(self.prompt_model_auto_upgrade_strategy, Unset): - prompt_model_auto_upgrade_strategy = UNSET - elif isinstance( - self.prompt_model_auto_upgrade_strategy, PromptModelAutoUpgradeStrategy - ): - prompt_model_auto_upgrade_strategy = ( - self.prompt_model_auto_upgrade_strategy.value - ) - else: - prompt_model_auto_upgrade_strategy = self.prompt_model_auto_upgrade_strategy - - retry_on_failure: bool | None | Unset - if isinstance(self.retry_on_failure, Unset): - retry_on_failure = UNSET - else: - retry_on_failure = self.retry_on_failure - - sampling_config: dict[str, Any] | None | Unset - if isinstance(self.sampling_config, Unset): - sampling_config = UNSET - elif isinstance(self.sampling_config, UpdateAgentRequestSamplingConfigType0): - sampling_config = self.sampling_config.to_dict() - else: - sampling_config = self.sampling_config - - set_default_evaluation_tier = self.set_default_evaluation_tier - - set_prompt_model_auto_rollback_triggers = ( - self.set_prompt_model_auto_rollback_triggers - ) - - set_sampling_config = self.set_sampling_config - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if agent_definition is not UNSET: - field_dict["agent_definition"] = agent_definition - if default_evaluation_tier is not UNSET: - field_dict["default_evaluation_tier"] = default_evaluation_tier - if description is not UNSET: - field_dict["description"] = description - if entity_remap is not UNSET: - field_dict["entity_remap"] = entity_remap - if evaluation_mode is not UNSET: - field_dict["evaluation_mode"] = evaluation_mode - if max_retries is not UNSET: - field_dict["max_retries"] = max_retries - if name is not UNSET: - field_dict["name"] = name - if prompt_model_auto_rollback_enabled is not UNSET: - field_dict["prompt_model_auto_rollback_enabled"] = ( - prompt_model_auto_rollback_enabled - ) - if prompt_model_auto_rollback_triggers is not UNSET: - field_dict["prompt_model_auto_rollback_triggers"] = ( - prompt_model_auto_rollback_triggers - ) - if prompt_model_auto_upgrade_strategy is not UNSET: - field_dict["prompt_model_auto_upgrade_strategy"] = ( - prompt_model_auto_upgrade_strategy - ) - if retry_on_failure is not UNSET: - field_dict["retry_on_failure"] = retry_on_failure - if sampling_config is not UNSET: - field_dict["sampling_config"] = sampling_config - if set_default_evaluation_tier is not UNSET: - field_dict["set_default_evaluation_tier"] = set_default_evaluation_tier - if set_prompt_model_auto_rollback_triggers is not UNSET: - field_dict["set_prompt_model_auto_rollback_triggers"] = ( - set_prompt_model_auto_rollback_triggers - ) - if set_sampling_config is not UNSET: - field_dict["set_sampling_config"] = set_sampling_config - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_agent_request_agent_definition_type_0 import ( - UpdateAgentRequestAgentDefinitionType0, - ) - from ..models.update_agent_request_entity_remap_type_0 import ( - UpdateAgentRequestEntityRemapType0, - ) - from ..models.update_agent_request_sampling_config_type_0 import ( - UpdateAgentRequestSamplingConfigType0, - ) - - d = dict(src_dict) - - def _parse_agent_definition( - data: object, - ) -> None | Unset | UpdateAgentRequestAgentDefinitionType0: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - agent_definition_type_0 = ( - UpdateAgentRequestAgentDefinitionType0.from_dict(data) - ) - - return agent_definition_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UpdateAgentRequestAgentDefinitionType0, data) - - agent_definition = _parse_agent_definition(d.pop("agent_definition", UNSET)) - - def _parse_default_evaluation_tier(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - default_evaluation_tier = _parse_default_evaluation_tier( - d.pop("default_evaluation_tier", UNSET) - ) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_entity_remap( - data: object, - ) -> None | Unset | UpdateAgentRequestEntityRemapType0: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - entity_remap_type_0 = UpdateAgentRequestEntityRemapType0.from_dict(data) - - return entity_remap_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UpdateAgentRequestEntityRemapType0, data) - - entity_remap = _parse_entity_remap(d.pop("entity_remap", UNSET)) - - def _parse_evaluation_mode(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - evaluation_mode = _parse_evaluation_mode(d.pop("evaluation_mode", UNSET)) - - def _parse_max_retries(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_retries = _parse_max_retries(d.pop("max_retries", UNSET)) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - def _parse_prompt_model_auto_rollback_enabled( - data: object, - ) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - prompt_model_auto_rollback_enabled = _parse_prompt_model_auto_rollback_enabled( - d.pop("prompt_model_auto_rollback_enabled", UNSET) - ) - - def _parse_prompt_model_auto_rollback_triggers( - 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() - prompt_model_auto_rollback_triggers_type_0 = cast(list[str], data) - - return prompt_model_auto_rollback_triggers_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - prompt_model_auto_rollback_triggers = ( - _parse_prompt_model_auto_rollback_triggers( - d.pop("prompt_model_auto_rollback_triggers", UNSET) - ) - ) - - def _parse_prompt_model_auto_upgrade_strategy( - data: object, - ) -> None | PromptModelAutoUpgradeStrategy | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - prompt_model_auto_upgrade_strategy_type_0 = ( - PromptModelAutoUpgradeStrategy(data) - ) - - return prompt_model_auto_upgrade_strategy_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PromptModelAutoUpgradeStrategy | Unset, data) - - prompt_model_auto_upgrade_strategy = _parse_prompt_model_auto_upgrade_strategy( - d.pop("prompt_model_auto_upgrade_strategy", UNSET) - ) - - def _parse_retry_on_failure(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - retry_on_failure = _parse_retry_on_failure(d.pop("retry_on_failure", UNSET)) - - def _parse_sampling_config( - data: object, - ) -> None | Unset | UpdateAgentRequestSamplingConfigType0: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - sampling_config_type_0 = ( - UpdateAgentRequestSamplingConfigType0.from_dict(data) - ) - - return sampling_config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UpdateAgentRequestSamplingConfigType0, data) - - sampling_config = _parse_sampling_config(d.pop("sampling_config", UNSET)) - - set_default_evaluation_tier = d.pop("set_default_evaluation_tier", UNSET) - - set_prompt_model_auto_rollback_triggers = d.pop( - "set_prompt_model_auto_rollback_triggers", UNSET - ) - - set_sampling_config = d.pop("set_sampling_config", UNSET) - - update_agent_request = cls( - agent_definition=agent_definition, - default_evaluation_tier=default_evaluation_tier, - description=description, - entity_remap=entity_remap, - evaluation_mode=evaluation_mode, - max_retries=max_retries, - name=name, - prompt_model_auto_rollback_enabled=prompt_model_auto_rollback_enabled, - prompt_model_auto_rollback_triggers=prompt_model_auto_rollback_triggers, - prompt_model_auto_upgrade_strategy=prompt_model_auto_upgrade_strategy, - retry_on_failure=retry_on_failure, - sampling_config=sampling_config, - set_default_evaluation_tier=set_default_evaluation_tier, - set_prompt_model_auto_rollback_triggers=set_prompt_model_auto_rollback_triggers, - set_sampling_config=set_sampling_config, - ) - - update_agent_request.additional_properties = d - return update_agent_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/seclai/_generated/models/update_agent_request_agent_definition_type_0.py b/seclai/_generated/models/update_agent_request_agent_definition_type_0.py deleted file mode 100644 index e90a89b..0000000 --- a/seclai/_generated/models/update_agent_request_agent_definition_type_0.py +++ /dev/null @@ -1,46 +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="UpdateAgentRequestAgentDefinitionType0") - - -@_attrs_define -class UpdateAgentRequestAgentDefinitionType0: - """ """ - - additional_properties: dict[str, Any] = _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) - update_agent_request_agent_definition_type_0 = cls() - - update_agent_request_agent_definition_type_0.additional_properties = d - return update_agent_request_agent_definition_type_0 - - @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/seclai/_generated/models/update_agent_request_entity_remap_type_0.py b/seclai/_generated/models/update_agent_request_entity_remap_type_0.py deleted file mode 100644 index 17eb665..0000000 --- a/seclai/_generated/models/update_agent_request_entity_remap_type_0.py +++ /dev/null @@ -1,46 +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="UpdateAgentRequestEntityRemapType0") - - -@_attrs_define -class UpdateAgentRequestEntityRemapType0: - """ """ - - 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) - update_agent_request_entity_remap_type_0 = cls() - - update_agent_request_entity_remap_type_0.additional_properties = d - return update_agent_request_entity_remap_type_0 - - @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/seclai/_generated/models/update_agent_request_sampling_config_type_0.py b/seclai/_generated/models/update_agent_request_sampling_config_type_0.py deleted file mode 100644 index d9cced7..0000000 --- a/seclai/_generated/models/update_agent_request_sampling_config_type_0.py +++ /dev/null @@ -1,46 +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="UpdateAgentRequestSamplingConfigType0") - - -@_attrs_define -class UpdateAgentRequestSamplingConfigType0: - """ """ - - additional_properties: dict[str, Any] = _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) - update_agent_request_sampling_config_type_0 = cls() - - update_agent_request_sampling_config_type_0.additional_properties = d - return update_agent_request_sampling_config_type_0 - - @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/seclai/_generated/models/update_alert_config_request.py b/seclai/_generated/models/update_alert_config_request.py deleted file mode 100644 index 8d610d4..0000000 --- a/seclai/_generated/models/update_alert_config_request.py +++ /dev/null @@ -1,194 +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.update_alert_config_request_threshold_type_0 import ( - UpdateAlertConfigRequestThresholdType0, - ) - - -T = TypeVar("T", bound="UpdateAlertConfigRequest") - - -@_attrs_define -class UpdateAlertConfigRequest: - """ - Attributes: - cooldown_minutes (int | None | Unset): Cooldown period in minutes - distribution_type (None | str | Unset): Distribution type - enabled (bool | None | Unset): Whether the alert config is enabled - recipient_user_ids (list[str] | None | Unset): User IDs for selected_members distribution - threshold (None | Unset | UpdateAlertConfigRequestThresholdType0): Threshold configuration - """ - - cooldown_minutes: int | None | Unset = UNSET - distribution_type: None | str | Unset = UNSET - enabled: bool | None | Unset = UNSET - recipient_user_ids: list[str] | None | Unset = UNSET - threshold: None | Unset | UpdateAlertConfigRequestThresholdType0 = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.update_alert_config_request_threshold_type_0 import ( - UpdateAlertConfigRequestThresholdType0, - ) - - cooldown_minutes: int | None | Unset - if isinstance(self.cooldown_minutes, Unset): - cooldown_minutes = UNSET - else: - cooldown_minutes = self.cooldown_minutes - - distribution_type: None | str | Unset - if isinstance(self.distribution_type, Unset): - distribution_type = UNSET - else: - distribution_type = self.distribution_type - - enabled: bool | None | Unset - if isinstance(self.enabled, Unset): - enabled = UNSET - else: - enabled = self.enabled - - recipient_user_ids: list[str] | None | Unset - if isinstance(self.recipient_user_ids, Unset): - recipient_user_ids = UNSET - elif isinstance(self.recipient_user_ids, list): - recipient_user_ids = self.recipient_user_ids - - else: - recipient_user_ids = self.recipient_user_ids - - threshold: dict[str, Any] | None | Unset - if isinstance(self.threshold, Unset): - threshold = UNSET - elif isinstance(self.threshold, UpdateAlertConfigRequestThresholdType0): - threshold = self.threshold.to_dict() - else: - threshold = self.threshold - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if cooldown_minutes is not UNSET: - field_dict["cooldown_minutes"] = cooldown_minutes - if distribution_type is not UNSET: - field_dict["distribution_type"] = distribution_type - if enabled is not UNSET: - field_dict["enabled"] = enabled - if recipient_user_ids is not UNSET: - field_dict["recipient_user_ids"] = recipient_user_ids - if threshold is not UNSET: - field_dict["threshold"] = threshold - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_alert_config_request_threshold_type_0 import ( - UpdateAlertConfigRequestThresholdType0, - ) - - d = dict(src_dict) - - def _parse_cooldown_minutes(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - cooldown_minutes = _parse_cooldown_minutes(d.pop("cooldown_minutes", UNSET)) - - def _parse_distribution_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - distribution_type = _parse_distribution_type(d.pop("distribution_type", UNSET)) - - def _parse_enabled(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - enabled = _parse_enabled(d.pop("enabled", UNSET)) - - def _parse_recipient_user_ids(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() - recipient_user_ids_type_0 = cast(list[str], data) - - return recipient_user_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - recipient_user_ids = _parse_recipient_user_ids( - d.pop("recipient_user_ids", UNSET) - ) - - def _parse_threshold( - data: object, - ) -> None | Unset | UpdateAlertConfigRequestThresholdType0: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - threshold_type_0 = UpdateAlertConfigRequestThresholdType0.from_dict( - data - ) - - return threshold_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UpdateAlertConfigRequestThresholdType0, data) - - threshold = _parse_threshold(d.pop("threshold", UNSET)) - - update_alert_config_request = cls( - cooldown_minutes=cooldown_minutes, - distribution_type=distribution_type, - enabled=enabled, - recipient_user_ids=recipient_user_ids, - threshold=threshold, - ) - - update_alert_config_request.additional_properties = d - return update_alert_config_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/seclai/_generated/models/update_alert_config_request_threshold_type_0.py b/seclai/_generated/models/update_alert_config_request_threshold_type_0.py deleted file mode 100644 index ecfa59d..0000000 --- a/seclai/_generated/models/update_alert_config_request_threshold_type_0.py +++ /dev/null @@ -1,46 +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="UpdateAlertConfigRequestThresholdType0") - - -@_attrs_define -class UpdateAlertConfigRequestThresholdType0: - """ """ - - additional_properties: dict[str, Any] = _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) - update_alert_config_request_threshold_type_0 = cls() - - update_alert_config_request_threshold_type_0.additional_properties = d - return update_alert_config_request_threshold_type_0 - - @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/seclai/_generated/models/update_api_version_request.py b/seclai/_generated/models/update_api_version_request.py deleted file mode 100644 index 3f19880..0000000 --- a/seclai/_generated/models/update_api_version_request.py +++ /dev/null @@ -1,74 +0,0 @@ -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="UpdateApiVersionRequest") - - -@_attrs_define -class UpdateApiVersionRequest: - """ - Attributes: - version (None | str | Unset): A YYYY-MM-DD date to pin the account to, or null to clear the pin (revert to the - default baseline). - """ - - version: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - version: None | str | Unset - if isinstance(self.version, Unset): - version = UNSET - else: - version = self.version - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if version is not UNSET: - field_dict["version"] = version - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_version(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - version = _parse_version(d.pop("version", UNSET)) - - update_api_version_request = cls( - version=version, - ) - - update_api_version_request.additional_properties = d - return update_api_version_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/seclai/_generated/models/update_evaluation_criteria_request.py b/seclai/_generated/models/update_evaluation_criteria_request.py deleted file mode 100644 index fa2f1c7..0000000 --- a/seclai/_generated/models/update_evaluation_criteria_request.py +++ /dev/null @@ -1,247 +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.agent_evaluation_tier import AgentEvaluationTier -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.update_evaluation_criteria_request_expectation_config_type_0 import ( - UpdateEvaluationCriteriaRequestExpectationConfigType0, - ) - - -T = TypeVar("T", bound="UpdateEvaluationCriteriaRequest") - - -@_attrs_define -class UpdateEvaluationCriteriaRequest: - """Request body for updating an evaluation criteria. - - Retry settings and sample frequency are set at the agent level. - - Attributes: - description (None | str | Unset): - enabled (bool | None | Unset): - evaluation_prompt (None | str | Unset): - evaluation_tier (AgentEvaluationTier | None | Unset): - expectation_config (None | Unset | UpdateEvaluationCriteriaRequestExpectationConfigType0): - pass_threshold (float | None | Unset): - step_id (None | str | Unset): - """ - - description: None | str | Unset = UNSET - enabled: bool | None | Unset = UNSET - evaluation_prompt: None | str | Unset = UNSET - evaluation_tier: AgentEvaluationTier | None | Unset = UNSET - expectation_config: ( - None | Unset | UpdateEvaluationCriteriaRequestExpectationConfigType0 - ) = UNSET - pass_threshold: float | None | Unset = UNSET - step_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.update_evaluation_criteria_request_expectation_config_type_0 import ( - UpdateEvaluationCriteriaRequestExpectationConfigType0, - ) - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - enabled: bool | None | Unset - if isinstance(self.enabled, Unset): - enabled = UNSET - else: - enabled = self.enabled - - evaluation_prompt: None | str | Unset - if isinstance(self.evaluation_prompt, Unset): - evaluation_prompt = UNSET - else: - evaluation_prompt = self.evaluation_prompt - - evaluation_tier: None | str | Unset - if isinstance(self.evaluation_tier, Unset): - evaluation_tier = UNSET - elif isinstance(self.evaluation_tier, AgentEvaluationTier): - evaluation_tier = self.evaluation_tier.value - else: - evaluation_tier = self.evaluation_tier - - expectation_config: dict[str, Any] | None | Unset - if isinstance(self.expectation_config, Unset): - expectation_config = UNSET - elif isinstance( - self.expectation_config, - UpdateEvaluationCriteriaRequestExpectationConfigType0, - ): - expectation_config = self.expectation_config.to_dict() - else: - expectation_config = self.expectation_config - - pass_threshold: float | None | Unset - if isinstance(self.pass_threshold, Unset): - pass_threshold = UNSET - else: - pass_threshold = self.pass_threshold - - step_id: None | str | Unset - if isinstance(self.step_id, Unset): - step_id = UNSET - else: - step_id = self.step_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if description is not UNSET: - field_dict["description"] = description - if enabled is not UNSET: - field_dict["enabled"] = enabled - if evaluation_prompt is not UNSET: - field_dict["evaluation_prompt"] = evaluation_prompt - if evaluation_tier is not UNSET: - field_dict["evaluation_tier"] = evaluation_tier - if expectation_config is not UNSET: - field_dict["expectation_config"] = expectation_config - if pass_threshold is not UNSET: - field_dict["pass_threshold"] = pass_threshold - if step_id is not UNSET: - field_dict["step_id"] = step_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_evaluation_criteria_request_expectation_config_type_0 import ( - UpdateEvaluationCriteriaRequestExpectationConfigType0, - ) - - d = dict(src_dict) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_enabled(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - enabled = _parse_enabled(d.pop("enabled", UNSET)) - - def _parse_evaluation_prompt(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - evaluation_prompt = _parse_evaluation_prompt(d.pop("evaluation_prompt", UNSET)) - - def _parse_evaluation_tier(data: object) -> AgentEvaluationTier | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - evaluation_tier_type_0 = AgentEvaluationTier(data) - - return evaluation_tier_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentEvaluationTier | None | Unset, data) - - evaluation_tier = _parse_evaluation_tier(d.pop("evaluation_tier", UNSET)) - - def _parse_expectation_config( - data: object, - ) -> None | Unset | UpdateEvaluationCriteriaRequestExpectationConfigType0: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - expectation_config_type_0 = ( - UpdateEvaluationCriteriaRequestExpectationConfigType0.from_dict( - data - ) - ) - - return expectation_config_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - None | Unset | UpdateEvaluationCriteriaRequestExpectationConfigType0, - data, - ) - - expectation_config = _parse_expectation_config( - d.pop("expectation_config", UNSET) - ) - - def _parse_pass_threshold(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - pass_threshold = _parse_pass_threshold(d.pop("pass_threshold", UNSET)) - - def _parse_step_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - step_id = _parse_step_id(d.pop("step_id", UNSET)) - - update_evaluation_criteria_request = cls( - description=description, - enabled=enabled, - evaluation_prompt=evaluation_prompt, - evaluation_tier=evaluation_tier, - expectation_config=expectation_config, - pass_threshold=pass_threshold, - step_id=step_id, - ) - - update_evaluation_criteria_request.additional_properties = d - return update_evaluation_criteria_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/seclai/_generated/models/update_evaluation_criteria_request_expectation_config_type_0.py b/seclai/_generated/models/update_evaluation_criteria_request_expectation_config_type_0.py deleted file mode 100644 index ac385a4..0000000 --- a/seclai/_generated/models/update_evaluation_criteria_request_expectation_config_type_0.py +++ /dev/null @@ -1,48 +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="UpdateEvaluationCriteriaRequestExpectationConfigType0") - - -@_attrs_define -class UpdateEvaluationCriteriaRequestExpectationConfigType0: - """ """ - - additional_properties: dict[str, Any] = _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) - update_evaluation_criteria_request_expectation_config_type_0 = cls() - - update_evaluation_criteria_request_expectation_config_type_0.additional_properties = ( - d - ) - return update_evaluation_criteria_request_expectation_config_type_0 - - @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/seclai/_generated/models/update_knowledge_base_body.py b/seclai/_generated/models/update_knowledge_base_body.py deleted file mode 100644 index 82f4048..0000000 --- a/seclai/_generated/models/update_knowledge_base_body.py +++ /dev/null @@ -1,207 +0,0 @@ -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="UpdateKnowledgeBaseBody") - - -@_attrs_define -class UpdateKnowledgeBaseBody: - """Request body for updating a knowledge base. - - Attributes: - default_score_threshold (float | None | Unset): Default score threshold (-1 to clear). - default_top_k (int | None | Unset): Default reranked results (0 to clear). - default_top_n (int | None | Unset): Default results (0 to clear). - description (None | str | Unset): New description. - name (None | str | Unset): New name. - reranker_model (None | str | Unset): Reranker model (empty string for no reranking). - source_ids (list[str] | None | Unset): New list of source connection IDs. - """ - - default_score_threshold: float | None | Unset = UNSET - default_top_k: int | None | Unset = UNSET - default_top_n: int | None | Unset = UNSET - description: None | str | Unset = UNSET - name: None | str | Unset = UNSET - reranker_model: None | str | Unset = UNSET - source_ids: list[str] | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - default_score_threshold: float | None | Unset - if isinstance(self.default_score_threshold, Unset): - default_score_threshold = UNSET - else: - default_score_threshold = self.default_score_threshold - - default_top_k: int | None | Unset - if isinstance(self.default_top_k, Unset): - default_top_k = UNSET - else: - default_top_k = self.default_top_k - - default_top_n: int | None | Unset - if isinstance(self.default_top_n, Unset): - default_top_n = UNSET - else: - default_top_n = self.default_top_n - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - reranker_model: None | str | Unset - if isinstance(self.reranker_model, Unset): - reranker_model = UNSET - else: - reranker_model = self.reranker_model - - source_ids: list[str] | None | Unset - if isinstance(self.source_ids, Unset): - source_ids = UNSET - elif isinstance(self.source_ids, list): - source_ids = self.source_ids - - else: - source_ids = self.source_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if default_score_threshold is not UNSET: - field_dict["default_score_threshold"] = default_score_threshold - if default_top_k is not UNSET: - field_dict["default_top_k"] = default_top_k - if default_top_n is not UNSET: - field_dict["default_top_n"] = default_top_n - if description is not UNSET: - field_dict["description"] = description - if name is not UNSET: - field_dict["name"] = name - if reranker_model is not UNSET: - field_dict["reranker_model"] = reranker_model - if source_ids is not UNSET: - field_dict["source_ids"] = source_ids - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_default_score_threshold(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - default_score_threshold = _parse_default_score_threshold( - d.pop("default_score_threshold", UNSET) - ) - - def _parse_default_top_k(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - default_top_k = _parse_default_top_k(d.pop("default_top_k", UNSET)) - - def _parse_default_top_n(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - default_top_n = _parse_default_top_n(d.pop("default_top_n", UNSET)) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - def _parse_reranker_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - reranker_model = _parse_reranker_model(d.pop("reranker_model", UNSET)) - - def _parse_source_ids(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() - source_ids_type_0 = cast(list[str], data) - - return source_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - source_ids = _parse_source_ids(d.pop("source_ids", UNSET)) - - update_knowledge_base_body = cls( - default_score_threshold=default_score_threshold, - default_top_k=default_top_k, - default_top_n=default_top_n, - description=description, - name=name, - reranker_model=reranker_model, - source_ids=source_ids, - ) - - update_knowledge_base_body.additional_properties = d - return update_knowledge_base_body - - @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/seclai/_generated/models/update_memory_bank_body.py b/seclai/_generated/models/update_memory_bank_body.py deleted file mode 100644 index 30fa14d..0000000 --- a/seclai/_generated/models/update_memory_bank_body.py +++ /dev/null @@ -1,202 +0,0 @@ -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="UpdateMemoryBankBody") - - -@_attrs_define -class UpdateMemoryBankBody: - """Request body for updating a memory bank. - - Omitted fields are left unchanged. To **clear** a field back to null, - send a zero-value sentinel: ``0`` for integers, ``""`` for strings. - - Attributes: - compaction_prompt (None | str | Unset): Custom prompt used when compacting older entries. When set, entries that - exceed a threshold are summarized into a new entry before being soft-deleted. Send empty string "" to clear and - disable summarisation. - description (None | str | Unset): Optional description. Send empty string "" to clear. - max_age_days (int | None | Unset): Max entry age in days before compaction. Checked inline after each write and - by the hourly background sweep. Send 0 to disable. - max_size_tokens (int | None | Unset): Max total tokens (per partition) before compaction. Checked inline after - each write and by the hourly background sweep. Send 0 to disable. - max_turns (int | None | Unset): Max conversation turns (per partition) before compaction. Checked inline after - each write and by the hourly background sweep. Send 0 to disable. - name (None | str | Unset): New name. - retention_days (int | None | Unset): Content source retention in days. Send 0 to clear (indefinite). - """ - - compaction_prompt: None | str | Unset = UNSET - description: None | str | Unset = UNSET - max_age_days: int | None | Unset = UNSET - max_size_tokens: int | None | Unset = UNSET - max_turns: int | None | Unset = UNSET - name: None | str | Unset = UNSET - retention_days: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - compaction_prompt: None | str | Unset - if isinstance(self.compaction_prompt, Unset): - compaction_prompt = UNSET - else: - compaction_prompt = self.compaction_prompt - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - max_age_days: int | None | Unset - if isinstance(self.max_age_days, Unset): - max_age_days = UNSET - else: - max_age_days = self.max_age_days - - max_size_tokens: int | None | Unset - if isinstance(self.max_size_tokens, Unset): - max_size_tokens = UNSET - else: - max_size_tokens = self.max_size_tokens - - max_turns: int | None | Unset - if isinstance(self.max_turns, Unset): - max_turns = UNSET - else: - max_turns = self.max_turns - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - retention_days: int | None | Unset - if isinstance(self.retention_days, Unset): - retention_days = UNSET - else: - retention_days = self.retention_days - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if compaction_prompt is not UNSET: - field_dict["compaction_prompt"] = compaction_prompt - if description is not UNSET: - field_dict["description"] = description - if max_age_days is not UNSET: - field_dict["max_age_days"] = max_age_days - if max_size_tokens is not UNSET: - field_dict["max_size_tokens"] = max_size_tokens - if max_turns is not UNSET: - field_dict["max_turns"] = max_turns - if name is not UNSET: - field_dict["name"] = name - if retention_days is not UNSET: - field_dict["retention_days"] = retention_days - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_compaction_prompt(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - compaction_prompt = _parse_compaction_prompt(d.pop("compaction_prompt", UNSET)) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_max_age_days(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_age_days = _parse_max_age_days(d.pop("max_age_days", UNSET)) - - def _parse_max_size_tokens(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_size_tokens = _parse_max_size_tokens(d.pop("max_size_tokens", UNSET)) - - def _parse_max_turns(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_turns = _parse_max_turns(d.pop("max_turns", UNSET)) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - def _parse_retention_days(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - retention_days = _parse_retention_days(d.pop("retention_days", UNSET)) - - update_memory_bank_body = cls( - compaction_prompt=compaction_prompt, - description=description, - max_age_days=max_age_days, - max_size_tokens=max_size_tokens, - max_turns=max_turns, - name=name, - retention_days=retention_days, - ) - - update_memory_bank_body.additional_properties = d - return update_memory_bank_body - - @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/seclai/_generated/models/update_organization_alert_preference_request.py b/seclai/_generated/models/update_organization_alert_preference_request.py deleted file mode 100644 index fed7ef5..0000000 --- a/seclai/_generated/models/update_organization_alert_preference_request.py +++ /dev/null @@ -1,61 +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="UpdateOrganizationAlertPreferenceRequest") - - -@_attrs_define -class UpdateOrganizationAlertPreferenceRequest: - """ - Attributes: - subscribed (bool): Whether the user should receive this alert for the organization - """ - - subscribed: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - subscribed = self.subscribed - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "subscribed": subscribed, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - subscribed = d.pop("subscribed") - - update_organization_alert_preference_request = cls( - subscribed=subscribed, - ) - - update_organization_alert_preference_request.additional_properties = d - return update_organization_alert_preference_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/seclai/_generated/models/update_solution_request.py b/seclai/_generated/models/update_solution_request.py deleted file mode 100644 index 3e0e382..0000000 --- a/seclai/_generated/models/update_solution_request.py +++ /dev/null @@ -1,94 +0,0 @@ -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="UpdateSolutionRequest") - - -@_attrs_define -class UpdateSolutionRequest: - """Request model for updating a solution - - Attributes: - description (None | str | Unset): Description of the solution - name (None | str | Unset): Name of the solution - """ - - description: None | str | Unset = UNSET - name: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if description is not UNSET: - field_dict["description"] = description - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - update_solution_request = cls( - description=description, - name=name, - ) - - update_solution_request.additional_properties = d - return update_solution_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/seclai/_generated/models/update_source_body.py b/seclai/_generated/models/update_source_body.py deleted file mode 100644 index 19039bc..0000000 --- a/seclai/_generated/models/update_source_body.py +++ /dev/null @@ -1,147 +0,0 @@ -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="UpdateSourceBody") - - -@_attrs_define -class UpdateSourceBody: - """Request body for updating a content source. - - Attributes: - media_types (list[str] | None | Unset): Media kinds to extract from indexed content and embed as multi-modal KB - chunks. Subset of ['images', 'video']. Only kinds the source's embedder can index are honored; unsupported - values are dropped. [] disables media extraction (text-only). - name (None | str | Unset): New name. - polling (None | str | Unset): New polling interval. - retention_days (int | None | Unset): New retention period in days (null for unlimited). Default: -1. - """ - - media_types: list[str] | None | Unset = UNSET - name: None | str | Unset = UNSET - polling: None | str | Unset = UNSET - retention_days: int | None | Unset = -1 - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - media_types: list[str] | None | Unset - if isinstance(self.media_types, Unset): - media_types = UNSET - elif isinstance(self.media_types, list): - media_types = self.media_types - - else: - media_types = self.media_types - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - polling: None | str | Unset - if isinstance(self.polling, Unset): - polling = UNSET - else: - polling = self.polling - - retention_days: int | None | Unset - if isinstance(self.retention_days, Unset): - retention_days = UNSET - else: - retention_days = self.retention_days - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if media_types is not UNSET: - field_dict["media_types"] = media_types - if name is not UNSET: - field_dict["name"] = name - if polling is not UNSET: - field_dict["polling"] = polling - if retention_days is not UNSET: - field_dict["retention_days"] = retention_days - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_media_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() - media_types_type_0 = cast(list[str], data) - - return media_types_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - media_types = _parse_media_types(d.pop("media_types", UNSET)) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - def _parse_polling(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - polling = _parse_polling(d.pop("polling", UNSET)) - - def _parse_retention_days(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - retention_days = _parse_retention_days(d.pop("retention_days", UNSET)) - - update_source_body = cls( - media_types=media_types, - name=name, - polling=polling, - retention_days=retention_days, - ) - - update_source_body.additional_properties = d - return update_source_body - - @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/seclai/_generated/models/upload_agent_input_api_response.py b/seclai/_generated/models/upload_agent_input_api_response.py deleted file mode 100644 index 2ca38eb..0000000 --- a/seclai/_generated/models/upload_agent_input_api_response.py +++ /dev/null @@ -1,115 +0,0 @@ -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="UploadAgentInputApiResponse") - - -@_attrs_define -class UploadAgentInputApiResponse: - """ - Attributes: - content_type (str): Resolved MIME type. - file_size (int): Size in bytes. - filename (str): Original filename. - id (str): Unique identifier for the upload. - status (str): processing, ready, or failed. - error (None | str | Unset): Error message if status is failed. - """ - - content_type: str - file_size: int - filename: str - id: str - status: str - error: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - content_type = self.content_type - - file_size = self.file_size - - filename = self.filename - - id = self.id - - status = self.status - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "content_type": content_type, - "file_size": file_size, - "filename": filename, - "id": id, - "status": status, - } - ) - if error is not UNSET: - field_dict["error"] = error - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - content_type = d.pop("content_type") - - file_size = d.pop("file_size") - - filename = d.pop("filename") - - id = d.pop("id") - - status = d.pop("status") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - upload_agent_input_api_response = cls( - content_type=content_type, - file_size=file_size, - filename=filename, - id=id, - status=status, - error=error, - ) - - upload_agent_input_api_response.additional_properties = d - return upload_agent_input_api_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/seclai/_generated/models/validation_error.py b/seclai/_generated/models/validation_error.py deleted file mode 100644 index cb0708f..0000000 --- a/seclai/_generated/models/validation_error.py +++ /dev/null @@ -1,90 +0,0 @@ -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 - -T = TypeVar("T", bound="ValidationError") - - -@_attrs_define -class ValidationError: - """ - Attributes: - loc (list[int | str]): - msg (str): - type_ (str): - """ - - loc: list[int | str] - msg: str - type_: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - loc = [] - for loc_item_data in self.loc: - loc_item: int | str - loc_item = loc_item_data - loc.append(loc_item) - - msg = self.msg - - type_ = self.type_ - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "loc": loc, - "msg": msg, - "type": type_, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - loc = [] - _loc = d.pop("loc") - for loc_item_data in _loc: - - def _parse_loc_item(data: object) -> int | str: - return cast(int | str, data) - - loc_item = _parse_loc_item(loc_item_data) - - loc.append(loc_item) - - msg = d.pop("msg") - - type_ = d.pop("type") - - validation_error = cls( - loc=loc, - msg=msg, - type_=type_, - ) - - validation_error.additional_properties = d - return validation_error - - @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/seclai/_generated/models/variant_category_response.py b/seclai/_generated/models/variant_category_response.py deleted file mode 100644 index f739bab..0000000 --- a/seclai/_generated/models/variant_category_response.py +++ /dev/null @@ -1,108 +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.variant_option_response import VariantOptionResponse - - -T = TypeVar("T", bound="VariantCategoryResponse") - - -@_attrs_define -class VariantCategoryResponse: - """Response model for a variant category - - Attributes: - category (str): - configurable (bool): - description (str): - options (list[VariantOptionResponse]): - title (str): - """ - - category: str - configurable: bool - description: str - options: list[VariantOptionResponse] - title: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - category = self.category - - configurable = self.configurable - - description = self.description - - options = [] - for options_item_data in self.options: - options_item = options_item_data.to_dict() - options.append(options_item) - - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "category": category, - "configurable": configurable, - "description": description, - "options": options, - "title": title, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.variant_option_response import VariantOptionResponse - - d = dict(src_dict) - category = d.pop("category") - - configurable = d.pop("configurable") - - description = d.pop("description") - - options = [] - _options = d.pop("options") - for options_item_data in _options: - options_item = VariantOptionResponse.from_dict(options_item_data) - - options.append(options_item) - - title = d.pop("title") - - variant_category_response = cls( - category=category, - configurable=configurable, - description=description, - options=options, - title=title, - ) - - variant_category_response.additional_properties = d - return variant_category_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/seclai/_generated/models/variant_option_response.py b/seclai/_generated/models/variant_option_response.py deleted file mode 100644 index 4c86dec..0000000 --- a/seclai/_generated/models/variant_option_response.py +++ /dev/null @@ -1,348 +0,0 @@ -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="VariantOptionResponse") - - -@_attrs_define -class VariantOptionResponse: - """Response model for a variant option - - Attributes: - default (bool): - title (str): - value (str): - description (None | str | Unset): - input_1h_cache_write_credits_per_1000_tokens (float | None | Unset): - input_5m_cache_write_credits_per_1000_tokens (float | None | Unset): - input_cache_hit_credits_per_1000_tokens (float | None | Unset): - input_credits_per_1000_tokens (float | None | Unset): - long_context_input_cache_hit_credits_per_1000_tokens (float | None | Unset): - long_context_input_credits_per_1000_tokens (float | None | Unset): - long_context_output_credits_per_1000_tokens (float | None | Unset): - long_context_threshold (int | None | Unset): - output_credits_per_1000_tokens (float | None | Unset): - """ - - default: bool - title: str - value: str - description: None | str | Unset = UNSET - input_1h_cache_write_credits_per_1000_tokens: float | None | Unset = UNSET - input_5m_cache_write_credits_per_1000_tokens: float | None | Unset = UNSET - input_cache_hit_credits_per_1000_tokens: float | None | Unset = UNSET - input_credits_per_1000_tokens: float | None | Unset = UNSET - long_context_input_cache_hit_credits_per_1000_tokens: float | None | Unset = UNSET - long_context_input_credits_per_1000_tokens: float | None | Unset = UNSET - long_context_output_credits_per_1000_tokens: float | None | Unset = UNSET - long_context_threshold: int | None | Unset = UNSET - output_credits_per_1000_tokens: float | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - default = self.default - - title = self.title - - value = self.value - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - input_1h_cache_write_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_1h_cache_write_credits_per_1000_tokens, Unset): - input_1h_cache_write_credits_per_1000_tokens = UNSET - else: - input_1h_cache_write_credits_per_1000_tokens = ( - self.input_1h_cache_write_credits_per_1000_tokens - ) - - input_5m_cache_write_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_5m_cache_write_credits_per_1000_tokens, Unset): - input_5m_cache_write_credits_per_1000_tokens = UNSET - else: - input_5m_cache_write_credits_per_1000_tokens = ( - self.input_5m_cache_write_credits_per_1000_tokens - ) - - input_cache_hit_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_cache_hit_credits_per_1000_tokens, Unset): - input_cache_hit_credits_per_1000_tokens = UNSET - else: - input_cache_hit_credits_per_1000_tokens = ( - self.input_cache_hit_credits_per_1000_tokens - ) - - input_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_credits_per_1000_tokens, Unset): - input_credits_per_1000_tokens = UNSET - else: - input_credits_per_1000_tokens = self.input_credits_per_1000_tokens - - long_context_input_cache_hit_credits_per_1000_tokens: float | None | Unset - if isinstance(self.long_context_input_cache_hit_credits_per_1000_tokens, Unset): - long_context_input_cache_hit_credits_per_1000_tokens = UNSET - else: - long_context_input_cache_hit_credits_per_1000_tokens = ( - self.long_context_input_cache_hit_credits_per_1000_tokens - ) - - long_context_input_credits_per_1000_tokens: float | None | Unset - if isinstance(self.long_context_input_credits_per_1000_tokens, Unset): - long_context_input_credits_per_1000_tokens = UNSET - else: - long_context_input_credits_per_1000_tokens = ( - self.long_context_input_credits_per_1000_tokens - ) - - long_context_output_credits_per_1000_tokens: float | None | Unset - if isinstance(self.long_context_output_credits_per_1000_tokens, Unset): - long_context_output_credits_per_1000_tokens = UNSET - else: - long_context_output_credits_per_1000_tokens = ( - self.long_context_output_credits_per_1000_tokens - ) - - long_context_threshold: int | None | Unset - if isinstance(self.long_context_threshold, Unset): - long_context_threshold = UNSET - else: - long_context_threshold = self.long_context_threshold - - output_credits_per_1000_tokens: float | None | Unset - if isinstance(self.output_credits_per_1000_tokens, Unset): - output_credits_per_1000_tokens = UNSET - else: - output_credits_per_1000_tokens = self.output_credits_per_1000_tokens - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "default": default, - "title": title, - "value": value, - } - ) - if description is not UNSET: - field_dict["description"] = description - if input_1h_cache_write_credits_per_1000_tokens is not UNSET: - field_dict["input_1h_cache_write_credits_per_1000_tokens"] = ( - input_1h_cache_write_credits_per_1000_tokens - ) - if input_5m_cache_write_credits_per_1000_tokens is not UNSET: - field_dict["input_5m_cache_write_credits_per_1000_tokens"] = ( - input_5m_cache_write_credits_per_1000_tokens - ) - if input_cache_hit_credits_per_1000_tokens is not UNSET: - field_dict["input_cache_hit_credits_per_1000_tokens"] = ( - input_cache_hit_credits_per_1000_tokens - ) - if input_credits_per_1000_tokens is not UNSET: - field_dict["input_credits_per_1000_tokens"] = input_credits_per_1000_tokens - if long_context_input_cache_hit_credits_per_1000_tokens is not UNSET: - field_dict["long_context_input_cache_hit_credits_per_1000_tokens"] = ( - long_context_input_cache_hit_credits_per_1000_tokens - ) - if long_context_input_credits_per_1000_tokens is not UNSET: - field_dict["long_context_input_credits_per_1000_tokens"] = ( - long_context_input_credits_per_1000_tokens - ) - if long_context_output_credits_per_1000_tokens is not UNSET: - field_dict["long_context_output_credits_per_1000_tokens"] = ( - long_context_output_credits_per_1000_tokens - ) - if long_context_threshold is not UNSET: - field_dict["long_context_threshold"] = long_context_threshold - if output_credits_per_1000_tokens is not UNSET: - field_dict["output_credits_per_1000_tokens"] = ( - output_credits_per_1000_tokens - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - default = d.pop("default") - - title = d.pop("title") - - value = d.pop("value") - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_input_1h_cache_write_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_1h_cache_write_credits_per_1000_tokens = ( - _parse_input_1h_cache_write_credits_per_1000_tokens( - d.pop("input_1h_cache_write_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_input_5m_cache_write_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_5m_cache_write_credits_per_1000_tokens = ( - _parse_input_5m_cache_write_credits_per_1000_tokens( - d.pop("input_5m_cache_write_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_input_cache_hit_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_cache_hit_credits_per_1000_tokens = ( - _parse_input_cache_hit_credits_per_1000_tokens( - d.pop("input_cache_hit_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_input_credits_per_1000_tokens(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_credits_per_1000_tokens = _parse_input_credits_per_1000_tokens( - d.pop("input_credits_per_1000_tokens", UNSET) - ) - - def _parse_long_context_input_cache_hit_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - long_context_input_cache_hit_credits_per_1000_tokens = ( - _parse_long_context_input_cache_hit_credits_per_1000_tokens( - d.pop("long_context_input_cache_hit_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_long_context_input_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - long_context_input_credits_per_1000_tokens = ( - _parse_long_context_input_credits_per_1000_tokens( - d.pop("long_context_input_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_long_context_output_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - long_context_output_credits_per_1000_tokens = ( - _parse_long_context_output_credits_per_1000_tokens( - d.pop("long_context_output_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_long_context_threshold(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - long_context_threshold = _parse_long_context_threshold( - d.pop("long_context_threshold", UNSET) - ) - - def _parse_output_credits_per_1000_tokens(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - output_credits_per_1000_tokens = _parse_output_credits_per_1000_tokens( - d.pop("output_credits_per_1000_tokens", UNSET) - ) - - variant_option_response = cls( - default=default, - title=title, - value=value, - description=description, - input_1h_cache_write_credits_per_1000_tokens=input_1h_cache_write_credits_per_1000_tokens, - input_5m_cache_write_credits_per_1000_tokens=input_5m_cache_write_credits_per_1000_tokens, - input_cache_hit_credits_per_1000_tokens=input_cache_hit_credits_per_1000_tokens, - input_credits_per_1000_tokens=input_credits_per_1000_tokens, - long_context_input_cache_hit_credits_per_1000_tokens=long_context_input_cache_hit_credits_per_1000_tokens, - long_context_input_credits_per_1000_tokens=long_context_input_credits_per_1000_tokens, - long_context_output_credits_per_1000_tokens=long_context_output_credits_per_1000_tokens, - long_context_threshold=long_context_threshold, - output_credits_per_1000_tokens=output_credits_per_1000_tokens, - ) - - variant_option_response.additional_properties = d - return variant_option_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/seclai/_generated/pyproject.toml b/seclai/_generated/pyproject.toml deleted file mode 100644 index f05b759..0000000 --- a/seclai/_generated/pyproject.toml +++ /dev/null @@ -1,26 +0,0 @@ -[tool.poetry] -name = "seclai-api-client" -version = "local" -description = "A client library for accessing Seclai API" -authors = [] -readme = "README.md" -packages = [ - { include = "seclai_api_client" }, -] -include = ["seclai_api_client/py.typed"] - -[tool.poetry.dependencies] -python = "^3.10" -httpx = ">=0.23.0,<0.29.0" -attrs = ">=22.2.0" -python-dateutil = "^2.8.0" - -[build-system] -requires = ["poetry-core>=2.0.0,<3.0.0"] -build-backend = "poetry.core.masonry.api" - -[tool.ruff] -line-length = 120 - -[tool.ruff.lint] -select = ["F", "I", "UP"] diff --git a/seclai/_generated/seclai_api_client/__init__.py b/seclai/_generated/seclai_api_client/__init__.py deleted file mode 100644 index 25fe58c..0000000 --- a/seclai/_generated/seclai_api_client/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -"""A client library for accessing Seclai API""" - -from .client import AuthenticatedClient, Client - -__all__ = ( - "AuthenticatedClient", - "Client", -) diff --git a/seclai/_generated/seclai_api_client/api/__init__.py b/seclai/_generated/seclai_api_client/api/__init__.py deleted file mode 100644 index 81f9fa2..0000000 --- a/seclai/_generated/seclai_api_client/api/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains methods for accessing the API""" diff --git a/seclai/_generated/seclai_api_client/api/agents/__init__.py b/seclai/_generated/seclai_api_client/api/agents/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/seclai_api_client/api/agents/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/seclai_api_client/api/agents/delete_agent_run_api_agents_agent_id_runs_run_id_delete.py b/seclai/_generated/seclai_api_client/api/agents/delete_agent_run_api_agents_agent_id_runs_run_id_delete.py deleted file mode 100644 index 83d2fc9..0000000 --- a/seclai/_generated/seclai_api_client/api/agents/delete_agent_run_api_agents_agent_id_runs_run_id_delete.py +++ /dev/null @@ -1,182 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_run_response import AgentRunResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import Response - - -def _get_kwargs( - agent_id: str, - run_id: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/agents/{agent_id}/runs/{run_id}".format( - agent_id=quote(str(agent_id), safe=""), - run_id=quote(str(run_id), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRunResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentRunResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRunResponse | 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( - agent_id: str, - run_id: str, - *, - client: AuthenticatedClient | Client, -) -> Response[AgentRunResponse | HTTPValidationError]: - """Delete Agent Run - - Cancel agent run. - - Args: - agent_id (str): - run_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[AgentRunResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - run_id=run_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - run_id: str, - *, - client: AuthenticatedClient | Client, -) -> AgentRunResponse | HTTPValidationError | None: - """Delete Agent Run - - Cancel agent run. - - Args: - agent_id (str): - run_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: - AgentRunResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - run_id=run_id, - client=client, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - run_id: str, - *, - client: AuthenticatedClient | Client, -) -> Response[AgentRunResponse | HTTPValidationError]: - """Delete Agent Run - - Cancel agent run. - - Args: - agent_id (str): - run_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[AgentRunResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - run_id=run_id, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - run_id: str, - *, - client: AuthenticatedClient | Client, -) -> AgentRunResponse | HTTPValidationError | None: - """Delete Agent Run - - Cancel agent run. - - Args: - agent_id (str): - run_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: - AgentRunResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - run_id=run_id, - client=client, - ) - ).parsed diff --git a/seclai/_generated/seclai_api_client/api/agents/get_agent_run_api_agents_agent_id_runs_run_id_get.py b/seclai/_generated/seclai_api_client/api/agents/get_agent_run_api_agents_agent_id_runs_run_id_get.py deleted file mode 100644 index 94c10b7..0000000 --- a/seclai/_generated/seclai_api_client/api/agents/get_agent_run_api_agents_agent_id_runs_run_id_get.py +++ /dev/null @@ -1,182 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_run_response import AgentRunResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import Response - - -def _get_kwargs( - agent_id: str, - run_id: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/runs/{run_id}".format( - agent_id=quote(str(agent_id), safe=""), - run_id=quote(str(run_id), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRunResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentRunResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRunResponse | 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( - agent_id: str, - run_id: str, - *, - client: AuthenticatedClient | Client, -) -> Response[AgentRunResponse | HTTPValidationError]: - """Get Agent Run - - Get agent run details. - - Args: - agent_id (str): - run_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[AgentRunResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - run_id=run_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - run_id: str, - *, - client: AuthenticatedClient | Client, -) -> AgentRunResponse | HTTPValidationError | None: - """Get Agent Run - - Get agent run details. - - Args: - agent_id (str): - run_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: - AgentRunResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - run_id=run_id, - client=client, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - run_id: str, - *, - client: AuthenticatedClient | Client, -) -> Response[AgentRunResponse | HTTPValidationError]: - """Get Agent Run - - Get agent run details. - - Args: - agent_id (str): - run_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[AgentRunResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - run_id=run_id, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - run_id: str, - *, - client: AuthenticatedClient | Client, -) -> AgentRunResponse | HTTPValidationError | None: - """Get Agent Run - - Get agent run details. - - Args: - agent_id (str): - run_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: - AgentRunResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - run_id=run_id, - client=client, - ) - ).parsed diff --git a/seclai/_generated/seclai_api_client/api/agents/list_agent_runs_api_agents_agent_id_runs_get.py b/seclai/_generated/seclai_api_client/api/agents/list_agent_runs_api_agents_agent_id_runs_get.py deleted file mode 100644 index 097cde4..0000000 --- a/seclai/_generated/seclai_api_client/api/agents/list_agent_runs_api_agents_agent_id_runs_get.py +++ /dev/null @@ -1,204 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_run_list_response import AgentRunListResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - agent_id: str, - *, - page: int | Unset = 1, - limit: int | Unset = 50, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/agents/{agent_id}/runs".format( - agent_id=quote(str(agent_id), safe=""), - ), - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRunListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentRunListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRunListResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 50, -) -> Response[AgentRunListResponse | HTTPValidationError]: - """List Agent Runs - - List agent runs for an agent with pagination. - - Args: - agent_id (str): - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 50. - - 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[AgentRunListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - page=page, - limit=limit, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 50, -) -> AgentRunListResponse | HTTPValidationError | None: - """List Agent Runs - - List agent runs for an agent with pagination. - - Args: - agent_id (str): - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 50. - - 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: - AgentRunListResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - page=page, - limit=limit, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 50, -) -> Response[AgentRunListResponse | HTTPValidationError]: - """List Agent Runs - - List agent runs for an agent with pagination. - - Args: - agent_id (str): - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 50. - - 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[AgentRunListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - page=page, - limit=limit, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 50, -) -> AgentRunListResponse | HTTPValidationError | None: - """List Agent Runs - - List agent runs for an agent with pagination. - - Args: - agent_id (str): - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 50. - - 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: - AgentRunListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - page=page, - limit=limit, - ) - ).parsed diff --git a/seclai/_generated/seclai_api_client/api/agents/run_agent_api_agents_agent_id_runs_post.py b/seclai/_generated/seclai_api_client/api/agents/run_agent_api_agents_agent_id_runs_post.py deleted file mode 100644 index 7f69dac..0000000 --- a/seclai/_generated/seclai_api_client/api/agents/run_agent_api_agents_agent_id_runs_post.py +++ /dev/null @@ -1,190 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.agent_run_request import AgentRunRequest -from ...models.agent_run_response import AgentRunResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import Response - - -def _get_kwargs( - agent_id: str, - *, - body: AgentRunRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/agents/{agent_id}/runs".format( - agent_id=quote(str(agent_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRunResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = AgentRunResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRunResponse | 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( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: AgentRunRequest, -) -> Response[AgentRunResponse | HTTPValidationError]: - """Run Agent - - Run an agent. - - Args: - agent_id (str): - body (AgentRunRequest): - - 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[AgentRunResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: AgentRunRequest, -) -> AgentRunResponse | HTTPValidationError | None: - """Run Agent - - Run an agent. - - Args: - agent_id (str): - body (AgentRunRequest): - - 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: - AgentRunResponse | HTTPValidationError - """ - - return sync_detailed( - agent_id=agent_id, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: AgentRunRequest, -) -> Response[AgentRunResponse | HTTPValidationError]: - """Run Agent - - Run an agent. - - Args: - agent_id (str): - body (AgentRunRequest): - - 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[AgentRunResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - agent_id=agent_id, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - agent_id: str, - *, - client: AuthenticatedClient | Client, - body: AgentRunRequest, -) -> AgentRunResponse | HTTPValidationError | None: - """Run Agent - - Run an agent. - - Args: - agent_id (str): - body (AgentRunRequest): - - 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: - AgentRunResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - agent_id=agent_id, - client=client, - body=body, - ) - ).parsed diff --git a/seclai/_generated/seclai_api_client/api/contents/__init__.py b/seclai/_generated/seclai_api_client/api/contents/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/seclai_api_client/api/contents/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/seclai_api_client/api/contents/delete_content_api_contents_source_connection_content_version_delete.py b/seclai/_generated/seclai_api_client/api/contents/delete_content_api_contents_source_connection_content_version_delete.py deleted file mode 100644 index 3637f5c..0000000 --- a/seclai/_generated/seclai_api_client/api/contents/delete_content_api_contents_source_connection_content_version_delete.py +++ /dev/null @@ -1,168 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...types import Response - - -def _get_kwargs( - source_connection_content_version: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/contents/{source_connection_content_version}".format( - source_connection_content_version=quote( - str(source_connection_content_version), safe="" - ), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | None: - if response.status_code == 204: - response_204 = cast(Any, None) - return response_204 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, 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( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, -) -> Response[Any | HTTPValidationError]: - """Delete Content - - Delete a specific content version. - - Args: - source_connection_content_version (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[Any | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, -) -> Any | HTTPValidationError | None: - """Delete Content - - Delete a specific content version. - - Args: - source_connection_content_version (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: - Any | HTTPValidationError - """ - - return sync_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - ).parsed - - -async def asyncio_detailed( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, -) -> Response[Any | HTTPValidationError]: - """Delete Content - - Delete a specific content version. - - Args: - source_connection_content_version (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[Any | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, -) -> Any | HTTPValidationError | None: - """Delete Content - - Delete a specific content version. - - Args: - source_connection_content_version (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: - Any | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - ) - ).parsed diff --git a/seclai/_generated/seclai_api_client/api/contents/get_content_detail_api_contents_source_connection_content_version_get.py b/seclai/_generated/seclai_api_client/api/contents/get_content_detail_api_contents_source_connection_content_version_get.py deleted file mode 100644 index c92fdce..0000000 --- a/seclai/_generated/seclai_api_client/api/contents/get_content_detail_api_contents_source_connection_content_version_get.py +++ /dev/null @@ -1,206 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.content_detail_response import ContentDetailResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_content_version: str, - *, - start: int | Unset = 0, - end: int | Unset = 5000, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["start"] = start - - params["end"] = end - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/contents/{source_connection_content_version}".format( - source_connection_content_version=quote( - str(source_connection_content_version), safe="" - ), - ), - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ContentDetailResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = ContentDetailResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ContentDetailResponse | 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( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - start: int | Unset = 0, - end: int | Unset = 5000, -) -> Response[ContentDetailResponse | HTTPValidationError]: - """Get Content Detail - - Get detailed information about a specific content version. - - Args: - source_connection_content_version (str): - start (int | Unset): Default: 0. - end (int | Unset): Default: 5000. - - 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[ContentDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - start=start, - end=end, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - start: int | Unset = 0, - end: int | Unset = 5000, -) -> ContentDetailResponse | HTTPValidationError | None: - """Get Content Detail - - Get detailed information about a specific content version. - - Args: - source_connection_content_version (str): - start (int | Unset): Default: 0. - end (int | Unset): Default: 5000. - - 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: - ContentDetailResponse | HTTPValidationError - """ - - return sync_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - start=start, - end=end, - ).parsed - - -async def asyncio_detailed( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - start: int | Unset = 0, - end: int | Unset = 5000, -) -> Response[ContentDetailResponse | HTTPValidationError]: - """Get Content Detail - - Get detailed information about a specific content version. - - Args: - source_connection_content_version (str): - start (int | Unset): Default: 0. - end (int | Unset): Default: 5000. - - 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[ContentDetailResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - start=start, - end=end, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - start: int | Unset = 0, - end: int | Unset = 5000, -) -> ContentDetailResponse | HTTPValidationError | None: - """Get Content Detail - - Get detailed information about a specific content version. - - Args: - source_connection_content_version (str): - start (int | Unset): Default: 0. - end (int | Unset): Default: 5000. - - 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: - ContentDetailResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - start=start, - end=end, - ) - ).parsed diff --git a/seclai/_generated/seclai_api_client/api/contents/list_content_embeddings_api_contents_source_connection_content_version_embeddings_get.py b/seclai/_generated/seclai_api_client/api/contents/list_content_embeddings_api_contents_source_connection_content_version_embeddings_get.py deleted file mode 100644 index c0c9e40..0000000 --- a/seclai/_generated/seclai_api_client/api/contents/list_content_embeddings_api_contents_source_connection_content_version_embeddings_get.py +++ /dev/null @@ -1,206 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.content_embeddings_list_response import ContentEmbeddingsListResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - source_connection_content_version: str, - *, - page: int | Unset = 1, - limit: int | Unset = 20, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/contents/{source_connection_content_version}/embeddings".format( - source_connection_content_version=quote( - str(source_connection_content_version), safe="" - ), - ), - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ContentEmbeddingsListResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = ContentEmbeddingsListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ContentEmbeddingsListResponse | 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( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, -) -> Response[ContentEmbeddingsListResponse | HTTPValidationError]: - """List Content Embeddings - - List embeddings for a specific content version. - - Args: - source_connection_content_version (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - - 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[ContentEmbeddingsListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - page=page, - limit=limit, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, -) -> ContentEmbeddingsListResponse | HTTPValidationError | None: - """List Content Embeddings - - List embeddings for a specific content version. - - Args: - source_connection_content_version (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - - 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: - ContentEmbeddingsListResponse | HTTPValidationError - """ - - return sync_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - page=page, - limit=limit, - ).parsed - - -async def asyncio_detailed( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, -) -> Response[ContentEmbeddingsListResponse | HTTPValidationError]: - """List Content Embeddings - - List embeddings for a specific content version. - - Args: - source_connection_content_version (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - - 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[ContentEmbeddingsListResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_content_version=source_connection_content_version, - page=page, - limit=limit, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_content_version: str, - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, -) -> ContentEmbeddingsListResponse | HTTPValidationError | None: - """List Content Embeddings - - List embeddings for a specific content version. - - Args: - source_connection_content_version (str): - page (int | Unset): Default: 1. - limit (int | Unset): Default: 20. - - 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: - ContentEmbeddingsListResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_content_version=source_connection_content_version, - client=client, - page=page, - limit=limit, - ) - ).parsed diff --git a/seclai/_generated/seclai_api_client/api/sources/__init__.py b/seclai/_generated/seclai_api_client/api/sources/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/seclai/_generated/seclai_api_client/api/sources/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/seclai/_generated/seclai_api_client/api/sources/list_sources_api_sources_get.py b/seclai/_generated/seclai_api_client/api/sources/list_sources_api_sources_get.py deleted file mode 100644 index 69c5d45..0000000 --- a/seclai/_generated/seclai_api_client/api/sources/list_sources_api_sources_get.py +++ /dev/null @@ -1,242 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.http_validation_error import HTTPValidationError -from ...models.source_list_response import SourceListResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - account_id: None | str | Unset = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["page"] = page - - params["limit"] = limit - - params["sort"] = sort - - params["order"] = order - - json_account_id: None | str | Unset - if isinstance(account_id, Unset): - json_account_id = UNSET - else: - json_account_id = account_id - params["account_id"] = json_account_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": "get", - "url": "/sources/", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> HTTPValidationError | SourceListResponse | None: - if response.status_code == 200: - response_200 = SourceListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[HTTPValidationError | SourceListResponse]: - 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: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - account_id: None | str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceListResponse]: - """List Sources - - List content sources with pagination. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - sort (str | Unset): Sort field Default: 'created_at'. - order (str | Unset): Sort order Default: 'desc'. - account_id (None | str | Unset): List sources for the given account. Defaults to the api - key's account. - - 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 | SourceListResponse] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - sort=sort, - order=order, - account_id=account_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - account_id: None | str | Unset = UNSET, -) -> HTTPValidationError | SourceListResponse | None: - """List Sources - - List content sources with pagination. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - sort (str | Unset): Sort field Default: 'created_at'. - order (str | Unset): Sort order Default: 'desc'. - account_id (None | str | Unset): List sources for the given account. Defaults to the api - key's account. - - 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 | SourceListResponse - """ - - return sync_detailed( - client=client, - page=page, - limit=limit, - sort=sort, - order=order, - account_id=account_id, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - account_id: None | str | Unset = UNSET, -) -> Response[HTTPValidationError | SourceListResponse]: - """List Sources - - List content sources with pagination. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - sort (str | Unset): Sort field Default: 'created_at'. - order (str | Unset): Sort order Default: 'desc'. - account_id (None | str | Unset): List sources for the given account. Defaults to the api - key's account. - - 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 | SourceListResponse] - """ - - kwargs = _get_kwargs( - page=page, - limit=limit, - sort=sort, - order=order, - account_id=account_id, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - page: int | Unset = 1, - limit: int | Unset = 20, - sort: str | Unset = "created_at", - order: str | Unset = "desc", - account_id: None | str | Unset = UNSET, -) -> HTTPValidationError | SourceListResponse | None: - """List Sources - - List content sources with pagination. - - Args: - page (int | Unset): Page number Default: 1. - limit (int | Unset): Items per page Default: 20. - sort (str | Unset): Sort field Default: 'created_at'. - order (str | Unset): Sort order Default: 'desc'. - account_id (None | str | Unset): List sources for the given account. Defaults to the api - key's account. - - 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 | SourceListResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - limit=limit, - sort=sort, - order=order, - account_id=account_id, - ) - ).parsed diff --git a/seclai/_generated/seclai_api_client/api/sources/upload_file_to_source_api_sources_source_connection_id_upload_post.py b/seclai/_generated/seclai_api_client/api/sources/upload_file_to_source_api_sources_source_connection_id_upload_post.py deleted file mode 100644 index 63d1ff1..0000000 --- a/seclai/_generated/seclai_api_client/api/sources/upload_file_to_source_api_sources_source_connection_id_upload_post.py +++ /dev/null @@ -1,190 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.body_upload_file_to_source_api_sources_source_connection_id_upload_post import ( - BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, -) -from ...models.file_upload_response import FileUploadResponse -from ...models.http_validation_error import HTTPValidationError -from ...types import Response - - -def _get_kwargs( - source_connection_id: str, - *, - body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/sources/{source_connection_id}/upload".format( - source_connection_id=quote(str(source_connection_id), safe=""), - ), - } - - _kwargs["files"] = body.to_multipart() - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> FileUploadResponse | HTTPValidationError | None: - if response.status_code == 200: - response_200 = FileUploadResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 422: - response_422 = HTTPValidationError.from_dict(response.json()) - - return response_422 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[FileUploadResponse | 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( - source_connection_id: str, - *, - client: AuthenticatedClient | Client, - body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, -) -> Response[FileUploadResponse | HTTPValidationError]: - """Upload File To Source - - Upload a file to a content source. - - Args: - source_connection_id (str): - body (BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost): - - 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[FileUploadResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - source_connection_id: str, - *, - client: AuthenticatedClient | Client, - body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, -) -> FileUploadResponse | HTTPValidationError | None: - """Upload File To Source - - Upload a file to a content source. - - Args: - source_connection_id (str): - body (BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost): - - 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: - FileUploadResponse | HTTPValidationError - """ - - return sync_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - source_connection_id: str, - *, - client: AuthenticatedClient | Client, - body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, -) -> Response[FileUploadResponse | HTTPValidationError]: - """Upload File To Source - - Upload a file to a content source. - - Args: - source_connection_id (str): - body (BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost): - - 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[FileUploadResponse | HTTPValidationError] - """ - - kwargs = _get_kwargs( - source_connection_id=source_connection_id, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - source_connection_id: str, - *, - client: AuthenticatedClient | Client, - body: BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, -) -> FileUploadResponse | HTTPValidationError | None: - """Upload File To Source - - Upload a file to a content source. - - Args: - source_connection_id (str): - body (BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost): - - 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: - FileUploadResponse | HTTPValidationError - """ - - return ( - await asyncio_detailed( - source_connection_id=source_connection_id, - client=client, - body=body, - ) - ).parsed diff --git a/seclai/_generated/seclai_api_client/client.py b/seclai/_generated/seclai_api_client/client.py deleted file mode 100644 index 7ff8c5d..0000000 --- a/seclai/_generated/seclai_api_client/client.py +++ /dev/null @@ -1,282 +0,0 @@ -import ssl -from typing import Any - -import httpx -from attrs import define, evolve, field - - -@define -class Client: - """A class for keeping track of data related to the API - - The following are accepted as keyword arguments and will be used to construct httpx Clients internally: - - ``base_url``: The base URL for the API, all requests are made to a relative path to this URL - - ``cookies``: A dictionary of cookies to be sent with every request - - ``headers``: A dictionary of headers to be sent with every request - - ``timeout``: The maximum amount of a time a request can take. API functions will raise - httpx.TimeoutException if this is exceeded. - - ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, - but can be set to False for testing purposes. - - ``follow_redirects``: Whether or not to follow redirects. Default value is False. - - ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. - - - Attributes: - raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a - status code that was not documented in the source OpenAPI document. Can also be provided as a keyword - argument to the constructor. - """ - - raise_on_unexpected_status: bool = field(default=False, kw_only=True) - _base_url: str = field(alias="base_url") - _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") - _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: str | bool | ssl.SSLContext = field( - default=True, kw_only=True, alias="verify_ssl" - ) - _follow_redirects: bool = field( - default=False, kw_only=True, alias="follow_redirects" - ) - _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: httpx.Client | None = field(default=None, init=False) - _async_client: httpx.AsyncClient | None = field(default=None, init=False) - - def with_headers(self, headers: dict[str, str]) -> "Client": - """Get a new client matching this one with additional headers""" - if self._client is not None: - self._client.headers.update(headers) - if self._async_client is not None: - self._async_client.headers.update(headers) - return evolve(self, headers={**self._headers, **headers}) - - def with_cookies(self, cookies: dict[str, str]) -> "Client": - """Get a new client matching this one with additional cookies""" - if self._client is not None: - self._client.cookies.update(cookies) - if self._async_client is not None: - self._async_client.cookies.update(cookies) - return evolve(self, cookies={**self._cookies, **cookies}) - - def with_timeout(self, timeout: httpx.Timeout) -> "Client": - """Get a new client matching this one with a new timeout configuration""" - if self._client is not None: - self._client.timeout = timeout - if self._async_client is not None: - self._async_client.timeout = timeout - return evolve(self, timeout=timeout) - - def set_httpx_client(self, client: httpx.Client) -> "Client": - """Manually set the underlying httpx.Client - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._client = client - return self - - def get_httpx_client(self) -> httpx.Client: - """Get the underlying httpx.Client, constructing a new one if not previously set""" - if self._client is None: - self._client = httpx.Client( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._client - - def __enter__(self) -> "Client": - """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" - self.get_httpx_client().__enter__() - return self - - def __exit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for internal httpx.Client (see httpx docs)""" - self.get_httpx_client().__exit__(*args, **kwargs) - - def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": - """Manually set the underlying httpx.AsyncClient - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._async_client = async_client - return self - - def get_async_httpx_client(self) -> httpx.AsyncClient: - """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" - if self._async_client is None: - self._async_client = httpx.AsyncClient( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._async_client - - async def __aenter__(self) -> "Client": - """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" - await self.get_async_httpx_client().__aenter__() - return self - - async def __aexit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" - await self.get_async_httpx_client().__aexit__(*args, **kwargs) - - -@define -class AuthenticatedClient: - """A Client which has been authenticated for use on secured endpoints - - The following are accepted as keyword arguments and will be used to construct httpx Clients internally: - - ``base_url``: The base URL for the API, all requests are made to a relative path to this URL - - ``cookies``: A dictionary of cookies to be sent with every request - - ``headers``: A dictionary of headers to be sent with every request - - ``timeout``: The maximum amount of a time a request can take. API functions will raise - httpx.TimeoutException if this is exceeded. - - ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, - but can be set to False for testing purposes. - - ``follow_redirects``: Whether or not to follow redirects. Default value is False. - - ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. - - - Attributes: - raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a - status code that was not documented in the source OpenAPI document. Can also be provided as a keyword - argument to the constructor. - token: The API key / token to use for authentication - prefix: Optional prefix for the auth header value (usually empty for API key auth) - auth_header_name: The name of the auth header (defaults to API key header) - """ - - raise_on_unexpected_status: bool = field(default=False, kw_only=True) - _base_url: str = field(alias="base_url") - _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") - _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: str | bool | ssl.SSLContext = field( - default=True, kw_only=True, alias="verify_ssl" - ) - _follow_redirects: bool = field( - default=False, kw_only=True, alias="follow_redirects" - ) - _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: httpx.Client | None = field(default=None, init=False) - _async_client: httpx.AsyncClient | None = field(default=None, init=False) - - token: str - prefix: str = "" - auth_header_name: str = "x-api-key" - - def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": - """Get a new client matching this one with additional headers""" - if self._client is not None: - self._client.headers.update(headers) - if self._async_client is not None: - self._async_client.headers.update(headers) - return evolve(self, headers={**self._headers, **headers}) - - def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": - """Get a new client matching this one with additional cookies""" - if self._client is not None: - self._client.cookies.update(cookies) - if self._async_client is not None: - self._async_client.cookies.update(cookies) - return evolve(self, cookies={**self._cookies, **cookies}) - - def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": - """Get a new client matching this one with a new timeout configuration""" - if self._client is not None: - self._client.timeout = timeout - if self._async_client is not None: - self._async_client.timeout = timeout - return evolve(self, timeout=timeout) - - def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": - """Manually set the underlying httpx.Client - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._client = client - return self - - def get_httpx_client(self) -> httpx.Client: - """Get the underlying httpx.Client, constructing a new one if not previously set""" - if self._client is None: - self._headers[self.auth_header_name] = ( - f"{self.prefix} {self.token}" if self.prefix else self.token - ) - self._client = httpx.Client( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._client - - def __enter__(self) -> "AuthenticatedClient": - """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" - self.get_httpx_client().__enter__() - return self - - def __exit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for internal httpx.Client (see httpx docs)""" - self.get_httpx_client().__exit__(*args, **kwargs) - - def set_async_httpx_client( - self, async_client: httpx.AsyncClient - ) -> "AuthenticatedClient": - """Manually set the underlying httpx.AsyncClient - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._async_client = async_client - return self - - def get_async_httpx_client(self) -> httpx.AsyncClient: - """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" - if self._async_client is None: - self._headers[self.auth_header_name] = ( - f"{self.prefix} {self.token}" if self.prefix else self.token - ) - self._async_client = httpx.AsyncClient( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._async_client - - async def __aenter__(self) -> "AuthenticatedClient": - """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" - await self.get_async_httpx_client().__aenter__() - return self - - async def __aexit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" - await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/seclai/_generated/seclai_api_client/errors.py b/seclai/_generated/seclai_api_client/errors.py deleted file mode 100644 index 5f92e76..0000000 --- a/seclai/_generated/seclai_api_client/errors.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Contains shared errors types that can be raised from API functions""" - - -class UnexpectedStatus(Exception): - """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" - - def __init__(self, status_code: int, content: bytes): - self.status_code = status_code - self.content = content - - super().__init__( - f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" - ) - - -__all__ = ["UnexpectedStatus"] diff --git a/seclai/_generated/seclai_api_client/models/__init__.py b/seclai/_generated/seclai_api_client/models/__init__.py deleted file mode 100644 index 5c05791..0000000 --- a/seclai/_generated/seclai_api_client/models/__init__.py +++ /dev/null @@ -1,473 +0,0 @@ -"""Contains all the data models used in inputs/outputs""" - -from .account_budget_response import AccountBudgetResponse -from .account_details_response import AccountDetailsResponse -from .account_response import AccountResponse -from .activity_budget_response import ActivityBudgetResponse -from .activity_credit_usage_response import ActivityCreditUsageResponse -from .agent_list_response import AgentListResponse -from .agent_response import AgentResponse -from .agent_run_attempt_response import AgentRunAttemptResponse -from .agent_run_details_response import AgentRunDetailsResponse -from .agent_run_details_response_metadata_type_0 import ( - AgentRunDetailsResponseMetadataType0, -) -from .agent_run_list_response import AgentRunListResponse -from .agent_run_request import AgentRunRequest -from .agent_run_request_metadata_type_0 import AgentRunRequestMetadataType0 -from .agent_run_response import AgentRunResponse -from .agent_run_status_response import AgentRunStatusResponse -from .agent_run_step_details_response import AgentRunStepDetailsResponse -from .agent_run_summary_response import AgentRunSummaryResponse -from .agent_trigger_frequency import AgentTriggerFrequency -from .agent_trigger_type import AgentTriggerType -from .agent_warning_model import AgentWarningModel -from .analyze_substitutions_request import AnalyzeSubstitutionsRequest -from .analyze_substitutions_response import AnalyzeSubstitutionsResponse -from .api_call_list_response import ApiCallListResponse -from .api_key_create_request import ApiKeyCreateRequest -from .api_key_create_response import ApiKeyCreateResponse -from .api_key_list_item_response import ApiKeyListItemResponse -from .api_key_list_response import ApiKeyListResponse -from .body_upload_file_to_source_api_sources_source_connection_id_upload_post import ( - BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, -) -from .body_upload_file_to_source_authenticated_sources_source_connection_id_upload_post import ( - BodyUploadFileToSourceAuthenticatedSourcesSourceConnectionIdUploadPost, -) -from .branch_current_state_response import BranchCurrentStateResponse -from .branch_current_state_response_definition import ( - BranchCurrentStateResponseDefinition, -) -from .branch_current_state_response_dependencies_type_0 import ( - BranchCurrentStateResponseDependenciesType0, -) -from .branch_current_state_response_dependencies_type_0_additional_property import ( - BranchCurrentStateResponseDependenciesType0AdditionalProperty, -) -from .branch_current_state_response_dependencies_type_0_additional_property_additional_property import ( - BranchCurrentStateResponseDependenciesType0AdditionalPropertyAdditionalProperty, -) -from .branch_summary_response import BranchSummaryResponse -from .budget_request import BudgetRequest -from .change_plan_request import ChangePlanRequest -from .chat_request import ChatRequest -from .chat_response import ChatResponse -from .comment_list_response import CommentListResponse -from .company_size import CompanySize -from .content_detail_response import ContentDetailResponse -from .content_detail_response_metadata_type_0_item import ( - ContentDetailResponseMetadataType0Item, -) -from .content_embedding_response import ContentEmbeddingResponse -from .content_embeddings_list_response import ContentEmbeddingsListResponse -from .content_filter_type import ContentFilterType -from .conversation_data import ConversationData -from .conversation_list_response import ConversationListResponse -from .conversation_message_response import ConversationMessageResponse -from .conversation_with_messages_response import ConversationWithMessagesResponse -from .cost_estimate_request import CostEstimateRequest -from .cost_estimate_response import CostEstimateResponse -from .create_agent_request import CreateAgentRequest -from .create_agent_request_metadata_type_0 import CreateAgentRequestMetadataType0 -from .create_knowledge_base_request import CreateKnowledgeBaseRequest -from .create_source_request import CreateSourceRequest -from .create_trigger_schedule_request import CreateTriggerScheduleRequest -from .credit_purchase_confirm_request import CreditPurchaseConfirmRequest -from .credit_purchase_price_response import CreditPurchasePriceResponse -from .credit_purchase_request import CreditPurchaseRequest -from .credit_purchase_response import CreditPurchaseResponse -from .credit_purchase_with_payment_method_request import ( - CreditPurchaseWithPaymentMethodRequest, -) -from .credit_purchase_with_payment_method_response import ( - CreditPurchaseWithPaymentMethodResponse, -) -from .credit_usage_slice_response import CreditUsageSliceResponse -from .default_chunking_config import DefaultChunkingConfig -from .delete_account_response import DeleteAccountResponse -from .detect_source_request import DetectSourceRequest -from .detect_source_response import DetectSourceResponse -from .email_preference_response import EmailPreferenceResponse -from .embedding_cost_info import EmbeddingCostInfo -from .embedding_model_info import EmbeddingModelInfo -from .embedding_models_response import EmbeddingModelsResponse -from .embedding_storage_credits import EmbeddingStorageCredits -from .feed_item import FeedItem -from .file_upload_config_response import FileUploadConfigResponse -from .file_upload_config_response_supported_types import ( - FileUploadConfigResponseSupportedTypes, -) -from .file_upload_config_response_supported_types_additional_property import ( - FileUploadConfigResponseSupportedTypesAdditionalProperty, -) -from .file_upload_response import FileUploadResponse -from .http_validation_error import HTTPValidationError -from .invitation_create_request import InvitationCreateRequest -from .invitations_list_response import InvitationsListResponse -from .json_type import JsonType -from .knowledge_base_content_version_response import KnowledgeBaseContentVersionResponse -from .knowledge_base_list_response import KnowledgeBaseListResponse -from .knowledge_base_response import KnowledgeBaseResponse -from .language_option import LanguageOption -from .list_payment_methods_response import ListPaymentMethodsResponse -from .mcp_server_request_list_response import MCPServerRequestListResponse -from .members_list_response import MembersListResponse -from .membership_type import MembershipType -from .membership_update_request import MembershipUpdateRequest -from .message_response import MessageResponse -from .onboarding_request import OnboardingRequest -from .organization_create_request import OrganizationCreateRequest -from .organization_list_response import OrganizationListResponse -from .organization_resource_counts_response import OrganizationResourceCountsResponse -from .organization_response import OrganizationResponse -from .page_link import PageLink -from .pagination_response import PaginationResponse -from .patch_branch_state_request import PatchBranchStateRequest -from .patch_branch_state_request_data_type_0 import PatchBranchStateRequestDataType0 -from .payment_intent_history_item import PaymentIntentHistoryItem -from .payment_intent_history_response import PaymentIntentHistoryResponse -from .payment_intent_status_response import PaymentIntentStatusResponse -from .payment_intent_status_response_payment_intent_type_0 import ( - PaymentIntentStatusResponsePaymentIntentType0, -) -from .payment_method_action_response import PaymentMethodActionResponse -from .payment_method_response import PaymentMethodResponse -from .payment_method_response_card import PaymentMethodResponseCard -from .pending_completed_failed_status import PendingCompletedFailedStatus -from .pending_processing_completed_failed_status import ( - PendingProcessingCompletedFailedStatus, -) -from .plan_price_response import PlanPriceResponse -from .plan_response import PlanResponse -from .plan_response_prices import PlanResponsePrices -from .polling_action import PollingAction -from .polling_type import PollingType -from .processing_phase_response import ProcessingPhaseResponse -from .prompt_model_response import PromptModelResponse -from .prompt_tool_response import PromptToolResponse -from .prompt_tool_response_headers_type_0 import PromptToolResponseHeadersType0 -from .provider_group_response import ProviderGroupResponse -from .pull_request import PullRequest -from .pull_response import PullResponse -from .related_account_response import RelatedAccountResponse -from .reranker_model_info import RerankerModelInfo -from .reranker_models_response import RerankerModelsResponse -from .rss_content_option import RSSContentOption -from .run_agent_request import RunAgentRequest -from .run_agent_request_metadata_type_0 import RunAgentRequestMetadataType0 -from .run_agent_response import RunAgentResponse -from .seed_type import SeedType -from .setup_intent_response import SetupIntentResponse -from .source_connection_embeddings_list_response import ( - SourceConnectionEmbeddingsListResponse, -) -from .source_connection_pull_list_response import SourceConnectionPullListResponse -from .source_connection_response import SourceConnectionResponse -from .source_content_list_response import SourceContentListResponse -from .source_list_response import SourceListResponse -from .source_pull_progress_response import SourcePullProgressResponse -from .source_response import SourceResponse -from .source_type import SourceType -from .start_subscription_request import StartSubscriptionRequest -from .start_subscription_response import StartSubscriptionResponse -from .step_debug_run_request import StepDebugRunRequest -from .step_debug_run_request_manual_inputs import StepDebugRunRequestManualInputs -from .step_debug_run_request_manual_metadata import StepDebugRunRequestManualMetadata -from .step_debug_run_request_manual_outputs import StepDebugRunRequestManualOutputs -from .step_debug_run_response import StepDebugRunResponse -from .step_run_attempt_list_response import StepRunAttemptListResponse -from .step_run_attempt_response import StepRunAttemptResponse -from .stripe_webhook_response import StripeWebhookResponse -from .submit_feedback_request import SubmitFeedbackRequest -from .subscription_cancelation_reason import SubscriptionCancelationReason -from .subscription_payment_intent_request import SubscriptionPaymentIntentRequest -from .subscription_payment_intent_response import SubscriptionPaymentIntentResponse -from .subscription_response import SubscriptionResponse -from .substitution_dependencies import SubstitutionDependencies -from .test_display_result_request import TestDisplayResultRequest -from .test_display_result_response import TestDisplayResultResponse -from .test_extract_html_request import TestExtractHtmlRequest -from .test_extract_html_response import TestExtractHtmlResponse -from .test_extract_json_request import TestExtractJsonRequest -from .test_extract_json_response import TestExtractJsonResponse -from .test_extract_xml_request import TestExtractXmlRequest -from .test_extract_xml_response import TestExtractXmlResponse -from .test_prompt_call_request import TestPromptCallRequest -from .test_prompt_call_request_json_template_type_0 import ( - TestPromptCallRequestJsonTemplateType0, -) -from .test_prompt_call_request_manual_inputs_type_0 import ( - TestPromptCallRequestManualInputsType0, -) -from .test_prompt_call_response import TestPromptCallResponse -from .test_prompt_call_response_result_type_0 import TestPromptCallResponseResultType0 -from .test_retrieval_request import TestRetrievalRequest -from .test_retrieval_request_metadata_filter_type_0 import ( - TestRetrievalRequestMetadataFilterType0, -) -from .test_retrieval_response import TestRetrievalResponse -from .test_s3_write_request import TestS3WriteRequest -from .test_s3_write_response import TestS3WriteResponse -from .test_s3_write_response_result_type_0 import TestS3WriteResponseResultType0 -from .test_send_email_request import TestSendEmailRequest -from .test_send_email_response import TestSendEmailResponse -from .test_send_email_response_result_type_0 import TestSendEmailResponseResultType0 -from .test_transform_request import TestTransformRequest -from .test_transform_request_placeholder_values import ( - TestTransformRequestPlaceholderValues, -) -from .test_transform_response import TestTransformResponse -from .test_webhook_call_request import TestWebhookCallRequest -from .test_webhook_call_request_headers_type_0 import TestWebhookCallRequestHeadersType0 -from .test_webhook_call_response import TestWebhookCallResponse -from .test_webhook_call_response_request_type_0 import ( - TestWebhookCallResponseRequestType0, -) -from .test_webhook_call_response_response_type_0 import ( - TestWebhookCallResponseResponseType0, -) -from .transform_rule_test import TransformRuleTest -from .trigger_response import TriggerResponse -from .trigger_response_metadata_type_0 import TriggerResponseMetadataType0 -from .trigger_schedule_response import TriggerScheduleResponse -from .update_agent_request import UpdateAgentRequest -from .update_auto_purchase_request import UpdateAutoPurchaseRequest -from .update_branch_state_request import UpdateBranchStateRequest -from .update_branch_state_request_definition import UpdateBranchStateRequestDefinition -from .update_email_preference_request import UpdateEmailPreferenceRequest -from .update_knowledge_base_request import UpdateKnowledgeBaseRequest -from .update_monthly_overage_budget_request import UpdateMonthlyOverageBudgetRequest -from .update_source_request import UpdateSourceRequest -from .update_stop_at_budget_limit_request import UpdateStopAtBudgetLimitRequest -from .update_trigger_request import UpdateTriggerRequest -from .update_trigger_request_metadata_type_0 import UpdateTriggerRequestMetadataType0 -from .update_trigger_schedule_request import UpdateTriggerScheduleRequest -from .update_user_profile_request import UpdateUserProfileRequest -from .usage_detail_activity_response import UsageDetailActivityResponse -from .usage_details_granularity import UsageDetailsGranularity -from .usage_origin_slice_response import UsageOriginSliceResponse -from .use_case_type import UseCaseType -from .user_profile_response import UserProfileResponse -from .user_response import UserResponse -from .validation_error import ValidationError -from .validation_error_response import ValidationErrorResponse -from .validation_field_error import ValidationFieldError -from .variant_category_response import VariantCategoryResponse -from .variant_option_response import VariantOptionResponse - -__all__ = ( - "AccountBudgetResponse", - "AccountDetailsResponse", - "AccountResponse", - "ActivityBudgetResponse", - "ActivityCreditUsageResponse", - "AgentListResponse", - "AgentResponse", - "AgentRunAttemptResponse", - "AgentRunDetailsResponse", - "AgentRunDetailsResponseMetadataType0", - "AgentRunListResponse", - "AgentRunRequest", - "AgentRunRequestMetadataType0", - "AgentRunResponse", - "AgentRunStatusResponse", - "AgentRunStepDetailsResponse", - "AgentRunSummaryResponse", - "AgentTriggerFrequency", - "AgentTriggerType", - "AgentWarningModel", - "AnalyzeSubstitutionsRequest", - "AnalyzeSubstitutionsResponse", - "ApiCallListResponse", - "ApiKeyCreateRequest", - "ApiKeyCreateResponse", - "ApiKeyListItemResponse", - "ApiKeyListResponse", - "BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost", - "BodyUploadFileToSourceAuthenticatedSourcesSourceConnectionIdUploadPost", - "BranchCurrentStateResponse", - "BranchCurrentStateResponseDefinition", - "BranchCurrentStateResponseDependenciesType0", - "BranchCurrentStateResponseDependenciesType0AdditionalProperty", - "BranchCurrentStateResponseDependenciesType0AdditionalPropertyAdditionalProperty", - "BranchSummaryResponse", - "BudgetRequest", - "ChangePlanRequest", - "ChatRequest", - "ChatResponse", - "CommentListResponse", - "CompanySize", - "ContentDetailResponse", - "ContentDetailResponseMetadataType0Item", - "ContentEmbeddingResponse", - "ContentEmbeddingsListResponse", - "ContentFilterType", - "ConversationData", - "ConversationListResponse", - "ConversationMessageResponse", - "ConversationWithMessagesResponse", - "CostEstimateRequest", - "CostEstimateResponse", - "CreateAgentRequest", - "CreateAgentRequestMetadataType0", - "CreateKnowledgeBaseRequest", - "CreateSourceRequest", - "CreateTriggerScheduleRequest", - "CreditPurchaseConfirmRequest", - "CreditPurchasePriceResponse", - "CreditPurchaseRequest", - "CreditPurchaseResponse", - "CreditPurchaseWithPaymentMethodRequest", - "CreditPurchaseWithPaymentMethodResponse", - "CreditUsageSliceResponse", - "DefaultChunkingConfig", - "DeleteAccountResponse", - "DetectSourceRequest", - "DetectSourceResponse", - "EmailPreferenceResponse", - "EmbeddingCostInfo", - "EmbeddingModelInfo", - "EmbeddingModelsResponse", - "EmbeddingStorageCredits", - "FeedItem", - "FileUploadConfigResponse", - "FileUploadConfigResponseSupportedTypes", - "FileUploadConfigResponseSupportedTypesAdditionalProperty", - "FileUploadResponse", - "HTTPValidationError", - "InvitationCreateRequest", - "InvitationsListResponse", - "JsonType", - "KnowledgeBaseContentVersionResponse", - "KnowledgeBaseListResponse", - "KnowledgeBaseResponse", - "LanguageOption", - "ListPaymentMethodsResponse", - "MCPServerRequestListResponse", - "MembershipType", - "MembershipUpdateRequest", - "MembersListResponse", - "MessageResponse", - "OnboardingRequest", - "OrganizationCreateRequest", - "OrganizationListResponse", - "OrganizationResourceCountsResponse", - "OrganizationResponse", - "PageLink", - "PaginationResponse", - "PatchBranchStateRequest", - "PatchBranchStateRequestDataType0", - "PaymentIntentHistoryItem", - "PaymentIntentHistoryResponse", - "PaymentIntentStatusResponse", - "PaymentIntentStatusResponsePaymentIntentType0", - "PaymentMethodActionResponse", - "PaymentMethodResponse", - "PaymentMethodResponseCard", - "PendingCompletedFailedStatus", - "PendingProcessingCompletedFailedStatus", - "PlanPriceResponse", - "PlanResponse", - "PlanResponsePrices", - "PollingAction", - "PollingType", - "ProcessingPhaseResponse", - "PromptModelResponse", - "PromptToolResponse", - "PromptToolResponseHeadersType0", - "ProviderGroupResponse", - "PullRequest", - "PullResponse", - "RelatedAccountResponse", - "RerankerModelInfo", - "RerankerModelsResponse", - "RSSContentOption", - "RunAgentRequest", - "RunAgentRequestMetadataType0", - "RunAgentResponse", - "SeedType", - "SetupIntentResponse", - "SourceConnectionEmbeddingsListResponse", - "SourceConnectionPullListResponse", - "SourceConnectionResponse", - "SourceContentListResponse", - "SourceListResponse", - "SourcePullProgressResponse", - "SourceResponse", - "SourceType", - "StartSubscriptionRequest", - "StartSubscriptionResponse", - "StepDebugRunRequest", - "StepDebugRunRequestManualInputs", - "StepDebugRunRequestManualMetadata", - "StepDebugRunRequestManualOutputs", - "StepDebugRunResponse", - "StepRunAttemptListResponse", - "StepRunAttemptResponse", - "StripeWebhookResponse", - "SubmitFeedbackRequest", - "SubscriptionCancelationReason", - "SubscriptionPaymentIntentRequest", - "SubscriptionPaymentIntentResponse", - "SubscriptionResponse", - "SubstitutionDependencies", - "TestDisplayResultRequest", - "TestDisplayResultResponse", - "TestExtractHtmlRequest", - "TestExtractHtmlResponse", - "TestExtractJsonRequest", - "TestExtractJsonResponse", - "TestExtractXmlRequest", - "TestExtractXmlResponse", - "TestPromptCallRequest", - "TestPromptCallRequestJsonTemplateType0", - "TestPromptCallRequestManualInputsType0", - "TestPromptCallResponse", - "TestPromptCallResponseResultType0", - "TestRetrievalRequest", - "TestRetrievalRequestMetadataFilterType0", - "TestRetrievalResponse", - "TestS3WriteRequest", - "TestS3WriteResponse", - "TestS3WriteResponseResultType0", - "TestSendEmailRequest", - "TestSendEmailResponse", - "TestSendEmailResponseResultType0", - "TestTransformRequest", - "TestTransformRequestPlaceholderValues", - "TestTransformResponse", - "TestWebhookCallRequest", - "TestWebhookCallRequestHeadersType0", - "TestWebhookCallResponse", - "TestWebhookCallResponseRequestType0", - "TestWebhookCallResponseResponseType0", - "TransformRuleTest", - "TriggerResponse", - "TriggerResponseMetadataType0", - "TriggerScheduleResponse", - "UpdateAgentRequest", - "UpdateAutoPurchaseRequest", - "UpdateBranchStateRequest", - "UpdateBranchStateRequestDefinition", - "UpdateEmailPreferenceRequest", - "UpdateKnowledgeBaseRequest", - "UpdateMonthlyOverageBudgetRequest", - "UpdateSourceRequest", - "UpdateStopAtBudgetLimitRequest", - "UpdateTriggerRequest", - "UpdateTriggerRequestMetadataType0", - "UpdateTriggerScheduleRequest", - "UpdateUserProfileRequest", - "UsageDetailActivityResponse", - "UsageDetailsGranularity", - "UsageOriginSliceResponse", - "UseCaseType", - "UserProfileResponse", - "UserResponse", - "ValidationError", - "ValidationErrorResponse", - "ValidationFieldError", - "VariantCategoryResponse", - "VariantOptionResponse", -) diff --git a/seclai/_generated/seclai_api_client/models/account_budget_response.py b/seclai/_generated/seclai_api_client/models/account_budget_response.py deleted file mode 100644 index 1e941dc..0000000 --- a/seclai/_generated/seclai_api_client/models/account_budget_response.py +++ /dev/null @@ -1,117 +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.activity_budget_response import ActivityBudgetResponse - - -T = TypeVar("T", bound="AccountBudgetResponse") - - -@_attrs_define -class AccountBudgetResponse: - """ - Attributes: - account_credits (int): - activity_budgets (list[ActivityBudgetResponse]): - auto_purchase_overages (bool): - monthly_overage_budget (int): - pending_credits (int): - stop_at_budget_limit (bool): - """ - - account_credits: int - activity_budgets: list[ActivityBudgetResponse] - auto_purchase_overages: bool - monthly_overage_budget: int - pending_credits: int - stop_at_budget_limit: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - account_credits = self.account_credits - - activity_budgets = [] - for activity_budgets_item_data in self.activity_budgets: - activity_budgets_item = activity_budgets_item_data.to_dict() - activity_budgets.append(activity_budgets_item) - - auto_purchase_overages = self.auto_purchase_overages - - monthly_overage_budget = self.monthly_overage_budget - - pending_credits = self.pending_credits - - stop_at_budget_limit = self.stop_at_budget_limit - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_credits": account_credits, - "activity_budgets": activity_budgets, - "auto_purchase_overages": auto_purchase_overages, - "monthly_overage_budget": monthly_overage_budget, - "pending_credits": pending_credits, - "stop_at_budget_limit": stop_at_budget_limit, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.activity_budget_response import ActivityBudgetResponse - - d = dict(src_dict) - account_credits = d.pop("account_credits") - - activity_budgets = [] - _activity_budgets = d.pop("activity_budgets") - for activity_budgets_item_data in _activity_budgets: - activity_budgets_item = ActivityBudgetResponse.from_dict( - activity_budgets_item_data - ) - - activity_budgets.append(activity_budgets_item) - - auto_purchase_overages = d.pop("auto_purchase_overages") - - monthly_overage_budget = d.pop("monthly_overage_budget") - - pending_credits = d.pop("pending_credits") - - stop_at_budget_limit = d.pop("stop_at_budget_limit") - - account_budget_response = cls( - account_credits=account_credits, - activity_budgets=activity_budgets, - auto_purchase_overages=auto_purchase_overages, - monthly_overage_budget=monthly_overage_budget, - pending_credits=pending_credits, - stop_at_budget_limit=stop_at_budget_limit, - ) - - account_budget_response.additional_properties = d - return account_budget_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/seclai/_generated/seclai_api_client/models/account_details_response.py b/seclai/_generated/seclai_api_client/models/account_details_response.py deleted file mode 100644 index 6435946..0000000 --- a/seclai/_generated/seclai_api_client/models/account_details_response.py +++ /dev/null @@ -1,627 +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.related_account_response import RelatedAccountResponse - - -T = TypeVar("T", bound="AccountDetailsResponse") - - -@_attrs_define -class AccountDetailsResponse: - """ - Attributes: - account_credits (int | None | Unset): - accounts (list[RelatedAccountResponse] | Unset): - auto_purchase_overages (bool | None | Unset): - days_until_content_deletion (int | None | Unset): - id (None | str | Unset): - knowledge_bases (int | None | Unset): - name (None | str | Unset): - pending_plan_monthly_credits (int | None | Unset): - pending_plan_name (None | str | Unset): - pending_subscription_start_date (None | str | Unset): - plan_agent_version_control (bool | None | Unset): - plan_api_access (bool | None | Unset): - plan_crawl_session_page_limit (int | None | Unset): - plan_max_agents (int | None | Unset): - plan_max_organization_members (int | None | Unset): - plan_max_organizations (int | None | Unset): - plan_monthly_credits (int | None | Unset): - plan_name (None | str | Unset): - plan_support (None | str | Unset): - readonly (bool | Unset): Default: False. - sources (int | None | Unset): - status (None | str | Unset): - subscription_period_credits (int | None | Unset): - subscription_period_end (None | str | Unset): - subscription_period_initial_credits (int | None | Unset): - subscription_period_start (None | str | Unset): - trial_days_available (int | None | Unset): - """ - - account_credits: int | None | Unset = UNSET - accounts: list[RelatedAccountResponse] | Unset = UNSET - auto_purchase_overages: bool | None | Unset = UNSET - days_until_content_deletion: int | None | Unset = UNSET - id: None | str | Unset = UNSET - knowledge_bases: int | None | Unset = UNSET - name: None | str | Unset = UNSET - pending_plan_monthly_credits: int | None | Unset = UNSET - pending_plan_name: None | str | Unset = UNSET - pending_subscription_start_date: None | str | Unset = UNSET - plan_agent_version_control: bool | None | Unset = UNSET - plan_api_access: bool | None | Unset = UNSET - plan_crawl_session_page_limit: int | None | Unset = UNSET - plan_max_agents: int | None | Unset = UNSET - plan_max_organization_members: int | None | Unset = UNSET - plan_max_organizations: int | None | Unset = UNSET - plan_monthly_credits: int | None | Unset = UNSET - plan_name: None | str | Unset = UNSET - plan_support: None | str | Unset = UNSET - readonly: bool | Unset = False - sources: int | None | Unset = UNSET - status: None | str | Unset = UNSET - subscription_period_credits: int | None | Unset = UNSET - subscription_period_end: None | str | Unset = UNSET - subscription_period_initial_credits: int | None | Unset = UNSET - subscription_period_start: None | str | Unset = UNSET - trial_days_available: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - account_credits: int | None | Unset - if isinstance(self.account_credits, Unset): - account_credits = UNSET - else: - account_credits = self.account_credits - - accounts: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.accounts, Unset): - accounts = [] - for accounts_item_data in self.accounts: - accounts_item = accounts_item_data.to_dict() - accounts.append(accounts_item) - - auto_purchase_overages: bool | None | Unset - if isinstance(self.auto_purchase_overages, Unset): - auto_purchase_overages = UNSET - else: - auto_purchase_overages = self.auto_purchase_overages - - days_until_content_deletion: int | None | Unset - if isinstance(self.days_until_content_deletion, Unset): - days_until_content_deletion = UNSET - else: - days_until_content_deletion = self.days_until_content_deletion - - id: None | str | Unset - if isinstance(self.id, Unset): - id = UNSET - else: - id = self.id - - knowledge_bases: int | None | Unset - if isinstance(self.knowledge_bases, Unset): - knowledge_bases = UNSET - else: - knowledge_bases = self.knowledge_bases - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - pending_plan_monthly_credits: int | None | Unset - if isinstance(self.pending_plan_monthly_credits, Unset): - pending_plan_monthly_credits = UNSET - else: - pending_plan_monthly_credits = self.pending_plan_monthly_credits - - pending_plan_name: None | str | Unset - if isinstance(self.pending_plan_name, Unset): - pending_plan_name = UNSET - else: - pending_plan_name = self.pending_plan_name - - pending_subscription_start_date: None | str | Unset - if isinstance(self.pending_subscription_start_date, Unset): - pending_subscription_start_date = UNSET - else: - pending_subscription_start_date = self.pending_subscription_start_date - - plan_agent_version_control: bool | None | Unset - if isinstance(self.plan_agent_version_control, Unset): - plan_agent_version_control = UNSET - else: - plan_agent_version_control = self.plan_agent_version_control - - plan_api_access: bool | None | Unset - if isinstance(self.plan_api_access, Unset): - plan_api_access = UNSET - else: - plan_api_access = self.plan_api_access - - plan_crawl_session_page_limit: int | None | Unset - if isinstance(self.plan_crawl_session_page_limit, Unset): - plan_crawl_session_page_limit = UNSET - else: - plan_crawl_session_page_limit = self.plan_crawl_session_page_limit - - plan_max_agents: int | None | Unset - if isinstance(self.plan_max_agents, Unset): - plan_max_agents = UNSET - else: - plan_max_agents = self.plan_max_agents - - plan_max_organization_members: int | None | Unset - if isinstance(self.plan_max_organization_members, Unset): - plan_max_organization_members = UNSET - else: - plan_max_organization_members = self.plan_max_organization_members - - plan_max_organizations: int | None | Unset - if isinstance(self.plan_max_organizations, Unset): - plan_max_organizations = UNSET - else: - plan_max_organizations = self.plan_max_organizations - - plan_monthly_credits: int | None | Unset - if isinstance(self.plan_monthly_credits, Unset): - plan_monthly_credits = UNSET - else: - plan_monthly_credits = self.plan_monthly_credits - - plan_name: None | str | Unset - if isinstance(self.plan_name, Unset): - plan_name = UNSET - else: - plan_name = self.plan_name - - plan_support: None | str | Unset - if isinstance(self.plan_support, Unset): - plan_support = UNSET - else: - plan_support = self.plan_support - - readonly = self.readonly - - sources: int | None | Unset - if isinstance(self.sources, Unset): - sources = UNSET - else: - sources = self.sources - - status: None | str | Unset - if isinstance(self.status, Unset): - status = UNSET - else: - status = self.status - - subscription_period_credits: int | None | Unset - if isinstance(self.subscription_period_credits, Unset): - subscription_period_credits = UNSET - else: - subscription_period_credits = self.subscription_period_credits - - subscription_period_end: None | str | Unset - if isinstance(self.subscription_period_end, Unset): - subscription_period_end = UNSET - else: - subscription_period_end = self.subscription_period_end - - subscription_period_initial_credits: int | None | Unset - if isinstance(self.subscription_period_initial_credits, Unset): - subscription_period_initial_credits = UNSET - else: - subscription_period_initial_credits = ( - self.subscription_period_initial_credits - ) - - subscription_period_start: None | str | Unset - if isinstance(self.subscription_period_start, Unset): - subscription_period_start = UNSET - else: - subscription_period_start = self.subscription_period_start - - trial_days_available: int | None | Unset - if isinstance(self.trial_days_available, Unset): - trial_days_available = UNSET - else: - trial_days_available = self.trial_days_available - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if account_credits is not UNSET: - field_dict["account_credits"] = account_credits - if accounts is not UNSET: - field_dict["accounts"] = accounts - if auto_purchase_overages is not UNSET: - field_dict["auto_purchase_overages"] = auto_purchase_overages - if days_until_content_deletion is not UNSET: - field_dict["days_until_content_deletion"] = days_until_content_deletion - if id is not UNSET: - field_dict["id"] = id - if knowledge_bases is not UNSET: - field_dict["knowledge_bases"] = knowledge_bases - if name is not UNSET: - field_dict["name"] = name - if pending_plan_monthly_credits is not UNSET: - field_dict["pending_plan_monthly_credits"] = pending_plan_monthly_credits - if pending_plan_name is not UNSET: - field_dict["pending_plan_name"] = pending_plan_name - if pending_subscription_start_date is not UNSET: - field_dict["pending_subscription_start_date"] = ( - pending_subscription_start_date - ) - if plan_agent_version_control is not UNSET: - field_dict["plan_agent_version_control"] = plan_agent_version_control - if plan_api_access is not UNSET: - field_dict["plan_api_access"] = plan_api_access - if plan_crawl_session_page_limit is not UNSET: - field_dict["plan_crawl_session_page_limit"] = plan_crawl_session_page_limit - if plan_max_agents is not UNSET: - field_dict["plan_max_agents"] = plan_max_agents - if plan_max_organization_members is not UNSET: - field_dict["plan_max_organization_members"] = plan_max_organization_members - if plan_max_organizations is not UNSET: - field_dict["plan_max_organizations"] = plan_max_organizations - if plan_monthly_credits is not UNSET: - field_dict["plan_monthly_credits"] = plan_monthly_credits - if plan_name is not UNSET: - field_dict["plan_name"] = plan_name - if plan_support is not UNSET: - field_dict["plan_support"] = plan_support - if readonly is not UNSET: - field_dict["readonly"] = readonly - if sources is not UNSET: - field_dict["sources"] = sources - if status is not UNSET: - field_dict["status"] = status - if subscription_period_credits is not UNSET: - field_dict["subscription_period_credits"] = subscription_period_credits - if subscription_period_end is not UNSET: - field_dict["subscription_period_end"] = subscription_period_end - if subscription_period_initial_credits is not UNSET: - field_dict["subscription_period_initial_credits"] = ( - subscription_period_initial_credits - ) - if subscription_period_start is not UNSET: - field_dict["subscription_period_start"] = subscription_period_start - if trial_days_available is not UNSET: - field_dict["trial_days_available"] = trial_days_available - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.related_account_response import RelatedAccountResponse - - d = dict(src_dict) - - def _parse_account_credits(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - account_credits = _parse_account_credits(d.pop("account_credits", UNSET)) - - _accounts = d.pop("accounts", UNSET) - accounts: list[RelatedAccountResponse] | Unset = UNSET - if _accounts is not UNSET: - accounts = [] - for accounts_item_data in _accounts: - accounts_item = RelatedAccountResponse.from_dict(accounts_item_data) - - accounts.append(accounts_item) - - def _parse_auto_purchase_overages(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - auto_purchase_overages = _parse_auto_purchase_overages( - d.pop("auto_purchase_overages", UNSET) - ) - - def _parse_days_until_content_deletion(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - days_until_content_deletion = _parse_days_until_content_deletion( - d.pop("days_until_content_deletion", UNSET) - ) - - 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_knowledge_bases(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - knowledge_bases = _parse_knowledge_bases(d.pop("knowledge_bases", UNSET)) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - def _parse_pending_plan_monthly_credits(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - pending_plan_monthly_credits = _parse_pending_plan_monthly_credits( - d.pop("pending_plan_monthly_credits", UNSET) - ) - - def _parse_pending_plan_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - pending_plan_name = _parse_pending_plan_name(d.pop("pending_plan_name", UNSET)) - - def _parse_pending_subscription_start_date(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - pending_subscription_start_date = _parse_pending_subscription_start_date( - d.pop("pending_subscription_start_date", UNSET) - ) - - def _parse_plan_agent_version_control(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - plan_agent_version_control = _parse_plan_agent_version_control( - d.pop("plan_agent_version_control", UNSET) - ) - - def _parse_plan_api_access(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - plan_api_access = _parse_plan_api_access(d.pop("plan_api_access", UNSET)) - - def _parse_plan_crawl_session_page_limit(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - plan_crawl_session_page_limit = _parse_plan_crawl_session_page_limit( - d.pop("plan_crawl_session_page_limit", UNSET) - ) - - def _parse_plan_max_agents(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - plan_max_agents = _parse_plan_max_agents(d.pop("plan_max_agents", UNSET)) - - def _parse_plan_max_organization_members(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - plan_max_organization_members = _parse_plan_max_organization_members( - d.pop("plan_max_organization_members", UNSET) - ) - - def _parse_plan_max_organizations(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - plan_max_organizations = _parse_plan_max_organizations( - d.pop("plan_max_organizations", UNSET) - ) - - def _parse_plan_monthly_credits(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - plan_monthly_credits = _parse_plan_monthly_credits( - d.pop("plan_monthly_credits", UNSET) - ) - - def _parse_plan_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - plan_name = _parse_plan_name(d.pop("plan_name", UNSET)) - - def _parse_plan_support(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - plan_support = _parse_plan_support(d.pop("plan_support", UNSET)) - - readonly = d.pop("readonly", UNSET) - - def _parse_sources(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - sources = _parse_sources(d.pop("sources", UNSET)) - - def _parse_status(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - status = _parse_status(d.pop("status", UNSET)) - - def _parse_subscription_period_credits(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - subscription_period_credits = _parse_subscription_period_credits( - d.pop("subscription_period_credits", UNSET) - ) - - def _parse_subscription_period_end(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - subscription_period_end = _parse_subscription_period_end( - d.pop("subscription_period_end", UNSET) - ) - - def _parse_subscription_period_initial_credits( - data: object, - ) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - subscription_period_initial_credits = ( - _parse_subscription_period_initial_credits( - d.pop("subscription_period_initial_credits", UNSET) - ) - ) - - def _parse_subscription_period_start(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - subscription_period_start = _parse_subscription_period_start( - d.pop("subscription_period_start", UNSET) - ) - - def _parse_trial_days_available(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - trial_days_available = _parse_trial_days_available( - d.pop("trial_days_available", UNSET) - ) - - account_details_response = cls( - account_credits=account_credits, - accounts=accounts, - auto_purchase_overages=auto_purchase_overages, - days_until_content_deletion=days_until_content_deletion, - id=id, - knowledge_bases=knowledge_bases, - name=name, - pending_plan_monthly_credits=pending_plan_monthly_credits, - pending_plan_name=pending_plan_name, - pending_subscription_start_date=pending_subscription_start_date, - plan_agent_version_control=plan_agent_version_control, - plan_api_access=plan_api_access, - plan_crawl_session_page_limit=plan_crawl_session_page_limit, - plan_max_agents=plan_max_agents, - plan_max_organization_members=plan_max_organization_members, - plan_max_organizations=plan_max_organizations, - plan_monthly_credits=plan_monthly_credits, - plan_name=plan_name, - plan_support=plan_support, - readonly=readonly, - sources=sources, - status=status, - subscription_period_credits=subscription_period_credits, - subscription_period_end=subscription_period_end, - subscription_period_initial_credits=subscription_period_initial_credits, - subscription_period_start=subscription_period_start, - trial_days_available=trial_days_available, - ) - - account_details_response.additional_properties = d - return account_details_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/seclai/_generated/seclai_api_client/models/account_response.py b/seclai/_generated/seclai_api_client/models/account_response.py deleted file mode 100644 index da1b7fb..0000000 --- a/seclai/_generated/seclai_api_client/models/account_response.py +++ /dev/null @@ -1,83 +0,0 @@ -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 - -T = TypeVar("T", bound="AccountResponse") - - -@_attrs_define -class AccountResponse: - """ - Attributes: - account_id (str): - ended_at (None | str): - started_at (str): - """ - - account_id: str - ended_at: None | str - started_at: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - ended_at: None | str - ended_at = self.ended_at - - started_at = self.started_at - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_id": account_id, - "ended_at": ended_at, - "started_at": started_at, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("account_id") - - def _parse_ended_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - ended_at = _parse_ended_at(d.pop("ended_at")) - - started_at = d.pop("started_at") - - account_response = cls( - account_id=account_id, - ended_at=ended_at, - started_at=started_at, - ) - - account_response.additional_properties = d - return account_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/seclai/_generated/seclai_api_client/models/activity_budget_response.py b/seclai/_generated/seclai_api_client/models/activity_budget_response.py deleted file mode 100644 index 16d96e0..0000000 --- a/seclai/_generated/seclai_api_client/models/activity_budget_response.py +++ /dev/null @@ -1,78 +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="ActivityBudgetResponse") - - -@_attrs_define -class ActivityBudgetResponse: - """Response model for budget operations. - - Attributes: - activity (str): - budget_limit (int): - stop_usage_at_limit (bool): - """ - - activity: str - budget_limit: int - stop_usage_at_limit: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - activity = self.activity - - budget_limit = self.budget_limit - - stop_usage_at_limit = self.stop_usage_at_limit - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "activity": activity, - "budget_limit": budget_limit, - "stop_usage_at_limit": stop_usage_at_limit, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - activity = d.pop("activity") - - budget_limit = d.pop("budget_limit") - - stop_usage_at_limit = d.pop("stop_usage_at_limit") - - activity_budget_response = cls( - activity=activity, - budget_limit=budget_limit, - stop_usage_at_limit=stop_usage_at_limit, - ) - - activity_budget_response.additional_properties = d - return activity_budget_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/seclai/_generated/seclai_api_client/models/activity_credit_usage_response.py b/seclai/_generated/seclai_api_client/models/activity_credit_usage_response.py deleted file mode 100644 index 81788d8..0000000 --- a/seclai/_generated/seclai_api_client/models/activity_credit_usage_response.py +++ /dev/null @@ -1,77 +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="ActivityCreditUsageResponse") - - -@_attrs_define -class ActivityCreditUsageResponse: - """ - Attributes: - activity (str): - credits_ (float): - origin (str): - """ - - activity: str - credits_: float - origin: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - activity = self.activity - - credits_ = self.credits_ - - origin = self.origin - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "activity": activity, - "credits": credits_, - "origin": origin, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - activity = d.pop("activity") - - credits_ = d.pop("credits") - - origin = d.pop("origin") - - activity_credit_usage_response = cls( - activity=activity, - credits_=credits_, - origin=origin, - ) - - activity_credit_usage_response.additional_properties = d - return activity_credit_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/seclai/_generated/seclai_api_client/models/agent_list_response.py b/seclai/_generated/seclai_api_client/models/agent_list_response.py deleted file mode 100644 index c6cda89..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_list_response.py +++ /dev/null @@ -1,76 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="AgentListResponse") - - -@_attrs_define -class AgentListResponse: - """Response model for paginated agent list - - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - agent_list_response = cls( - data=data, - pagination=pagination, - ) - - agent_list_response.additional_properties = d - return agent_list_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/seclai/_generated/seclai_api_client/models/agent_response.py b/seclai/_generated/seclai_api_client/models/agent_response.py deleted file mode 100644 index bf1f9bf..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_response.py +++ /dev/null @@ -1,154 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.branch_summary_response import BranchSummaryResponse - - -T = TypeVar("T", bound="AgentResponse") - - -@_attrs_define -class AgentResponse: - """Response model for agent data - - Attributes: - branches (list[BranchSummaryResponse]): - created_at (str): - description (None | str): - id (UUID): - name (str): - updated_at (str): - has_scheduled_runs (bool | Unset): Default: False. - trigger_type (None | str | Unset): - """ - - branches: list[BranchSummaryResponse] - created_at: str - description: None | str - id: UUID - name: str - updated_at: str - has_scheduled_runs: bool | Unset = False - trigger_type: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - branches = [] - for branches_item_data in self.branches: - branches_item = branches_item_data.to_dict() - branches.append(branches_item) - - created_at = self.created_at - - description: None | str - description = self.description - - id = str(self.id) - - name = self.name - - updated_at = self.updated_at - - has_scheduled_runs = self.has_scheduled_runs - - trigger_type: None | str | Unset - if isinstance(self.trigger_type, Unset): - trigger_type = UNSET - else: - trigger_type = self.trigger_type - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "branches": branches, - "created_at": created_at, - "description": description, - "id": id, - "name": name, - "updated_at": updated_at, - } - ) - if has_scheduled_runs is not UNSET: - field_dict["has_scheduled_runs"] = has_scheduled_runs - if trigger_type is not UNSET: - field_dict["trigger_type"] = trigger_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.branch_summary_response import BranchSummaryResponse - - d = dict(src_dict) - branches = [] - _branches = d.pop("branches") - for branches_item_data in _branches: - branches_item = BranchSummaryResponse.from_dict(branches_item_data) - - branches.append(branches_item) - - created_at = d.pop("created_at") - - def _parse_description(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - description = _parse_description(d.pop("description")) - - id = UUID(d.pop("id")) - - name = d.pop("name") - - updated_at = d.pop("updated_at") - - has_scheduled_runs = d.pop("has_scheduled_runs", UNSET) - - def _parse_trigger_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trigger_type = _parse_trigger_type(d.pop("trigger_type", UNSET)) - - agent_response = cls( - branches=branches, - created_at=created_at, - description=description, - id=id, - name=name, - updated_at=updated_at, - has_scheduled_runs=has_scheduled_runs, - trigger_type=trigger_type, - ) - - agent_response.additional_properties = d - return agent_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/seclai/_generated/seclai_api_client/models/agent_run_attempt_response.py b/seclai/_generated/seclai_api_client/models/agent_run_attempt_response.py deleted file mode 100644 index d38b013..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_run_attempt_response.py +++ /dev/null @@ -1,122 +0,0 @@ -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 ..models.pending_processing_completed_failed_status import ( - PendingProcessingCompletedFailedStatus, -) - -T = TypeVar("T", bound="AgentRunAttemptResponse") - - -@_attrs_define -class AgentRunAttemptResponse: - """ - Attributes: - duration (float | None): Duration of the attempt in seconds. - ended_at (None | str): Timestamp when the attempt ended. - error (None | str): Error message if the attempt failed. - started_at (None | str): Timestamp when the attempt started. - status (PendingProcessingCompletedFailedStatus): - """ - - duration: float | None - ended_at: None | str - error: None | str - started_at: None | str - status: PendingProcessingCompletedFailedStatus - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - duration: float | None - duration = self.duration - - ended_at: None | str - ended_at = self.ended_at - - error: None | str - error = self.error - - started_at: None | str - started_at = self.started_at - - status = self.status.value - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "duration": duration, - "ended_at": ended_at, - "error": error, - "started_at": started_at, - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_duration(data: object) -> float | None: - if data is None: - return data - return cast(float | None, data) - - duration = _parse_duration(d.pop("duration")) - - def _parse_ended_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - ended_at = _parse_ended_at(d.pop("ended_at")) - - def _parse_error(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - error = _parse_error(d.pop("error")) - - def _parse_started_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - started_at = _parse_started_at(d.pop("started_at")) - - status = PendingProcessingCompletedFailedStatus(d.pop("status")) - - agent_run_attempt_response = cls( - duration=duration, - ended_at=ended_at, - error=error, - started_at=started_at, - status=status, - ) - - agent_run_attempt_response.additional_properties = d - return agent_run_attempt_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/seclai/_generated/seclai_api_client/models/agent_run_details_response.py b/seclai/_generated/seclai_api_client/models/agent_run_details_response.py deleted file mode 100644 index c7b6d88..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_run_details_response.py +++ /dev/null @@ -1,160 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.agent_run_details_response_metadata_type_0 import ( - AgentRunDetailsResponseMetadataType0, - ) - from ..models.agent_run_step_details_response import AgentRunStepDetailsResponse - - -T = TypeVar("T", bound="AgentRunDetailsResponse") - - -@_attrs_define -class AgentRunDetailsResponse: - """Response model for agent run details used by the run history details view. - - Attributes: - agent_id (UUID): - input_ (None | str): - metadata (AgentRunDetailsResponseMetadataType0 | None): - mode (str): - run_id (UUID): - status (str): - steps (list[AgentRunStepDetailsResponse]): - """ - - agent_id: UUID - input_: None | str - metadata: AgentRunDetailsResponseMetadataType0 | None - mode: str - run_id: UUID - status: str - steps: list[AgentRunStepDetailsResponse] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.agent_run_details_response_metadata_type_0 import ( - AgentRunDetailsResponseMetadataType0, - ) - - agent_id = str(self.agent_id) - - input_: None | str - input_ = self.input_ - - metadata: dict[str, Any] | None - if isinstance(self.metadata, AgentRunDetailsResponseMetadataType0): - metadata = self.metadata.to_dict() - else: - metadata = self.metadata - - mode = self.mode - - run_id = str(self.run_id) - - status = self.status - - steps = [] - for steps_item_data in self.steps: - steps_item = steps_item_data.to_dict() - steps.append(steps_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_id": agent_id, - "input": input_, - "metadata": metadata, - "mode": mode, - "run_id": run_id, - "status": status, - "steps": steps, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_run_details_response_metadata_type_0 import ( - AgentRunDetailsResponseMetadataType0, - ) - from ..models.agent_run_step_details_response import AgentRunStepDetailsResponse - - d = dict(src_dict) - agent_id = UUID(d.pop("agent_id")) - - def _parse_input_(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - input_ = _parse_input_(d.pop("input")) - - def _parse_metadata( - data: object, - ) -> AgentRunDetailsResponseMetadataType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_type_0 = AgentRunDetailsResponseMetadataType0.from_dict(data) - - return metadata_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentRunDetailsResponseMetadataType0 | None, data) - - metadata = _parse_metadata(d.pop("metadata")) - - mode = d.pop("mode") - - run_id = UUID(d.pop("run_id")) - - status = d.pop("status") - - steps = [] - _steps = d.pop("steps") - for steps_item_data in _steps: - steps_item = AgentRunStepDetailsResponse.from_dict(steps_item_data) - - steps.append(steps_item) - - agent_run_details_response = cls( - agent_id=agent_id, - input_=input_, - metadata=metadata, - mode=mode, - run_id=run_id, - status=status, - steps=steps, - ) - - agent_run_details_response.additional_properties = d - return agent_run_details_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/seclai/_generated/seclai_api_client/models/agent_run_details_response_metadata_type_0.py b/seclai/_generated/seclai_api_client/models/agent_run_details_response_metadata_type_0.py deleted file mode 100644 index 2fb24ff..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_run_details_response_metadata_type_0.py +++ /dev/null @@ -1,46 +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="AgentRunDetailsResponseMetadataType0") - - -@_attrs_define -class AgentRunDetailsResponseMetadataType0: - """ """ - - additional_properties: dict[str, Any] = _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_run_details_response_metadata_type_0 = cls() - - agent_run_details_response_metadata_type_0.additional_properties = d - return agent_run_details_response_metadata_type_0 - - @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/seclai/_generated/seclai_api_client/models/agent_run_list_response.py b/seclai/_generated/seclai_api_client/models/agent_run_list_response.py deleted file mode 100644 index f799b86..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_run_list_response.py +++ /dev/null @@ -1,85 +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.agent_run_response import AgentRunResponse - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="AgentRunListResponse") - - -@_attrs_define -class AgentRunListResponse: - """ - Attributes: - data (list[AgentRunResponse]): List of agent runs. - pagination (PaginationResponse): Pagination information. - """ - - data: list[AgentRunResponse] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_run_response import AgentRunResponse - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = AgentRunResponse.from_dict(data_item_data) - - data.append(data_item) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - agent_run_list_response = cls( - data=data, - pagination=pagination, - ) - - agent_run_list_response.additional_properties = d - return agent_run_list_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/seclai/_generated/seclai_api_client/models/agent_run_request.py b/seclai/_generated/seclai_api_client/models/agent_run_request.py deleted file mode 100644 index 8f08c65..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_run_request.py +++ /dev/null @@ -1,117 +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.agent_run_request_metadata_type_0 import AgentRunRequestMetadataType0 - - -T = TypeVar("T", bound="AgentRunRequest") - - -@_attrs_define -class AgentRunRequest: - """ - Attributes: - input_ (None | str): Input to provide to the agent upon running for agents with dynamic triggers. - metadata (AgentRunRequestMetadataType0 | None): Metadata to make available for string substitution expressions - in agent tasks. - priority (bool | Unset): If true, the agent run will be treated as priority execution. Default: False. - """ - - input_: None | str - metadata: AgentRunRequestMetadataType0 | None - priority: bool | Unset = False - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.agent_run_request_metadata_type_0 import ( - AgentRunRequestMetadataType0, - ) - - input_: None | str - input_ = self.input_ - - metadata: dict[str, Any] | None - if isinstance(self.metadata, AgentRunRequestMetadataType0): - metadata = self.metadata.to_dict() - else: - metadata = self.metadata - - priority = self.priority - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "input": input_, - "metadata": metadata, - } - ) - if priority is not UNSET: - field_dict["priority"] = priority - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_run_request_metadata_type_0 import ( - AgentRunRequestMetadataType0, - ) - - d = dict(src_dict) - - def _parse_input_(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - input_ = _parse_input_(d.pop("input")) - - def _parse_metadata(data: object) -> AgentRunRequestMetadataType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_type_0 = AgentRunRequestMetadataType0.from_dict(data) - - return metadata_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentRunRequestMetadataType0 | None, data) - - metadata = _parse_metadata(d.pop("metadata")) - - priority = d.pop("priority", UNSET) - - agent_run_request = cls( - input_=input_, - metadata=metadata, - priority=priority, - ) - - agent_run_request.additional_properties = d - return agent_run_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/seclai/_generated/seclai_api_client/models/agent_run_request_metadata_type_0.py b/seclai/_generated/seclai_api_client/models/agent_run_request_metadata_type_0.py deleted file mode 100644 index d133748..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_run_request_metadata_type_0.py +++ /dev/null @@ -1,46 +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="AgentRunRequestMetadataType0") - - -@_attrs_define -class AgentRunRequestMetadataType0: - """ """ - - additional_properties: dict[str, Any] = _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_run_request_metadata_type_0 = cls() - - agent_run_request_metadata_type_0.additional_properties = d - return agent_run_request_metadata_type_0 - - @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/seclai/_generated/seclai_api_client/models/agent_run_response.py b/seclai/_generated/seclai_api_client/models/agent_run_response.py deleted file mode 100644 index cfcce57..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_run_response.py +++ /dev/null @@ -1,153 +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.pending_processing_completed_failed_status import ( - PendingProcessingCompletedFailedStatus, -) - -if TYPE_CHECKING: - from ..models.agent_run_attempt_response import AgentRunAttemptResponse - - -T = TypeVar("T", bound="AgentRunResponse") - - -@_attrs_define -class AgentRunResponse: - """ - Attributes: - attempts (list[AgentRunAttemptResponse]): List of attempts made for this agent run. - credits_ (float | None): Credits consumed by the agent run, if applicable. - error_count (int): Number of errors encountered during the run. - input_ (None | str): Input provided to the agent for this run. - output (None | str): Output produced by the agent run. - priority (bool): Indicates if the run was treated as a priority execution. - run_id (str): Unique identifier for the agent run. - status (PendingProcessingCompletedFailedStatus): - """ - - attempts: list[AgentRunAttemptResponse] - credits_: float | None - error_count: int - input_: None | str - output: None | str - priority: bool - run_id: str - status: PendingProcessingCompletedFailedStatus - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - attempts = [] - for attempts_item_data in self.attempts: - attempts_item = attempts_item_data.to_dict() - attempts.append(attempts_item) - - credits_: float | None - credits_ = self.credits_ - - error_count = self.error_count - - input_: None | str - input_ = self.input_ - - output: None | str - output = self.output - - priority = self.priority - - run_id = self.run_id - - status = self.status.value - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "attempts": attempts, - "credits": credits_, - "error_count": error_count, - "input": input_, - "output": output, - "priority": priority, - "run_id": run_id, - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_run_attempt_response import AgentRunAttemptResponse - - d = dict(src_dict) - attempts = [] - _attempts = d.pop("attempts") - for attempts_item_data in _attempts: - attempts_item = AgentRunAttemptResponse.from_dict(attempts_item_data) - - attempts.append(attempts_item) - - def _parse_credits_(data: object) -> float | None: - if data is None: - return data - return cast(float | None, data) - - credits_ = _parse_credits_(d.pop("credits")) - - error_count = d.pop("error_count") - - def _parse_input_(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - input_ = _parse_input_(d.pop("input")) - - def _parse_output(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - output = _parse_output(d.pop("output")) - - priority = d.pop("priority") - - run_id = d.pop("run_id") - - status = PendingProcessingCompletedFailedStatus(d.pop("status")) - - agent_run_response = cls( - attempts=attempts, - credits_=credits_, - error_count=error_count, - input_=input_, - output=output, - priority=priority, - run_id=run_id, - status=status, - ) - - agent_run_response.additional_properties = d - return agent_run_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/seclai/_generated/seclai_api_client/models/agent_run_status_response.py b/seclai/_generated/seclai_api_client/models/agent_run_status_response.py deleted file mode 100644 index 9cee640..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_run_status_response.py +++ /dev/null @@ -1,157 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, 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="AgentRunStatusResponse") - - -@_attrs_define -class AgentRunStatusResponse: - """Response model for agent run status and optional display output. - - Attributes: - agent_id (UUID): - run_id (UUID): - status (str): - steps_completed (int): - steps_total (int): - credits_used (float | None | Unset): - error (None | str | Unset): - output (None | str | Unset): - """ - - agent_id: UUID - run_id: UUID - status: str - steps_completed: int - steps_total: int - credits_used: float | None | Unset = UNSET - error: None | str | Unset = UNSET - output: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_id = str(self.agent_id) - - run_id = str(self.run_id) - - status = self.status - - steps_completed = self.steps_completed - - steps_total = self.steps_total - - credits_used: float | None | Unset - if isinstance(self.credits_used, Unset): - credits_used = UNSET - else: - credits_used = self.credits_used - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - output: None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - else: - output = self.output - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_id": agent_id, - "run_id": run_id, - "status": status, - "steps_completed": steps_completed, - "steps_total": steps_total, - } - ) - if credits_used is not UNSET: - field_dict["credits_used"] = credits_used - if error is not UNSET: - field_dict["error"] = error - if output is not UNSET: - field_dict["output"] = output - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_id = UUID(d.pop("agent_id")) - - run_id = UUID(d.pop("run_id")) - - status = d.pop("status") - - steps_completed = d.pop("steps_completed") - - steps_total = d.pop("steps_total") - - def _parse_credits_used(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - credits_used = _parse_credits_used(d.pop("credits_used", UNSET)) - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - agent_run_status_response = cls( - agent_id=agent_id, - run_id=run_id, - status=status, - steps_completed=steps_completed, - steps_total=steps_total, - credits_used=credits_used, - error=error, - output=output, - ) - - agent_run_status_response.additional_properties = d - return agent_run_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/seclai/_generated/seclai_api_client/models/agent_run_step_details_response.py b/seclai/_generated/seclai_api_client/models/agent_run_step_details_response.py deleted file mode 100644 index a533aac..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_run_step_details_response.py +++ /dev/null @@ -1,190 +0,0 @@ -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="AgentRunStepDetailsResponse") - - -@_attrs_define -class AgentRunStepDetailsResponse: - """Response model for detailed per-step run information. - - Attributes: - agent_step_id (str): - credits_used (float | None): - duration_seconds (float | None): - ended_at (None | str): - error (None | str): - input_ (None | str): - output (None | str): - started_at (None | str): - status (str): - step_type (None | str | Unset): - """ - - agent_step_id: str - credits_used: float | None - duration_seconds: float | None - ended_at: None | str - error: None | str - input_: None | str - output: None | str - started_at: None | str - status: str - step_type: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_step_id = self.agent_step_id - - credits_used: float | None - credits_used = self.credits_used - - duration_seconds: float | None - duration_seconds = self.duration_seconds - - ended_at: None | str - ended_at = self.ended_at - - error: None | str - error = self.error - - input_: None | str - input_ = self.input_ - - output: None | str - output = self.output - - started_at: None | str - started_at = self.started_at - - status = self.status - - step_type: None | str | Unset - if isinstance(self.step_type, Unset): - step_type = UNSET - else: - step_type = self.step_type - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_step_id": agent_step_id, - "credits_used": credits_used, - "duration_seconds": duration_seconds, - "ended_at": ended_at, - "error": error, - "input": input_, - "output": output, - "started_at": started_at, - "status": status, - } - ) - if step_type is not UNSET: - field_dict["step_type"] = step_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_step_id = d.pop("agent_step_id") - - def _parse_credits_used(data: object) -> float | None: - if data is None: - return data - return cast(float | None, data) - - credits_used = _parse_credits_used(d.pop("credits_used")) - - def _parse_duration_seconds(data: object) -> float | None: - if data is None: - return data - return cast(float | None, data) - - duration_seconds = _parse_duration_seconds(d.pop("duration_seconds")) - - def _parse_ended_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - ended_at = _parse_ended_at(d.pop("ended_at")) - - def _parse_error(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - error = _parse_error(d.pop("error")) - - def _parse_input_(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - input_ = _parse_input_(d.pop("input")) - - def _parse_output(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - output = _parse_output(d.pop("output")) - - def _parse_started_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - started_at = _parse_started_at(d.pop("started_at")) - - status = d.pop("status") - - def _parse_step_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - step_type = _parse_step_type(d.pop("step_type", UNSET)) - - agent_run_step_details_response = cls( - agent_step_id=agent_step_id, - credits_used=credits_used, - duration_seconds=duration_seconds, - ended_at=ended_at, - error=error, - input_=input_, - output=output, - started_at=started_at, - status=status, - step_type=step_type, - ) - - agent_run_step_details_response.additional_properties = d - return agent_run_step_details_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/seclai/_generated/seclai_api_client/models/agent_run_summary_response.py b/seclai/_generated/seclai_api_client/models/agent_run_summary_response.py deleted file mode 100644 index cea2a4c..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_run_summary_response.py +++ /dev/null @@ -1,183 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, 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="AgentRunSummaryResponse") - - -@_attrs_define -class AgentRunSummaryResponse: - """Response model for a single agent run summary - - Attributes: - agent_id (UUID): - created_at (str): - id (UUID): - mode (str): - status (str): - updated_at (str): - completed_at (None | str | Unset): - credits_used (float | None | Unset): - started_at (None | str | Unset): - steps_completed (int | Unset): Default: 0. - steps_total (int | Unset): Default: 0. - """ - - agent_id: UUID - created_at: str - id: UUID - mode: str - status: str - updated_at: str - completed_at: None | str | Unset = UNSET - credits_used: float | None | Unset = UNSET - started_at: None | str | Unset = UNSET - steps_completed: int | Unset = 0 - steps_total: int | Unset = 0 - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_id = str(self.agent_id) - - created_at = self.created_at - - id = str(self.id) - - mode = self.mode - - status = self.status - - updated_at = self.updated_at - - completed_at: None | str | Unset - if isinstance(self.completed_at, Unset): - completed_at = UNSET - else: - completed_at = self.completed_at - - credits_used: float | None | Unset - if isinstance(self.credits_used, Unset): - credits_used = UNSET - else: - credits_used = self.credits_used - - started_at: None | str | Unset - if isinstance(self.started_at, Unset): - started_at = UNSET - else: - started_at = self.started_at - - steps_completed = self.steps_completed - - steps_total = self.steps_total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_id": agent_id, - "created_at": created_at, - "id": id, - "mode": mode, - "status": status, - "updated_at": updated_at, - } - ) - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - if credits_used is not UNSET: - field_dict["credits_used"] = credits_used - if started_at is not UNSET: - field_dict["started_at"] = started_at - if steps_completed is not UNSET: - field_dict["steps_completed"] = steps_completed - if steps_total is not UNSET: - field_dict["steps_total"] = steps_total - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_id = UUID(d.pop("agent_id")) - - created_at = d.pop("created_at") - - id = UUID(d.pop("id")) - - mode = d.pop("mode") - - status = d.pop("status") - - updated_at = d.pop("updated_at") - - def _parse_completed_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) - - def _parse_credits_used(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - credits_used = _parse_credits_used(d.pop("credits_used", UNSET)) - - def _parse_started_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - started_at = _parse_started_at(d.pop("started_at", UNSET)) - - steps_completed = d.pop("steps_completed", UNSET) - - steps_total = d.pop("steps_total", UNSET) - - agent_run_summary_response = cls( - agent_id=agent_id, - created_at=created_at, - id=id, - mode=mode, - status=status, - updated_at=updated_at, - completed_at=completed_at, - credits_used=credits_used, - started_at=started_at, - steps_completed=steps_completed, - steps_total=steps_total, - ) - - agent_run_summary_response.additional_properties = d - return agent_run_summary_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/seclai/_generated/seclai_api_client/models/agent_trigger_frequency.py b/seclai/_generated/seclai_api_client/models/agent_trigger_frequency.py deleted file mode 100644 index d1933de..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_trigger_frequency.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class AgentTriggerFrequency(str, Enum): - DAILY = "daily" - HOURLY = "hourly" - MONTHLY = "monthly" - WEEKLY = "weekly" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/agent_trigger_type.py b/seclai/_generated/seclai_api_client/models/agent_trigger_type.py deleted file mode 100644 index df0f9c0..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_trigger_type.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class AgentTriggerType(str, Enum): - CONTENT_ADDED = "content_added" - CONTENT_ADDED_OR_UPDATED = "content_added_or_updated" - CONTENT_UPDATED = "content_updated" - DYNAMIC_INPUT = "dynamic_input" - TEMPLATE_INPUT = "template_input" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/agent_warning_model.py b/seclai/_generated/seclai_api_client/models/agent_warning_model.py deleted file mode 100644 index a93f01a..0000000 --- a/seclai/_generated/seclai_api_client/models/agent_warning_model.py +++ /dev/null @@ -1,81 +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 - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="AgentWarningModel") - - -@_attrs_define -class AgentWarningModel: - """Warning about potential issues in an agent - - Attributes: - message (str): - step_path (str): - severity (str | Unset): Default: 'warning'. - """ - - message: str - step_path: str - severity: str | Unset = "warning" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - message = self.message - - step_path = self.step_path - - severity = self.severity - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "message": message, - "step_path": step_path, - } - ) - if severity is not UNSET: - field_dict["severity"] = severity - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - message = d.pop("message") - - step_path = d.pop("step_path") - - severity = d.pop("severity", UNSET) - - agent_warning_model = cls( - message=message, - step_path=step_path, - severity=severity, - ) - - agent_warning_model.additional_properties = d - return agent_warning_model - - @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/seclai/_generated/seclai_api_client/models/analyze_substitutions_request.py b/seclai/_generated/seclai_api_client/models/analyze_substitutions_request.py deleted file mode 100644 index 5523896..0000000 --- a/seclai/_generated/seclai_api_client/models/analyze_substitutions_request.py +++ /dev/null @@ -1,62 +0,0 @@ -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 - -T = TypeVar("T", bound="AnalyzeSubstitutionsRequest") - - -@_attrs_define -class AnalyzeSubstitutionsRequest: - """Request to analyze string substitutions in templates. - - Attributes: - templates (list[str]): List of template strings to analyze for substitutions - """ - - templates: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - templates = self.templates - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "templates": templates, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - templates = cast(list[str], d.pop("templates")) - - analyze_substitutions_request = cls( - templates=templates, - ) - - analyze_substitutions_request.additional_properties = d - return analyze_substitutions_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/seclai/_generated/seclai_api_client/models/analyze_substitutions_response.py b/seclai/_generated/seclai_api_client/models/analyze_substitutions_response.py deleted file mode 100644 index f40f427..0000000 --- a/seclai/_generated/seclai_api_client/models/analyze_substitutions_response.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.substitution_dependencies import SubstitutionDependencies - - -T = TypeVar("T", bound="AnalyzeSubstitutionsResponse") - - -@_attrs_define -class AnalyzeSubstitutionsResponse: - """Response with analyzed substitution dependencies. - - Attributes: - dependencies (SubstitutionDependencies): Dependencies found in templates. - """ - - dependencies: SubstitutionDependencies - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - dependencies = self.dependencies.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "dependencies": dependencies, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.substitution_dependencies import SubstitutionDependencies - - d = dict(src_dict) - dependencies = SubstitutionDependencies.from_dict(d.pop("dependencies")) - - analyze_substitutions_response = cls( - dependencies=dependencies, - ) - - analyze_substitutions_response.additional_properties = d - return analyze_substitutions_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/seclai/_generated/seclai_api_client/models/api_call_list_response.py b/seclai/_generated/seclai_api_client/models/api_call_list_response.py deleted file mode 100644 index 606cd17..0000000 --- a/seclai/_generated/seclai_api_client/models/api_call_list_response.py +++ /dev/null @@ -1,75 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="ApiCallListResponse") - - -@_attrs_define -class ApiCallListResponse: - """ - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - api_call_list_response = cls( - data=data, - pagination=pagination, - ) - - api_call_list_response.additional_properties = d - return api_call_list_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/seclai/_generated/seclai_api_client/models/api_key_create_request.py b/seclai/_generated/seclai_api_client/models/api_key_create_request.py deleted file mode 100644 index 953d5cb..0000000 --- a/seclai/_generated/seclai_api_client/models/api_key_create_request.py +++ /dev/null @@ -1,73 +0,0 @@ -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="ApiKeyCreateRequest") - - -@_attrs_define -class ApiKeyCreateRequest: - """ - Attributes: - name (None | str | Unset): Optional name for the API key - """ - - name: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - api_key_create_request = cls( - name=name, - ) - - api_key_create_request.additional_properties = d - return api_key_create_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/seclai/_generated/seclai_api_client/models/api_key_create_response.py b/seclai/_generated/seclai_api_client/models/api_key_create_response.py deleted file mode 100644 index 752655e..0000000 --- a/seclai/_generated/seclai_api_client/models/api_key_create_response.py +++ /dev/null @@ -1,91 +0,0 @@ -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 - -T = TypeVar("T", bound="ApiKeyCreateResponse") - - -@_attrs_define -class ApiKeyCreateResponse: - """ - Attributes: - created_at (str): - id (str): - key (str): - name (None | str): - """ - - created_at: str - id: str - key: str - name: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at - - id = self.id - - key = self.key - - name: None | str - name = self.name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "created_at": created_at, - "id": id, - "key": key, - "name": name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created_at = d.pop("created_at") - - id = d.pop("id") - - key = d.pop("key") - - def _parse_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - name = _parse_name(d.pop("name")) - - api_key_create_response = cls( - created_at=created_at, - id=id, - key=key, - name=name, - ) - - api_key_create_response.additional_properties = d - return api_key_create_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/seclai/_generated/seclai_api_client/models/api_key_list_item_response.py b/seclai/_generated/seclai_api_client/models/api_key_list_item_response.py deleted file mode 100644 index 24cf21f..0000000 --- a/seclai/_generated/seclai_api_client/models/api_key_list_item_response.py +++ /dev/null @@ -1,97 +0,0 @@ -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 - -T = TypeVar("T", bound="ApiKeyListItemResponse") - - -@_attrs_define -class ApiKeyListItemResponse: - """ - Attributes: - created_at (str): - id (str): - last_used_at (None | str): - name (None | str): - """ - - created_at: str - id: str - last_used_at: None | str - name: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at - - id = self.id - - last_used_at: None | str - last_used_at = self.last_used_at - - name: None | str - name = self.name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "created_at": created_at, - "id": id, - "last_used_at": last_used_at, - "name": name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created_at = d.pop("created_at") - - id = d.pop("id") - - def _parse_last_used_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - last_used_at = _parse_last_used_at(d.pop("last_used_at")) - - def _parse_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - name = _parse_name(d.pop("name")) - - api_key_list_item_response = cls( - created_at=created_at, - id=id, - last_used_at=last_used_at, - name=name, - ) - - api_key_list_item_response.additional_properties = d - return api_key_list_item_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/seclai/_generated/seclai_api_client/models/api_key_list_response.py b/seclai/_generated/seclai_api_client/models/api_key_list_response.py deleted file mode 100644 index 2cfb2f4..0000000 --- a/seclai/_generated/seclai_api_client/models/api_key_list_response.py +++ /dev/null @@ -1,75 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="ApiKeyListResponse") - - -@_attrs_define -class ApiKeyListResponse: - """ - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - api_key_list_response = cls( - data=data, - pagination=pagination, - ) - - api_key_list_response.additional_properties = d - return api_key_list_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/seclai/_generated/seclai_api_client/models/body_upload_file_to_source_api_sources_source_connection_id_upload_post.py b/seclai/_generated/seclai_api_client/models/body_upload_file_to_source_api_sources_source_connection_id_upload_post.py deleted file mode 100644 index 73507a6..0000000 --- a/seclai/_generated/seclai_api_client/models/body_upload_file_to_source_api_sources_source_connection_id_upload_post.py +++ /dev/null @@ -1,89 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from io import BytesIO -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from .. import types -from ..types import UNSET, File, Unset - -T = TypeVar("T", bound="BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost") - - -@_attrs_define -class BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost: - """ - Attributes: - file (File): File to upload - title (str | Unset): Optional title for the content - """ - - file: File - title: str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - file = self.file.to_tuple() - - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "file": file, - } - ) - if title is not UNSET: - field_dict["title"] = title - - return field_dict - - def to_multipart(self) -> types.RequestFiles: - files: types.RequestFiles = [] - - files.append(("file", self.file.to_tuple())) - - if not isinstance(self.title, Unset): - files.append(("title", (None, str(self.title).encode(), "text/plain"))) - - for prop_name, prop in self.additional_properties.items(): - files.append((prop_name, (None, str(prop).encode(), "text/plain"))) - - return files - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - file = File(payload=BytesIO(d.pop("file"))) - - title = d.pop("title", UNSET) - - body_upload_file_to_source_api_sources_source_connection_id_upload_post = cls( - file=file, - title=title, - ) - - body_upload_file_to_source_api_sources_source_connection_id_upload_post.additional_properties = ( - d - ) - return body_upload_file_to_source_api_sources_source_connection_id_upload_post - - @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/seclai/_generated/seclai_api_client/models/body_upload_file_to_source_authenticated_sources_source_connection_id_upload_post.py b/seclai/_generated/seclai_api_client/models/body_upload_file_to_source_authenticated_sources_source_connection_id_upload_post.py deleted file mode 100644 index 9443e1a..0000000 --- a/seclai/_generated/seclai_api_client/models/body_upload_file_to_source_authenticated_sources_source_connection_id_upload_post.py +++ /dev/null @@ -1,77 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from io import BytesIO -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, File, Unset - -T = TypeVar( - "T", bound="BodyUploadFileToSourceAuthenticatedSourcesSourceConnectionIdUploadPost" -) - - -@_attrs_define -class BodyUploadFileToSourceAuthenticatedSourcesSourceConnectionIdUploadPost: - """ - Attributes: - file (File): File to upload - title (str | Unset): Optional title for the content - """ - - file: File - title: str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - file = self.file.to_tuple() - - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "file": file, - } - ) - if title is not UNSET: - field_dict["title"] = title - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - file = File(payload=BytesIO(d.pop("file"))) - - title = d.pop("title", UNSET) - - body_upload_file_to_source_authenticated_sources_source_connection_id_upload_post = cls( - file=file, - title=title, - ) - - body_upload_file_to_source_authenticated_sources_source_connection_id_upload_post.additional_properties = ( - d - ) - return body_upload_file_to_source_authenticated_sources_source_connection_id_upload_post - - @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/seclai/_generated/seclai_api_client/models/branch_current_state_response.py b/seclai/_generated/seclai_api_client/models/branch_current_state_response.py deleted file mode 100644 index 6472dac..0000000 --- a/seclai/_generated/seclai_api_client/models/branch_current_state_response.py +++ /dev/null @@ -1,255 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.agent_warning_model import AgentWarningModel - from ..models.branch_current_state_response_definition import ( - BranchCurrentStateResponseDefinition, - ) - from ..models.branch_current_state_response_dependencies_type_0 import ( - BranchCurrentStateResponseDependenciesType0, - ) - - -T = TypeVar("T", bound="BranchCurrentStateResponse") - - -@_attrs_define -class BranchCurrentStateResponse: - """Response model for branch current state data - - Attributes: - branch_id (UUID): - branch_name (str): - change_id (UUID): - created_at (str): - definition (BranchCurrentStateResponseDefinition): - schema_version (str): - user_id (UUID): - user_name (None | str): - dependencies (BranchCurrentStateResponseDependenciesType0 | None | Unset): - success (bool | Unset): Default: True. - trigger_type (None | str | Unset): - warnings (list[AgentWarningModel] | None | Unset): - """ - - branch_id: UUID - branch_name: str - change_id: UUID - created_at: str - definition: BranchCurrentStateResponseDefinition - schema_version: str - user_id: UUID - user_name: None | str - dependencies: BranchCurrentStateResponseDependenciesType0 | None | Unset = UNSET - success: bool | Unset = True - trigger_type: None | str | Unset = UNSET - warnings: list[AgentWarningModel] | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.branch_current_state_response_dependencies_type_0 import ( - BranchCurrentStateResponseDependenciesType0, - ) - - branch_id = str(self.branch_id) - - branch_name = self.branch_name - - change_id = str(self.change_id) - - created_at = self.created_at - - definition = self.definition.to_dict() - - schema_version = self.schema_version - - user_id = str(self.user_id) - - user_name: None | str - user_name = self.user_name - - dependencies: dict[str, Any] | None | Unset - if isinstance(self.dependencies, Unset): - dependencies = UNSET - elif isinstance(self.dependencies, BranchCurrentStateResponseDependenciesType0): - dependencies = self.dependencies.to_dict() - else: - dependencies = self.dependencies - - success = self.success - - trigger_type: None | str | Unset - if isinstance(self.trigger_type, Unset): - trigger_type = UNSET - else: - trigger_type = self.trigger_type - - warnings: list[dict[str, Any]] | None | Unset - if isinstance(self.warnings, Unset): - warnings = UNSET - elif isinstance(self.warnings, list): - warnings = [] - for warnings_type_0_item_data in self.warnings: - warnings_type_0_item = warnings_type_0_item_data.to_dict() - warnings.append(warnings_type_0_item) - - else: - warnings = self.warnings - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "branch_id": branch_id, - "branch_name": branch_name, - "change_id": change_id, - "created_at": created_at, - "definition": definition, - "schema_version": schema_version, - "user_id": user_id, - "user_name": user_name, - } - ) - if dependencies is not UNSET: - field_dict["dependencies"] = dependencies - if success is not UNSET: - field_dict["success"] = success - if trigger_type is not UNSET: - field_dict["trigger_type"] = trigger_type - if warnings is not UNSET: - field_dict["warnings"] = warnings - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_warning_model import AgentWarningModel - from ..models.branch_current_state_response_definition import ( - BranchCurrentStateResponseDefinition, - ) - from ..models.branch_current_state_response_dependencies_type_0 import ( - BranchCurrentStateResponseDependenciesType0, - ) - - d = dict(src_dict) - branch_id = UUID(d.pop("branch_id")) - - branch_name = d.pop("branch_name") - - change_id = UUID(d.pop("change_id")) - - created_at = d.pop("created_at") - - definition = BranchCurrentStateResponseDefinition.from_dict(d.pop("definition")) - - schema_version = d.pop("schema_version") - - user_id = UUID(d.pop("user_id")) - - def _parse_user_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - user_name = _parse_user_name(d.pop("user_name")) - - def _parse_dependencies( - data: object, - ) -> BranchCurrentStateResponseDependenciesType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - dependencies_type_0 = ( - BranchCurrentStateResponseDependenciesType0.from_dict(data) - ) - - return dependencies_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - BranchCurrentStateResponseDependenciesType0 | None | Unset, data - ) - - dependencies = _parse_dependencies(d.pop("dependencies", UNSET)) - - success = d.pop("success", UNSET) - - def _parse_trigger_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trigger_type = _parse_trigger_type(d.pop("trigger_type", UNSET)) - - def _parse_warnings(data: object) -> list[AgentWarningModel] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - warnings_type_0 = [] - _warnings_type_0 = data - for warnings_type_0_item_data in _warnings_type_0: - warnings_type_0_item = AgentWarningModel.from_dict( - warnings_type_0_item_data - ) - - warnings_type_0.append(warnings_type_0_item) - - return warnings_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[AgentWarningModel] | None | Unset, data) - - warnings = _parse_warnings(d.pop("warnings", UNSET)) - - branch_current_state_response = cls( - branch_id=branch_id, - branch_name=branch_name, - change_id=change_id, - created_at=created_at, - definition=definition, - schema_version=schema_version, - user_id=user_id, - user_name=user_name, - dependencies=dependencies, - success=success, - trigger_type=trigger_type, - warnings=warnings, - ) - - branch_current_state_response.additional_properties = d - return branch_current_state_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/seclai/_generated/seclai_api_client/models/branch_current_state_response_definition.py b/seclai/_generated/seclai_api_client/models/branch_current_state_response_definition.py deleted file mode 100644 index 7b73ab0..0000000 --- a/seclai/_generated/seclai_api_client/models/branch_current_state_response_definition.py +++ /dev/null @@ -1,46 +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="BranchCurrentStateResponseDefinition") - - -@_attrs_define -class BranchCurrentStateResponseDefinition: - """ """ - - additional_properties: dict[str, Any] = _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) - branch_current_state_response_definition = cls() - - branch_current_state_response_definition.additional_properties = d - return branch_current_state_response_definition - - @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/seclai/_generated/seclai_api_client/models/branch_current_state_response_dependencies_type_0.py b/seclai/_generated/seclai_api_client/models/branch_current_state_response_dependencies_type_0.py deleted file mode 100644 index aa497a0..0000000 --- a/seclai/_generated/seclai_api_client/models/branch_current_state_response_dependencies_type_0.py +++ /dev/null @@ -1,77 +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.branch_current_state_response_dependencies_type_0_additional_property import ( - BranchCurrentStateResponseDependenciesType0AdditionalProperty, - ) - - -T = TypeVar("T", bound="BranchCurrentStateResponseDependenciesType0") - - -@_attrs_define -class BranchCurrentStateResponseDependenciesType0: - """ """ - - additional_properties: dict[ - str, BranchCurrentStateResponseDependenciesType0AdditionalProperty - ] = _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.branch_current_state_response_dependencies_type_0_additional_property import ( - BranchCurrentStateResponseDependenciesType0AdditionalProperty, - ) - - d = dict(src_dict) - branch_current_state_response_dependencies_type_0 = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = ( - BranchCurrentStateResponseDependenciesType0AdditionalProperty.from_dict( - prop_dict - ) - ) - - additional_properties[prop_name] = additional_property - - branch_current_state_response_dependencies_type_0.additional_properties = ( - additional_properties - ) - return branch_current_state_response_dependencies_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> BranchCurrentStateResponseDependenciesType0AdditionalProperty: - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: BranchCurrentStateResponseDependenciesType0AdditionalProperty, - ) -> 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/seclai/_generated/seclai_api_client/models/branch_current_state_response_dependencies_type_0_additional_property.py b/seclai/_generated/seclai_api_client/models/branch_current_state_response_dependencies_type_0_additional_property.py deleted file mode 100644 index b279b6b..0000000 --- a/seclai/_generated/seclai_api_client/models/branch_current_state_response_dependencies_type_0_additional_property.py +++ /dev/null @@ -1,78 +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.branch_current_state_response_dependencies_type_0_additional_property_additional_property import ( - BranchCurrentStateResponseDependenciesType0AdditionalPropertyAdditionalProperty, - ) - - -T = TypeVar("T", bound="BranchCurrentStateResponseDependenciesType0AdditionalProperty") - - -@_attrs_define -class BranchCurrentStateResponseDependenciesType0AdditionalProperty: - """ """ - - additional_properties: dict[ - str, - BranchCurrentStateResponseDependenciesType0AdditionalPropertyAdditionalProperty, - ] = _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.branch_current_state_response_dependencies_type_0_additional_property_additional_property import ( - BranchCurrentStateResponseDependenciesType0AdditionalPropertyAdditionalProperty, - ) - - d = dict(src_dict) - branch_current_state_response_dependencies_type_0_additional_property = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = BranchCurrentStateResponseDependenciesType0AdditionalPropertyAdditionalProperty.from_dict( - prop_dict - ) - - additional_properties[prop_name] = additional_property - - branch_current_state_response_dependencies_type_0_additional_property.additional_properties = ( - additional_properties - ) - return branch_current_state_response_dependencies_type_0_additional_property - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> ( - BranchCurrentStateResponseDependenciesType0AdditionalPropertyAdditionalProperty - ): - return self.additional_properties[key] - - def __setitem__( - self, - key: str, - value: BranchCurrentStateResponseDependenciesType0AdditionalPropertyAdditionalProperty, - ) -> 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/seclai/_generated/seclai_api_client/models/branch_current_state_response_dependencies_type_0_additional_property_additional_property.py b/seclai/_generated/seclai_api_client/models/branch_current_state_response_dependencies_type_0_additional_property_additional_property.py deleted file mode 100644 index 1868f10..0000000 --- a/seclai/_generated/seclai_api_client/models/branch_current_state_response_dependencies_type_0_additional_property_additional_property.py +++ /dev/null @@ -1,53 +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="BranchCurrentStateResponseDependenciesType0AdditionalPropertyAdditionalProperty", -) - - -@_attrs_define -class BranchCurrentStateResponseDependenciesType0AdditionalPropertyAdditionalProperty: - """ """ - - additional_properties: dict[str, Any] = _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) - branch_current_state_response_dependencies_type_0_additional_property_additional_property = ( - cls() - ) - - branch_current_state_response_dependencies_type_0_additional_property_additional_property.additional_properties = ( - d - ) - return branch_current_state_response_dependencies_type_0_additional_property_additional_property - - @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/seclai/_generated/seclai_api_client/models/branch_summary_response.py b/seclai/_generated/seclai_api_client/models/branch_summary_response.py deleted file mode 100644 index b63ae2a..0000000 --- a/seclai/_generated/seclai_api_client/models/branch_summary_response.py +++ /dev/null @@ -1,103 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="BranchSummaryResponse") - - -@_attrs_define -class BranchSummaryResponse: - """Response model for branch summary data - - Attributes: - id (UUID): - most_recent_change_at (None | str): - most_recent_commit_at (None | str): - name (str): - """ - - id: UUID - most_recent_change_at: None | str - most_recent_commit_at: None | str - name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - id = str(self.id) - - most_recent_change_at: None | str - most_recent_change_at = self.most_recent_change_at - - most_recent_commit_at: None | str - most_recent_commit_at = self.most_recent_commit_at - - name = self.name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "id": id, - "most_recent_change_at": most_recent_change_at, - "most_recent_commit_at": most_recent_commit_at, - "name": name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id = UUID(d.pop("id")) - - def _parse_most_recent_change_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - most_recent_change_at = _parse_most_recent_change_at( - d.pop("most_recent_change_at") - ) - - def _parse_most_recent_commit_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - most_recent_commit_at = _parse_most_recent_commit_at( - d.pop("most_recent_commit_at") - ) - - name = d.pop("name") - - branch_summary_response = cls( - id=id, - most_recent_change_at=most_recent_change_at, - most_recent_commit_at=most_recent_commit_at, - name=name, - ) - - branch_summary_response.additional_properties = d - return branch_summary_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/seclai/_generated/seclai_api_client/models/budget_request.py b/seclai/_generated/seclai_api_client/models/budget_request.py deleted file mode 100644 index d0cbedf..0000000 --- a/seclai/_generated/seclai_api_client/models/budget_request.py +++ /dev/null @@ -1,70 +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="BudgetRequest") - - -@_attrs_define -class BudgetRequest: - """Request model for creating or updating a budget. - - Attributes: - budget_limit (int): Budget limit in appropriate units - stop_usage_at_limit (bool): Whether to stop usage when limit is reached - """ - - budget_limit: int - stop_usage_at_limit: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - budget_limit = self.budget_limit - - stop_usage_at_limit = self.stop_usage_at_limit - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "budget_limit": budget_limit, - "stop_usage_at_limit": stop_usage_at_limit, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - budget_limit = d.pop("budget_limit") - - stop_usage_at_limit = d.pop("stop_usage_at_limit") - - budget_request = cls( - budget_limit=budget_limit, - stop_usage_at_limit=stop_usage_at_limit, - ) - - budget_request.additional_properties = d - return budget_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/seclai/_generated/seclai_api_client/models/change_plan_request.py b/seclai/_generated/seclai_api_client/models/change_plan_request.py deleted file mode 100644 index a545e8e..0000000 --- a/seclai/_generated/seclai_api_client/models/change_plan_request.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ChangePlanRequest") - - -@_attrs_define -class ChangePlanRequest: - """ - Attributes: - plan_id (UUID): - """ - - plan_id: UUID - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - plan_id = str(self.plan_id) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "plan_id": plan_id, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - plan_id = UUID(d.pop("plan_id")) - - change_plan_request = cls( - plan_id=plan_id, - ) - - change_plan_request.additional_properties = d - return change_plan_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/seclai/_generated/seclai_api_client/models/chat_request.py b/seclai/_generated/seclai_api_client/models/chat_request.py deleted file mode 100644 index 0edf915..0000000 --- a/seclai/_generated/seclai_api_client/models/chat_request.py +++ /dev/null @@ -1,92 +0,0 @@ -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="ChatRequest") - - -@_attrs_define -class ChatRequest: - """Request model for chat messages - - Attributes: - message (str): The chat message content - prompt_model_id (str): ID of the prompt model to use for response generation - conversation_id (None | str | Unset): - """ - - message: str - prompt_model_id: str - conversation_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - message = self.message - - prompt_model_id = self.prompt_model_id - - conversation_id: None | str | Unset - if isinstance(self.conversation_id, Unset): - conversation_id = UNSET - else: - conversation_id = self.conversation_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "message": message, - "prompt_model_id": prompt_model_id, - } - ) - if conversation_id is not UNSET: - field_dict["conversation_id"] = conversation_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - message = d.pop("message") - - prompt_model_id = d.pop("prompt_model_id") - - def _parse_conversation_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - conversation_id = _parse_conversation_id(d.pop("conversation_id", UNSET)) - - chat_request = cls( - message=message, - prompt_model_id=prompt_model_id, - conversation_id=conversation_id, - ) - - chat_request.additional_properties = d - return chat_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/seclai/_generated/seclai_api_client/models/chat_response.py b/seclai/_generated/seclai_api_client/models/chat_response.py deleted file mode 100644 index f8e1696..0000000 --- a/seclai/_generated/seclai_api_client/models/chat_response.py +++ /dev/null @@ -1,132 +0,0 @@ -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 ..models.pending_completed_failed_status import PendingCompletedFailedStatus -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ChatResponse") - - -@_attrs_define -class ChatResponse: - """Response model for chat messages - - Attributes: - assistant_response (None | str): - conversation_id (str): - message_id (str): - prompt_model_id (str): - status (PendingCompletedFailedStatus): - user_prompt (str): - error (None | str | Unset): - """ - - assistant_response: None | str - conversation_id: str - message_id: str - prompt_model_id: str - status: PendingCompletedFailedStatus - user_prompt: str - error: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - assistant_response: None | str - assistant_response = self.assistant_response - - conversation_id = self.conversation_id - - message_id = self.message_id - - prompt_model_id = self.prompt_model_id - - status = self.status.value - - user_prompt = self.user_prompt - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "assistant_response": assistant_response, - "conversation_id": conversation_id, - "message_id": message_id, - "prompt_model_id": prompt_model_id, - "status": status, - "user_prompt": user_prompt, - } - ) - if error is not UNSET: - field_dict["error"] = error - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_assistant_response(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - assistant_response = _parse_assistant_response(d.pop("assistant_response")) - - conversation_id = d.pop("conversation_id") - - message_id = d.pop("message_id") - - prompt_model_id = d.pop("prompt_model_id") - - status = PendingCompletedFailedStatus(d.pop("status")) - - user_prompt = d.pop("user_prompt") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - chat_response = cls( - assistant_response=assistant_response, - conversation_id=conversation_id, - message_id=message_id, - prompt_model_id=prompt_model_id, - status=status, - user_prompt=user_prompt, - error=error, - ) - - chat_response.additional_properties = d - return chat_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/seclai/_generated/seclai_api_client/models/comment_list_response.py b/seclai/_generated/seclai_api_client/models/comment_list_response.py deleted file mode 100644 index 88337d6..0000000 --- a/seclai/_generated/seclai_api_client/models/comment_list_response.py +++ /dev/null @@ -1,76 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="CommentListResponse") - - -@_attrs_define -class CommentListResponse: - """Response model for paginated comment list - - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - comment_list_response = cls( - data=data, - pagination=pagination, - ) - - comment_list_response.additional_properties = d - return comment_list_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/seclai/_generated/seclai_api_client/models/company_size.py b/seclai/_generated/seclai_api_client/models/company_size.py deleted file mode 100644 index 7422070..0000000 --- a/seclai/_generated/seclai_api_client/models/company_size.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class CompanySize(str, Enum): - JUST_ME = "just_me" - SIZE_11_50 = "size_11_50" - SIZE_2_10 = "size_2_10" - SIZE_51_PLUS = "size_51_plus" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/content_detail_response.py b/seclai/_generated/seclai_api_client/models/content_detail_response.py deleted file mode 100644 index 7e5fbff..0000000 --- a/seclai/_generated/seclai_api_client/models/content_detail_response.py +++ /dev/null @@ -1,325 +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 - -if TYPE_CHECKING: - from ..models.content_detail_response_metadata_type_0_item import ( - ContentDetailResponseMetadataType0Item, - ) - - -T = TypeVar("T", bound="ContentDetailResponse") - - -@_attrs_define -class ContentDetailResponse: - """Response model for content detail. - - Attributes: - content_duration (int | None): Duration of the content in seconds. - content_duration_display (None | str): Display string for content duration. - content_status (str): Status of the content. - content_type (str): Type of the content. - content_type_display (str): Display name of the content type. - content_url (str): URL of the content. - content_word_count (int | None): Word count of the content. - description (None | str): Description of the content. - error (None | str): Error message, if any. - id (str): Unique identifier for the content version. - metadata (list[ContentDetailResponseMetadataType0Item] | None): Metadata associated with the content. - published_at (None | str): Timestamp when the content was published. - pulled_at (str): Timestamp when the content was pulled. - source_connection_content_version_id (str): ID of the source connection content version. - source_connection_id (str): ID of the source connection. - source_name (str): Name of the source. - source_type (str): Type of the source. - text_content (None | str): Text content. - text_content_end (int): End position of the text content. - text_content_start (int): Start position of the text content. - text_content_total_length (int): Total length of the text content. - title (None | str): Title of the content. - """ - - content_duration: int | None - content_duration_display: None | str - content_status: str - content_type: str - content_type_display: str - content_url: str - content_word_count: int | None - description: None | str - error: None | str - id: str - metadata: list[ContentDetailResponseMetadataType0Item] | None - published_at: None | str - pulled_at: str - source_connection_content_version_id: str - source_connection_id: str - source_name: str - source_type: str - text_content: None | str - text_content_end: int - text_content_start: int - text_content_total_length: int - title: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - content_duration: int | None - content_duration = self.content_duration - - content_duration_display: None | str - content_duration_display = self.content_duration_display - - content_status = self.content_status - - content_type = self.content_type - - content_type_display = self.content_type_display - - content_url = self.content_url - - content_word_count: int | None - content_word_count = self.content_word_count - - description: None | str - description = self.description - - error: None | str - error = self.error - - id = self.id - - metadata: list[dict[str, Any]] | None - if isinstance(self.metadata, list): - metadata = [] - for metadata_type_0_item_data in self.metadata: - metadata_type_0_item = metadata_type_0_item_data.to_dict() - metadata.append(metadata_type_0_item) - - else: - metadata = self.metadata - - published_at: None | str - published_at = self.published_at - - pulled_at = self.pulled_at - - source_connection_content_version_id = self.source_connection_content_version_id - - source_connection_id = self.source_connection_id - - source_name = self.source_name - - source_type = self.source_type - - text_content: None | str - text_content = self.text_content - - text_content_end = self.text_content_end - - text_content_start = self.text_content_start - - text_content_total_length = self.text_content_total_length - - title: None | str - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "content_duration": content_duration, - "content_duration_display": content_duration_display, - "content_status": content_status, - "content_type": content_type, - "content_type_display": content_type_display, - "content_url": content_url, - "content_word_count": content_word_count, - "description": description, - "error": error, - "id": id, - "metadata": metadata, - "published_at": published_at, - "pulled_at": pulled_at, - "source_connection_content_version_id": source_connection_content_version_id, - "source_connection_id": source_connection_id, - "source_name": source_name, - "source_type": source_type, - "text_content": text_content, - "text_content_end": text_content_end, - "text_content_start": text_content_start, - "text_content_total_length": text_content_total_length, - "title": title, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.content_detail_response_metadata_type_0_item import ( - ContentDetailResponseMetadataType0Item, - ) - - d = dict(src_dict) - - def _parse_content_duration(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - content_duration = _parse_content_duration(d.pop("content_duration")) - - def _parse_content_duration_display(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - content_duration_display = _parse_content_duration_display( - d.pop("content_duration_display") - ) - - content_status = d.pop("content_status") - - content_type = d.pop("content_type") - - content_type_display = d.pop("content_type_display") - - content_url = d.pop("content_url") - - def _parse_content_word_count(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - content_word_count = _parse_content_word_count(d.pop("content_word_count")) - - def _parse_description(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - description = _parse_description(d.pop("description")) - - def _parse_error(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - error = _parse_error(d.pop("error")) - - id = d.pop("id") - - def _parse_metadata( - data: object, - ) -> list[ContentDetailResponseMetadataType0Item] | None: - if data is None: - return data - try: - if not isinstance(data, list): - raise TypeError() - metadata_type_0 = [] - _metadata_type_0 = data - for metadata_type_0_item_data in _metadata_type_0: - metadata_type_0_item = ( - ContentDetailResponseMetadataType0Item.from_dict( - metadata_type_0_item_data - ) - ) - - metadata_type_0.append(metadata_type_0_item) - - return metadata_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[ContentDetailResponseMetadataType0Item] | None, data) - - metadata = _parse_metadata(d.pop("metadata")) - - def _parse_published_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - published_at = _parse_published_at(d.pop("published_at")) - - pulled_at = d.pop("pulled_at") - - source_connection_content_version_id = d.pop( - "source_connection_content_version_id" - ) - - source_connection_id = d.pop("source_connection_id") - - source_name = d.pop("source_name") - - source_type = d.pop("source_type") - - def _parse_text_content(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - text_content = _parse_text_content(d.pop("text_content")) - - text_content_end = d.pop("text_content_end") - - text_content_start = d.pop("text_content_start") - - text_content_total_length = d.pop("text_content_total_length") - - def _parse_title(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - title = _parse_title(d.pop("title")) - - content_detail_response = cls( - content_duration=content_duration, - content_duration_display=content_duration_display, - content_status=content_status, - content_type=content_type, - content_type_display=content_type_display, - content_url=content_url, - content_word_count=content_word_count, - description=description, - error=error, - id=id, - metadata=metadata, - published_at=published_at, - pulled_at=pulled_at, - source_connection_content_version_id=source_connection_content_version_id, - source_connection_id=source_connection_id, - source_name=source_name, - source_type=source_type, - text_content=text_content, - text_content_end=text_content_end, - text_content_start=text_content_start, - text_content_total_length=text_content_total_length, - title=title, - ) - - content_detail_response.additional_properties = d - return content_detail_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/seclai/_generated/seclai_api_client/models/content_detail_response_metadata_type_0_item.py b/seclai/_generated/seclai_api_client/models/content_detail_response_metadata_type_0_item.py deleted file mode 100644 index e7a3413..0000000 --- a/seclai/_generated/seclai_api_client/models/content_detail_response_metadata_type_0_item.py +++ /dev/null @@ -1,46 +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="ContentDetailResponseMetadataType0Item") - - -@_attrs_define -class ContentDetailResponseMetadataType0Item: - """ """ - - 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) - content_detail_response_metadata_type_0_item = cls() - - content_detail_response_metadata_type_0_item.additional_properties = d - return content_detail_response_metadata_type_0_item - - @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/seclai/_generated/seclai_api_client/models/content_embedding_response.py b/seclai/_generated/seclai_api_client/models/content_embedding_response.py deleted file mode 100644 index ea22bf7..0000000 --- a/seclai/_generated/seclai_api_client/models/content_embedding_response.py +++ /dev/null @@ -1,110 +0,0 @@ -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 - -T = TypeVar("T", bound="ContentEmbeddingResponse") - - -@_attrs_define -class ContentEmbeddingResponse: - """Response model for content embedding. - - Attributes: - batch_duration (float): - batch_size (int): - id (str): - text (str): - text_end (int): - text_start (int): - vector (list[float]): - """ - - batch_duration: float - batch_size: int - id: str - text: str - text_end: int - text_start: int - vector: list[float] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - batch_duration = self.batch_duration - - batch_size = self.batch_size - - id = self.id - - text = self.text - - text_end = self.text_end - - text_start = self.text_start - - vector = self.vector - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "batch_duration": batch_duration, - "batch_size": batch_size, - "id": id, - "text": text, - "text_end": text_end, - "text_start": text_start, - "vector": vector, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - batch_duration = d.pop("batch_duration") - - batch_size = d.pop("batch_size") - - id = d.pop("id") - - text = d.pop("text") - - text_end = d.pop("text_end") - - text_start = d.pop("text_start") - - vector = cast(list[float], d.pop("vector")) - - content_embedding_response = cls( - batch_duration=batch_duration, - batch_size=batch_size, - id=id, - text=text, - text_end=text_end, - text_start=text_start, - vector=vector, - ) - - content_embedding_response.additional_properties = d - return content_embedding_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/seclai/_generated/seclai_api_client/models/content_embeddings_list_response.py b/seclai/_generated/seclai_api_client/models/content_embeddings_list_response.py deleted file mode 100644 index 62278fd..0000000 --- a/seclai/_generated/seclai_api_client/models/content_embeddings_list_response.py +++ /dev/null @@ -1,86 +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.content_embedding_response import ContentEmbeddingResponse - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="ContentEmbeddingsListResponse") - - -@_attrs_define -class ContentEmbeddingsListResponse: - """Response model for paginated content embeddings. - - Attributes: - data (list[ContentEmbeddingResponse]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[ContentEmbeddingResponse] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.content_embedding_response import ContentEmbeddingResponse - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = ContentEmbeddingResponse.from_dict(data_item_data) - - data.append(data_item) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - content_embeddings_list_response = cls( - data=data, - pagination=pagination, - ) - - content_embeddings_list_response.additional_properties = d - return content_embeddings_list_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/seclai/_generated/seclai_api_client/models/content_filter_type.py b/seclai/_generated/seclai_api_client/models/content_filter_type.py deleted file mode 100644 index 3bffd6f..0000000 --- a/seclai/_generated/seclai_api_client/models/content_filter_type.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class ContentFilterType(str, Enum): - AI_MAIN_CONTENT = "ai_main_content" - AI_MAIN_CONTENT_SKIP_ADS = "ai_main_content_skip_ads" - HEADER_FOOTER_NAVIGATION = "header_footer_navigation" - NONE = "none" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/conversation_data.py b/seclai/_generated/seclai_api_client/models/conversation_data.py deleted file mode 100644 index a7370ef..0000000 --- a/seclai/_generated/seclai_api_client/models/conversation_data.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field -from dateutil.parser import isoparse - -T = TypeVar("T", bound="ConversationData") - - -@_attrs_define -class ConversationData: - """ - Attributes: - created_at (datetime.datetime): - id (UUID): - knowledge_base_id (UUID): - title (None | str): - updated_at (datetime.datetime): - user_id (UUID): - """ - - created_at: datetime.datetime - id: UUID - knowledge_base_id: UUID - title: None | str - updated_at: datetime.datetime - user_id: UUID - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at.isoformat() - - id = str(self.id) - - knowledge_base_id = str(self.knowledge_base_id) - - title: None | str - title = self.title - - updated_at = self.updated_at.isoformat() - - user_id = str(self.user_id) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "created_at": created_at, - "id": id, - "knowledge_base_id": knowledge_base_id, - "title": title, - "updated_at": updated_at, - "user_id": user_id, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created_at = isoparse(d.pop("created_at")) - - id = UUID(d.pop("id")) - - knowledge_base_id = UUID(d.pop("knowledge_base_id")) - - def _parse_title(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - title = _parse_title(d.pop("title")) - - updated_at = isoparse(d.pop("updated_at")) - - user_id = UUID(d.pop("user_id")) - - conversation_data = cls( - created_at=created_at, - id=id, - knowledge_base_id=knowledge_base_id, - title=title, - updated_at=updated_at, - user_id=user_id, - ) - - conversation_data.additional_properties = d - return conversation_data - - @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/seclai/_generated/seclai_api_client/models/conversation_list_response.py b/seclai/_generated/seclai_api_client/models/conversation_list_response.py deleted file mode 100644 index 06e0570..0000000 --- a/seclai/_generated/seclai_api_client/models/conversation_list_response.py +++ /dev/null @@ -1,76 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="ConversationListResponse") - - -@_attrs_define -class ConversationListResponse: - """Response model for paginated conversation list - - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - conversation_list_response = cls( - data=data, - pagination=pagination, - ) - - conversation_list_response.additional_properties = d - return conversation_list_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/seclai/_generated/seclai_api_client/models/conversation_message_response.py b/seclai/_generated/seclai_api_client/models/conversation_message_response.py deleted file mode 100644 index 71735e6..0000000 --- a/seclai/_generated/seclai_api_client/models/conversation_message_response.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ConversationMessageResponse") - - -@_attrs_define -class ConversationMessageResponse: - """Response model for conversation message data - - Attributes: - assistant_response (None | str): - created_at (str): - id (UUID): - status (str): - updated_at (str): - user_prompt (str): - """ - - assistant_response: None | str - created_at: str - id: UUID - status: str - updated_at: str - user_prompt: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - assistant_response: None | str - assistant_response = self.assistant_response - - created_at = self.created_at - - id = str(self.id) - - status = self.status - - updated_at = self.updated_at - - user_prompt = self.user_prompt - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "assistant_response": assistant_response, - "created_at": created_at, - "id": id, - "status": status, - "updated_at": updated_at, - "user_prompt": user_prompt, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_assistant_response(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - assistant_response = _parse_assistant_response(d.pop("assistant_response")) - - created_at = d.pop("created_at") - - id = UUID(d.pop("id")) - - status = d.pop("status") - - updated_at = d.pop("updated_at") - - user_prompt = d.pop("user_prompt") - - conversation_message_response = cls( - assistant_response=assistant_response, - created_at=created_at, - id=id, - status=status, - updated_at=updated_at, - user_prompt=user_prompt, - ) - - conversation_message_response.additional_properties = d - return conversation_message_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/seclai/_generated/seclai_api_client/models/conversation_with_messages_response.py b/seclai/_generated/seclai_api_client/models/conversation_with_messages_response.py deleted file mode 100644 index 444a1c2..0000000 --- a/seclai/_generated/seclai_api_client/models/conversation_with_messages_response.py +++ /dev/null @@ -1,86 +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.conversation_data import ConversationData - from ..models.conversation_message_response import ConversationMessageResponse - - -T = TypeVar("T", bound="ConversationWithMessagesResponse") - - -@_attrs_define -class ConversationWithMessagesResponse: - """Response model for conversation with messages data - - Attributes: - conversation (ConversationData): - messages (list[ConversationMessageResponse]): - """ - - conversation: ConversationData - messages: list[ConversationMessageResponse] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - conversation = self.conversation.to_dict() - - messages = [] - for messages_item_data in self.messages: - messages_item = messages_item_data.to_dict() - messages.append(messages_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "conversation": conversation, - "messages": messages, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.conversation_data import ConversationData - from ..models.conversation_message_response import ConversationMessageResponse - - d = dict(src_dict) - conversation = ConversationData.from_dict(d.pop("conversation")) - - messages = [] - _messages = d.pop("messages") - for messages_item_data in _messages: - messages_item = ConversationMessageResponse.from_dict(messages_item_data) - - messages.append(messages_item) - - conversation_with_messages_response = cls( - conversation=conversation, - messages=messages, - ) - - conversation_with_messages_response.additional_properties = d - return conversation_with_messages_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/seclai/_generated/seclai_api_client/models/cost_estimate_request.py b/seclai/_generated/seclai_api_client/models/cost_estimate_request.py deleted file mode 100644 index f9bfbbe..0000000 --- a/seclai/_generated/seclai_api_client/models/cost_estimate_request.py +++ /dev/null @@ -1,192 +0,0 @@ -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="CostEstimateRequest") - - -@_attrs_define -class CostEstimateRequest: - """Request model for cost estimation. - - Attributes: - chunk_overlap (int | Unset): Chunk overlap in characters Default: 200. - chunk_size (int | Unset): Chunk size in characters Default: 1000. - episodes_per_day (float | None | Unset): Number of episodes per day - num_pages (int | None | Unset): Number of pages - retention_months (int | None | Unset): Retention period in months - source_type (None | str | Unset): Source type: 'rss_feed' or 'website'. If not provided, will be inferred from - other fields. - words_per_episode (int | None | Unset): Number of words per episode - words_per_page (int | None | Unset): Average words per page - """ - - chunk_overlap: int | Unset = 200 - chunk_size: int | Unset = 1000 - episodes_per_day: float | None | Unset = UNSET - num_pages: int | None | Unset = UNSET - retention_months: int | None | Unset = UNSET - source_type: None | str | Unset = UNSET - words_per_episode: int | None | Unset = UNSET - words_per_page: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - chunk_overlap = self.chunk_overlap - - chunk_size = self.chunk_size - - episodes_per_day: float | None | Unset - if isinstance(self.episodes_per_day, Unset): - episodes_per_day = UNSET - else: - episodes_per_day = self.episodes_per_day - - num_pages: int | None | Unset - if isinstance(self.num_pages, Unset): - num_pages = UNSET - else: - num_pages = self.num_pages - - retention_months: int | None | Unset - if isinstance(self.retention_months, Unset): - retention_months = UNSET - else: - retention_months = self.retention_months - - source_type: None | str | Unset - if isinstance(self.source_type, Unset): - source_type = UNSET - else: - source_type = self.source_type - - words_per_episode: int | None | Unset - if isinstance(self.words_per_episode, Unset): - words_per_episode = UNSET - else: - words_per_episode = self.words_per_episode - - words_per_page: int | None | Unset - if isinstance(self.words_per_page, Unset): - words_per_page = UNSET - else: - words_per_page = self.words_per_page - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if chunk_overlap is not UNSET: - field_dict["chunk_overlap"] = chunk_overlap - if chunk_size is not UNSET: - field_dict["chunk_size"] = chunk_size - if episodes_per_day is not UNSET: - field_dict["episodes_per_day"] = episodes_per_day - if num_pages is not UNSET: - field_dict["num_pages"] = num_pages - if retention_months is not UNSET: - field_dict["retention_months"] = retention_months - if source_type is not UNSET: - field_dict["source_type"] = source_type - if words_per_episode is not UNSET: - field_dict["words_per_episode"] = words_per_episode - if words_per_page is not UNSET: - field_dict["words_per_page"] = words_per_page - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - chunk_overlap = d.pop("chunk_overlap", UNSET) - - chunk_size = d.pop("chunk_size", UNSET) - - def _parse_episodes_per_day(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - episodes_per_day = _parse_episodes_per_day(d.pop("episodes_per_day", UNSET)) - - def _parse_num_pages(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - num_pages = _parse_num_pages(d.pop("num_pages", UNSET)) - - def _parse_retention_months(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - retention_months = _parse_retention_months(d.pop("retention_months", UNSET)) - - def _parse_source_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - source_type = _parse_source_type(d.pop("source_type", UNSET)) - - def _parse_words_per_episode(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - words_per_episode = _parse_words_per_episode(d.pop("words_per_episode", UNSET)) - - def _parse_words_per_page(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - words_per_page = _parse_words_per_page(d.pop("words_per_page", UNSET)) - - cost_estimate_request = cls( - chunk_overlap=chunk_overlap, - chunk_size=chunk_size, - episodes_per_day=episodes_per_day, - num_pages=num_pages, - retention_months=retention_months, - source_type=source_type, - words_per_episode=words_per_episode, - words_per_page=words_per_page, - ) - - cost_estimate_request.additional_properties = d - return cost_estimate_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/seclai/_generated/seclai_api_client/models/cost_estimate_response.py b/seclai/_generated/seclai_api_client/models/cost_estimate_response.py deleted file mode 100644 index f68e97f..0000000 --- a/seclai/_generated/seclai_api_client/models/cost_estimate_response.py +++ /dev/null @@ -1,330 +0,0 @@ -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="CostEstimateResponse") - - -@_attrs_define -class CostEstimateResponse: - """Response model for cost estimation. - - Attributes: - default_dimension (int): Default dimension size - default_model_name (str): Name of the default embedding model - chunks_per_episode (int | None | Unset): Number of chunks per episode - cost_per_episode (float | None | Unset): Total cost per episode (processing + indexing + storage for 1 month) - cost_per_month (float | None | Unset): Total cost per month at current episode frequency - episodes_per_day (float | None | Unset): Episodes per day - feed_processing_cost_per_episode (float | None | Unset): Cost in credits for processing feed per episode - indexing_cost (float | None | Unset): Total cost for embedding generation - indexing_cost_per_episode (float | None | Unset): Cost in credits for indexing per episode - num_chunks (int | None | Unset): Total number of chunks - page_processing_cost (float | None | Unset): Total cost for processing all pages - storage_cost (float | None | Unset): Total storage cost for retention period - storage_cost_per_chunk_per_month (float | None | Unset): Cost in credits for storing one chunk for one month - total_cost (float | None | Unset): Total estimated cost - """ - - default_dimension: int - default_model_name: str - chunks_per_episode: int | None | Unset = UNSET - cost_per_episode: float | None | Unset = UNSET - cost_per_month: float | None | Unset = UNSET - episodes_per_day: float | None | Unset = UNSET - feed_processing_cost_per_episode: float | None | Unset = UNSET - indexing_cost: float | None | Unset = UNSET - indexing_cost_per_episode: float | None | Unset = UNSET - num_chunks: int | None | Unset = UNSET - page_processing_cost: float | None | Unset = UNSET - storage_cost: float | None | Unset = UNSET - storage_cost_per_chunk_per_month: float | None | Unset = UNSET - total_cost: float | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - default_dimension = self.default_dimension - - default_model_name = self.default_model_name - - chunks_per_episode: int | None | Unset - if isinstance(self.chunks_per_episode, Unset): - chunks_per_episode = UNSET - else: - chunks_per_episode = self.chunks_per_episode - - cost_per_episode: float | None | Unset - if isinstance(self.cost_per_episode, Unset): - cost_per_episode = UNSET - else: - cost_per_episode = self.cost_per_episode - - cost_per_month: float | None | Unset - if isinstance(self.cost_per_month, Unset): - cost_per_month = UNSET - else: - cost_per_month = self.cost_per_month - - episodes_per_day: float | None | Unset - if isinstance(self.episodes_per_day, Unset): - episodes_per_day = UNSET - else: - episodes_per_day = self.episodes_per_day - - feed_processing_cost_per_episode: float | None | Unset - if isinstance(self.feed_processing_cost_per_episode, Unset): - feed_processing_cost_per_episode = UNSET - else: - feed_processing_cost_per_episode = self.feed_processing_cost_per_episode - - indexing_cost: float | None | Unset - if isinstance(self.indexing_cost, Unset): - indexing_cost = UNSET - else: - indexing_cost = self.indexing_cost - - indexing_cost_per_episode: float | None | Unset - if isinstance(self.indexing_cost_per_episode, Unset): - indexing_cost_per_episode = UNSET - else: - indexing_cost_per_episode = self.indexing_cost_per_episode - - num_chunks: int | None | Unset - if isinstance(self.num_chunks, Unset): - num_chunks = UNSET - else: - num_chunks = self.num_chunks - - page_processing_cost: float | None | Unset - if isinstance(self.page_processing_cost, Unset): - page_processing_cost = UNSET - else: - page_processing_cost = self.page_processing_cost - - storage_cost: float | None | Unset - if isinstance(self.storage_cost, Unset): - storage_cost = UNSET - else: - storage_cost = self.storage_cost - - storage_cost_per_chunk_per_month: float | None | Unset - if isinstance(self.storage_cost_per_chunk_per_month, Unset): - storage_cost_per_chunk_per_month = UNSET - else: - storage_cost_per_chunk_per_month = self.storage_cost_per_chunk_per_month - - total_cost: float | None | Unset - if isinstance(self.total_cost, Unset): - total_cost = UNSET - else: - total_cost = self.total_cost - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "default_dimension": default_dimension, - "default_model_name": default_model_name, - } - ) - if chunks_per_episode is not UNSET: - field_dict["chunks_per_episode"] = chunks_per_episode - if cost_per_episode is not UNSET: - field_dict["cost_per_episode"] = cost_per_episode - if cost_per_month is not UNSET: - field_dict["cost_per_month"] = cost_per_month - if episodes_per_day is not UNSET: - field_dict["episodes_per_day"] = episodes_per_day - if feed_processing_cost_per_episode is not UNSET: - field_dict["feed_processing_cost_per_episode"] = ( - feed_processing_cost_per_episode - ) - if indexing_cost is not UNSET: - field_dict["indexing_cost"] = indexing_cost - if indexing_cost_per_episode is not UNSET: - field_dict["indexing_cost_per_episode"] = indexing_cost_per_episode - if num_chunks is not UNSET: - field_dict["num_chunks"] = num_chunks - if page_processing_cost is not UNSET: - field_dict["page_processing_cost"] = page_processing_cost - if storage_cost is not UNSET: - field_dict["storage_cost"] = storage_cost - if storage_cost_per_chunk_per_month is not UNSET: - field_dict["storage_cost_per_chunk_per_month"] = ( - storage_cost_per_chunk_per_month - ) - if total_cost is not UNSET: - field_dict["total_cost"] = total_cost - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - default_dimension = d.pop("default_dimension") - - default_model_name = d.pop("default_model_name") - - def _parse_chunks_per_episode(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunks_per_episode = _parse_chunks_per_episode( - d.pop("chunks_per_episode", UNSET) - ) - - def _parse_cost_per_episode(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - cost_per_episode = _parse_cost_per_episode(d.pop("cost_per_episode", UNSET)) - - def _parse_cost_per_month(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - cost_per_month = _parse_cost_per_month(d.pop("cost_per_month", UNSET)) - - def _parse_episodes_per_day(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - episodes_per_day = _parse_episodes_per_day(d.pop("episodes_per_day", UNSET)) - - def _parse_feed_processing_cost_per_episode( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - feed_processing_cost_per_episode = _parse_feed_processing_cost_per_episode( - d.pop("feed_processing_cost_per_episode", UNSET) - ) - - def _parse_indexing_cost(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - indexing_cost = _parse_indexing_cost(d.pop("indexing_cost", UNSET)) - - def _parse_indexing_cost_per_episode(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - indexing_cost_per_episode = _parse_indexing_cost_per_episode( - d.pop("indexing_cost_per_episode", UNSET) - ) - - def _parse_num_chunks(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - num_chunks = _parse_num_chunks(d.pop("num_chunks", UNSET)) - - def _parse_page_processing_cost(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - page_processing_cost = _parse_page_processing_cost( - d.pop("page_processing_cost", UNSET) - ) - - def _parse_storage_cost(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - storage_cost = _parse_storage_cost(d.pop("storage_cost", UNSET)) - - def _parse_storage_cost_per_chunk_per_month( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - storage_cost_per_chunk_per_month = _parse_storage_cost_per_chunk_per_month( - d.pop("storage_cost_per_chunk_per_month", UNSET) - ) - - def _parse_total_cost(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - total_cost = _parse_total_cost(d.pop("total_cost", UNSET)) - - cost_estimate_response = cls( - default_dimension=default_dimension, - default_model_name=default_model_name, - chunks_per_episode=chunks_per_episode, - cost_per_episode=cost_per_episode, - cost_per_month=cost_per_month, - episodes_per_day=episodes_per_day, - feed_processing_cost_per_episode=feed_processing_cost_per_episode, - indexing_cost=indexing_cost, - indexing_cost_per_episode=indexing_cost_per_episode, - num_chunks=num_chunks, - page_processing_cost=page_processing_cost, - storage_cost=storage_cost, - storage_cost_per_chunk_per_month=storage_cost_per_chunk_per_month, - total_cost=total_cost, - ) - - cost_estimate_response.additional_properties = d - return cost_estimate_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/seclai/_generated/seclai_api_client/models/create_agent_request.py b/seclai/_generated/seclai_api_client/models/create_agent_request.py deleted file mode 100644 index 68a53d9..0000000 --- a/seclai/_generated/seclai_api_client/models/create_agent_request.py +++ /dev/null @@ -1,236 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.agent_trigger_type import AgentTriggerType -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.create_agent_request_metadata_type_0 import ( - CreateAgentRequestMetadataType0, - ) - - -T = TypeVar("T", bound="CreateAgentRequest") - - -@_attrs_define -class CreateAgentRequest: - """Request model for creating/duplicating an agent - - Attributes: - name (str): Agent name - agent_template (None | str | Unset): Template to use for initial agent definition: 'blank' or - 'retrieval_example' - description (None | str | Unset): Optional agent description - input_ (None | str | Unset): Template input for agents with TEMPLATE_INPUT trigger type - knowledge_base_id (None | Unset | UUID): Knowledge base to use when creating an initial agent definition - template. Optional; if omitted, retrieval steps must be configured later. - metadata (CreateAgentRequestMetadataType0 | None | Unset): Metadata available for string substitutions in the - agent - trigger_type (AgentTriggerType | None | Unset): The type of event that triggers this agent (optional for - duplicate) - """ - - name: str - agent_template: None | str | Unset = UNSET - description: None | str | Unset = UNSET - input_: None | str | Unset = UNSET - knowledge_base_id: None | Unset | UUID = UNSET - metadata: CreateAgentRequestMetadataType0 | None | Unset = UNSET - trigger_type: AgentTriggerType | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.create_agent_request_metadata_type_0 import ( - CreateAgentRequestMetadataType0, - ) - - name = self.name - - agent_template: None | str | Unset - if isinstance(self.agent_template, Unset): - agent_template = UNSET - else: - agent_template = self.agent_template - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - input_: None | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - else: - input_ = self.input_ - - knowledge_base_id: None | str | Unset - if isinstance(self.knowledge_base_id, Unset): - knowledge_base_id = UNSET - elif isinstance(self.knowledge_base_id, UUID): - knowledge_base_id = str(self.knowledge_base_id) - else: - knowledge_base_id = self.knowledge_base_id - - metadata: dict[str, Any] | None | Unset - if isinstance(self.metadata, Unset): - metadata = UNSET - elif isinstance(self.metadata, CreateAgentRequestMetadataType0): - metadata = self.metadata.to_dict() - else: - metadata = self.metadata - - trigger_type: None | str | Unset - if isinstance(self.trigger_type, Unset): - trigger_type = UNSET - elif isinstance(self.trigger_type, AgentTriggerType): - trigger_type = self.trigger_type.value - else: - trigger_type = self.trigger_type - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "name": name, - } - ) - if agent_template is not UNSET: - field_dict["agent_template"] = agent_template - if description is not UNSET: - field_dict["description"] = description - if input_ is not UNSET: - field_dict["input"] = input_ - if knowledge_base_id is not UNSET: - field_dict["knowledge_base_id"] = knowledge_base_id - if metadata is not UNSET: - field_dict["metadata"] = metadata - if trigger_type is not UNSET: - field_dict["trigger_type"] = trigger_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.create_agent_request_metadata_type_0 import ( - CreateAgentRequestMetadataType0, - ) - - d = dict(src_dict) - name = d.pop("name") - - def _parse_agent_template(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_template = _parse_agent_template(d.pop("agent_template", UNSET)) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_input_(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_knowledge_base_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() - knowledge_base_id_type_0 = UUID(data) - - return knowledge_base_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - knowledge_base_id = _parse_knowledge_base_id(d.pop("knowledge_base_id", UNSET)) - - def _parse_metadata( - data: object, - ) -> CreateAgentRequestMetadataType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_type_0 = CreateAgentRequestMetadataType0.from_dict(data) - - return metadata_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CreateAgentRequestMetadataType0 | None | Unset, data) - - metadata = _parse_metadata(d.pop("metadata", UNSET)) - - def _parse_trigger_type(data: object) -> AgentTriggerType | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - trigger_type_type_0 = AgentTriggerType(data) - - return trigger_type_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentTriggerType | None | Unset, data) - - trigger_type = _parse_trigger_type(d.pop("trigger_type", UNSET)) - - create_agent_request = cls( - name=name, - agent_template=agent_template, - description=description, - input_=input_, - knowledge_base_id=knowledge_base_id, - metadata=metadata, - trigger_type=trigger_type, - ) - - create_agent_request.additional_properties = d - return create_agent_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/seclai/_generated/seclai_api_client/models/create_agent_request_metadata_type_0.py b/seclai/_generated/seclai_api_client/models/create_agent_request_metadata_type_0.py deleted file mode 100644 index f560ec6..0000000 --- a/seclai/_generated/seclai_api_client/models/create_agent_request_metadata_type_0.py +++ /dev/null @@ -1,46 +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="CreateAgentRequestMetadataType0") - - -@_attrs_define -class CreateAgentRequestMetadataType0: - """ """ - - additional_properties: dict[str, Any] = _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) - create_agent_request_metadata_type_0 = cls() - - create_agent_request_metadata_type_0.additional_properties = d - return create_agent_request_metadata_type_0 - - @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/seclai/_generated/seclai_api_client/models/create_knowledge_base_request.py b/seclai/_generated/seclai_api_client/models/create_knowledge_base_request.py deleted file mode 100644 index 8f23250..0000000 --- a/seclai/_generated/seclai_api_client/models/create_knowledge_base_request.py +++ /dev/null @@ -1,121 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, 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="CreateKnowledgeBaseRequest") - - -@_attrs_define -class CreateKnowledgeBaseRequest: - """Request model for creating a new knowledge base - - Attributes: - name (str): Name of the knowledge base - source_ids (list[UUID]): List of source connection IDs to associate with the knowledge base - description (None | str | Unset): Optional description of the knowledge base - reranker_model (None | str | Unset): Optional reranker model to use (None for no reranking) - """ - - name: str - source_ids: list[UUID] - description: None | str | Unset = UNSET - reranker_model: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - name = self.name - - source_ids = [] - for source_ids_item_data in self.source_ids: - source_ids_item = str(source_ids_item_data) - source_ids.append(source_ids_item) - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - reranker_model: None | str | Unset - if isinstance(self.reranker_model, Unset): - reranker_model = UNSET - else: - reranker_model = self.reranker_model - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "name": name, - "source_ids": source_ids, - } - ) - if description is not UNSET: - field_dict["description"] = description - if reranker_model is not UNSET: - field_dict["reranker_model"] = reranker_model - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - name = d.pop("name") - - source_ids = [] - _source_ids = d.pop("source_ids") - for source_ids_item_data in _source_ids: - source_ids_item = UUID(source_ids_item_data) - - source_ids.append(source_ids_item) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_reranker_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - reranker_model = _parse_reranker_model(d.pop("reranker_model", UNSET)) - - create_knowledge_base_request = cls( - name=name, - source_ids=source_ids, - description=description, - reranker_model=reranker_model, - ) - - create_knowledge_base_request.additional_properties = d - return create_knowledge_base_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/seclai/_generated/seclai_api_client/models/create_source_request.py b/seclai/_generated/seclai_api_client/models/create_source_request.py deleted file mode 100644 index a0d43a5..0000000 --- a/seclai/_generated/seclai_api_client/models/create_source_request.py +++ /dev/null @@ -1,482 +0,0 @@ -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 ..models.content_filter_type import ContentFilterType -from ..models.polling_action import PollingAction -from ..models.polling_type import PollingType -from ..models.seed_type import SeedType -from ..models.source_type import SourceType -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateSourceRequest") - - -@_attrs_define -class CreateSourceRequest: - """Request model for creating a new source - - Attributes: - source_type (SourceType): - chunk_language (None | str | Unset): Language for language-specific text splitting - chunk_overlap (int | None | Unset): Chunk overlap for text splitting - chunk_regex_separators (bool | None | Unset): Whether to treat separators as regex patterns - chunk_separators (None | str | Unset): Custom chunk separators as JSON array string - chunk_size (int | None | Unset): Chunk size for text splitting - content_filter (ContentFilterType | None | Unset): Content filtering strategy - dimensions (int | None | Unset): Embedding dimensions - embedding_model (None | str | Unset): Embedding model ID - latest_n (int | None | Unset): Number of latest items for seeding - name (None | str | Unset): Name of the source - polling (None | PollingType | Unset): Polling frequency: once, hourly, daily, weekly - polling_action (None | PollingAction | Unset): Polling action to take - polling_max_items (int | None | Unset): Maximum items to fetch per poll - retention (int | None | Unset): Retention period in days (null for infinite) - seed (None | SeedType | Unset): Seeding type: full_history, selected_items, latest_n - selected_items (list[str] | None | Unset): List of selected item IDs for seeding - url (None | str | Unset): URL of the source (alternative to url_id) - url_id (None | str | Unset): ID of the URL (alternative to url) - """ - - source_type: SourceType - chunk_language: None | str | Unset = UNSET - chunk_overlap: int | None | Unset = UNSET - chunk_regex_separators: bool | None | Unset = UNSET - chunk_separators: None | str | Unset = UNSET - chunk_size: int | None | Unset = UNSET - content_filter: ContentFilterType | None | Unset = UNSET - dimensions: int | None | Unset = UNSET - embedding_model: None | str | Unset = UNSET - latest_n: int | None | Unset = UNSET - name: None | str | Unset = UNSET - polling: None | PollingType | Unset = UNSET - polling_action: None | PollingAction | Unset = UNSET - polling_max_items: int | None | Unset = UNSET - retention: int | None | Unset = UNSET - seed: None | SeedType | Unset = UNSET - selected_items: list[str] | None | Unset = UNSET - url: None | str | Unset = UNSET - url_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - source_type = self.source_type.value - - chunk_language: None | str | Unset - if isinstance(self.chunk_language, Unset): - chunk_language = UNSET - else: - chunk_language = self.chunk_language - - chunk_overlap: int | None | Unset - if isinstance(self.chunk_overlap, Unset): - chunk_overlap = UNSET - else: - chunk_overlap = self.chunk_overlap - - chunk_regex_separators: bool | None | Unset - if isinstance(self.chunk_regex_separators, Unset): - chunk_regex_separators = UNSET - else: - chunk_regex_separators = self.chunk_regex_separators - - chunk_separators: None | str | Unset - if isinstance(self.chunk_separators, Unset): - chunk_separators = UNSET - else: - chunk_separators = self.chunk_separators - - chunk_size: int | None | Unset - if isinstance(self.chunk_size, Unset): - chunk_size = UNSET - else: - chunk_size = self.chunk_size - - content_filter: None | str | Unset - if isinstance(self.content_filter, Unset): - content_filter = UNSET - elif isinstance(self.content_filter, ContentFilterType): - content_filter = self.content_filter.value - else: - content_filter = self.content_filter - - dimensions: int | None | Unset - if isinstance(self.dimensions, Unset): - dimensions = UNSET - else: - dimensions = self.dimensions - - embedding_model: None | str | Unset - if isinstance(self.embedding_model, Unset): - embedding_model = UNSET - else: - embedding_model = self.embedding_model - - latest_n: int | None | Unset - if isinstance(self.latest_n, Unset): - latest_n = UNSET - else: - latest_n = self.latest_n - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - polling: None | str | Unset - if isinstance(self.polling, Unset): - polling = UNSET - elif isinstance(self.polling, PollingType): - polling = self.polling.value - else: - polling = self.polling - - polling_action: None | str | Unset - if isinstance(self.polling_action, Unset): - polling_action = UNSET - elif isinstance(self.polling_action, PollingAction): - polling_action = self.polling_action.value - else: - polling_action = self.polling_action - - polling_max_items: int | None | Unset - if isinstance(self.polling_max_items, Unset): - polling_max_items = UNSET - else: - polling_max_items = self.polling_max_items - - retention: int | None | Unset - if isinstance(self.retention, Unset): - retention = UNSET - else: - retention = self.retention - - seed: None | str | Unset - if isinstance(self.seed, Unset): - seed = UNSET - elif isinstance(self.seed, SeedType): - seed = self.seed.value - else: - seed = self.seed - - selected_items: list[str] | None | Unset - if isinstance(self.selected_items, Unset): - selected_items = UNSET - elif isinstance(self.selected_items, list): - selected_items = self.selected_items - - else: - selected_items = self.selected_items - - url: None | str | Unset - if isinstance(self.url, Unset): - url = UNSET - else: - url = self.url - - url_id: None | str | Unset - if isinstance(self.url_id, Unset): - url_id = UNSET - else: - url_id = self.url_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "source_type": source_type, - } - ) - if chunk_language is not UNSET: - field_dict["chunk_language"] = chunk_language - if chunk_overlap is not UNSET: - field_dict["chunk_overlap"] = chunk_overlap - if chunk_regex_separators is not UNSET: - field_dict["chunk_regex_separators"] = chunk_regex_separators - if chunk_separators is not UNSET: - field_dict["chunk_separators"] = chunk_separators - if chunk_size is not UNSET: - field_dict["chunk_size"] = chunk_size - if content_filter is not UNSET: - field_dict["content_filter"] = content_filter - if dimensions is not UNSET: - field_dict["dimensions"] = dimensions - if embedding_model is not UNSET: - field_dict["embedding_model"] = embedding_model - if latest_n is not UNSET: - field_dict["latest_n"] = latest_n - if name is not UNSET: - field_dict["name"] = name - if polling is not UNSET: - field_dict["polling"] = polling - if polling_action is not UNSET: - field_dict["polling_action"] = polling_action - if polling_max_items is not UNSET: - field_dict["polling_max_items"] = polling_max_items - if retention is not UNSET: - field_dict["retention"] = retention - if seed is not UNSET: - field_dict["seed"] = seed - if selected_items is not UNSET: - field_dict["selected_items"] = selected_items - if url is not UNSET: - field_dict["url"] = url - if url_id is not UNSET: - field_dict["url_id"] = url_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - source_type = SourceType(d.pop("source_type")) - - def _parse_chunk_language(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - chunk_language = _parse_chunk_language(d.pop("chunk_language", UNSET)) - - def _parse_chunk_overlap(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_overlap = _parse_chunk_overlap(d.pop("chunk_overlap", UNSET)) - - def _parse_chunk_regex_separators(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - chunk_regex_separators = _parse_chunk_regex_separators( - d.pop("chunk_regex_separators", UNSET) - ) - - def _parse_chunk_separators(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - chunk_separators = _parse_chunk_separators(d.pop("chunk_separators", UNSET)) - - def _parse_chunk_size(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_size = _parse_chunk_size(d.pop("chunk_size", UNSET)) - - def _parse_content_filter(data: object) -> ContentFilterType | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - content_filter_type_0 = ContentFilterType(data) - - return content_filter_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(ContentFilterType | None | Unset, data) - - content_filter = _parse_content_filter(d.pop("content_filter", UNSET)) - - def _parse_dimensions(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - dimensions = _parse_dimensions(d.pop("dimensions", UNSET)) - - def _parse_embedding_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - embedding_model = _parse_embedding_model(d.pop("embedding_model", UNSET)) - - def _parse_latest_n(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - latest_n = _parse_latest_n(d.pop("latest_n", UNSET)) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - def _parse_polling(data: object) -> None | PollingType | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - polling_type_0 = PollingType(data) - - return polling_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PollingType | Unset, data) - - polling = _parse_polling(d.pop("polling", UNSET)) - - def _parse_polling_action(data: object) -> None | PollingAction | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - polling_action_type_0 = PollingAction(data) - - return polling_action_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PollingAction | Unset, data) - - polling_action = _parse_polling_action(d.pop("polling_action", UNSET)) - - def _parse_polling_max_items(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - polling_max_items = _parse_polling_max_items(d.pop("polling_max_items", UNSET)) - - def _parse_retention(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - retention = _parse_retention(d.pop("retention", UNSET)) - - def _parse_seed(data: object) -> None | SeedType | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - seed_type_0 = SeedType(data) - - return seed_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SeedType | Unset, data) - - seed = _parse_seed(d.pop("seed", UNSET)) - - def _parse_selected_items(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() - selected_items_type_0 = cast(list[str], data) - - return selected_items_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - selected_items = _parse_selected_items(d.pop("selected_items", UNSET)) - - def _parse_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - url = _parse_url(d.pop("url", UNSET)) - - def _parse_url_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - url_id = _parse_url_id(d.pop("url_id", UNSET)) - - create_source_request = cls( - source_type=source_type, - chunk_language=chunk_language, - chunk_overlap=chunk_overlap, - chunk_regex_separators=chunk_regex_separators, - chunk_separators=chunk_separators, - chunk_size=chunk_size, - content_filter=content_filter, - dimensions=dimensions, - embedding_model=embedding_model, - latest_n=latest_n, - name=name, - polling=polling, - polling_action=polling_action, - polling_max_items=polling_max_items, - retention=retention, - seed=seed, - selected_items=selected_items, - url=url, - url_id=url_id, - ) - - create_source_request.additional_properties = d - return create_source_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/seclai/_generated/seclai_api_client/models/create_trigger_schedule_request.py b/seclai/_generated/seclai_api_client/models/create_trigger_schedule_request.py deleted file mode 100644 index 62b9038..0000000 --- a/seclai/_generated/seclai_api_client/models/create_trigger_schedule_request.py +++ /dev/null @@ -1,175 +0,0 @@ -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 ..models.agent_trigger_frequency import AgentTriggerFrequency -from ..types import UNSET, Unset - -T = TypeVar("T", bound="CreateTriggerScheduleRequest") - - -@_attrs_define -class CreateTriggerScheduleRequest: - """Request model for creating an agent trigger schedule - - Attributes: - frequency (AgentTriggerFrequency): - day_of_month (int | None | Unset): Day of month (1-31, or negative for counting from end: -1=last day) - day_of_week (int | None | Unset): Day of week (0=Monday, 6=Sunday) for weekly schedules - hour_of_day (int | None | Unset): Hour of day (0-23) for daily/weekly/monthly schedules - minute_of_hour (int | None | Unset): Minute of hour (0-59) for all schedules - repeat_interval (int | Unset): How often to repeat (e.g., every 2 days) Default: 1. - weekday_of_month (int | None | Unset): Weekday of month (0=first Monday, 8=second Tuesday, etc.) for monthly - schedules - """ - - frequency: AgentTriggerFrequency - day_of_month: int | None | Unset = UNSET - day_of_week: int | None | Unset = UNSET - hour_of_day: int | None | Unset = UNSET - minute_of_hour: int | None | Unset = UNSET - repeat_interval: int | Unset = 1 - weekday_of_month: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - frequency = self.frequency.value - - day_of_month: int | None | Unset - if isinstance(self.day_of_month, Unset): - day_of_month = UNSET - else: - day_of_month = self.day_of_month - - day_of_week: int | None | Unset - if isinstance(self.day_of_week, Unset): - day_of_week = UNSET - else: - day_of_week = self.day_of_week - - hour_of_day: int | None | Unset - if isinstance(self.hour_of_day, Unset): - hour_of_day = UNSET - else: - hour_of_day = self.hour_of_day - - minute_of_hour: int | None | Unset - if isinstance(self.minute_of_hour, Unset): - minute_of_hour = UNSET - else: - minute_of_hour = self.minute_of_hour - - repeat_interval = self.repeat_interval - - weekday_of_month: int | None | Unset - if isinstance(self.weekday_of_month, Unset): - weekday_of_month = UNSET - else: - weekday_of_month = self.weekday_of_month - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "frequency": frequency, - } - ) - if day_of_month is not UNSET: - field_dict["day_of_month"] = day_of_month - if day_of_week is not UNSET: - field_dict["day_of_week"] = day_of_week - if hour_of_day is not UNSET: - field_dict["hour_of_day"] = hour_of_day - if minute_of_hour is not UNSET: - field_dict["minute_of_hour"] = minute_of_hour - if repeat_interval is not UNSET: - field_dict["repeat_interval"] = repeat_interval - if weekday_of_month is not UNSET: - field_dict["weekday_of_month"] = weekday_of_month - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - frequency = AgentTriggerFrequency(d.pop("frequency")) - - def _parse_day_of_month(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - day_of_month = _parse_day_of_month(d.pop("day_of_month", UNSET)) - - def _parse_day_of_week(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - day_of_week = _parse_day_of_week(d.pop("day_of_week", UNSET)) - - def _parse_hour_of_day(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - hour_of_day = _parse_hour_of_day(d.pop("hour_of_day", UNSET)) - - def _parse_minute_of_hour(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - minute_of_hour = _parse_minute_of_hour(d.pop("minute_of_hour", UNSET)) - - repeat_interval = d.pop("repeat_interval", UNSET) - - def _parse_weekday_of_month(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - weekday_of_month = _parse_weekday_of_month(d.pop("weekday_of_month", UNSET)) - - create_trigger_schedule_request = cls( - frequency=frequency, - day_of_month=day_of_month, - day_of_week=day_of_week, - hour_of_day=hour_of_day, - minute_of_hour=minute_of_hour, - repeat_interval=repeat_interval, - weekday_of_month=weekday_of_month, - ) - - create_trigger_schedule_request.additional_properties = d - return create_trigger_schedule_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/seclai/_generated/seclai_api_client/models/credit_purchase_confirm_request.py b/seclai/_generated/seclai_api_client/models/credit_purchase_confirm_request.py deleted file mode 100644 index 021db31..0000000 --- a/seclai/_generated/seclai_api_client/models/credit_purchase_confirm_request.py +++ /dev/null @@ -1,61 +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="CreditPurchaseConfirmRequest") - - -@_attrs_define -class CreditPurchaseConfirmRequest: - """ - Attributes: - payment_intent_id (str): - """ - - payment_intent_id: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - payment_intent_id = self.payment_intent_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "payment_intent_id": payment_intent_id, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - payment_intent_id = d.pop("payment_intent_id") - - credit_purchase_confirm_request = cls( - payment_intent_id=payment_intent_id, - ) - - credit_purchase_confirm_request.additional_properties = d - return credit_purchase_confirm_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/seclai/_generated/seclai_api_client/models/credit_purchase_price_response.py b/seclai/_generated/seclai_api_client/models/credit_purchase_price_response.py deleted file mode 100644 index 1c04a4d..0000000 --- a/seclai/_generated/seclai_api_client/models/credit_purchase_price_response.py +++ /dev/null @@ -1,77 +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="CreditPurchasePriceResponse") - - -@_attrs_define -class CreditPurchasePriceResponse: - """ - Attributes: - credits_ (int): - currency (str): - price (float): - """ - - credits_: int - currency: str - price: float - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - credits_ = self.credits_ - - currency = self.currency - - price = self.price - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "credits": credits_, - "currency": currency, - "price": price, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - credits_ = d.pop("credits") - - currency = d.pop("currency") - - price = d.pop("price") - - credit_purchase_price_response = cls( - credits_=credits_, - currency=currency, - price=price, - ) - - credit_purchase_price_response.additional_properties = d - return credit_purchase_price_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/seclai/_generated/seclai_api_client/models/credit_purchase_request.py b/seclai/_generated/seclai_api_client/models/credit_purchase_request.py deleted file mode 100644 index a777e39..0000000 --- a/seclai/_generated/seclai_api_client/models/credit_purchase_request.py +++ /dev/null @@ -1,61 +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="CreditPurchaseRequest") - - -@_attrs_define -class CreditPurchaseRequest: - """ - Attributes: - amount (float): Amount to spend on credits ($10 - $1,000) - """ - - amount: float - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - amount = self.amount - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "amount": amount, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - amount = d.pop("amount") - - credit_purchase_request = cls( - amount=amount, - ) - - credit_purchase_request.additional_properties = d - return credit_purchase_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/seclai/_generated/seclai_api_client/models/credit_purchase_response.py b/seclai/_generated/seclai_api_client/models/credit_purchase_response.py deleted file mode 100644 index 0f5c30d..0000000 --- a/seclai/_generated/seclai_api_client/models/credit_purchase_response.py +++ /dev/null @@ -1,131 +0,0 @@ -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="CreditPurchaseResponse") - - -@_attrs_define -class CreditPurchaseResponse: - """ - Attributes: - message (str): - success (bool): - client_secret (None | str | Unset): - credits_ (int | None | Unset): - payment_intent_id (None | str | Unset): - """ - - message: str - success: bool - client_secret: None | str | Unset = UNSET - credits_: int | None | Unset = UNSET - payment_intent_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - message = self.message - - success = self.success - - client_secret: None | str | Unset - if isinstance(self.client_secret, Unset): - client_secret = UNSET - else: - client_secret = self.client_secret - - credits_: int | None | Unset - if isinstance(self.credits_, Unset): - credits_ = UNSET - else: - credits_ = self.credits_ - - payment_intent_id: None | str | Unset - if isinstance(self.payment_intent_id, Unset): - payment_intent_id = UNSET - else: - payment_intent_id = self.payment_intent_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "message": message, - "success": success, - } - ) - if client_secret is not UNSET: - field_dict["client_secret"] = client_secret - if credits_ is not UNSET: - field_dict["credits"] = credits_ - if payment_intent_id is not UNSET: - field_dict["payment_intent_id"] = payment_intent_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - message = d.pop("message") - - success = d.pop("success") - - def _parse_client_secret(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - client_secret = _parse_client_secret(d.pop("client_secret", UNSET)) - - def _parse_credits_(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - credits_ = _parse_credits_(d.pop("credits", UNSET)) - - def _parse_payment_intent_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - payment_intent_id = _parse_payment_intent_id(d.pop("payment_intent_id", UNSET)) - - credit_purchase_response = cls( - message=message, - success=success, - client_secret=client_secret, - credits_=credits_, - payment_intent_id=payment_intent_id, - ) - - credit_purchase_response.additional_properties = d - return credit_purchase_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/seclai/_generated/seclai_api_client/models/credit_purchase_with_payment_method_request.py b/seclai/_generated/seclai_api_client/models/credit_purchase_with_payment_method_request.py deleted file mode 100644 index 59bb51c..0000000 --- a/seclai/_generated/seclai_api_client/models/credit_purchase_with_payment_method_request.py +++ /dev/null @@ -1,69 +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="CreditPurchaseWithPaymentMethodRequest") - - -@_attrs_define -class CreditPurchaseWithPaymentMethodRequest: - """ - Attributes: - amount (float): Amount to spend on credits ($10 - $1,000) - payment_method_id (str): ID of the existing payment method to use - """ - - amount: float - payment_method_id: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - amount = self.amount - - payment_method_id = self.payment_method_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "amount": amount, - "payment_method_id": payment_method_id, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - amount = d.pop("amount") - - payment_method_id = d.pop("payment_method_id") - - credit_purchase_with_payment_method_request = cls( - amount=amount, - payment_method_id=payment_method_id, - ) - - credit_purchase_with_payment_method_request.additional_properties = d - return credit_purchase_with_payment_method_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/seclai/_generated/seclai_api_client/models/credit_purchase_with_payment_method_response.py b/seclai/_generated/seclai_api_client/models/credit_purchase_with_payment_method_response.py deleted file mode 100644 index 7166ecc..0000000 --- a/seclai/_generated/seclai_api_client/models/credit_purchase_with_payment_method_response.py +++ /dev/null @@ -1,151 +0,0 @@ -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="CreditPurchaseWithPaymentMethodResponse") - - -@_attrs_define -class CreditPurchaseWithPaymentMethodResponse: - """ - Attributes: - message (str): - success (bool): - client_secret (None | str | Unset): - credits_ (int | None | Unset): - payment_intent_id (None | str | Unset): - status (None | str | Unset): - """ - - message: str - success: bool - client_secret: None | str | Unset = UNSET - credits_: int | None | Unset = UNSET - payment_intent_id: None | str | Unset = UNSET - status: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - message = self.message - - success = self.success - - client_secret: None | str | Unset - if isinstance(self.client_secret, Unset): - client_secret = UNSET - else: - client_secret = self.client_secret - - credits_: int | None | Unset - if isinstance(self.credits_, Unset): - credits_ = UNSET - else: - credits_ = self.credits_ - - payment_intent_id: None | str | Unset - if isinstance(self.payment_intent_id, Unset): - payment_intent_id = UNSET - else: - payment_intent_id = self.payment_intent_id - - status: None | str | Unset - if isinstance(self.status, Unset): - status = UNSET - else: - status = self.status - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "message": message, - "success": success, - } - ) - if client_secret is not UNSET: - field_dict["client_secret"] = client_secret - if credits_ is not UNSET: - field_dict["credits"] = credits_ - if payment_intent_id is not UNSET: - field_dict["payment_intent_id"] = payment_intent_id - 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) - message = d.pop("message") - - success = d.pop("success") - - def _parse_client_secret(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - client_secret = _parse_client_secret(d.pop("client_secret", UNSET)) - - def _parse_credits_(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - credits_ = _parse_credits_(d.pop("credits", UNSET)) - - def _parse_payment_intent_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - payment_intent_id = _parse_payment_intent_id(d.pop("payment_intent_id", UNSET)) - - def _parse_status(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - status = _parse_status(d.pop("status", UNSET)) - - credit_purchase_with_payment_method_response = cls( - message=message, - success=success, - client_secret=client_secret, - credits_=credits_, - payment_intent_id=payment_intent_id, - status=status, - ) - - credit_purchase_with_payment_method_response.additional_properties = d - return credit_purchase_with_payment_method_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/seclai/_generated/seclai_api_client/models/credit_usage_slice_response.py b/seclai/_generated/seclai_api_client/models/credit_usage_slice_response.py deleted file mode 100644 index 995b193..0000000 --- a/seclai/_generated/seclai_api_client/models/credit_usage_slice_response.py +++ /dev/null @@ -1,93 +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.activity_credit_usage_response import ActivityCreditUsageResponse - - -T = TypeVar("T", bound="CreditUsageSliceResponse") - - -@_attrs_define -class CreditUsageSliceResponse: - """ - Attributes: - activities (list[ActivityCreditUsageResponse]): - credits_ (float): - start (str): - """ - - activities: list[ActivityCreditUsageResponse] - credits_: float - start: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - activities = [] - for activities_item_data in self.activities: - activities_item = activities_item_data.to_dict() - activities.append(activities_item) - - credits_ = self.credits_ - - start = self.start - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "activities": activities, - "credits": credits_, - "start": start, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.activity_credit_usage_response import ActivityCreditUsageResponse - - d = dict(src_dict) - activities = [] - _activities = d.pop("activities") - for activities_item_data in _activities: - activities_item = ActivityCreditUsageResponse.from_dict( - activities_item_data - ) - - activities.append(activities_item) - - credits_ = d.pop("credits") - - start = d.pop("start") - - credit_usage_slice_response = cls( - activities=activities, - credits_=credits_, - start=start, - ) - - credit_usage_slice_response.additional_properties = d - return credit_usage_slice_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/seclai/_generated/seclai_api_client/models/default_chunking_config.py b/seclai/_generated/seclai_api_client/models/default_chunking_config.py deleted file mode 100644 index dff2d70..0000000 --- a/seclai/_generated/seclai_api_client/models/default_chunking_config.py +++ /dev/null @@ -1,78 +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="DefaultChunkingConfig") - - -@_attrs_define -class DefaultChunkingConfig: - """Default chunking configuration - - Attributes: - chunk_mode (str): Default chunking mode: 'custom' or 'language' - chunk_overlap (int): Default chunk overlap in characters - chunk_size (int): Default chunk size in characters - """ - - chunk_mode: str - chunk_overlap: int - chunk_size: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - chunk_mode = self.chunk_mode - - chunk_overlap = self.chunk_overlap - - chunk_size = self.chunk_size - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "chunk_mode": chunk_mode, - "chunk_overlap": chunk_overlap, - "chunk_size": chunk_size, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - chunk_mode = d.pop("chunk_mode") - - chunk_overlap = d.pop("chunk_overlap") - - chunk_size = d.pop("chunk_size") - - default_chunking_config = cls( - chunk_mode=chunk_mode, - chunk_overlap=chunk_overlap, - chunk_size=chunk_size, - ) - - default_chunking_config.additional_properties = d - return default_chunking_config - - @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/seclai/_generated/seclai_api_client/models/delete_account_response.py b/seclai/_generated/seclai_api_client/models/delete_account_response.py deleted file mode 100644 index 496e429..0000000 --- a/seclai/_generated/seclai_api_client/models/delete_account_response.py +++ /dev/null @@ -1,84 +0,0 @@ -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="DeleteAccountResponse") - - -@_attrs_define -class DeleteAccountResponse: - """Response model for account deletion. - - Attributes: - message (str): - deleted_at (None | str | Unset): - """ - - message: str - deleted_at: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - message = self.message - - deleted_at: None | str | Unset - if isinstance(self.deleted_at, Unset): - deleted_at = UNSET - else: - deleted_at = self.deleted_at - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "message": message, - } - ) - if deleted_at is not UNSET: - field_dict["deleted_at"] = deleted_at - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - message = d.pop("message") - - def _parse_deleted_at(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - deleted_at = _parse_deleted_at(d.pop("deleted_at", UNSET)) - - delete_account_response = cls( - message=message, - deleted_at=deleted_at, - ) - - delete_account_response.additional_properties = d - return delete_account_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/seclai/_generated/seclai_api_client/models/detect_source_request.py b/seclai/_generated/seclai_api_client/models/detect_source_request.py deleted file mode 100644 index 8806154..0000000 --- a/seclai/_generated/seclai_api_client/models/detect_source_request.py +++ /dev/null @@ -1,62 +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="DetectSourceRequest") - - -@_attrs_define -class DetectSourceRequest: - """Request model for detecting a source type for a URL - - Attributes: - url (str): URL to inspect for source type - """ - - url: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - url = self.url - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "url": url, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - url = d.pop("url") - - detect_source_request = cls( - url=url, - ) - - detect_source_request.additional_properties = d - return detect_source_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/seclai/_generated/seclai_api_client/models/detect_source_response.py b/seclai/_generated/seclai_api_client/models/detect_source_response.py deleted file mode 100644 index e2d5691..0000000 --- a/seclai/_generated/seclai_api_client/models/detect_source_response.py +++ /dev/null @@ -1,452 +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.feed_item import FeedItem - from ..models.page_link import PageLink - from ..models.rss_content_option import RSSContentOption - - -T = TypeVar("T", bound="DetectSourceResponse") - - -@_attrs_define -class DetectSourceResponse: - """Response model for detection results - - Attributes: - source_type (str): Detected type: 'website' or 'rss_feed' - avg_episodes_per_month (float | None | Unset): Average number of episodes published per month - avg_words_per_episode (int | None | Unset): Average word count per episode - content_type (None | str | Unset): HTTP Content-Type observed during detection - error (None | str | Unset): Error message if detection failed - estimated_episodes_per_day (float | None | Unset): Estimated number of episodes per day based on RSS feed - publication dates - example_words_per_episode (int | Unset): Example word count if no historical data available Default: 500. - existing_source_name (None | str | Unset): Name of the existing source if user already has it - feed_items (list[FeedItem] | None | Unset): List of detected feed items - feed_title (None | str | Unset): Detected feed title - final_url (None | str | Unset): Final resolved URL after redirects (if any) - has_historical_data (bool | Unset): Whether we have historical data for this feed Default: False. - page_links (list[PageLink] | None | Unset): List of discovered subpages for websites - rss_content_default (None | str | Unset): Recommended default RSS content selection - rss_content_options (list[RSSContentOption] | None | Unset): Available RSS content selection options - title (None | str | Unset): Detected page/feed title - url_id (None | str | Unset): ID of the URL - """ - - source_type: str - avg_episodes_per_month: float | None | Unset = UNSET - avg_words_per_episode: int | None | Unset = UNSET - content_type: None | str | Unset = UNSET - error: None | str | Unset = UNSET - estimated_episodes_per_day: float | None | Unset = UNSET - example_words_per_episode: int | Unset = 500 - existing_source_name: None | str | Unset = UNSET - feed_items: list[FeedItem] | None | Unset = UNSET - feed_title: None | str | Unset = UNSET - final_url: None | str | Unset = UNSET - has_historical_data: bool | Unset = False - page_links: list[PageLink] | None | Unset = UNSET - rss_content_default: None | str | Unset = UNSET - rss_content_options: list[RSSContentOption] | None | Unset = UNSET - title: None | str | Unset = UNSET - url_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - source_type = self.source_type - - avg_episodes_per_month: float | None | Unset - if isinstance(self.avg_episodes_per_month, Unset): - avg_episodes_per_month = UNSET - else: - avg_episodes_per_month = self.avg_episodes_per_month - - avg_words_per_episode: int | None | Unset - if isinstance(self.avg_words_per_episode, Unset): - avg_words_per_episode = UNSET - else: - avg_words_per_episode = self.avg_words_per_episode - - content_type: None | str | Unset - if isinstance(self.content_type, Unset): - content_type = UNSET - else: - content_type = self.content_type - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - estimated_episodes_per_day: float | None | Unset - if isinstance(self.estimated_episodes_per_day, Unset): - estimated_episodes_per_day = UNSET - else: - estimated_episodes_per_day = self.estimated_episodes_per_day - - example_words_per_episode = self.example_words_per_episode - - existing_source_name: None | str | Unset - if isinstance(self.existing_source_name, Unset): - existing_source_name = UNSET - else: - existing_source_name = self.existing_source_name - - feed_items: list[dict[str, Any]] | None | Unset - if isinstance(self.feed_items, Unset): - feed_items = UNSET - elif isinstance(self.feed_items, list): - feed_items = [] - for feed_items_type_0_item_data in self.feed_items: - feed_items_type_0_item = feed_items_type_0_item_data.to_dict() - feed_items.append(feed_items_type_0_item) - - else: - feed_items = self.feed_items - - feed_title: None | str | Unset - if isinstance(self.feed_title, Unset): - feed_title = UNSET - else: - feed_title = self.feed_title - - final_url: None | str | Unset - if isinstance(self.final_url, Unset): - final_url = UNSET - else: - final_url = self.final_url - - has_historical_data = self.has_historical_data - - page_links: list[dict[str, Any]] | None | Unset - if isinstance(self.page_links, Unset): - page_links = UNSET - elif isinstance(self.page_links, list): - page_links = [] - for page_links_type_0_item_data in self.page_links: - page_links_type_0_item = page_links_type_0_item_data.to_dict() - page_links.append(page_links_type_0_item) - - else: - page_links = self.page_links - - rss_content_default: None | str | Unset - if isinstance(self.rss_content_default, Unset): - rss_content_default = UNSET - else: - rss_content_default = self.rss_content_default - - rss_content_options: list[dict[str, Any]] | None | Unset - if isinstance(self.rss_content_options, Unset): - rss_content_options = UNSET - elif isinstance(self.rss_content_options, list): - rss_content_options = [] - for rss_content_options_type_0_item_data in self.rss_content_options: - rss_content_options_type_0_item = ( - rss_content_options_type_0_item_data.to_dict() - ) - rss_content_options.append(rss_content_options_type_0_item) - - else: - rss_content_options = self.rss_content_options - - title: None | str | Unset - if isinstance(self.title, Unset): - title = UNSET - else: - title = self.title - - url_id: None | str | Unset - if isinstance(self.url_id, Unset): - url_id = UNSET - else: - url_id = self.url_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "source_type": source_type, - } - ) - if avg_episodes_per_month is not UNSET: - field_dict["avg_episodes_per_month"] = avg_episodes_per_month - if avg_words_per_episode is not UNSET: - field_dict["avg_words_per_episode"] = avg_words_per_episode - if content_type is not UNSET: - field_dict["content_type"] = content_type - if error is not UNSET: - field_dict["error"] = error - if estimated_episodes_per_day is not UNSET: - field_dict["estimated_episodes_per_day"] = estimated_episodes_per_day - if example_words_per_episode is not UNSET: - field_dict["example_words_per_episode"] = example_words_per_episode - if existing_source_name is not UNSET: - field_dict["existing_source_name"] = existing_source_name - if feed_items is not UNSET: - field_dict["feed_items"] = feed_items - if feed_title is not UNSET: - field_dict["feed_title"] = feed_title - if final_url is not UNSET: - field_dict["final_url"] = final_url - if has_historical_data is not UNSET: - field_dict["has_historical_data"] = has_historical_data - if page_links is not UNSET: - field_dict["page_links"] = page_links - if rss_content_default is not UNSET: - field_dict["rss_content_default"] = rss_content_default - if rss_content_options is not UNSET: - field_dict["rss_content_options"] = rss_content_options - if title is not UNSET: - field_dict["title"] = title - if url_id is not UNSET: - field_dict["url_id"] = url_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.feed_item import FeedItem - from ..models.page_link import PageLink - from ..models.rss_content_option import RSSContentOption - - d = dict(src_dict) - source_type = d.pop("source_type") - - def _parse_avg_episodes_per_month(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - avg_episodes_per_month = _parse_avg_episodes_per_month( - d.pop("avg_episodes_per_month", UNSET) - ) - - def _parse_avg_words_per_episode(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - avg_words_per_episode = _parse_avg_words_per_episode( - d.pop("avg_words_per_episode", UNSET) - ) - - def _parse_content_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - content_type = _parse_content_type(d.pop("content_type", UNSET)) - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_estimated_episodes_per_day(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - estimated_episodes_per_day = _parse_estimated_episodes_per_day( - d.pop("estimated_episodes_per_day", UNSET) - ) - - example_words_per_episode = d.pop("example_words_per_episode", UNSET) - - def _parse_existing_source_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - existing_source_name = _parse_existing_source_name( - d.pop("existing_source_name", UNSET) - ) - - def _parse_feed_items(data: object) -> list[FeedItem] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - feed_items_type_0 = [] - _feed_items_type_0 = data - for feed_items_type_0_item_data in _feed_items_type_0: - feed_items_type_0_item = FeedItem.from_dict( - feed_items_type_0_item_data - ) - - feed_items_type_0.append(feed_items_type_0_item) - - return feed_items_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[FeedItem] | None | Unset, data) - - feed_items = _parse_feed_items(d.pop("feed_items", UNSET)) - - def _parse_feed_title(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - feed_title = _parse_feed_title(d.pop("feed_title", UNSET)) - - def _parse_final_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - final_url = _parse_final_url(d.pop("final_url", UNSET)) - - has_historical_data = d.pop("has_historical_data", UNSET) - - def _parse_page_links(data: object) -> list[PageLink] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - page_links_type_0 = [] - _page_links_type_0 = data - for page_links_type_0_item_data in _page_links_type_0: - page_links_type_0_item = PageLink.from_dict( - page_links_type_0_item_data - ) - - page_links_type_0.append(page_links_type_0_item) - - return page_links_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[PageLink] | None | Unset, data) - - page_links = _parse_page_links(d.pop("page_links", UNSET)) - - def _parse_rss_content_default(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - rss_content_default = _parse_rss_content_default( - d.pop("rss_content_default", UNSET) - ) - - def _parse_rss_content_options( - data: object, - ) -> list[RSSContentOption] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - rss_content_options_type_0 = [] - _rss_content_options_type_0 = data - for rss_content_options_type_0_item_data in _rss_content_options_type_0: - rss_content_options_type_0_item = RSSContentOption.from_dict( - rss_content_options_type_0_item_data - ) - - rss_content_options_type_0.append(rss_content_options_type_0_item) - - return rss_content_options_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[RSSContentOption] | None | Unset, data) - - rss_content_options = _parse_rss_content_options( - d.pop("rss_content_options", UNSET) - ) - - def _parse_title(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - title = _parse_title(d.pop("title", UNSET)) - - def _parse_url_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - url_id = _parse_url_id(d.pop("url_id", UNSET)) - - detect_source_response = cls( - source_type=source_type, - avg_episodes_per_month=avg_episodes_per_month, - avg_words_per_episode=avg_words_per_episode, - content_type=content_type, - error=error, - estimated_episodes_per_day=estimated_episodes_per_day, - example_words_per_episode=example_words_per_episode, - existing_source_name=existing_source_name, - feed_items=feed_items, - feed_title=feed_title, - final_url=final_url, - has_historical_data=has_historical_data, - page_links=page_links, - rss_content_default=rss_content_default, - rss_content_options=rss_content_options, - title=title, - url_id=url_id, - ) - - detect_source_response.additional_properties = d - return detect_source_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/seclai/_generated/seclai_api_client/models/email_preference_response.py b/seclai/_generated/seclai_api_client/models/email_preference_response.py deleted file mode 100644 index 965506a..0000000 --- a/seclai/_generated/seclai_api_client/models/email_preference_response.py +++ /dev/null @@ -1,78 +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="EmailPreferenceResponse") - - -@_attrs_define -class EmailPreferenceResponse: - """Response model for email preference - - Attributes: - email_type (str): Type of email - mandatory (bool): Whether this preference is mandatory - subscribed (bool): Whether user is subscribed - """ - - email_type: str - mandatory: bool - subscribed: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - email_type = self.email_type - - mandatory = self.mandatory - - subscribed = self.subscribed - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "email_type": email_type, - "mandatory": mandatory, - "subscribed": subscribed, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - email_type = d.pop("email_type") - - mandatory = d.pop("mandatory") - - subscribed = d.pop("subscribed") - - email_preference_response = cls( - email_type=email_type, - mandatory=mandatory, - subscribed=subscribed, - ) - - email_preference_response.additional_properties = d - return email_preference_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/seclai/_generated/seclai_api_client/models/embedding_cost_info.py b/seclai/_generated/seclai_api_client/models/embedding_cost_info.py deleted file mode 100644 index 8c14ff8..0000000 --- a/seclai/_generated/seclai_api_client/models/embedding_cost_info.py +++ /dev/null @@ -1,83 +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="EmbeddingCostInfo") - - -@_attrs_define -class EmbeddingCostInfo: - """Embedding cost information for a specific model/dimension combination - - Costs are calculated for a 15-word query using the conversion formula: - - 4 characters per token - - 6 characters average per English word - - Therefore: 15 words × (4/6) tokens/word = 10 tokens - - Attributes: - credits_per_15_word_query (float): - dimensions (int): - model (str): - """ - - credits_per_15_word_query: float - dimensions: int - model: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - credits_per_15_word_query = self.credits_per_15_word_query - - dimensions = self.dimensions - - model = self.model - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "credits_per_15_word_query": credits_per_15_word_query, - "dimensions": dimensions, - "model": model, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - credits_per_15_word_query = d.pop("credits_per_15_word_query") - - dimensions = d.pop("dimensions") - - model = d.pop("model") - - embedding_cost_info = cls( - credits_per_15_word_query=credits_per_15_word_query, - dimensions=dimensions, - model=model, - ) - - embedding_cost_info.additional_properties = d - return embedding_cost_info - - @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/seclai/_generated/seclai_api_client/models/embedding_model_info.py b/seclai/_generated/seclai_api_client/models/embedding_model_info.py deleted file mode 100644 index f6bbb64..0000000 --- a/seclai/_generated/seclai_api_client/models/embedding_model_info.py +++ /dev/null @@ -1,190 +0,0 @@ -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="EmbeddingModelInfo") - - -@_attrs_define -class EmbeddingModelInfo: - """Information about an embedding model - - Attributes: - credits_ (float): Estimated credits per 1,000 English words - dimensions (list[int]): Dimensions options - model_id (str): Model identifier - model_type (str): Full model type identifier (enum value) - description (None | str | Unset): Model description - mteb_retrieval_score (float | None | Unset): MTEB retrieval score - name (None | str | Unset): Human-readable model name - speed (None | str | Unset): Model processing speed - url (None | str | Unset): Model documentation URL - """ - - credits_: float - dimensions: list[int] - model_id: str - model_type: str - description: None | str | Unset = UNSET - mteb_retrieval_score: float | None | Unset = UNSET - name: None | str | Unset = UNSET - speed: None | str | Unset = UNSET - url: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - credits_ = self.credits_ - - dimensions = self.dimensions - - model_id = self.model_id - - model_type = self.model_type - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - mteb_retrieval_score: float | None | Unset - if isinstance(self.mteb_retrieval_score, Unset): - mteb_retrieval_score = UNSET - else: - mteb_retrieval_score = self.mteb_retrieval_score - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - speed: None | str | Unset - if isinstance(self.speed, Unset): - speed = UNSET - else: - speed = self.speed - - url: None | str | Unset - if isinstance(self.url, Unset): - url = UNSET - else: - url = self.url - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "credits": credits_, - "dimensions": dimensions, - "model_id": model_id, - "model_type": model_type, - } - ) - if description is not UNSET: - field_dict["description"] = description - if mteb_retrieval_score is not UNSET: - field_dict["mteb_retrieval_score"] = mteb_retrieval_score - if name is not UNSET: - field_dict["name"] = name - if speed is not UNSET: - field_dict["speed"] = speed - if url is not UNSET: - field_dict["url"] = url - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - credits_ = d.pop("credits") - - dimensions = cast(list[int], d.pop("dimensions")) - - model_id = d.pop("model_id") - - model_type = d.pop("model_type") - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_mteb_retrieval_score(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - mteb_retrieval_score = _parse_mteb_retrieval_score( - d.pop("mteb_retrieval_score", UNSET) - ) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - def _parse_speed(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - speed = _parse_speed(d.pop("speed", UNSET)) - - def _parse_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - url = _parse_url(d.pop("url", UNSET)) - - embedding_model_info = cls( - credits_=credits_, - dimensions=dimensions, - model_id=model_id, - model_type=model_type, - description=description, - mteb_retrieval_score=mteb_retrieval_score, - name=name, - speed=speed, - url=url, - ) - - embedding_model_info.additional_properties = d - return embedding_model_info - - @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/seclai/_generated/seclai_api_client/models/embedding_models_response.py b/seclai/_generated/seclai_api_client/models/embedding_models_response.py deleted file mode 100644 index 114586d..0000000 --- a/seclai/_generated/seclai_api_client/models/embedding_models_response.py +++ /dev/null @@ -1,176 +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.default_chunking_config import DefaultChunkingConfig - from ..models.embedding_model_info import EmbeddingModelInfo - from ..models.embedding_storage_credits import EmbeddingStorageCredits - from ..models.language_option import LanguageOption - - -T = TypeVar("T", bound="EmbeddingModelsResponse") - - -@_attrs_define -class EmbeddingModelsResponse: - """Response model for embedding models list - - Attributes: - default_chunking (DefaultChunkingConfig): Default chunking configuration - file_processing_credits_per_mb (float): Credits per MB for file processing - language_options (list[LanguageOption]): Available programming languages for language-specific chunking - models (list[EmbeddingModelInfo]): List of available embedding models - storage_credits (list[EmbeddingStorageCredits]): Storage credits information for embedding dimensions - default_dimension (int | None | Unset): Default dimension for the default model - default_model_type (None | str | Unset): Default model type (full enum value) - """ - - default_chunking: DefaultChunkingConfig - file_processing_credits_per_mb: float - language_options: list[LanguageOption] - models: list[EmbeddingModelInfo] - storage_credits: list[EmbeddingStorageCredits] - default_dimension: int | None | Unset = UNSET - default_model_type: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - default_chunking = self.default_chunking.to_dict() - - file_processing_credits_per_mb = self.file_processing_credits_per_mb - - language_options = [] - for language_options_item_data in self.language_options: - language_options_item = language_options_item_data.to_dict() - language_options.append(language_options_item) - - models = [] - for models_item_data in self.models: - models_item = models_item_data.to_dict() - models.append(models_item) - - storage_credits = [] - for storage_credits_item_data in self.storage_credits: - storage_credits_item = storage_credits_item_data.to_dict() - storage_credits.append(storage_credits_item) - - default_dimension: int | None | Unset - if isinstance(self.default_dimension, Unset): - default_dimension = UNSET - else: - default_dimension = self.default_dimension - - default_model_type: None | str | Unset - if isinstance(self.default_model_type, Unset): - default_model_type = UNSET - else: - default_model_type = self.default_model_type - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "default_chunking": default_chunking, - "file_processing_credits_per_mb": file_processing_credits_per_mb, - "language_options": language_options, - "models": models, - "storage_credits": storage_credits, - } - ) - if default_dimension is not UNSET: - field_dict["default_dimension"] = default_dimension - if default_model_type is not UNSET: - field_dict["default_model_type"] = default_model_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.default_chunking_config import DefaultChunkingConfig - from ..models.embedding_model_info import EmbeddingModelInfo - from ..models.embedding_storage_credits import EmbeddingStorageCredits - from ..models.language_option import LanguageOption - - d = dict(src_dict) - default_chunking = DefaultChunkingConfig.from_dict(d.pop("default_chunking")) - - file_processing_credits_per_mb = d.pop("file_processing_credits_per_mb") - - language_options = [] - _language_options = d.pop("language_options") - for language_options_item_data in _language_options: - language_options_item = LanguageOption.from_dict(language_options_item_data) - - language_options.append(language_options_item) - - models = [] - _models = d.pop("models") - for models_item_data in _models: - models_item = EmbeddingModelInfo.from_dict(models_item_data) - - models.append(models_item) - - storage_credits = [] - _storage_credits = d.pop("storage_credits") - for storage_credits_item_data in _storage_credits: - storage_credits_item = EmbeddingStorageCredits.from_dict( - storage_credits_item_data - ) - - storage_credits.append(storage_credits_item) - - def _parse_default_dimension(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - default_dimension = _parse_default_dimension(d.pop("default_dimension", UNSET)) - - def _parse_default_model_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - default_model_type = _parse_default_model_type( - d.pop("default_model_type", UNSET) - ) - - embedding_models_response = cls( - default_chunking=default_chunking, - file_processing_credits_per_mb=file_processing_credits_per_mb, - language_options=language_options, - models=models, - storage_credits=storage_credits, - default_dimension=default_dimension, - default_model_type=default_model_type, - ) - - embedding_models_response.additional_properties = d - return embedding_models_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/seclai/_generated/seclai_api_client/models/embedding_storage_credits.py b/seclai/_generated/seclai_api_client/models/embedding_storage_credits.py deleted file mode 100644 index 431e908..0000000 --- a/seclai/_generated/seclai_api_client/models/embedding_storage_credits.py +++ /dev/null @@ -1,70 +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="EmbeddingStorageCredits") - - -@_attrs_define -class EmbeddingStorageCredits: - """Storage credits information for a specific dimensions setting - - Attributes: - credits_ (int): Credits per record per month - dimensions (int): Number of embedding dimensions - """ - - credits_: int - dimensions: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - credits_ = self.credits_ - - dimensions = self.dimensions - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "credits": credits_, - "dimensions": dimensions, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - credits_ = d.pop("credits") - - dimensions = d.pop("dimensions") - - embedding_storage_credits = cls( - credits_=credits_, - dimensions=dimensions, - ) - - embedding_storage_credits.additional_properties = d - return embedding_storage_credits - - @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/seclai/_generated/seclai_api_client/models/feed_item.py b/seclai/_generated/seclai_api_client/models/feed_item.py deleted file mode 100644 index d1f54fe..0000000 --- a/seclai/_generated/seclai_api_client/models/feed_item.py +++ /dev/null @@ -1,90 +0,0 @@ -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 - -T = TypeVar("T", bound="FeedItem") - - -@_attrs_define -class FeedItem: - """Information about a single feed item. - - Attributes: - guid (str): - published_at (None | str): - title (None | str): - """ - - guid: str - published_at: None | str - title: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - guid = self.guid - - published_at: None | str - published_at = self.published_at - - title: None | str - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "guid": guid, - "published_at": published_at, - "title": title, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - guid = d.pop("guid") - - def _parse_published_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - published_at = _parse_published_at(d.pop("published_at")) - - def _parse_title(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - title = _parse_title(d.pop("title")) - - feed_item = cls( - guid=guid, - published_at=published_at, - title=title, - ) - - feed_item.additional_properties = d - return feed_item - - @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/seclai/_generated/seclai_api_client/models/file_upload_config_response.py b/seclai/_generated/seclai_api_client/models/file_upload_config_response.py deleted file mode 100644 index 3d1eb5e..0000000 --- a/seclai/_generated/seclai_api_client/models/file_upload_config_response.py +++ /dev/null @@ -1,83 +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_upload_config_response_supported_types import ( - FileUploadConfigResponseSupportedTypes, - ) - - -T = TypeVar("T", bound="FileUploadConfigResponse") - - -@_attrs_define -class FileUploadConfigResponse: - """Response model for file upload configuration - - Attributes: - max_file_size (int): Maximum file size in bytes - supported_types (FileUploadConfigResponseSupportedTypes): Map of MIME types to file info with 'ext' and - 'category' keys - """ - - max_file_size: int - supported_types: FileUploadConfigResponseSupportedTypes - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - max_file_size = self.max_file_size - - supported_types = self.supported_types.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "max_file_size": max_file_size, - "supported_types": supported_types, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.file_upload_config_response_supported_types import ( - FileUploadConfigResponseSupportedTypes, - ) - - d = dict(src_dict) - max_file_size = d.pop("max_file_size") - - supported_types = FileUploadConfigResponseSupportedTypes.from_dict( - d.pop("supported_types") - ) - - file_upload_config_response = cls( - max_file_size=max_file_size, - supported_types=supported_types, - ) - - file_upload_config_response.additional_properties = d - return file_upload_config_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/seclai/_generated/seclai_api_client/models/file_upload_config_response_supported_types.py b/seclai/_generated/seclai_api_client/models/file_upload_config_response_supported_types.py deleted file mode 100644 index 27eeacf..0000000 --- a/seclai/_generated/seclai_api_client/models/file_upload_config_response_supported_types.py +++ /dev/null @@ -1,75 +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_upload_config_response_supported_types_additional_property import ( - FileUploadConfigResponseSupportedTypesAdditionalProperty, - ) - - -T = TypeVar("T", bound="FileUploadConfigResponseSupportedTypes") - - -@_attrs_define -class FileUploadConfigResponseSupportedTypes: - """Map of MIME types to file info with 'ext' and 'category' keys""" - - additional_properties: dict[ - str, FileUploadConfigResponseSupportedTypesAdditionalProperty - ] = _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_upload_config_response_supported_types_additional_property import ( - FileUploadConfigResponseSupportedTypesAdditionalProperty, - ) - - d = dict(src_dict) - file_upload_config_response_supported_types = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = ( - FileUploadConfigResponseSupportedTypesAdditionalProperty.from_dict( - prop_dict - ) - ) - - additional_properties[prop_name] = additional_property - - file_upload_config_response_supported_types.additional_properties = ( - additional_properties - ) - return file_upload_config_response_supported_types - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__( - self, key: str - ) -> FileUploadConfigResponseSupportedTypesAdditionalProperty: - return self.additional_properties[key] - - def __setitem__( - self, key: str, value: FileUploadConfigResponseSupportedTypesAdditionalProperty - ) -> 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/seclai/_generated/seclai_api_client/models/file_upload_config_response_supported_types_additional_property.py b/seclai/_generated/seclai_api_client/models/file_upload_config_response_supported_types_additional_property.py deleted file mode 100644 index 6178587..0000000 --- a/seclai/_generated/seclai_api_client/models/file_upload_config_response_supported_types_additional_property.py +++ /dev/null @@ -1,48 +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="FileUploadConfigResponseSupportedTypesAdditionalProperty") - - -@_attrs_define -class FileUploadConfigResponseSupportedTypesAdditionalProperty: - """ """ - - 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) - file_upload_config_response_supported_types_additional_property = cls() - - file_upload_config_response_supported_types_additional_property.additional_properties = ( - d - ) - return file_upload_config_response_supported_types_additional_property - - @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/seclai/_generated/seclai_api_client/models/file_upload_response.py b/seclai/_generated/seclai_api_client/models/file_upload_response.py deleted file mode 100644 index 30bfc20..0000000 --- a/seclai/_generated/seclai_api_client/models/file_upload_response.py +++ /dev/null @@ -1,103 +0,0 @@ -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 - -T = TypeVar("T", bound="FileUploadResponse") - - -@_attrs_define -class FileUploadResponse: - """Response model for file upload - - Attributes: - content_version_id (None | str): ID of the created content version - filename (str): Original filename - source_connection_content_version_id (None | str): ID of the duplicate source connection content version - status (str): Processing status - """ - - content_version_id: None | str - filename: str - source_connection_content_version_id: None | str - status: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - content_version_id: None | str - content_version_id = self.content_version_id - - filename = self.filename - - source_connection_content_version_id: None | str - source_connection_content_version_id = self.source_connection_content_version_id - - status = self.status - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "content_version_id": content_version_id, - "filename": filename, - "source_connection_content_version_id": source_connection_content_version_id, - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_content_version_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - content_version_id = _parse_content_version_id(d.pop("content_version_id")) - - filename = d.pop("filename") - - def _parse_source_connection_content_version_id(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - source_connection_content_version_id = ( - _parse_source_connection_content_version_id( - d.pop("source_connection_content_version_id") - ) - ) - - status = d.pop("status") - - file_upload_response = cls( - content_version_id=content_version_id, - filename=filename, - source_connection_content_version_id=source_connection_content_version_id, - status=status, - ) - - file_upload_response.additional_properties = d - return file_upload_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/seclai/_generated/seclai_api_client/models/http_validation_error.py b/seclai/_generated/seclai_api_client/models/http_validation_error.py deleted file mode 100644 index 195e5a7..0000000 --- a/seclai/_generated/seclai_api_client/models/http_validation_error.py +++ /dev/null @@ -1,79 +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 - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.validation_error import ValidationError - - -T = TypeVar("T", bound="HTTPValidationError") - - -@_attrs_define -class HTTPValidationError: - """ - Attributes: - detail (list[ValidationError] | Unset): - """ - - detail: list[ValidationError] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - detail: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.detail, Unset): - detail = [] - for detail_item_data in self.detail: - detail_item = detail_item_data.to_dict() - detail.append(detail_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if detail is not UNSET: - field_dict["detail"] = detail - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.validation_error import ValidationError - - d = dict(src_dict) - _detail = d.pop("detail", UNSET) - detail: list[ValidationError] | Unset = UNSET - if _detail is not UNSET: - detail = [] - for detail_item_data in _detail: - detail_item = ValidationError.from_dict(detail_item_data) - - detail.append(detail_item) - - http_validation_error = cls( - detail=detail, - ) - - http_validation_error.additional_properties = d - return http_validation_error - - @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/seclai/_generated/seclai_api_client/models/invitation_create_request.py b/seclai/_generated/seclai_api_client/models/invitation_create_request.py deleted file mode 100644 index d5d5f4f..0000000 --- a/seclai/_generated/seclai_api_client/models/invitation_create_request.py +++ /dev/null @@ -1,81 +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 - -from ..models.membership_type import MembershipType -from ..types import UNSET, Unset - -T = TypeVar("T", bound="InvitationCreateRequest") - - -@_attrs_define -class InvitationCreateRequest: - """Request model for creating an organization invitation. - - Attributes: - email (str): - membership_type (MembershipType | Unset): Organization membership types - """ - - email: str - membership_type: MembershipType | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - email = self.email - - membership_type: str | Unset = UNSET - if not isinstance(self.membership_type, Unset): - membership_type = self.membership_type.value - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "email": email, - } - ) - if membership_type is not UNSET: - field_dict["membership_type"] = membership_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - email = d.pop("email") - - _membership_type = d.pop("membership_type", UNSET) - membership_type: MembershipType | Unset - if isinstance(_membership_type, Unset): - membership_type = UNSET - else: - membership_type = MembershipType(_membership_type) - - invitation_create_request = cls( - email=email, - membership_type=membership_type, - ) - - invitation_create_request.additional_properties = d - return invitation_create_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/seclai/_generated/seclai_api_client/models/invitations_list_response.py b/seclai/_generated/seclai_api_client/models/invitations_list_response.py deleted file mode 100644 index d630e0b..0000000 --- a/seclai/_generated/seclai_api_client/models/invitations_list_response.py +++ /dev/null @@ -1,76 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="InvitationsListResponse") - - -@_attrs_define -class InvitationsListResponse: - """Response model for organization invitations list. - - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - invitations_list_response = cls( - data=data, - pagination=pagination, - ) - - invitations_list_response.additional_properties = d - return invitations_list_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/seclai/_generated/seclai_api_client/models/json_type.py b/seclai/_generated/seclai_api_client/models/json_type.py deleted file mode 100644 index d4d90b5..0000000 --- a/seclai/_generated/seclai_api_client/models/json_type.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class JsonType(str, Enum): - ARRAY = "array" - OBJECT = "object" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/knowledge_base_content_version_response.py b/seclai/_generated/seclai_api_client/models/knowledge_base_content_version_response.py deleted file mode 100644 index 575f4f1..0000000 --- a/seclai/_generated/seclai_api_client/models/knowledge_base_content_version_response.py +++ /dev/null @@ -1,120 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="KnowledgeBaseContentVersionResponse") - - -@_attrs_define -class KnowledgeBaseContentVersionResponse: - """ - Attributes: - id (UUID): - published_at (None | str): - source_name (str): - status (str): - title (None | str): - url (None | str): - """ - - id: UUID - published_at: None | str - source_name: str - status: str - title: None | str - url: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - id = str(self.id) - - published_at: None | str - published_at = self.published_at - - source_name = self.source_name - - status = self.status - - title: None | str - title = self.title - - url: None | str - url = self.url - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "id": id, - "published_at": published_at, - "source_name": source_name, - "status": status, - "title": title, - "url": url, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id = UUID(d.pop("id")) - - def _parse_published_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - published_at = _parse_published_at(d.pop("published_at")) - - source_name = d.pop("source_name") - - status = d.pop("status") - - def _parse_title(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - title = _parse_title(d.pop("title")) - - def _parse_url(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - url = _parse_url(d.pop("url")) - - knowledge_base_content_version_response = cls( - id=id, - published_at=published_at, - source_name=source_name, - status=status, - title=title, - url=url, - ) - - knowledge_base_content_version_response.additional_properties = d - return knowledge_base_content_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/seclai/_generated/seclai_api_client/models/knowledge_base_list_response.py b/seclai/_generated/seclai_api_client/models/knowledge_base_list_response.py deleted file mode 100644 index 8734044..0000000 --- a/seclai/_generated/seclai_api_client/models/knowledge_base_list_response.py +++ /dev/null @@ -1,76 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="KnowledgeBaseListResponse") - - -@_attrs_define -class KnowledgeBaseListResponse: - """Response model for paginated knowledge base list - - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - knowledge_base_list_response = cls( - data=data, - pagination=pagination, - ) - - knowledge_base_list_response.additional_properties = d - return knowledge_base_list_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/seclai/_generated/seclai_api_client/models/knowledge_base_response.py b/seclai/_generated/seclai_api_client/models/knowledge_base_response.py deleted file mode 100644 index cb765fd..0000000 --- a/seclai/_generated/seclai_api_client/models/knowledge_base_response.py +++ /dev/null @@ -1,184 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.account_response import AccountResponse - from ..models.source_connection_response import SourceConnectionResponse - - -T = TypeVar("T", bound="KnowledgeBaseResponse") - - -@_attrs_define -class KnowledgeBaseResponse: - """Response model for knowledge base data - - Attributes: - accounts (list[AccountResponse]): - created_at (str): - description (None | str): - id (UUID): - keyword_search_enabled (bool): - knowledge_base_enabled (bool): - mcp_server_enabled (bool): - name (str): - semantic_search_enabled (bool): - sources (list[SourceConnectionResponse]): - updated_at (str): - readonly (bool | Unset): Default: False. - """ - - accounts: list[AccountResponse] - created_at: str - description: None | str - id: UUID - keyword_search_enabled: bool - knowledge_base_enabled: bool - mcp_server_enabled: bool - name: str - semantic_search_enabled: bool - sources: list[SourceConnectionResponse] - updated_at: str - readonly: bool | Unset = False - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - accounts = [] - for accounts_item_data in self.accounts: - accounts_item = accounts_item_data.to_dict() - accounts.append(accounts_item) - - created_at = self.created_at - - description: None | str - description = self.description - - id = str(self.id) - - keyword_search_enabled = self.keyword_search_enabled - - knowledge_base_enabled = self.knowledge_base_enabled - - mcp_server_enabled = self.mcp_server_enabled - - name = self.name - - semantic_search_enabled = self.semantic_search_enabled - - sources = [] - for sources_item_data in self.sources: - sources_item = sources_item_data.to_dict() - sources.append(sources_item) - - updated_at = self.updated_at - - readonly = self.readonly - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "accounts": accounts, - "created_at": created_at, - "description": description, - "id": id, - "keyword_search_enabled": keyword_search_enabled, - "knowledge_base_enabled": knowledge_base_enabled, - "mcp_server_enabled": mcp_server_enabled, - "name": name, - "semantic_search_enabled": semantic_search_enabled, - "sources": sources, - "updated_at": updated_at, - } - ) - if readonly is not UNSET: - field_dict["readonly"] = readonly - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.account_response import AccountResponse - from ..models.source_connection_response import SourceConnectionResponse - - d = dict(src_dict) - accounts = [] - _accounts = d.pop("accounts") - for accounts_item_data in _accounts: - accounts_item = AccountResponse.from_dict(accounts_item_data) - - accounts.append(accounts_item) - - created_at = d.pop("created_at") - - def _parse_description(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - description = _parse_description(d.pop("description")) - - id = UUID(d.pop("id")) - - keyword_search_enabled = d.pop("keyword_search_enabled") - - knowledge_base_enabled = d.pop("knowledge_base_enabled") - - mcp_server_enabled = d.pop("mcp_server_enabled") - - name = d.pop("name") - - semantic_search_enabled = d.pop("semantic_search_enabled") - - sources = [] - _sources = d.pop("sources") - for sources_item_data in _sources: - sources_item = SourceConnectionResponse.from_dict(sources_item_data) - - sources.append(sources_item) - - updated_at = d.pop("updated_at") - - readonly = d.pop("readonly", UNSET) - - knowledge_base_response = cls( - accounts=accounts, - created_at=created_at, - description=description, - id=id, - keyword_search_enabled=keyword_search_enabled, - knowledge_base_enabled=knowledge_base_enabled, - mcp_server_enabled=mcp_server_enabled, - name=name, - semantic_search_enabled=semantic_search_enabled, - sources=sources, - updated_at=updated_at, - readonly=readonly, - ) - - knowledge_base_response.additional_properties = d - return knowledge_base_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/seclai/_generated/seclai_api_client/models/language_option.py b/seclai/_generated/seclai_api_client/models/language_option.py deleted file mode 100644 index 2b6719c..0000000 --- a/seclai/_generated/seclai_api_client/models/language_option.py +++ /dev/null @@ -1,70 +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="LanguageOption") - - -@_attrs_define -class LanguageOption: - """Programming language option for language-specific chunking - - Attributes: - label (str): Human-readable language name - value (str): Language identifier - """ - - label: str - value: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - label = self.label - - value = self.value - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "label": label, - "value": value, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - label = d.pop("label") - - value = d.pop("value") - - language_option = cls( - label=label, - value=value, - ) - - language_option.additional_properties = d - return language_option - - @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/seclai/_generated/seclai_api_client/models/list_payment_methods_response.py b/seclai/_generated/seclai_api_client/models/list_payment_methods_response.py deleted file mode 100644 index 584ddba..0000000 --- a/seclai/_generated/seclai_api_client/models/list_payment_methods_response.py +++ /dev/null @@ -1,96 +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 - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.payment_method_response import PaymentMethodResponse - - -T = TypeVar("T", bound="ListPaymentMethodsResponse") - - -@_attrs_define -class ListPaymentMethodsResponse: - """ - Attributes: - payment_methods (list[PaymentMethodResponse]): - success (bool): - message (str | Unset): Default: ''. - """ - - payment_methods: list[PaymentMethodResponse] - success: bool - message: str | Unset = "" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - payment_methods = [] - for payment_methods_item_data in self.payment_methods: - payment_methods_item = payment_methods_item_data.to_dict() - payment_methods.append(payment_methods_item) - - success = self.success - - message = self.message - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "payment_methods": payment_methods, - "success": success, - } - ) - if message is not UNSET: - field_dict["message"] = message - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.payment_method_response import PaymentMethodResponse - - d = dict(src_dict) - payment_methods = [] - _payment_methods = d.pop("payment_methods") - for payment_methods_item_data in _payment_methods: - payment_methods_item = PaymentMethodResponse.from_dict( - payment_methods_item_data - ) - - payment_methods.append(payment_methods_item) - - success = d.pop("success") - - message = d.pop("message", UNSET) - - list_payment_methods_response = cls( - payment_methods=payment_methods, - success=success, - message=message, - ) - - list_payment_methods_response.additional_properties = d - return list_payment_methods_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/seclai/_generated/seclai_api_client/models/mcp_server_request_list_response.py b/seclai/_generated/seclai_api_client/models/mcp_server_request_list_response.py deleted file mode 100644 index 253aa91..0000000 --- a/seclai/_generated/seclai_api_client/models/mcp_server_request_list_response.py +++ /dev/null @@ -1,76 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="MCPServerRequestListResponse") - - -@_attrs_define -class MCPServerRequestListResponse: - """Response model for paginated MCP server request list - - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - mcp_server_request_list_response = cls( - data=data, - pagination=pagination, - ) - - mcp_server_request_list_response.additional_properties = d - return mcp_server_request_list_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/seclai/_generated/seclai_api_client/models/members_list_response.py b/seclai/_generated/seclai_api_client/models/members_list_response.py deleted file mode 100644 index 6c650a5..0000000 --- a/seclai/_generated/seclai_api_client/models/members_list_response.py +++ /dev/null @@ -1,76 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="MembersListResponse") - - -@_attrs_define -class MembersListResponse: - """Response model for organization members list. - - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - members_list_response = cls( - data=data, - pagination=pagination, - ) - - members_list_response.additional_properties = d - return members_list_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/seclai/_generated/seclai_api_client/models/membership_type.py b/seclai/_generated/seclai_api_client/models/membership_type.py deleted file mode 100644 index 0d90ef0..0000000 --- a/seclai/_generated/seclai_api_client/models/membership_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class MembershipType(str, Enum): - ADMINISTRATOR = "administrator" - OWNER = "owner" - VIEWER = "viewer" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/membership_update_request.py b/seclai/_generated/seclai_api_client/models/membership_update_request.py deleted file mode 100644 index d1abe1d..0000000 --- a/seclai/_generated/seclai_api_client/models/membership_update_request.py +++ /dev/null @@ -1,64 +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 - -from ..models.membership_type import MembershipType - -T = TypeVar("T", bound="MembershipUpdateRequest") - - -@_attrs_define -class MembershipUpdateRequest: - """Request model for updating a member's role. - - Attributes: - membership_type (MembershipType): Organization membership types - """ - - membership_type: MembershipType - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - membership_type = self.membership_type.value - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "membership_type": membership_type, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - membership_type = MembershipType(d.pop("membership_type")) - - membership_update_request = cls( - membership_type=membership_type, - ) - - membership_update_request.additional_properties = d - return membership_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/seclai/_generated/seclai_api_client/models/message_response.py b/seclai/_generated/seclai_api_client/models/message_response.py deleted file mode 100644 index dff8d8f..0000000 --- a/seclai/_generated/seclai_api_client/models/message_response.py +++ /dev/null @@ -1,92 +0,0 @@ -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="MessageResponse") - - -@_attrs_define -class MessageResponse: - """ - Attributes: - message (str): - account_id (None | str | Unset): - success (bool | Unset): Default: False. - """ - - message: str - account_id: None | str | Unset = UNSET - success: bool | Unset = False - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - message = self.message - - account_id: None | str | Unset - if isinstance(self.account_id, Unset): - account_id = UNSET - else: - account_id = self.account_id - - success = self.success - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "message": message, - } - ) - if account_id is not UNSET: - field_dict["account_id"] = account_id - if success is not UNSET: - field_dict["success"] = success - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - message = d.pop("message") - - def _parse_account_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - account_id = _parse_account_id(d.pop("account_id", UNSET)) - - success = d.pop("success", UNSET) - - message_response = cls( - message=message, - account_id=account_id, - success=success, - ) - - message_response.additional_properties = d - return message_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/seclai/_generated/seclai_api_client/models/onboarding_request.py b/seclai/_generated/seclai_api_client/models/onboarding_request.py deleted file mode 100644 index dcc7db6..0000000 --- a/seclai/_generated/seclai_api_client/models/onboarding_request.py +++ /dev/null @@ -1,171 +0,0 @@ -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 ..models.company_size import CompanySize -from ..models.use_case_type import UseCaseType -from ..types import UNSET, Unset - -T = TypeVar("T", bound="OnboardingRequest") - - -@_attrs_define -class OnboardingRequest: - """Request model for completing onboarding. - - Attributes: - account_type (str): The account type the user selected to start with - first_name (str): User's first name - last_name (str): User's last name - company_size (CompanySize | None | Unset): Size of the user's company - other_use_case (None | str | Unset): Other use case if 'Other' is selected - use_cases (list[UseCaseType] | None | Unset): List of primary use cases for the user - """ - - account_type: str - first_name: str - last_name: str - company_size: CompanySize | None | Unset = UNSET - other_use_case: None | str | Unset = UNSET - use_cases: list[UseCaseType] | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - account_type = self.account_type - - first_name = self.first_name - - last_name = self.last_name - - company_size: None | str | Unset - if isinstance(self.company_size, Unset): - company_size = UNSET - elif isinstance(self.company_size, CompanySize): - company_size = self.company_size.value - else: - company_size = self.company_size - - other_use_case: None | str | Unset - if isinstance(self.other_use_case, Unset): - other_use_case = UNSET - else: - other_use_case = self.other_use_case - - use_cases: list[str] | None | Unset - if isinstance(self.use_cases, Unset): - use_cases = UNSET - elif isinstance(self.use_cases, list): - use_cases = [] - for use_cases_type_0_item_data in self.use_cases: - use_cases_type_0_item = use_cases_type_0_item_data.value - use_cases.append(use_cases_type_0_item) - - else: - use_cases = self.use_cases - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_type": account_type, - "first_name": first_name, - "last_name": last_name, - } - ) - if company_size is not UNSET: - field_dict["company_size"] = company_size - if other_use_case is not UNSET: - field_dict["other_use_case"] = other_use_case - if use_cases is not UNSET: - field_dict["use_cases"] = use_cases - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_type = d.pop("account_type") - - first_name = d.pop("first_name") - - last_name = d.pop("last_name") - - def _parse_company_size(data: object) -> CompanySize | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - company_size_type_0 = CompanySize(data) - - return company_size_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CompanySize | None | Unset, data) - - company_size = _parse_company_size(d.pop("company_size", UNSET)) - - def _parse_other_use_case(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - other_use_case = _parse_other_use_case(d.pop("other_use_case", UNSET)) - - def _parse_use_cases(data: object) -> list[UseCaseType] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - use_cases_type_0 = [] - _use_cases_type_0 = data - for use_cases_type_0_item_data in _use_cases_type_0: - use_cases_type_0_item = UseCaseType(use_cases_type_0_item_data) - - use_cases_type_0.append(use_cases_type_0_item) - - return use_cases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[UseCaseType] | None | Unset, data) - - use_cases = _parse_use_cases(d.pop("use_cases", UNSET)) - - onboarding_request = cls( - account_type=account_type, - first_name=first_name, - last_name=last_name, - company_size=company_size, - other_use_case=other_use_case, - use_cases=use_cases, - ) - - onboarding_request.additional_properties = d - return onboarding_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/seclai/_generated/seclai_api_client/models/organization_create_request.py b/seclai/_generated/seclai_api_client/models/organization_create_request.py deleted file mode 100644 index 7113ccf..0000000 --- a/seclai/_generated/seclai_api_client/models/organization_create_request.py +++ /dev/null @@ -1,84 +0,0 @@ -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="OrganizationCreateRequest") - - -@_attrs_define -class OrganizationCreateRequest: - """Request model for creating an organization. - - Attributes: - name (str): - description (None | str | Unset): - """ - - name: str - description: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - name = self.name - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "name": name, - } - ) - 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: - d = dict(src_dict) - name = d.pop("name") - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - organization_create_request = cls( - name=name, - description=description, - ) - - organization_create_request.additional_properties = d - return organization_create_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/seclai/_generated/seclai_api_client/models/organization_list_response.py b/seclai/_generated/seclai_api_client/models/organization_list_response.py deleted file mode 100644 index a853636..0000000 --- a/seclai/_generated/seclai_api_client/models/organization_list_response.py +++ /dev/null @@ -1,76 +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.organization_response import OrganizationResponse - - -T = TypeVar("T", bound="OrganizationListResponse") - - -@_attrs_define -class OrganizationListResponse: - """Response model for organization list. - - Attributes: - organizations (list[OrganizationResponse]): - """ - - organizations: list[OrganizationResponse] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - organizations = [] - for organizations_item_data in self.organizations: - organizations_item = organizations_item_data.to_dict() - organizations.append(organizations_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "organizations": organizations, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.organization_response import OrganizationResponse - - d = dict(src_dict) - organizations = [] - _organizations = d.pop("organizations") - for organizations_item_data in _organizations: - organizations_item = OrganizationResponse.from_dict(organizations_item_data) - - organizations.append(organizations_item) - - organization_list_response = cls( - organizations=organizations, - ) - - organization_list_response.additional_properties = d - return organization_list_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/seclai/_generated/seclai_api_client/models/organization_resource_counts_response.py b/seclai/_generated/seclai_api_client/models/organization_resource_counts_response.py deleted file mode 100644 index ec58d47..0000000 --- a/seclai/_generated/seclai_api_client/models/organization_resource_counts_response.py +++ /dev/null @@ -1,70 +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="OrganizationResourceCountsResponse") - - -@_attrs_define -class OrganizationResourceCountsResponse: - """Response model for organization resource counts. - - Attributes: - knowledge_base_count (int): - source_count (int): - """ - - knowledge_base_count: int - source_count: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - knowledge_base_count = self.knowledge_base_count - - source_count = self.source_count - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "knowledge_base_count": knowledge_base_count, - "source_count": source_count, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - knowledge_base_count = d.pop("knowledge_base_count") - - source_count = d.pop("source_count") - - organization_resource_counts_response = cls( - knowledge_base_count=knowledge_base_count, - source_count=source_count, - ) - - organization_resource_counts_response.additional_properties = d - return organization_resource_counts_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/seclai/_generated/seclai_api_client/models/organization_response.py b/seclai/_generated/seclai_api_client/models/organization_response.py deleted file mode 100644 index 2f682d3..0000000 --- a/seclai/_generated/seclai_api_client/models/organization_response.py +++ /dev/null @@ -1,140 +0,0 @@ -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 - -T = TypeVar("T", bound="OrganizationResponse") - - -@_attrs_define -class OrganizationResponse: - """Response model for organization data. - - Attributes: - created_at (str): - description (None | str): - id (str): - independent_billing (bool): - member_count (int): - monthly_credit_limit (int | None): - name (str): - updated_at (str): - user_role (str): - """ - - created_at: str - description: None | str - id: str - independent_billing: bool - member_count: int - monthly_credit_limit: int | None - name: str - updated_at: str - user_role: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at - - description: None | str - description = self.description - - id = self.id - - independent_billing = self.independent_billing - - member_count = self.member_count - - monthly_credit_limit: int | None - monthly_credit_limit = self.monthly_credit_limit - - name = self.name - - updated_at = self.updated_at - - user_role = self.user_role - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "created_at": created_at, - "description": description, - "id": id, - "independent_billing": independent_billing, - "member_count": member_count, - "monthly_credit_limit": monthly_credit_limit, - "name": name, - "updated_at": updated_at, - "user_role": user_role, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created_at = d.pop("created_at") - - def _parse_description(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - description = _parse_description(d.pop("description")) - - id = d.pop("id") - - independent_billing = d.pop("independent_billing") - - member_count = d.pop("member_count") - - def _parse_monthly_credit_limit(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - monthly_credit_limit = _parse_monthly_credit_limit( - d.pop("monthly_credit_limit") - ) - - name = d.pop("name") - - updated_at = d.pop("updated_at") - - user_role = d.pop("user_role") - - organization_response = cls( - created_at=created_at, - description=description, - id=id, - independent_billing=independent_billing, - member_count=member_count, - monthly_credit_limit=monthly_credit_limit, - name=name, - updated_at=updated_at, - user_role=user_role, - ) - - organization_response.additional_properties = d - return organization_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/seclai/_generated/seclai_api_client/models/page_link.py b/seclai/_generated/seclai_api_client/models/page_link.py deleted file mode 100644 index ca18fa4..0000000 --- a/seclai/_generated/seclai_api_client/models/page_link.py +++ /dev/null @@ -1,77 +0,0 @@ -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 - -T = TypeVar("T", bound="PageLink") - - -@_attrs_define -class PageLink: - """Website page link. - - Attributes: - title (None | str): - url (str): - """ - - title: None | str - url: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - title: None | str - title = self.title - - url = self.url - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "title": title, - "url": url, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_title(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - title = _parse_title(d.pop("title")) - - url = d.pop("url") - - page_link = cls( - title=title, - url=url, - ) - - page_link.additional_properties = d - return page_link - - @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/seclai/_generated/seclai_api_client/models/pagination_response.py b/seclai/_generated/seclai_api_client/models/pagination_response.py deleted file mode 100644 index 62234c4..0000000 --- a/seclai/_generated/seclai_api_client/models/pagination_response.py +++ /dev/null @@ -1,102 +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="PaginationResponse") - - -@_attrs_define -class PaginationResponse: - """Pagination information. - - Attributes: - has_next (bool): - has_prev (bool): - limit (int): - page (int): - pages (int): - total (int): - """ - - has_next: bool - has_prev: bool - limit: int - page: int - pages: int - total: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - has_next = self.has_next - - has_prev = self.has_prev - - limit = self.limit - - page = self.page - - pages = self.pages - - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "has_next": has_next, - "has_prev": has_prev, - "limit": limit, - "page": page, - "pages": pages, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - has_next = d.pop("has_next") - - has_prev = d.pop("has_prev") - - limit = d.pop("limit") - - page = d.pop("page") - - pages = d.pop("pages") - - total = d.pop("total") - - pagination_response = cls( - has_next=has_next, - has_prev=has_prev, - limit=limit, - page=page, - pages=pages, - total=total, - ) - - pagination_response.additional_properties = d - return pagination_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/seclai/_generated/seclai_api_client/models/patch_branch_state_request.py b/seclai/_generated/seclai_api_client/models/patch_branch_state_request.py deleted file mode 100644 index 434ec78..0000000 --- a/seclai/_generated/seclai_api_client/models/patch_branch_state_request.py +++ /dev/null @@ -1,129 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.patch_branch_state_request_data_type_0 import ( - PatchBranchStateRequestDataType0, - ) - - -T = TypeVar("T", bound="PatchBranchStateRequest") - - -@_attrs_define -class PatchBranchStateRequest: - """Request model for patching a branch's current state - - Attributes: - action (str): The operation to perform: 'update_fields', 'insert_between', 'add_sibling', 'delete', or - 'delete_and_move_children_up' - change_id (UUID): The expected current change_id (for optimistic locking) - step_path (str): JSON path to the target location (e.g., 'agent', 'agent.steps[0]') - data (None | PatchBranchStateRequestDataType0 | Unset): The data for the operation (required for update_fields, - insert_between, add_sibling) - """ - - action: str - change_id: UUID - step_path: str - data: None | PatchBranchStateRequestDataType0 | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.patch_branch_state_request_data_type_0 import ( - PatchBranchStateRequestDataType0, - ) - - action = self.action - - change_id = str(self.change_id) - - step_path = self.step_path - - data: dict[str, Any] | None | Unset - if isinstance(self.data, Unset): - data = UNSET - elif isinstance(self.data, PatchBranchStateRequestDataType0): - data = self.data.to_dict() - else: - data = self.data - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "action": action, - "change_id": change_id, - "step_path": step_path, - } - ) - if data is not UNSET: - field_dict["data"] = data - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.patch_branch_state_request_data_type_0 import ( - PatchBranchStateRequestDataType0, - ) - - d = dict(src_dict) - action = d.pop("action") - - change_id = UUID(d.pop("change_id")) - - step_path = d.pop("step_path") - - def _parse_data( - data: object, - ) -> None | PatchBranchStateRequestDataType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - data_type_0 = PatchBranchStateRequestDataType0.from_dict(data) - - return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PatchBranchStateRequestDataType0 | Unset, data) - - data = _parse_data(d.pop("data", UNSET)) - - patch_branch_state_request = cls( - action=action, - change_id=change_id, - step_path=step_path, - data=data, - ) - - patch_branch_state_request.additional_properties = d - return patch_branch_state_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/seclai/_generated/seclai_api_client/models/patch_branch_state_request_data_type_0.py b/seclai/_generated/seclai_api_client/models/patch_branch_state_request_data_type_0.py deleted file mode 100644 index e3921f1..0000000 --- a/seclai/_generated/seclai_api_client/models/patch_branch_state_request_data_type_0.py +++ /dev/null @@ -1,46 +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="PatchBranchStateRequestDataType0") - - -@_attrs_define -class PatchBranchStateRequestDataType0: - """ """ - - additional_properties: dict[str, Any] = _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) - patch_branch_state_request_data_type_0 = cls() - - patch_branch_state_request_data_type_0.additional_properties = d - return patch_branch_state_request_data_type_0 - - @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/seclai/_generated/seclai_api_client/models/payment_intent_history_item.py b/seclai/_generated/seclai_api_client/models/payment_intent_history_item.py deleted file mode 100644 index 025443c..0000000 --- a/seclai/_generated/seclai_api_client/models/payment_intent_history_item.py +++ /dev/null @@ -1,117 +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="PaymentIntentHistoryItem") - - -@_attrs_define -class PaymentIntentHistoryItem: - """ - Attributes: - amount (int): - created_at (str): - currency (str): - description (str): - id (str): - payment_type (str): - statement (str): - status (str): - """ - - amount: int - created_at: str - currency: str - description: str - id: str - payment_type: str - statement: str - status: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - amount = self.amount - - created_at = self.created_at - - currency = self.currency - - description = self.description - - id = self.id - - payment_type = self.payment_type - - statement = self.statement - - status = self.status - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "amount": amount, - "created_at": created_at, - "currency": currency, - "description": description, - "id": id, - "payment_type": payment_type, - "statement": statement, - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - amount = d.pop("amount") - - created_at = d.pop("created_at") - - currency = d.pop("currency") - - description = d.pop("description") - - id = d.pop("id") - - payment_type = d.pop("payment_type") - - statement = d.pop("statement") - - status = d.pop("status") - - payment_intent_history_item = cls( - amount=amount, - created_at=created_at, - currency=currency, - description=description, - id=id, - payment_type=payment_type, - statement=statement, - status=status, - ) - - payment_intent_history_item.additional_properties = d - return payment_intent_history_item - - @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/seclai/_generated/seclai_api_client/models/payment_intent_history_response.py b/seclai/_generated/seclai_api_client/models/payment_intent_history_response.py deleted file mode 100644 index f92a4f6..0000000 --- a/seclai/_generated/seclai_api_client/models/payment_intent_history_response.py +++ /dev/null @@ -1,120 +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 - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.payment_intent_history_item import PaymentIntentHistoryItem - - -T = TypeVar("T", bound="PaymentIntentHistoryResponse") - - -@_attrs_define -class PaymentIntentHistoryResponse: - """ - Attributes: - page (int): - payment_intents (list[PaymentIntentHistoryItem]): - per_page (int): - success (bool): - total (int): - message (str | Unset): Default: ''. - """ - - page: int - payment_intents: list[PaymentIntentHistoryItem] - per_page: int - success: bool - total: int - message: str | Unset = "" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - page = self.page - - payment_intents = [] - for payment_intents_item_data in self.payment_intents: - payment_intents_item = payment_intents_item_data.to_dict() - payment_intents.append(payment_intents_item) - - per_page = self.per_page - - success = self.success - - total = self.total - - message = self.message - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "page": page, - "payment_intents": payment_intents, - "per_page": per_page, - "success": success, - "total": total, - } - ) - if message is not UNSET: - field_dict["message"] = message - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.payment_intent_history_item import PaymentIntentHistoryItem - - d = dict(src_dict) - page = d.pop("page") - - payment_intents = [] - _payment_intents = d.pop("payment_intents") - for payment_intents_item_data in _payment_intents: - payment_intents_item = PaymentIntentHistoryItem.from_dict( - payment_intents_item_data - ) - - payment_intents.append(payment_intents_item) - - per_page = d.pop("per_page") - - success = d.pop("success") - - total = d.pop("total") - - message = d.pop("message", UNSET) - - payment_intent_history_response = cls( - page=page, - payment_intents=payment_intents, - per_page=per_page, - success=success, - total=total, - message=message, - ) - - payment_intent_history_response.additional_properties = d - return payment_intent_history_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/seclai/_generated/seclai_api_client/models/payment_intent_status_response.py b/seclai/_generated/seclai_api_client/models/payment_intent_status_response.py deleted file mode 100644 index 81eaccf..0000000 --- a/seclai/_generated/seclai_api_client/models/payment_intent_status_response.py +++ /dev/null @@ -1,123 +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.payment_intent_status_response_payment_intent_type_0 import ( - PaymentIntentStatusResponsePaymentIntentType0, - ) - - -T = TypeVar("T", bound="PaymentIntentStatusResponse") - - -@_attrs_define -class PaymentIntentStatusResponse: - """ - Attributes: - message (str): - success (bool): - payment_intent (None | PaymentIntentStatusResponsePaymentIntentType0 | Unset): - """ - - message: str - success: bool - payment_intent: None | PaymentIntentStatusResponsePaymentIntentType0 | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.payment_intent_status_response_payment_intent_type_0 import ( - PaymentIntentStatusResponsePaymentIntentType0, - ) - - message = self.message - - success = self.success - - payment_intent: dict[str, Any] | None | Unset - if isinstance(self.payment_intent, Unset): - payment_intent = UNSET - elif isinstance( - self.payment_intent, PaymentIntentStatusResponsePaymentIntentType0 - ): - payment_intent = self.payment_intent.to_dict() - else: - payment_intent = self.payment_intent - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "message": message, - "success": success, - } - ) - if payment_intent is not UNSET: - field_dict["payment_intent"] = payment_intent - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.payment_intent_status_response_payment_intent_type_0 import ( - PaymentIntentStatusResponsePaymentIntentType0, - ) - - d = dict(src_dict) - message = d.pop("message") - - success = d.pop("success") - - def _parse_payment_intent( - data: object, - ) -> None | PaymentIntentStatusResponsePaymentIntentType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - payment_intent_type_0 = ( - PaymentIntentStatusResponsePaymentIntentType0.from_dict(data) - ) - - return payment_intent_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - None | PaymentIntentStatusResponsePaymentIntentType0 | Unset, data - ) - - payment_intent = _parse_payment_intent(d.pop("payment_intent", UNSET)) - - payment_intent_status_response = cls( - message=message, - success=success, - payment_intent=payment_intent, - ) - - payment_intent_status_response.additional_properties = d - return payment_intent_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/seclai/_generated/seclai_api_client/models/payment_intent_status_response_payment_intent_type_0.py b/seclai/_generated/seclai_api_client/models/payment_intent_status_response_payment_intent_type_0.py deleted file mode 100644 index 42dd7f8..0000000 --- a/seclai/_generated/seclai_api_client/models/payment_intent_status_response_payment_intent_type_0.py +++ /dev/null @@ -1,46 +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="PaymentIntentStatusResponsePaymentIntentType0") - - -@_attrs_define -class PaymentIntentStatusResponsePaymentIntentType0: - """ """ - - additional_properties: dict[str, Any] = _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) - payment_intent_status_response_payment_intent_type_0 = cls() - - payment_intent_status_response_payment_intent_type_0.additional_properties = d - return payment_intent_status_response_payment_intent_type_0 - - @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/seclai/_generated/seclai_api_client/models/payment_method_action_response.py b/seclai/_generated/seclai_api_client/models/payment_method_action_response.py deleted file mode 100644 index 0530304..0000000 --- a/seclai/_generated/seclai_api_client/models/payment_method_action_response.py +++ /dev/null @@ -1,69 +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="PaymentMethodActionResponse") - - -@_attrs_define -class PaymentMethodActionResponse: - """ - Attributes: - message (str): - success (bool): - """ - - message: str - success: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - message = self.message - - success = self.success - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "message": message, - "success": success, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - message = d.pop("message") - - success = d.pop("success") - - payment_method_action_response = cls( - message=message, - success=success, - ) - - payment_method_action_response.additional_properties = d - return payment_method_action_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/seclai/_generated/seclai_api_client/models/payment_method_response.py b/seclai/_generated/seclai_api_client/models/payment_method_response.py deleted file mode 100644 index afc460b..0000000 --- a/seclai/_generated/seclai_api_client/models/payment_method_response.py +++ /dev/null @@ -1,91 +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.payment_method_response_card import PaymentMethodResponseCard - - -T = TypeVar("T", bound="PaymentMethodResponse") - - -@_attrs_define -class PaymentMethodResponse: - """ - Attributes: - card (PaymentMethodResponseCard): - id (str): - is_default (bool): - type_ (str): - """ - - card: PaymentMethodResponseCard - id: str - is_default: bool - type_: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - card = self.card.to_dict() - - id = self.id - - is_default = self.is_default - - type_ = self.type_ - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "card": card, - "id": id, - "is_default": is_default, - "type": type_, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.payment_method_response_card import PaymentMethodResponseCard - - d = dict(src_dict) - card = PaymentMethodResponseCard.from_dict(d.pop("card")) - - id = d.pop("id") - - is_default = d.pop("is_default") - - type_ = d.pop("type") - - payment_method_response = cls( - card=card, - id=id, - is_default=is_default, - type_=type_, - ) - - payment_method_response.additional_properties = d - return payment_method_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/seclai/_generated/seclai_api_client/models/payment_method_response_card.py b/seclai/_generated/seclai_api_client/models/payment_method_response_card.py deleted file mode 100644 index 96d2241..0000000 --- a/seclai/_generated/seclai_api_client/models/payment_method_response_card.py +++ /dev/null @@ -1,46 +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="PaymentMethodResponseCard") - - -@_attrs_define -class PaymentMethodResponseCard: - """ """ - - additional_properties: dict[str, Any] = _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) - payment_method_response_card = cls() - - payment_method_response_card.additional_properties = d - return payment_method_response_card - - @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/seclai/_generated/seclai_api_client/models/pending_completed_failed_status.py b/seclai/_generated/seclai_api_client/models/pending_completed_failed_status.py deleted file mode 100644 index 708baeb..0000000 --- a/seclai/_generated/seclai_api_client/models/pending_completed_failed_status.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class PendingCompletedFailedStatus(str, Enum): - COMPLETED = "completed" - FAILED = "failed" - PENDING = "pending" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/pending_processing_completed_failed_status.py b/seclai/_generated/seclai_api_client/models/pending_processing_completed_failed_status.py deleted file mode 100644 index 06bd7ff..0000000 --- a/seclai/_generated/seclai_api_client/models/pending_processing_completed_failed_status.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class PendingProcessingCompletedFailedStatus(str, Enum): - COMPLETED = "completed" - FAILED = "failed" - PENDING = "pending" - PROCESSING = "processing" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/plan_price_response.py b/seclai/_generated/seclai_api_client/models/plan_price_response.py deleted file mode 100644 index a0710e1..0000000 --- a/seclai/_generated/seclai_api_client/models/plan_price_response.py +++ /dev/null @@ -1,107 +0,0 @@ -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 - -T = TypeVar("T", bound="PlanPriceResponse") - - -@_attrs_define -class PlanPriceResponse: - """Response model for plan pricing. - - Attributes: - available_at (None | str): - currency (str): - expires_at (None | str): - id (str): - price (float): - """ - - available_at: None | str - currency: str - expires_at: None | str - id: str - price: float - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - available_at: None | str - available_at = self.available_at - - currency = self.currency - - expires_at: None | str - expires_at = self.expires_at - - id = self.id - - price = self.price - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "available_at": available_at, - "currency": currency, - "expires_at": expires_at, - "id": id, - "price": price, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_available_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - available_at = _parse_available_at(d.pop("available_at")) - - currency = d.pop("currency") - - def _parse_expires_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - expires_at = _parse_expires_at(d.pop("expires_at")) - - id = d.pop("id") - - price = d.pop("price") - - plan_price_response = cls( - available_at=available_at, - currency=currency, - expires_at=expires_at, - id=id, - price=price, - ) - - plan_price_response.additional_properties = d - return plan_price_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/seclai/_generated/seclai_api_client/models/plan_response.py b/seclai/_generated/seclai_api_client/models/plan_response.py deleted file mode 100644 index 4dd5fe0..0000000 --- a/seclai/_generated/seclai_api_client/models/plan_response.py +++ /dev/null @@ -1,212 +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 - -if TYPE_CHECKING: - from ..models.plan_response_prices import PlanResponsePrices - - -T = TypeVar("T", bound="PlanResponse") - - -@_attrs_define -class PlanResponse: - """Response model for plan information. - - Attributes: - api_access (bool): - available_at (None | str): - crawl_session_page_limit (int | None): - default (bool): - expires_at (None | str): - id (str): - max_agents (int | None): - max_organization_members (int | None): - max_organizations (int | None): - monthly_credits (int): - name (str): - prices (PlanResponsePrices): - support (str): - trial_duration_days (int): - """ - - api_access: bool - available_at: None | str - crawl_session_page_limit: int | None - default: bool - expires_at: None | str - id: str - max_agents: int | None - max_organization_members: int | None - max_organizations: int | None - monthly_credits: int - name: str - prices: PlanResponsePrices - support: str - trial_duration_days: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - api_access = self.api_access - - available_at: None | str - available_at = self.available_at - - crawl_session_page_limit: int | None - crawl_session_page_limit = self.crawl_session_page_limit - - default = self.default - - expires_at: None | str - expires_at = self.expires_at - - id = self.id - - max_agents: int | None - max_agents = self.max_agents - - max_organization_members: int | None - max_organization_members = self.max_organization_members - - max_organizations: int | None - max_organizations = self.max_organizations - - monthly_credits = self.monthly_credits - - name = self.name - - prices = self.prices.to_dict() - - support = self.support - - trial_duration_days = self.trial_duration_days - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "api_access": api_access, - "available_at": available_at, - "crawl_session_page_limit": crawl_session_page_limit, - "default": default, - "expires_at": expires_at, - "id": id, - "max_agents": max_agents, - "max_organization_members": max_organization_members, - "max_organizations": max_organizations, - "monthly_credits": monthly_credits, - "name": name, - "prices": prices, - "support": support, - "trial_duration_days": trial_duration_days, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.plan_response_prices import PlanResponsePrices - - d = dict(src_dict) - api_access = d.pop("api_access") - - def _parse_available_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - available_at = _parse_available_at(d.pop("available_at")) - - def _parse_crawl_session_page_limit(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - crawl_session_page_limit = _parse_crawl_session_page_limit( - d.pop("crawl_session_page_limit") - ) - - default = d.pop("default") - - def _parse_expires_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - expires_at = _parse_expires_at(d.pop("expires_at")) - - id = d.pop("id") - - def _parse_max_agents(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - max_agents = _parse_max_agents(d.pop("max_agents")) - - def _parse_max_organization_members(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - max_organization_members = _parse_max_organization_members( - d.pop("max_organization_members") - ) - - def _parse_max_organizations(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - max_organizations = _parse_max_organizations(d.pop("max_organizations")) - - monthly_credits = d.pop("monthly_credits") - - name = d.pop("name") - - prices = PlanResponsePrices.from_dict(d.pop("prices")) - - support = d.pop("support") - - trial_duration_days = d.pop("trial_duration_days") - - plan_response = cls( - api_access=api_access, - available_at=available_at, - crawl_session_page_limit=crawl_session_page_limit, - default=default, - expires_at=expires_at, - id=id, - max_agents=max_agents, - max_organization_members=max_organization_members, - max_organizations=max_organizations, - monthly_credits=monthly_credits, - name=name, - prices=prices, - support=support, - trial_duration_days=trial_duration_days, - ) - - plan_response.additional_properties = d - return plan_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/seclai/_generated/seclai_api_client/models/plan_response_prices.py b/seclai/_generated/seclai_api_client/models/plan_response_prices.py deleted file mode 100644 index 05eb3e9..0000000 --- a/seclai/_generated/seclai_api_client/models/plan_response_prices.py +++ /dev/null @@ -1,61 +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.plan_price_response import PlanPriceResponse - - -T = TypeVar("T", bound="PlanResponsePrices") - - -@_attrs_define -class PlanResponsePrices: - """ """ - - additional_properties: dict[str, PlanPriceResponse] = _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.plan_price_response import PlanPriceResponse - - d = dict(src_dict) - plan_response_prices = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = PlanPriceResponse.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - plan_response_prices.additional_properties = additional_properties - return plan_response_prices - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> PlanPriceResponse: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: PlanPriceResponse) -> 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/seclai/_generated/seclai_api_client/models/polling_action.py b/seclai/_generated/seclai_api_client/models/polling_action.py deleted file mode 100644 index 2579627..0000000 --- a/seclai/_generated/seclai_api_client/models/polling_action.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class PollingAction(str, Enum): - NEW = "new" - NEW_AND_UPDATED = "new_and_updated" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/polling_type.py b/seclai/_generated/seclai_api_client/models/polling_type.py deleted file mode 100644 index e8036cc..0000000 --- a/seclai/_generated/seclai_api_client/models/polling_type.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class PollingType(str, Enum): - DAILY = "daily" - HOURLY = "hourly" - MANUALLY = "manually" - ONCE = "once" - WEEKLY = "weekly" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/processing_phase_response.py b/seclai/_generated/seclai_api_client/models/processing_phase_response.py deleted file mode 100644 index 8a79d90..0000000 --- a/seclai/_generated/seclai_api_client/models/processing_phase_response.py +++ /dev/null @@ -1,86 +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="ProcessingPhaseResponse") - - -@_attrs_define -class ProcessingPhaseResponse: - """Response model for a processing phase - - Attributes: - active (int): Active items in this phase - completed (int): Completed items in this phase - phase (str): Phase name - ratio (float): Completion ratio for this phase - """ - - active: int - completed: int - phase: str - ratio: float - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - active = self.active - - completed = self.completed - - phase = self.phase - - ratio = self.ratio - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "active": active, - "completed": completed, - "phase": phase, - "ratio": ratio, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - active = d.pop("active") - - completed = d.pop("completed") - - phase = d.pop("phase") - - ratio = d.pop("ratio") - - processing_phase_response = cls( - active=active, - completed=completed, - phase=phase, - ratio=ratio, - ) - - processing_phase_response.additional_properties = d - return processing_phase_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/seclai/_generated/seclai_api_client/models/prompt_model_response.py b/seclai/_generated/seclai_api_client/models/prompt_model_response.py deleted file mode 100644 index 35d068b..0000000 --- a/seclai/_generated/seclai_api_client/models/prompt_model_response.py +++ /dev/null @@ -1,432 +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.prompt_tool_response import PromptToolResponse - from ..models.variant_category_response import VariantCategoryResponse - - -T = TypeVar("T", bound="PromptModelResponse") - - -@_attrs_define -class PromptModelResponse: - """Response model for prompt model data - - Attributes: - default (bool): - description (str): - enabled (bool): - id (str): - max_conversation_length (int): - max_tokens (int): - model_id (str): - name (str): - provider (str): - input_1h_cache_write_credits_per_1000_tokens (float | None | Unset): - input_5m_cache_write_credits_per_1000_tokens (float | None | Unset): - input_cache_hit_credits_per_1000_tokens (float | None | Unset): - input_credits_per_1000_tokens (float | None | Unset): - last_used (bool | Unset): Default: False. - output_credits_per_1000_tokens (float | None | Unset): - schema_documentation_url (None | str | Unset): - schema_notes (None | str | Unset): - tools_disabled (list[PromptToolResponse] | Unset): - tools_enabled (list[PromptToolResponse] | Unset): - url (None | str | Unset): - variants (list[VariantCategoryResponse] | None | Unset): - """ - - default: bool - description: str - enabled: bool - id: str - max_conversation_length: int - max_tokens: int - model_id: str - name: str - provider: str - input_1h_cache_write_credits_per_1000_tokens: float | None | Unset = UNSET - input_5m_cache_write_credits_per_1000_tokens: float | None | Unset = UNSET - input_cache_hit_credits_per_1000_tokens: float | None | Unset = UNSET - input_credits_per_1000_tokens: float | None | Unset = UNSET - last_used: bool | Unset = False - output_credits_per_1000_tokens: float | None | Unset = UNSET - schema_documentation_url: None | str | Unset = UNSET - schema_notes: None | str | Unset = UNSET - tools_disabled: list[PromptToolResponse] | Unset = UNSET - tools_enabled: list[PromptToolResponse] | Unset = UNSET - url: None | str | Unset = UNSET - variants: list[VariantCategoryResponse] | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - default = self.default - - description = self.description - - enabled = self.enabled - - id = self.id - - max_conversation_length = self.max_conversation_length - - max_tokens = self.max_tokens - - model_id = self.model_id - - name = self.name - - provider = self.provider - - input_1h_cache_write_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_1h_cache_write_credits_per_1000_tokens, Unset): - input_1h_cache_write_credits_per_1000_tokens = UNSET - else: - input_1h_cache_write_credits_per_1000_tokens = ( - self.input_1h_cache_write_credits_per_1000_tokens - ) - - input_5m_cache_write_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_5m_cache_write_credits_per_1000_tokens, Unset): - input_5m_cache_write_credits_per_1000_tokens = UNSET - else: - input_5m_cache_write_credits_per_1000_tokens = ( - self.input_5m_cache_write_credits_per_1000_tokens - ) - - input_cache_hit_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_cache_hit_credits_per_1000_tokens, Unset): - input_cache_hit_credits_per_1000_tokens = UNSET - else: - input_cache_hit_credits_per_1000_tokens = ( - self.input_cache_hit_credits_per_1000_tokens - ) - - input_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_credits_per_1000_tokens, Unset): - input_credits_per_1000_tokens = UNSET - else: - input_credits_per_1000_tokens = self.input_credits_per_1000_tokens - - last_used = self.last_used - - output_credits_per_1000_tokens: float | None | Unset - if isinstance(self.output_credits_per_1000_tokens, Unset): - output_credits_per_1000_tokens = UNSET - else: - output_credits_per_1000_tokens = self.output_credits_per_1000_tokens - - schema_documentation_url: None | str | Unset - if isinstance(self.schema_documentation_url, Unset): - schema_documentation_url = UNSET - else: - schema_documentation_url = self.schema_documentation_url - - schema_notes: None | str | Unset - if isinstance(self.schema_notes, Unset): - schema_notes = UNSET - else: - schema_notes = self.schema_notes - - tools_disabled: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.tools_disabled, Unset): - tools_disabled = [] - for tools_disabled_item_data in self.tools_disabled: - tools_disabled_item = tools_disabled_item_data.to_dict() - tools_disabled.append(tools_disabled_item) - - tools_enabled: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.tools_enabled, Unset): - tools_enabled = [] - for tools_enabled_item_data in self.tools_enabled: - tools_enabled_item = tools_enabled_item_data.to_dict() - tools_enabled.append(tools_enabled_item) - - url: None | str | Unset - if isinstance(self.url, Unset): - url = UNSET - else: - url = self.url - - variants: list[dict[str, Any]] | None | Unset - if isinstance(self.variants, Unset): - variants = UNSET - elif isinstance(self.variants, list): - variants = [] - for variants_type_0_item_data in self.variants: - variants_type_0_item = variants_type_0_item_data.to_dict() - variants.append(variants_type_0_item) - - else: - variants = self.variants - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "default": default, - "description": description, - "enabled": enabled, - "id": id, - "max_conversation_length": max_conversation_length, - "max_tokens": max_tokens, - "model_id": model_id, - "name": name, - "provider": provider, - } - ) - if input_1h_cache_write_credits_per_1000_tokens is not UNSET: - field_dict["input_1h_cache_write_credits_per_1000_tokens"] = ( - input_1h_cache_write_credits_per_1000_tokens - ) - if input_5m_cache_write_credits_per_1000_tokens is not UNSET: - field_dict["input_5m_cache_write_credits_per_1000_tokens"] = ( - input_5m_cache_write_credits_per_1000_tokens - ) - if input_cache_hit_credits_per_1000_tokens is not UNSET: - field_dict["input_cache_hit_credits_per_1000_tokens"] = ( - input_cache_hit_credits_per_1000_tokens - ) - if input_credits_per_1000_tokens is not UNSET: - field_dict["input_credits_per_1000_tokens"] = input_credits_per_1000_tokens - if last_used is not UNSET: - field_dict["last_used"] = last_used - if output_credits_per_1000_tokens is not UNSET: - field_dict["output_credits_per_1000_tokens"] = ( - output_credits_per_1000_tokens - ) - if schema_documentation_url is not UNSET: - field_dict["schema_documentation_url"] = schema_documentation_url - if schema_notes is not UNSET: - field_dict["schema_notes"] = schema_notes - if tools_disabled is not UNSET: - field_dict["tools_disabled"] = tools_disabled - if tools_enabled is not UNSET: - field_dict["tools_enabled"] = tools_enabled - if url is not UNSET: - field_dict["url"] = url - if variants is not UNSET: - field_dict["variants"] = variants - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.prompt_tool_response import PromptToolResponse - from ..models.variant_category_response import VariantCategoryResponse - - d = dict(src_dict) - default = d.pop("default") - - description = d.pop("description") - - enabled = d.pop("enabled") - - id = d.pop("id") - - max_conversation_length = d.pop("max_conversation_length") - - max_tokens = d.pop("max_tokens") - - model_id = d.pop("model_id") - - name = d.pop("name") - - provider = d.pop("provider") - - def _parse_input_1h_cache_write_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_1h_cache_write_credits_per_1000_tokens = ( - _parse_input_1h_cache_write_credits_per_1000_tokens( - d.pop("input_1h_cache_write_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_input_5m_cache_write_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_5m_cache_write_credits_per_1000_tokens = ( - _parse_input_5m_cache_write_credits_per_1000_tokens( - d.pop("input_5m_cache_write_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_input_cache_hit_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_cache_hit_credits_per_1000_tokens = ( - _parse_input_cache_hit_credits_per_1000_tokens( - d.pop("input_cache_hit_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_input_credits_per_1000_tokens(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_credits_per_1000_tokens = _parse_input_credits_per_1000_tokens( - d.pop("input_credits_per_1000_tokens", UNSET) - ) - - last_used = d.pop("last_used", UNSET) - - def _parse_output_credits_per_1000_tokens(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - output_credits_per_1000_tokens = _parse_output_credits_per_1000_tokens( - d.pop("output_credits_per_1000_tokens", UNSET) - ) - - def _parse_schema_documentation_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - schema_documentation_url = _parse_schema_documentation_url( - d.pop("schema_documentation_url", UNSET) - ) - - def _parse_schema_notes(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - schema_notes = _parse_schema_notes(d.pop("schema_notes", UNSET)) - - _tools_disabled = d.pop("tools_disabled", UNSET) - tools_disabled: list[PromptToolResponse] | Unset = UNSET - if _tools_disabled is not UNSET: - tools_disabled = [] - for tools_disabled_item_data in _tools_disabled: - tools_disabled_item = PromptToolResponse.from_dict( - tools_disabled_item_data - ) - - tools_disabled.append(tools_disabled_item) - - _tools_enabled = d.pop("tools_enabled", UNSET) - tools_enabled: list[PromptToolResponse] | Unset = UNSET - if _tools_enabled is not UNSET: - tools_enabled = [] - for tools_enabled_item_data in _tools_enabled: - tools_enabled_item = PromptToolResponse.from_dict( - tools_enabled_item_data - ) - - tools_enabled.append(tools_enabled_item) - - def _parse_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - url = _parse_url(d.pop("url", UNSET)) - - def _parse_variants( - data: object, - ) -> list[VariantCategoryResponse] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - variants_type_0 = [] - _variants_type_0 = data - for variants_type_0_item_data in _variants_type_0: - variants_type_0_item = VariantCategoryResponse.from_dict( - variants_type_0_item_data - ) - - variants_type_0.append(variants_type_0_item) - - return variants_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[VariantCategoryResponse] | None | Unset, data) - - variants = _parse_variants(d.pop("variants", UNSET)) - - prompt_model_response = cls( - default=default, - description=description, - enabled=enabled, - id=id, - max_conversation_length=max_conversation_length, - max_tokens=max_tokens, - model_id=model_id, - name=name, - provider=provider, - input_1h_cache_write_credits_per_1000_tokens=input_1h_cache_write_credits_per_1000_tokens, - input_5m_cache_write_credits_per_1000_tokens=input_5m_cache_write_credits_per_1000_tokens, - input_cache_hit_credits_per_1000_tokens=input_cache_hit_credits_per_1000_tokens, - input_credits_per_1000_tokens=input_credits_per_1000_tokens, - last_used=last_used, - output_credits_per_1000_tokens=output_credits_per_1000_tokens, - schema_documentation_url=schema_documentation_url, - schema_notes=schema_notes, - tools_disabled=tools_disabled, - tools_enabled=tools_enabled, - url=url, - variants=variants, - ) - - prompt_model_response.additional_properties = d - return prompt_model_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/seclai/_generated/seclai_api_client/models/prompt_tool_response.py b/seclai/_generated/seclai_api_client/models/prompt_tool_response.py deleted file mode 100644 index 15858b3..0000000 --- a/seclai/_generated/seclai_api_client/models/prompt_tool_response.py +++ /dev/null @@ -1,246 +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.prompt_tool_response_headers_type_0 import ( - PromptToolResponseHeadersType0, - ) - - -T = TypeVar("T", bound="PromptToolResponse") - - -@_attrs_define -class PromptToolResponse: - """Response model for a prompt tool. - - Attributes: - id (str): - name (str): - tool_type (str): - description (None | str | Unset): - documentation_url (None | str | Unset): - example (None | str | Unset): - headers (None | PromptToolResponseHeadersType0 | Unset): - notes (None | str | Unset): - tool_name (None | str | Unset): - tool_type_pattern (None | str | Unset): - """ - - id: str - name: str - tool_type: str - description: None | str | Unset = UNSET - documentation_url: None | str | Unset = UNSET - example: None | str | Unset = UNSET - headers: None | PromptToolResponseHeadersType0 | Unset = UNSET - notes: None | str | Unset = UNSET - tool_name: None | str | Unset = UNSET - tool_type_pattern: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.prompt_tool_response_headers_type_0 import ( - PromptToolResponseHeadersType0, - ) - - id = self.id - - name = self.name - - tool_type = self.tool_type - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - documentation_url: None | str | Unset - if isinstance(self.documentation_url, Unset): - documentation_url = UNSET - else: - documentation_url = self.documentation_url - - example: None | str | Unset - if isinstance(self.example, Unset): - example = UNSET - else: - example = self.example - - headers: dict[str, Any] | None | Unset - if isinstance(self.headers, Unset): - headers = UNSET - elif isinstance(self.headers, PromptToolResponseHeadersType0): - headers = self.headers.to_dict() - else: - headers = self.headers - - notes: None | str | Unset - if isinstance(self.notes, Unset): - notes = UNSET - else: - notes = self.notes - - tool_name: None | str | Unset - if isinstance(self.tool_name, Unset): - tool_name = UNSET - else: - tool_name = self.tool_name - - tool_type_pattern: None | str | Unset - if isinstance(self.tool_type_pattern, Unset): - tool_type_pattern = UNSET - else: - tool_type_pattern = self.tool_type_pattern - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "id": id, - "name": name, - "tool_type": tool_type, - } - ) - if description is not UNSET: - field_dict["description"] = description - if documentation_url is not UNSET: - field_dict["documentation_url"] = documentation_url - if example is not UNSET: - field_dict["example"] = example - if headers is not UNSET: - field_dict["headers"] = headers - if notes is not UNSET: - field_dict["notes"] = notes - if tool_name is not UNSET: - field_dict["tool_name"] = tool_name - if tool_type_pattern is not UNSET: - field_dict["tool_type_pattern"] = tool_type_pattern - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.prompt_tool_response_headers_type_0 import ( - PromptToolResponseHeadersType0, - ) - - d = dict(src_dict) - id = d.pop("id") - - name = d.pop("name") - - tool_type = d.pop("tool_type") - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_documentation_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - documentation_url = _parse_documentation_url(d.pop("documentation_url", UNSET)) - - def _parse_example(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - example = _parse_example(d.pop("example", UNSET)) - - def _parse_headers( - data: object, - ) -> None | PromptToolResponseHeadersType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - headers_type_0 = PromptToolResponseHeadersType0.from_dict(data) - - return headers_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PromptToolResponseHeadersType0 | Unset, data) - - headers = _parse_headers(d.pop("headers", UNSET)) - - def _parse_notes(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - notes = _parse_notes(d.pop("notes", UNSET)) - - def _parse_tool_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - tool_name = _parse_tool_name(d.pop("tool_name", UNSET)) - - def _parse_tool_type_pattern(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - tool_type_pattern = _parse_tool_type_pattern(d.pop("tool_type_pattern", UNSET)) - - prompt_tool_response = cls( - id=id, - name=name, - tool_type=tool_type, - description=description, - documentation_url=documentation_url, - example=example, - headers=headers, - notes=notes, - tool_name=tool_name, - tool_type_pattern=tool_type_pattern, - ) - - prompt_tool_response.additional_properties = d - return prompt_tool_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/seclai/_generated/seclai_api_client/models/prompt_tool_response_headers_type_0.py b/seclai/_generated/seclai_api_client/models/prompt_tool_response_headers_type_0.py deleted file mode 100644 index fa0dd1f..0000000 --- a/seclai/_generated/seclai_api_client/models/prompt_tool_response_headers_type_0.py +++ /dev/null @@ -1,46 +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="PromptToolResponseHeadersType0") - - -@_attrs_define -class PromptToolResponseHeadersType0: - """ """ - - 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) - prompt_tool_response_headers_type_0 = cls() - - prompt_tool_response_headers_type_0.additional_properties = d - return prompt_tool_response_headers_type_0 - - @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/seclai/_generated/seclai_api_client/models/provider_group_response.py b/seclai/_generated/seclai_api_client/models/provider_group_response.py deleted file mode 100644 index c9c19e3..0000000 --- a/seclai/_generated/seclai_api_client/models/provider_group_response.py +++ /dev/null @@ -1,84 +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.prompt_model_response import PromptModelResponse - - -T = TypeVar("T", bound="ProviderGroupResponse") - - -@_attrs_define -class ProviderGroupResponse: - """Response model for provider group with models - - Attributes: - models (list[PromptModelResponse]): - provider (str): - """ - - models: list[PromptModelResponse] - provider: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - models = [] - for models_item_data in self.models: - models_item = models_item_data.to_dict() - models.append(models_item) - - provider = self.provider - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "models": models, - "provider": provider, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.prompt_model_response import PromptModelResponse - - d = dict(src_dict) - models = [] - _models = d.pop("models") - for models_item_data in _models: - models_item = PromptModelResponse.from_dict(models_item_data) - - models.append(models_item) - - provider = d.pop("provider") - - provider_group_response = cls( - models=models, - provider=provider, - ) - - provider_group_response.additional_properties = d - return provider_group_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/seclai/_generated/seclai_api_client/models/pull_request.py b/seclai/_generated/seclai_api_client/models/pull_request.py deleted file mode 100644 index 6a9108b..0000000 --- a/seclai/_generated/seclai_api_client/models/pull_request.py +++ /dev/null @@ -1,116 +0,0 @@ -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 ..models.seed_type import SeedType -from ..types import UNSET, Unset - -T = TypeVar("T", bound="PullRequest") - - -@_attrs_define -class PullRequest: - """Manual pull request for a source. - - Attributes: - seed (SeedType): - latest_n (int | None | Unset): Number of latest items to pull (required if seed=latest_n) - selected_items (list[str] | None | Unset): List of selected item GUIDs (required if seed=selected_items) - """ - - seed: SeedType - latest_n: int | None | Unset = UNSET - selected_items: list[str] | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - seed = self.seed.value - - latest_n: int | None | Unset - if isinstance(self.latest_n, Unset): - latest_n = UNSET - else: - latest_n = self.latest_n - - selected_items: list[str] | None | Unset - if isinstance(self.selected_items, Unset): - selected_items = UNSET - elif isinstance(self.selected_items, list): - selected_items = self.selected_items - - else: - selected_items = self.selected_items - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "seed": seed, - } - ) - if latest_n is not UNSET: - field_dict["latest_n"] = latest_n - if selected_items is not UNSET: - field_dict["selected_items"] = selected_items - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - seed = SeedType(d.pop("seed")) - - def _parse_latest_n(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - latest_n = _parse_latest_n(d.pop("latest_n", UNSET)) - - def _parse_selected_items(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() - selected_items_type_0 = cast(list[str], data) - - return selected_items_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - selected_items = _parse_selected_items(d.pop("selected_items", UNSET)) - - pull_request = cls( - seed=seed, - latest_n=latest_n, - selected_items=selected_items, - ) - - pull_request.additional_properties = d - return pull_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/seclai/_generated/seclai_api_client/models/pull_response.py b/seclai/_generated/seclai_api_client/models/pull_response.py deleted file mode 100644 index 60afc70..0000000 --- a/seclai/_generated/seclai_api_client/models/pull_response.py +++ /dev/null @@ -1,91 +0,0 @@ -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="PullResponse") - - -@_attrs_define -class PullResponse: - """ - Attributes: - message (str): - success (bool): - task_id (None | str | Unset): - """ - - message: str - success: bool - task_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - message = self.message - - success = self.success - - task_id: None | str | Unset - if isinstance(self.task_id, Unset): - task_id = UNSET - else: - task_id = self.task_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "message": message, - "success": success, - } - ) - if task_id is not UNSET: - field_dict["task_id"] = task_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - message = d.pop("message") - - success = d.pop("success") - - def _parse_task_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - task_id = _parse_task_id(d.pop("task_id", UNSET)) - - pull_response = cls( - message=message, - success=success, - task_id=task_id, - ) - - pull_response.additional_properties = d - return pull_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/seclai/_generated/seclai_api_client/models/related_account_response.py b/seclai/_generated/seclai_api_client/models/related_account_response.py deleted file mode 100644 index b9766c1..0000000 --- a/seclai/_generated/seclai_api_client/models/related_account_response.py +++ /dev/null @@ -1,131 +0,0 @@ -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="RelatedAccountResponse") - - -@_attrs_define -class RelatedAccountResponse: - """ - Attributes: - account_id (str): - name (str): - description (None | str | Unset): - membership_type (None | str | Unset): - organization_id (None | str | Unset): - """ - - account_id: str - name: str - description: None | str | Unset = UNSET - membership_type: None | str | Unset = UNSET - organization_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - name = self.name - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - membership_type: None | str | Unset - if isinstance(self.membership_type, Unset): - membership_type = UNSET - else: - membership_type = self.membership_type - - organization_id: None | str | Unset - if isinstance(self.organization_id, Unset): - organization_id = UNSET - else: - organization_id = self.organization_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_id": account_id, - "name": name, - } - ) - if description is not UNSET: - field_dict["description"] = description - if membership_type is not UNSET: - field_dict["membership_type"] = membership_type - if organization_id is not UNSET: - field_dict["organization_id"] = organization_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("account_id") - - name = d.pop("name") - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_membership_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - membership_type = _parse_membership_type(d.pop("membership_type", UNSET)) - - def _parse_organization_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - organization_id = _parse_organization_id(d.pop("organization_id", UNSET)) - - related_account_response = cls( - account_id=account_id, - name=name, - description=description, - membership_type=membership_type, - organization_id=organization_id, - ) - - related_account_response.additional_properties = d - return related_account_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/seclai/_generated/seclai_api_client/models/reranker_model_info.py b/seclai/_generated/seclai_api_client/models/reranker_model_info.py deleted file mode 100644 index 1f6dc6e..0000000 --- a/seclai/_generated/seclai_api_client/models/reranker_model_info.py +++ /dev/null @@ -1,128 +0,0 @@ -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="RerankerModelInfo") - - -@_attrs_define -class RerankerModelInfo: - """Information about a reranker model - - Attributes: - credits_per_action (float): - is_default (bool): - model_type (str): - name (str): - description (None | str | Unset): - url (None | str | Unset): - """ - - credits_per_action: float - is_default: bool - model_type: str - name: str - description: None | str | Unset = UNSET - url: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - credits_per_action = self.credits_per_action - - is_default = self.is_default - - model_type = self.model_type - - name = self.name - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - url: None | str | Unset - if isinstance(self.url, Unset): - url = UNSET - else: - url = self.url - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "credits_per_action": credits_per_action, - "is_default": is_default, - "model_type": model_type, - "name": name, - } - ) - if description is not UNSET: - field_dict["description"] = description - if url is not UNSET: - field_dict["url"] = url - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - credits_per_action = d.pop("credits_per_action") - - is_default = d.pop("is_default") - - model_type = d.pop("model_type") - - name = d.pop("name") - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - url = _parse_url(d.pop("url", UNSET)) - - reranker_model_info = cls( - credits_per_action=credits_per_action, - is_default=is_default, - model_type=model_type, - name=name, - description=description, - url=url, - ) - - reranker_model_info.additional_properties = d - return reranker_model_info - - @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/seclai/_generated/seclai_api_client/models/reranker_models_response.py b/seclai/_generated/seclai_api_client/models/reranker_models_response.py deleted file mode 100644 index bc8c537..0000000 --- a/seclai/_generated/seclai_api_client/models/reranker_models_response.py +++ /dev/null @@ -1,112 +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.embedding_cost_info import EmbeddingCostInfo - from ..models.reranker_model_info import RerankerModelInfo - - -T = TypeVar("T", bound="RerankerModelsResponse") - - -@_attrs_define -class RerankerModelsResponse: - """Response model for reranker models list - - Attributes: - default_model_type (str): - embedding_costs (list[EmbeddingCostInfo]): - models (list[RerankerModelInfo]): - search_processing_credits (float): - """ - - default_model_type: str - embedding_costs: list[EmbeddingCostInfo] - models: list[RerankerModelInfo] - search_processing_credits: float - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - default_model_type = self.default_model_type - - embedding_costs = [] - for embedding_costs_item_data in self.embedding_costs: - embedding_costs_item = embedding_costs_item_data.to_dict() - embedding_costs.append(embedding_costs_item) - - models = [] - for models_item_data in self.models: - models_item = models_item_data.to_dict() - models.append(models_item) - - search_processing_credits = self.search_processing_credits - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "default_model_type": default_model_type, - "embedding_costs": embedding_costs, - "models": models, - "search_processing_credits": search_processing_credits, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.embedding_cost_info import EmbeddingCostInfo - from ..models.reranker_model_info import RerankerModelInfo - - d = dict(src_dict) - default_model_type = d.pop("default_model_type") - - embedding_costs = [] - _embedding_costs = d.pop("embedding_costs") - for embedding_costs_item_data in _embedding_costs: - embedding_costs_item = EmbeddingCostInfo.from_dict( - embedding_costs_item_data - ) - - embedding_costs.append(embedding_costs_item) - - models = [] - _models = d.pop("models") - for models_item_data in _models: - models_item = RerankerModelInfo.from_dict(models_item_data) - - models.append(models_item) - - search_processing_credits = d.pop("search_processing_credits") - - reranker_models_response = cls( - default_model_type=default_model_type, - embedding_costs=embedding_costs, - models=models, - search_processing_credits=search_processing_credits, - ) - - reranker_models_response.additional_properties = d - return reranker_models_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/seclai/_generated/seclai_api_client/models/rss_content_option.py b/seclai/_generated/seclai_api_client/models/rss_content_option.py deleted file mode 100644 index c76b724..0000000 --- a/seclai/_generated/seclai_api_client/models/rss_content_option.py +++ /dev/null @@ -1,78 +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="RSSContentOption") - - -@_attrs_define -class RSSContentOption: - """RSS content selection option. - - Attributes: - episode_count (int): - label (str): - value (str): - """ - - episode_count: int - label: str - value: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - episode_count = self.episode_count - - label = self.label - - value = self.value - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "episode_count": episode_count, - "label": label, - "value": value, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - episode_count = d.pop("episode_count") - - label = d.pop("label") - - value = d.pop("value") - - rss_content_option = cls( - episode_count=episode_count, - label=label, - value=value, - ) - - rss_content_option.additional_properties = d - return rss_content_option - - @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/seclai/_generated/seclai_api_client/models/run_agent_request.py b/seclai/_generated/seclai_api_client/models/run_agent_request.py deleted file mode 100644 index 1974c8a..0000000 --- a/seclai/_generated/seclai_api_client/models/run_agent_request.py +++ /dev/null @@ -1,161 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.run_agent_request_metadata_type_0 import RunAgentRequestMetadataType0 - - -T = TypeVar("T", bound="RunAgentRequest") - - -@_attrs_define -class RunAgentRequest: - """Request model for running an agent - - Attributes: - content_version_id (None | Unset | UUID): ContentVersion id for content-based triggers (CONTENT_ADDED / - CONTENT_UPDATED). - input_ (None | str | Unset): Input for agents with DYNAMIC_INPUT trigger type - metadata (None | RunAgentRequestMetadataType0 | Unset): Metadata for string substitutions - priority (bool | Unset): If true, run in priority mode (worker instance) Default: False. - """ - - content_version_id: None | Unset | UUID = UNSET - input_: None | str | Unset = UNSET - metadata: None | RunAgentRequestMetadataType0 | Unset = UNSET - priority: bool | Unset = False - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.run_agent_request_metadata_type_0 import ( - RunAgentRequestMetadataType0, - ) - - content_version_id: None | str | Unset - if isinstance(self.content_version_id, Unset): - content_version_id = UNSET - elif isinstance(self.content_version_id, UUID): - content_version_id = str(self.content_version_id) - else: - content_version_id = self.content_version_id - - input_: None | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - else: - input_ = self.input_ - - metadata: dict[str, Any] | None | Unset - if isinstance(self.metadata, Unset): - metadata = UNSET - elif isinstance(self.metadata, RunAgentRequestMetadataType0): - metadata = self.metadata.to_dict() - else: - metadata = self.metadata - - priority = self.priority - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if content_version_id is not UNSET: - field_dict["content_version_id"] = content_version_id - if input_ is not UNSET: - field_dict["input"] = input_ - if metadata is not UNSET: - field_dict["metadata"] = metadata - if priority is not UNSET: - field_dict["priority"] = priority - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.run_agent_request_metadata_type_0 import ( - RunAgentRequestMetadataType0, - ) - - d = dict(src_dict) - - def _parse_content_version_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() - content_version_id_type_0 = UUID(data) - - return content_version_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - content_version_id = _parse_content_version_id( - d.pop("content_version_id", UNSET) - ) - - def _parse_input_(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_metadata( - data: object, - ) -> None | RunAgentRequestMetadataType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_type_0 = RunAgentRequestMetadataType0.from_dict(data) - - return metadata_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | RunAgentRequestMetadataType0 | Unset, data) - - metadata = _parse_metadata(d.pop("metadata", UNSET)) - - priority = d.pop("priority", UNSET) - - run_agent_request = cls( - content_version_id=content_version_id, - input_=input_, - metadata=metadata, - priority=priority, - ) - - run_agent_request.additional_properties = d - return run_agent_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/seclai/_generated/seclai_api_client/models/run_agent_request_metadata_type_0.py b/seclai/_generated/seclai_api_client/models/run_agent_request_metadata_type_0.py deleted file mode 100644 index 612f33a..0000000 --- a/seclai/_generated/seclai_api_client/models/run_agent_request_metadata_type_0.py +++ /dev/null @@ -1,46 +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="RunAgentRequestMetadataType0") - - -@_attrs_define -class RunAgentRequestMetadataType0: - """ """ - - additional_properties: dict[str, Any] = _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) - run_agent_request_metadata_type_0 = cls() - - run_agent_request_metadata_type_0.additional_properties = d - return run_agent_request_metadata_type_0 - - @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/seclai/_generated/seclai_api_client/models/run_agent_response.py b/seclai/_generated/seclai_api_client/models/run_agent_response.py deleted file mode 100644 index 948361d..0000000 --- a/seclai/_generated/seclai_api_client/models/run_agent_response.py +++ /dev/null @@ -1,87 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="RunAgentResponse") - - -@_attrs_define -class RunAgentResponse: - """Response model for agent run - - Attributes: - agent_id (UUID): - message (str): - run_id (UUID): - status (str): - """ - - agent_id: UUID - message: str - run_id: UUID - status: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_id = str(self.agent_id) - - message = self.message - - run_id = str(self.run_id) - - status = self.status - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_id": agent_id, - "message": message, - "run_id": run_id, - "status": status, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_id = UUID(d.pop("agent_id")) - - message = d.pop("message") - - run_id = UUID(d.pop("run_id")) - - status = d.pop("status") - - run_agent_response = cls( - agent_id=agent_id, - message=message, - run_id=run_id, - status=status, - ) - - run_agent_response.additional_properties = d - return run_agent_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/seclai/_generated/seclai_api_client/models/seed_type.py b/seclai/_generated/seclai_api_client/models/seed_type.py deleted file mode 100644 index 29915c8..0000000 --- a/seclai/_generated/seclai_api_client/models/seed_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class SeedType(str, Enum): - FULL_HISTORY = "full_history" - LATEST_N = "latest_n" - SELECTED_ITEMS = "selected_items" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/setup_intent_response.py b/seclai/_generated/seclai_api_client/models/setup_intent_response.py deleted file mode 100644 index 278592a..0000000 --- a/seclai/_generated/seclai_api_client/models/setup_intent_response.py +++ /dev/null @@ -1,91 +0,0 @@ -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="SetupIntentResponse") - - -@_attrs_define -class SetupIntentResponse: - """ - Attributes: - message (str): - success (bool): - client_secret (None | str | Unset): - """ - - message: str - success: bool - client_secret: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - message = self.message - - success = self.success - - client_secret: None | str | Unset - if isinstance(self.client_secret, Unset): - client_secret = UNSET - else: - client_secret = self.client_secret - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "message": message, - "success": success, - } - ) - if client_secret is not UNSET: - field_dict["client_secret"] = client_secret - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - message = d.pop("message") - - success = d.pop("success") - - def _parse_client_secret(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - client_secret = _parse_client_secret(d.pop("client_secret", UNSET)) - - setup_intent_response = cls( - message=message, - success=success, - client_secret=client_secret, - ) - - setup_intent_response.additional_properties = d - return setup_intent_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/seclai/_generated/seclai_api_client/models/source_connection_embeddings_list_response.py b/seclai/_generated/seclai_api_client/models/source_connection_embeddings_list_response.py deleted file mode 100644 index c1a3564..0000000 --- a/seclai/_generated/seclai_api_client/models/source_connection_embeddings_list_response.py +++ /dev/null @@ -1,76 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="SourceConnectionEmbeddingsListResponse") - - -@_attrs_define -class SourceConnectionEmbeddingsListResponse: - """Response model for paginated source connection embeddings. - - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - source_connection_embeddings_list_response = cls( - data=data, - pagination=pagination, - ) - - source_connection_embeddings_list_response.additional_properties = d - return source_connection_embeddings_list_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/seclai/_generated/seclai_api_client/models/source_connection_pull_list_response.py b/seclai/_generated/seclai_api_client/models/source_connection_pull_list_response.py deleted file mode 100644 index 084b39c..0000000 --- a/seclai/_generated/seclai_api_client/models/source_connection_pull_list_response.py +++ /dev/null @@ -1,76 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="SourceConnectionPullListResponse") - - -@_attrs_define -class SourceConnectionPullListResponse: - """Response model for paginated URL request list - - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - source_connection_pull_list_response = cls( - data=data, - pagination=pagination, - ) - - source_connection_pull_list_response.additional_properties = d - return source_connection_pull_list_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/seclai/_generated/seclai_api_client/models/source_connection_response.py b/seclai/_generated/seclai_api_client/models/source_connection_response.py deleted file mode 100644 index 3e62c87..0000000 --- a/seclai/_generated/seclai_api_client/models/source_connection_response.py +++ /dev/null @@ -1,109 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, 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="SourceConnectionResponse") - - -@_attrs_define -class SourceConnectionResponse: - """Response model for source connection information - - Attributes: - id (UUID): - name (str): - source_type (str): - url (str): - polling (None | str | Unset): - """ - - id: UUID - name: str - source_type: str - url: str - polling: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - id = str(self.id) - - name = self.name - - source_type = self.source_type - - url = self.url - - polling: None | str | Unset - if isinstance(self.polling, Unset): - polling = UNSET - else: - polling = self.polling - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "id": id, - "name": name, - "source_type": source_type, - "url": url, - } - ) - if polling is not UNSET: - field_dict["polling"] = polling - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id = UUID(d.pop("id")) - - name = d.pop("name") - - source_type = d.pop("source_type") - - url = d.pop("url") - - def _parse_polling(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - polling = _parse_polling(d.pop("polling", UNSET)) - - source_connection_response = cls( - id=id, - name=name, - source_type=source_type, - url=url, - polling=polling, - ) - - source_connection_response.additional_properties = d - return source_connection_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/seclai/_generated/seclai_api_client/models/source_content_list_response.py b/seclai/_generated/seclai_api_client/models/source_content_list_response.py deleted file mode 100644 index 312c958..0000000 --- a/seclai/_generated/seclai_api_client/models/source_content_list_response.py +++ /dev/null @@ -1,76 +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 - -if TYPE_CHECKING: - from ..models.pagination_response import PaginationResponse - - -T = TypeVar("T", bound="SourceContentListResponse") - - -@_attrs_define -class SourceContentListResponse: - """Response model for paginated source content list - - Attributes: - data (list[Any]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[Any] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = self.data - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - - d = dict(src_dict) - data = cast(list[Any], d.pop("data")) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - source_content_list_response = cls( - data=data, - pagination=pagination, - ) - - source_content_list_response.additional_properties = d - return source_content_list_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/seclai/_generated/seclai_api_client/models/source_list_response.py b/seclai/_generated/seclai_api_client/models/source_list_response.py deleted file mode 100644 index b9222c2..0000000 --- a/seclai/_generated/seclai_api_client/models/source_list_response.py +++ /dev/null @@ -1,86 +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.pagination_response import PaginationResponse - from ..models.source_response import SourceResponse - - -T = TypeVar("T", bound="SourceListResponse") - - -@_attrs_define -class SourceListResponse: - """Response model for paginated source list - - Attributes: - data (list[SourceResponse]): - pagination (PaginationResponse): Pagination information. - """ - - data: list[SourceResponse] - pagination: PaginationResponse - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) - - pagination = self.pagination.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "data": data, - "pagination": pagination, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination_response import PaginationResponse - from ..models.source_response import SourceResponse - - d = dict(src_dict) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = SourceResponse.from_dict(data_item_data) - - data.append(data_item) - - pagination = PaginationResponse.from_dict(d.pop("pagination")) - - source_list_response = cls( - data=data, - pagination=pagination, - ) - - source_list_response.additional_properties = d - return source_list_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/seclai/_generated/seclai_api_client/models/source_pull_progress_response.py b/seclai/_generated/seclai_api_client/models/source_pull_progress_response.py deleted file mode 100644 index 9d6a8c1..0000000 --- a/seclai/_generated/seclai_api_client/models/source_pull_progress_response.py +++ /dev/null @@ -1,147 +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 - -if TYPE_CHECKING: - from ..models.processing_phase_response import ProcessingPhaseResponse - - -T = TypeVar("T", bound="SourcePullProgressResponse") - - -@_attrs_define -class SourcePullProgressResponse: - """Response model for source processing progress - - Attributes: - failed (int | None): Total items failed - phases (list[ProcessingPhaseResponse] | None): List of processing phases - ratio (float | None): Overall completion ratio - status (str): Processing status - total (int | None): Total items being processed - """ - - failed: int | None - phases: list[ProcessingPhaseResponse] | None - ratio: float | None - status: str - total: int | None - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - failed: int | None - failed = self.failed - - phases: list[dict[str, Any]] | None - if isinstance(self.phases, list): - phases = [] - for phases_type_0_item_data in self.phases: - phases_type_0_item = phases_type_0_item_data.to_dict() - phases.append(phases_type_0_item) - - else: - phases = self.phases - - ratio: float | None - ratio = self.ratio - - status = self.status - - total: int | None - total = self.total - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "failed": failed, - "phases": phases, - "ratio": ratio, - "status": status, - "total": total, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.processing_phase_response import ProcessingPhaseResponse - - d = dict(src_dict) - - def _parse_failed(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - failed = _parse_failed(d.pop("failed")) - - def _parse_phases(data: object) -> list[ProcessingPhaseResponse] | None: - if data is None: - return data - try: - if not isinstance(data, list): - raise TypeError() - phases_type_0 = [] - _phases_type_0 = data - for phases_type_0_item_data in _phases_type_0: - phases_type_0_item = ProcessingPhaseResponse.from_dict( - phases_type_0_item_data - ) - - phases_type_0.append(phases_type_0_item) - - return phases_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[ProcessingPhaseResponse] | None, data) - - phases = _parse_phases(d.pop("phases")) - - def _parse_ratio(data: object) -> float | None: - if data is None: - return data - return cast(float | None, data) - - ratio = _parse_ratio(d.pop("ratio")) - - status = d.pop("status") - - def _parse_total(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - total = _parse_total(d.pop("total")) - - source_pull_progress_response = cls( - failed=failed, - phases=phases, - ratio=ratio, - status=status, - total=total, - ) - - source_pull_progress_response.additional_properties = d - return source_pull_progress_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/seclai/_generated/seclai_api_client/models/source_response.py b/seclai/_generated/seclai_api_client/models/source_response.py deleted file mode 100644 index fc9d4f9..0000000 --- a/seclai/_generated/seclai_api_client/models/source_response.py +++ /dev/null @@ -1,446 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, 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="SourceResponse") - - -@_attrs_define -class SourceResponse: - """Response model for source data. - - Attributes: - account_id (UUID): Account ID associated with the source. - content_filter (str): Content filter for the source connection. - created_at (str): Timestamp when the source connection was created. - id (str): Unique identifier for the source connection. - name (str): Name of the source connection. - next_poll_at (None | str): Timestamp for the next scheduled poll. - polling (None | str): Polling configuration for the source connection. - polling_action (None | str): Polling action for the source connection. - polling_max_items (int | None): Maximum items to poll for the source connection. - pulled_at (None | str): Timestamp when content was last pulled. - retention (int | None): Retention period for the source connection. - source_type (str): Type of the source connection. - updated_at (str): Timestamp when the source connection was last updated. - url (None | str): URL of the source connection. - avg_episodes_per_month (float | None | Unset): Average number of episodes per month. - avg_words_per_episode (int | None | Unset): Average number of words per episode. - chunk_language (None | str | Unset): Language used for chunking content. - chunk_overlap (int | None | Unset): Chunk overlap for content processing. - chunk_regex_separators (bool | None | Unset): Indicates if chunk separators are regex patterns. - chunk_separators (None | str | Unset): Chunk separators used for content processing. - chunk_size (int | None | Unset): Chunk size for content processing. - content_count (int | Unset): Number of content items associated with the source connection. Default: 0. - dimensions (int | None | Unset): Dimensions of the embedding model. - embedding_model (None | str | Unset): Embedding model used for the source connection. - embedding_model_type (None | str | Unset): Type of the embedding model. - has_historical_data (bool | Unset): Indicates if the source connection has historical data. Default: False. - readonly (bool | Unset): Indicates if the source connection is read-only. Default: False. - """ - - account_id: UUID - content_filter: str - created_at: str - id: str - name: str - next_poll_at: None | str - polling: None | str - polling_action: None | str - polling_max_items: int | None - pulled_at: None | str - retention: int | None - source_type: str - updated_at: str - url: None | str - avg_episodes_per_month: float | None | Unset = UNSET - avg_words_per_episode: int | None | Unset = UNSET - chunk_language: None | str | Unset = UNSET - chunk_overlap: int | None | Unset = UNSET - chunk_regex_separators: bool | None | Unset = UNSET - chunk_separators: None | str | Unset = UNSET - chunk_size: int | None | Unset = UNSET - content_count: int | Unset = 0 - dimensions: int | None | Unset = UNSET - embedding_model: None | str | Unset = UNSET - embedding_model_type: None | str | Unset = UNSET - has_historical_data: bool | Unset = False - readonly: bool | Unset = False - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - account_id = str(self.account_id) - - content_filter = self.content_filter - - created_at = self.created_at - - id = self.id - - name = self.name - - next_poll_at: None | str - next_poll_at = self.next_poll_at - - polling: None | str - polling = self.polling - - polling_action: None | str - polling_action = self.polling_action - - polling_max_items: int | None - polling_max_items = self.polling_max_items - - pulled_at: None | str - pulled_at = self.pulled_at - - retention: int | None - retention = self.retention - - source_type = self.source_type - - updated_at = self.updated_at - - url: None | str - url = self.url - - avg_episodes_per_month: float | None | Unset - if isinstance(self.avg_episodes_per_month, Unset): - avg_episodes_per_month = UNSET - else: - avg_episodes_per_month = self.avg_episodes_per_month - - avg_words_per_episode: int | None | Unset - if isinstance(self.avg_words_per_episode, Unset): - avg_words_per_episode = UNSET - else: - avg_words_per_episode = self.avg_words_per_episode - - chunk_language: None | str | Unset - if isinstance(self.chunk_language, Unset): - chunk_language = UNSET - else: - chunk_language = self.chunk_language - - chunk_overlap: int | None | Unset - if isinstance(self.chunk_overlap, Unset): - chunk_overlap = UNSET - else: - chunk_overlap = self.chunk_overlap - - chunk_regex_separators: bool | None | Unset - if isinstance(self.chunk_regex_separators, Unset): - chunk_regex_separators = UNSET - else: - chunk_regex_separators = self.chunk_regex_separators - - chunk_separators: None | str | Unset - if isinstance(self.chunk_separators, Unset): - chunk_separators = UNSET - else: - chunk_separators = self.chunk_separators - - chunk_size: int | None | Unset - if isinstance(self.chunk_size, Unset): - chunk_size = UNSET - else: - chunk_size = self.chunk_size - - content_count = self.content_count - - dimensions: int | None | Unset - if isinstance(self.dimensions, Unset): - dimensions = UNSET - else: - dimensions = self.dimensions - - embedding_model: None | str | Unset - if isinstance(self.embedding_model, Unset): - embedding_model = UNSET - else: - embedding_model = self.embedding_model - - embedding_model_type: None | str | Unset - if isinstance(self.embedding_model_type, Unset): - embedding_model_type = UNSET - else: - embedding_model_type = self.embedding_model_type - - has_historical_data = self.has_historical_data - - readonly = self.readonly - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "account_id": account_id, - "content_filter": content_filter, - "created_at": created_at, - "id": id, - "name": name, - "next_poll_at": next_poll_at, - "polling": polling, - "polling_action": polling_action, - "polling_max_items": polling_max_items, - "pulled_at": pulled_at, - "retention": retention, - "source_type": source_type, - "updated_at": updated_at, - "url": url, - } - ) - if avg_episodes_per_month is not UNSET: - field_dict["avg_episodes_per_month"] = avg_episodes_per_month - if avg_words_per_episode is not UNSET: - field_dict["avg_words_per_episode"] = avg_words_per_episode - if chunk_language is not UNSET: - field_dict["chunk_language"] = chunk_language - if chunk_overlap is not UNSET: - field_dict["chunk_overlap"] = chunk_overlap - if chunk_regex_separators is not UNSET: - field_dict["chunk_regex_separators"] = chunk_regex_separators - if chunk_separators is not UNSET: - field_dict["chunk_separators"] = chunk_separators - if chunk_size is not UNSET: - field_dict["chunk_size"] = chunk_size - if content_count is not UNSET: - field_dict["content_count"] = content_count - if dimensions is not UNSET: - field_dict["dimensions"] = dimensions - if embedding_model is not UNSET: - field_dict["embedding_model"] = embedding_model - if embedding_model_type is not UNSET: - field_dict["embedding_model_type"] = embedding_model_type - if has_historical_data is not UNSET: - field_dict["has_historical_data"] = has_historical_data - if readonly is not UNSET: - field_dict["readonly"] = readonly - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = UUID(d.pop("account_id")) - - content_filter = d.pop("content_filter") - - created_at = d.pop("created_at") - - id = d.pop("id") - - name = d.pop("name") - - def _parse_next_poll_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - next_poll_at = _parse_next_poll_at(d.pop("next_poll_at")) - - def _parse_polling(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - polling = _parse_polling(d.pop("polling")) - - def _parse_polling_action(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - polling_action = _parse_polling_action(d.pop("polling_action")) - - def _parse_polling_max_items(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - polling_max_items = _parse_polling_max_items(d.pop("polling_max_items")) - - def _parse_pulled_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - pulled_at = _parse_pulled_at(d.pop("pulled_at")) - - def _parse_retention(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - retention = _parse_retention(d.pop("retention")) - - source_type = d.pop("source_type") - - updated_at = d.pop("updated_at") - - def _parse_url(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - url = _parse_url(d.pop("url")) - - def _parse_avg_episodes_per_month(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - avg_episodes_per_month = _parse_avg_episodes_per_month( - d.pop("avg_episodes_per_month", UNSET) - ) - - def _parse_avg_words_per_episode(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - avg_words_per_episode = _parse_avg_words_per_episode( - d.pop("avg_words_per_episode", UNSET) - ) - - def _parse_chunk_language(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - chunk_language = _parse_chunk_language(d.pop("chunk_language", UNSET)) - - def _parse_chunk_overlap(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_overlap = _parse_chunk_overlap(d.pop("chunk_overlap", UNSET)) - - def _parse_chunk_regex_separators(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - chunk_regex_separators = _parse_chunk_regex_separators( - d.pop("chunk_regex_separators", UNSET) - ) - - def _parse_chunk_separators(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - chunk_separators = _parse_chunk_separators(d.pop("chunk_separators", UNSET)) - - def _parse_chunk_size(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - chunk_size = _parse_chunk_size(d.pop("chunk_size", UNSET)) - - content_count = d.pop("content_count", UNSET) - - def _parse_dimensions(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - dimensions = _parse_dimensions(d.pop("dimensions", UNSET)) - - def _parse_embedding_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - embedding_model = _parse_embedding_model(d.pop("embedding_model", UNSET)) - - def _parse_embedding_model_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - embedding_model_type = _parse_embedding_model_type( - d.pop("embedding_model_type", UNSET) - ) - - has_historical_data = d.pop("has_historical_data", UNSET) - - readonly = d.pop("readonly", UNSET) - - source_response = cls( - account_id=account_id, - content_filter=content_filter, - created_at=created_at, - id=id, - name=name, - next_poll_at=next_poll_at, - polling=polling, - polling_action=polling_action, - polling_max_items=polling_max_items, - pulled_at=pulled_at, - retention=retention, - source_type=source_type, - updated_at=updated_at, - url=url, - avg_episodes_per_month=avg_episodes_per_month, - avg_words_per_episode=avg_words_per_episode, - chunk_language=chunk_language, - chunk_overlap=chunk_overlap, - chunk_regex_separators=chunk_regex_separators, - chunk_separators=chunk_separators, - chunk_size=chunk_size, - content_count=content_count, - dimensions=dimensions, - embedding_model=embedding_model, - embedding_model_type=embedding_model_type, - has_historical_data=has_historical_data, - readonly=readonly, - ) - - source_response.additional_properties = d - return source_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/seclai/_generated/seclai_api_client/models/source_type.py b/seclai/_generated/seclai_api_client/models/source_type.py deleted file mode 100644 index cc8c280..0000000 --- a/seclai/_generated/seclai_api_client/models/source_type.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class SourceType(str, Enum): - CUSTOM_INDEX = "custom_index" - FILE_UPLOADS = "file_uploads" - INVALID = "invalid" - RSS_FEED = "rss_feed" - WEBSITE = "website" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/start_subscription_request.py b/seclai/_generated/seclai_api_client/models/start_subscription_request.py deleted file mode 100644 index 75da508..0000000 --- a/seclai/_generated/seclai_api_client/models/start_subscription_request.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, 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="StartSubscriptionRequest") - - -@_attrs_define -class StartSubscriptionRequest: - """ - Attributes: - plan_id (UUID): - payment_method_id (None | str | Unset): - """ - - plan_id: UUID - payment_method_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - plan_id = str(self.plan_id) - - payment_method_id: None | str | Unset - if isinstance(self.payment_method_id, Unset): - payment_method_id = UNSET - else: - payment_method_id = self.payment_method_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "plan_id": plan_id, - } - ) - if payment_method_id is not UNSET: - field_dict["payment_method_id"] = payment_method_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - plan_id = UUID(d.pop("plan_id")) - - def _parse_payment_method_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - payment_method_id = _parse_payment_method_id(d.pop("payment_method_id", UNSET)) - - start_subscription_request = cls( - plan_id=plan_id, - payment_method_id=payment_method_id, - ) - - start_subscription_request.additional_properties = d - return start_subscription_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/seclai/_generated/seclai_api_client/models/start_subscription_response.py b/seclai/_generated/seclai_api_client/models/start_subscription_response.py deleted file mode 100644 index a6994ec..0000000 --- a/seclai/_generated/seclai_api_client/models/start_subscription_response.py +++ /dev/null @@ -1,94 +0,0 @@ -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="StartSubscriptionResponse") - - -@_attrs_define -class StartSubscriptionResponse: - """ - Attributes: - message (str): - stripe_client_secret (None | str | Unset): - success (bool | Unset): Default: False. - """ - - message: str - stripe_client_secret: None | str | Unset = UNSET - success: bool | Unset = False - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - message = self.message - - stripe_client_secret: None | str | Unset - if isinstance(self.stripe_client_secret, Unset): - stripe_client_secret = UNSET - else: - stripe_client_secret = self.stripe_client_secret - - success = self.success - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "message": message, - } - ) - if stripe_client_secret is not UNSET: - field_dict["stripe_client_secret"] = stripe_client_secret - if success is not UNSET: - field_dict["success"] = success - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - message = d.pop("message") - - def _parse_stripe_client_secret(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - stripe_client_secret = _parse_stripe_client_secret( - d.pop("stripe_client_secret", UNSET) - ) - - success = d.pop("success", UNSET) - - start_subscription_response = cls( - message=message, - stripe_client_secret=stripe_client_secret, - success=success, - ) - - start_subscription_response.additional_properties = d - return start_subscription_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/seclai/_generated/seclai_api_client/models/step_debug_run_request.py b/seclai/_generated/seclai_api_client/models/step_debug_run_request.py deleted file mode 100644 index 1932ea3..0000000 --- a/seclai/_generated/seclai_api_client/models/step_debug_run_request.py +++ /dev/null @@ -1,178 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.step_debug_run_request_manual_inputs import ( - StepDebugRunRequestManualInputs, - ) - from ..models.step_debug_run_request_manual_metadata import ( - StepDebugRunRequestManualMetadata, - ) - from ..models.step_debug_run_request_manual_outputs import ( - StepDebugRunRequestManualOutputs, - ) - - -T = TypeVar("T", bound="StepDebugRunRequest") - - -@_attrs_define -class StepDebugRunRequest: - """ - Attributes: - agent_input (None | str | Unset): Override for the original agent input - manual_inputs (StepDebugRunRequestManualInputs | Unset): Manual overrides for {{step..input}} - manual_metadata (StepDebugRunRequestManualMetadata | Unset): Manual metadata values - manual_outputs (StepDebugRunRequestManualOutputs | Unset): Manual overrides for {{step..output}} - source_agent_run_id (None | Unset | UUID): Optional agent run to use for default inputs - """ - - agent_input: None | str | Unset = UNSET - manual_inputs: StepDebugRunRequestManualInputs | Unset = UNSET - manual_metadata: StepDebugRunRequestManualMetadata | Unset = UNSET - manual_outputs: StepDebugRunRequestManualOutputs | Unset = UNSET - source_agent_run_id: None | Unset | UUID = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_input: None | str | Unset - if isinstance(self.agent_input, Unset): - agent_input = UNSET - else: - agent_input = self.agent_input - - manual_inputs: dict[str, Any] | Unset = UNSET - if not isinstance(self.manual_inputs, Unset): - manual_inputs = self.manual_inputs.to_dict() - - manual_metadata: dict[str, Any] | Unset = UNSET - if not isinstance(self.manual_metadata, Unset): - manual_metadata = self.manual_metadata.to_dict() - - manual_outputs: dict[str, Any] | Unset = UNSET - if not isinstance(self.manual_outputs, Unset): - manual_outputs = self.manual_outputs.to_dict() - - source_agent_run_id: None | str | Unset - if isinstance(self.source_agent_run_id, Unset): - source_agent_run_id = UNSET - elif isinstance(self.source_agent_run_id, UUID): - source_agent_run_id = str(self.source_agent_run_id) - else: - source_agent_run_id = self.source_agent_run_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if agent_input is not UNSET: - field_dict["agent_input"] = agent_input - if manual_inputs is not UNSET: - field_dict["manual_inputs"] = manual_inputs - if manual_metadata is not UNSET: - field_dict["manual_metadata"] = manual_metadata - if manual_outputs is not UNSET: - field_dict["manual_outputs"] = manual_outputs - if source_agent_run_id is not UNSET: - field_dict["source_agent_run_id"] = source_agent_run_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.step_debug_run_request_manual_inputs import ( - StepDebugRunRequestManualInputs, - ) - from ..models.step_debug_run_request_manual_metadata import ( - StepDebugRunRequestManualMetadata, - ) - from ..models.step_debug_run_request_manual_outputs import ( - StepDebugRunRequestManualOutputs, - ) - - d = dict(src_dict) - - def _parse_agent_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - agent_input = _parse_agent_input(d.pop("agent_input", UNSET)) - - _manual_inputs = d.pop("manual_inputs", UNSET) - manual_inputs: StepDebugRunRequestManualInputs | Unset - if isinstance(_manual_inputs, Unset): - manual_inputs = UNSET - else: - manual_inputs = StepDebugRunRequestManualInputs.from_dict(_manual_inputs) - - _manual_metadata = d.pop("manual_metadata", UNSET) - manual_metadata: StepDebugRunRequestManualMetadata | Unset - if isinstance(_manual_metadata, Unset): - manual_metadata = UNSET - else: - manual_metadata = StepDebugRunRequestManualMetadata.from_dict( - _manual_metadata - ) - - _manual_outputs = d.pop("manual_outputs", UNSET) - manual_outputs: StepDebugRunRequestManualOutputs | Unset - if isinstance(_manual_outputs, Unset): - manual_outputs = UNSET - else: - manual_outputs = StepDebugRunRequestManualOutputs.from_dict(_manual_outputs) - - def _parse_source_agent_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() - source_agent_run_id_type_0 = UUID(data) - - return source_agent_run_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - source_agent_run_id = _parse_source_agent_run_id( - d.pop("source_agent_run_id", UNSET) - ) - - step_debug_run_request = cls( - agent_input=agent_input, - manual_inputs=manual_inputs, - manual_metadata=manual_metadata, - manual_outputs=manual_outputs, - source_agent_run_id=source_agent_run_id, - ) - - step_debug_run_request.additional_properties = d - return step_debug_run_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/seclai/_generated/seclai_api_client/models/step_debug_run_request_manual_inputs.py b/seclai/_generated/seclai_api_client/models/step_debug_run_request_manual_inputs.py deleted file mode 100644 index a665f55..0000000 --- a/seclai/_generated/seclai_api_client/models/step_debug_run_request_manual_inputs.py +++ /dev/null @@ -1,46 +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="StepDebugRunRequestManualInputs") - - -@_attrs_define -class StepDebugRunRequestManualInputs: - """Manual overrides for {{step..input}}""" - - 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) - step_debug_run_request_manual_inputs = cls() - - step_debug_run_request_manual_inputs.additional_properties = d - return step_debug_run_request_manual_inputs - - @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/seclai/_generated/seclai_api_client/models/step_debug_run_request_manual_metadata.py b/seclai/_generated/seclai_api_client/models/step_debug_run_request_manual_metadata.py deleted file mode 100644 index 505fca4..0000000 --- a/seclai/_generated/seclai_api_client/models/step_debug_run_request_manual_metadata.py +++ /dev/null @@ -1,46 +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="StepDebugRunRequestManualMetadata") - - -@_attrs_define -class StepDebugRunRequestManualMetadata: - """Manual metadata values""" - - additional_properties: dict[str, Any] = _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) - step_debug_run_request_manual_metadata = cls() - - step_debug_run_request_manual_metadata.additional_properties = d - return step_debug_run_request_manual_metadata - - @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/seclai/_generated/seclai_api_client/models/step_debug_run_request_manual_outputs.py b/seclai/_generated/seclai_api_client/models/step_debug_run_request_manual_outputs.py deleted file mode 100644 index 9440728..0000000 --- a/seclai/_generated/seclai_api_client/models/step_debug_run_request_manual_outputs.py +++ /dev/null @@ -1,46 +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="StepDebugRunRequestManualOutputs") - - -@_attrs_define -class StepDebugRunRequestManualOutputs: - """Manual overrides for {{step..output}}""" - - 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) - step_debug_run_request_manual_outputs = cls() - - step_debug_run_request_manual_outputs.additional_properties = d - return step_debug_run_request_manual_outputs - - @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/seclai/_generated/seclai_api_client/models/step_debug_run_response.py b/seclai/_generated/seclai_api_client/models/step_debug_run_response.py deleted file mode 100644 index 4bfa37c..0000000 --- a/seclai/_generated/seclai_api_client/models/step_debug_run_response.py +++ /dev/null @@ -1,134 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, 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="StepDebugRunResponse") - - -@_attrs_define -class StepDebugRunResponse: - """ - Attributes: - success (bool): Whether the debug run succeeded - error (None | str | Unset): Error message when the run fails - output (None | str | Unset): Rendered output captured from the step - step_run_id (None | Unset | UUID): ID of the temporary step run - """ - - success: bool - error: None | str | Unset = UNSET - output: None | str | Unset = UNSET - step_run_id: None | Unset | UUID = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - output: None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - else: - output = self.output - - step_run_id: None | str | Unset - if isinstance(self.step_run_id, Unset): - step_run_id = UNSET - elif isinstance(self.step_run_id, UUID): - step_run_id = str(self.step_run_id) - else: - step_run_id = self.step_run_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - if output is not UNSET: - field_dict["output"] = output - if step_run_id is not UNSET: - field_dict["step_run_id"] = step_run_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - def _parse_step_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() - step_run_id_type_0 = UUID(data) - - return step_run_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - step_run_id = _parse_step_run_id(d.pop("step_run_id", UNSET)) - - step_debug_run_response = cls( - success=success, - error=error, - output=output, - step_run_id=step_run_id, - ) - - step_debug_run_response.additional_properties = d - return step_debug_run_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/seclai/_generated/seclai_api_client/models/step_run_attempt_list_response.py b/seclai/_generated/seclai_api_client/models/step_run_attempt_list_response.py deleted file mode 100644 index 3ffbce1..0000000 --- a/seclai/_generated/seclai_api_client/models/step_run_attempt_list_response.py +++ /dev/null @@ -1,108 +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.step_run_attempt_response import StepRunAttemptResponse - - -T = TypeVar("T", bound="StepRunAttemptListResponse") - - -@_attrs_define -class StepRunAttemptListResponse: - """Response model for paginated step run attempt list - - Attributes: - items (list[StepRunAttemptResponse]): - page (int): - page_size (int): - total (int): - total_pages (int): - """ - - items: list[StepRunAttemptResponse] - page: int - page_size: int - total: int - total_pages: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - items = [] - for items_item_data in self.items: - items_item = items_item_data.to_dict() - items.append(items_item) - - page = self.page - - page_size = self.page_size - - total = self.total - - total_pages = self.total_pages - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "items": items, - "page": page, - "page_size": page_size, - "total": total, - "total_pages": total_pages, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.step_run_attempt_response import StepRunAttemptResponse - - d = dict(src_dict) - items = [] - _items = d.pop("items") - for items_item_data in _items: - items_item = StepRunAttemptResponse.from_dict(items_item_data) - - items.append(items_item) - - page = d.pop("page") - - page_size = d.pop("page_size") - - total = d.pop("total") - - total_pages = d.pop("total_pages") - - step_run_attempt_list_response = cls( - items=items, - page=page, - page_size=page_size, - total=total, - total_pages=total_pages, - ) - - step_run_attempt_list_response.additional_properties = d - return step_run_attempt_list_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/seclai/_generated/seclai_api_client/models/step_run_attempt_response.py b/seclai/_generated/seclai_api_client/models/step_run_attempt_response.py deleted file mode 100644 index 620ced0..0000000 --- a/seclai/_generated/seclai_api_client/models/step_run_attempt_response.py +++ /dev/null @@ -1,137 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="StepRunAttemptResponse") - - -@_attrs_define -class StepRunAttemptResponse: - """Response model for a single step run attempt - - Attributes: - agent_step_run_id (UUID): - created_at (str): - ended_at (None | str): - error (None | str): - id (UUID): - started_at (None | str): - status (str): - updated_at (str): - """ - - agent_step_run_id: UUID - created_at: str - ended_at: None | str - error: None | str - id: UUID - started_at: None | str - status: str - updated_at: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_step_run_id = str(self.agent_step_run_id) - - created_at = self.created_at - - ended_at: None | str - ended_at = self.ended_at - - error: None | str - error = self.error - - id = str(self.id) - - started_at: None | str - started_at = self.started_at - - status = self.status - - updated_at = self.updated_at - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_step_run_id": agent_step_run_id, - "created_at": created_at, - "ended_at": ended_at, - "error": error, - "id": id, - "started_at": started_at, - "status": status, - "updated_at": updated_at, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_step_run_id = UUID(d.pop("agent_step_run_id")) - - created_at = d.pop("created_at") - - def _parse_ended_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - ended_at = _parse_ended_at(d.pop("ended_at")) - - def _parse_error(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - error = _parse_error(d.pop("error")) - - id = UUID(d.pop("id")) - - def _parse_started_at(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - started_at = _parse_started_at(d.pop("started_at")) - - status = d.pop("status") - - updated_at = d.pop("updated_at") - - step_run_attempt_response = cls( - agent_step_run_id=agent_step_run_id, - created_at=created_at, - ended_at=ended_at, - error=error, - id=id, - started_at=started_at, - status=status, - updated_at=updated_at, - ) - - step_run_attempt_response.additional_properties = d - return step_run_attempt_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/seclai/_generated/seclai_api_client/models/stripe_webhook_response.py b/seclai/_generated/seclai_api_client/models/stripe_webhook_response.py deleted file mode 100644 index 68dba84..0000000 --- a/seclai/_generated/seclai_api_client/models/stripe_webhook_response.py +++ /dev/null @@ -1,61 +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="StripeWebhookResponse") - - -@_attrs_define -class StripeWebhookResponse: - """ - Attributes: - success (bool): - """ - - success: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - success = self.success - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "success": success, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - success = d.pop("success") - - stripe_webhook_response = cls( - success=success, - ) - - stripe_webhook_response.additional_properties = d - return stripe_webhook_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/seclai/_generated/seclai_api_client/models/submit_feedback_request.py b/seclai/_generated/seclai_api_client/models/submit_feedback_request.py deleted file mode 100644 index 5d3b54d..0000000 --- a/seclai/_generated/seclai_api_client/models/submit_feedback_request.py +++ /dev/null @@ -1,186 +0,0 @@ -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 ..models.subscription_cancelation_reason import SubscriptionCancelationReason -from ..types import UNSET, Unset - -T = TypeVar("T", bound="SubmitFeedbackRequest") - - -@_attrs_define -class SubmitFeedbackRequest: - """ - Attributes: - reason (SubscriptionCancelationReason): Predefined reasons for subscription cancellation - better_service (None | str | Unset): - comments (None | str | Unset): - desired_content_source_type (None | str | Unset): - other (None | str | Unset): - use_case_missing (None | str | Unset): - website_url (None | str | Unset): - """ - - reason: SubscriptionCancelationReason - better_service: None | str | Unset = UNSET - comments: None | str | Unset = UNSET - desired_content_source_type: None | str | Unset = UNSET - other: None | str | Unset = UNSET - use_case_missing: None | str | Unset = UNSET - website_url: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - reason = self.reason.value - - better_service: None | str | Unset - if isinstance(self.better_service, Unset): - better_service = UNSET - else: - better_service = self.better_service - - comments: None | str | Unset - if isinstance(self.comments, Unset): - comments = UNSET - else: - comments = self.comments - - desired_content_source_type: None | str | Unset - if isinstance(self.desired_content_source_type, Unset): - desired_content_source_type = UNSET - else: - desired_content_source_type = self.desired_content_source_type - - other: None | str | Unset - if isinstance(self.other, Unset): - other = UNSET - else: - other = self.other - - use_case_missing: None | str | Unset - if isinstance(self.use_case_missing, Unset): - use_case_missing = UNSET - else: - use_case_missing = self.use_case_missing - - website_url: None | str | Unset - if isinstance(self.website_url, Unset): - website_url = UNSET - else: - website_url = self.website_url - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "reason": reason, - } - ) - if better_service is not UNSET: - field_dict["better_service"] = better_service - if comments is not UNSET: - field_dict["comments"] = comments - if desired_content_source_type is not UNSET: - field_dict["desired_content_source_type"] = desired_content_source_type - if other is not UNSET: - field_dict["other"] = other - if use_case_missing is not UNSET: - field_dict["use_case_missing"] = use_case_missing - if website_url is not UNSET: - field_dict["website_url"] = website_url - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - reason = SubscriptionCancelationReason(d.pop("reason")) - - def _parse_better_service(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - better_service = _parse_better_service(d.pop("better_service", UNSET)) - - def _parse_comments(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - comments = _parse_comments(d.pop("comments", UNSET)) - - def _parse_desired_content_source_type(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - desired_content_source_type = _parse_desired_content_source_type( - d.pop("desired_content_source_type", UNSET) - ) - - def _parse_other(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - other = _parse_other(d.pop("other", UNSET)) - - def _parse_use_case_missing(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - use_case_missing = _parse_use_case_missing(d.pop("use_case_missing", UNSET)) - - def _parse_website_url(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - website_url = _parse_website_url(d.pop("website_url", UNSET)) - - submit_feedback_request = cls( - reason=reason, - better_service=better_service, - comments=comments, - desired_content_source_type=desired_content_source_type, - other=other, - use_case_missing=use_case_missing, - website_url=website_url, - ) - - submit_feedback_request.additional_properties = d - return submit_feedback_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/seclai/_generated/seclai_api_client/models/subscription_cancelation_reason.py b/seclai/_generated/seclai_api_client/models/subscription_cancelation_reason.py deleted file mode 100644 index 004a302..0000000 --- a/seclai/_generated/seclai_api_client/models/subscription_cancelation_reason.py +++ /dev/null @@ -1,16 +0,0 @@ -from enum import Enum - - -class SubscriptionCancelationReason(str, Enum): - CONTENT_SOURCE_TYPE_NOT_SUPPORTED = "content_source_type_not_supported" - FOUND_BETTER_SERVICE = "found_better_service" - NOT_USING_ENOUGH = "not_using_enough" - OTHER = "other" - TECHNICAL_ISSUES = "technical_issues" - TEMPORARY_NEED = "temporary_need" - TOO_EXPENSIVE = "too_expensive" - USE_CASE_NOT_SUPPORTED = "use_case_not_supported" - WEBSITE_DOES_NOT_ALLOW_SCRAPING = "website_does_not_allow_scraping" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/subscription_payment_intent_request.py b/seclai/_generated/seclai_api_client/models/subscription_payment_intent_request.py deleted file mode 100644 index 7b6c9a9..0000000 --- a/seclai/_generated/seclai_api_client/models/subscription_payment_intent_request.py +++ /dev/null @@ -1,83 +0,0 @@ -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="SubscriptionPaymentIntentRequest") - - -@_attrs_define -class SubscriptionPaymentIntentRequest: - """ - Attributes: - plan_id (str): - currency (None | str | Unset): - """ - - plan_id: str - currency: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - plan_id = self.plan_id - - currency: None | str | Unset - if isinstance(self.currency, Unset): - currency = UNSET - else: - currency = self.currency - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "plan_id": plan_id, - } - ) - if currency is not UNSET: - field_dict["currency"] = currency - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - plan_id = d.pop("plan_id") - - def _parse_currency(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - currency = _parse_currency(d.pop("currency", UNSET)) - - subscription_payment_intent_request = cls( - plan_id=plan_id, - currency=currency, - ) - - subscription_payment_intent_request.additional_properties = d - return subscription_payment_intent_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/seclai/_generated/seclai_api_client/models/subscription_payment_intent_response.py b/seclai/_generated/seclai_api_client/models/subscription_payment_intent_response.py deleted file mode 100644 index e4c4e1c..0000000 --- a/seclai/_generated/seclai_api_client/models/subscription_payment_intent_response.py +++ /dev/null @@ -1,171 +0,0 @@ -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="SubscriptionPaymentIntentResponse") - - -@_attrs_define -class SubscriptionPaymentIntentResponse: - """ - Attributes: - message (str): - success (bool): - amount (int | None | Unset): - client_secret (None | str | Unset): - currency (None | str | Unset): - status (None | str | Unset): - subscription_id (None | str | Unset): - """ - - message: str - success: bool - amount: int | None | Unset = UNSET - client_secret: None | str | Unset = UNSET - currency: None | str | Unset = UNSET - status: None | str | Unset = UNSET - subscription_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - message = self.message - - success = self.success - - amount: int | None | Unset - if isinstance(self.amount, Unset): - amount = UNSET - else: - amount = self.amount - - client_secret: None | str | Unset - if isinstance(self.client_secret, Unset): - client_secret = UNSET - else: - client_secret = self.client_secret - - currency: None | str | Unset - if isinstance(self.currency, Unset): - currency = UNSET - else: - currency = self.currency - - status: None | str | Unset - if isinstance(self.status, Unset): - status = UNSET - else: - status = self.status - - subscription_id: None | str | Unset - if isinstance(self.subscription_id, Unset): - subscription_id = UNSET - else: - subscription_id = self.subscription_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "message": message, - "success": success, - } - ) - if amount is not UNSET: - field_dict["amount"] = amount - if client_secret is not UNSET: - field_dict["client_secret"] = client_secret - if currency is not UNSET: - field_dict["currency"] = currency - if status is not UNSET: - field_dict["status"] = status - if subscription_id is not UNSET: - field_dict["subscription_id"] = subscription_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - message = d.pop("message") - - success = d.pop("success") - - def _parse_amount(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - amount = _parse_amount(d.pop("amount", UNSET)) - - def _parse_client_secret(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - client_secret = _parse_client_secret(d.pop("client_secret", UNSET)) - - def _parse_currency(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - currency = _parse_currency(d.pop("currency", UNSET)) - - def _parse_status(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - status = _parse_status(d.pop("status", UNSET)) - - def _parse_subscription_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - subscription_id = _parse_subscription_id(d.pop("subscription_id", UNSET)) - - subscription_payment_intent_response = cls( - message=message, - success=success, - amount=amount, - client_secret=client_secret, - currency=currency, - status=status, - subscription_id=subscription_id, - ) - - subscription_payment_intent_response.additional_properties = d - return subscription_payment_intent_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/seclai/_generated/seclai_api_client/models/subscription_response.py b/seclai/_generated/seclai_api_client/models/subscription_response.py deleted file mode 100644 index 3a538d7..0000000 --- a/seclai/_generated/seclai_api_client/models/subscription_response.py +++ /dev/null @@ -1,198 +0,0 @@ -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="SubscriptionResponse") - - -@_attrs_define -class SubscriptionResponse: - """Response model for subscription information. - - Attributes: - created_at (str): - id (str): - is_trial (bool): - plan_id (str): - plan_name (str): - status (str): - updated_at (str): - billing_cycle_anchor (None | str | Unset): - current_period_end (None | str | Unset): - current_period_start (None | str | Unset): - trial_end_date (None | str | Unset): - """ - - created_at: str - id: str - is_trial: bool - plan_id: str - plan_name: str - status: str - updated_at: str - billing_cycle_anchor: None | str | Unset = UNSET - current_period_end: None | str | Unset = UNSET - current_period_start: None | str | Unset = UNSET - trial_end_date: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - created_at = self.created_at - - id = self.id - - is_trial = self.is_trial - - plan_id = self.plan_id - - plan_name = self.plan_name - - status = self.status - - updated_at = self.updated_at - - billing_cycle_anchor: None | str | Unset - if isinstance(self.billing_cycle_anchor, Unset): - billing_cycle_anchor = UNSET - else: - billing_cycle_anchor = self.billing_cycle_anchor - - current_period_end: None | str | Unset - if isinstance(self.current_period_end, Unset): - current_period_end = UNSET - else: - current_period_end = self.current_period_end - - current_period_start: None | str | Unset - if isinstance(self.current_period_start, Unset): - current_period_start = UNSET - else: - current_period_start = self.current_period_start - - trial_end_date: None | str | Unset - if isinstance(self.trial_end_date, Unset): - trial_end_date = UNSET - else: - trial_end_date = self.trial_end_date - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "created_at": created_at, - "id": id, - "is_trial": is_trial, - "plan_id": plan_id, - "plan_name": plan_name, - "status": status, - "updated_at": updated_at, - } - ) - if billing_cycle_anchor is not UNSET: - field_dict["billing_cycle_anchor"] = billing_cycle_anchor - if current_period_end is not UNSET: - field_dict["current_period_end"] = current_period_end - if current_period_start is not UNSET: - field_dict["current_period_start"] = current_period_start - if trial_end_date is not UNSET: - field_dict["trial_end_date"] = trial_end_date - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - created_at = d.pop("created_at") - - id = d.pop("id") - - is_trial = d.pop("is_trial") - - plan_id = d.pop("plan_id") - - plan_name = d.pop("plan_name") - - status = d.pop("status") - - updated_at = d.pop("updated_at") - - def _parse_billing_cycle_anchor(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - billing_cycle_anchor = _parse_billing_cycle_anchor( - d.pop("billing_cycle_anchor", UNSET) - ) - - def _parse_current_period_end(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - current_period_end = _parse_current_period_end( - d.pop("current_period_end", UNSET) - ) - - def _parse_current_period_start(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - current_period_start = _parse_current_period_start( - d.pop("current_period_start", UNSET) - ) - - def _parse_trial_end_date(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - trial_end_date = _parse_trial_end_date(d.pop("trial_end_date", UNSET)) - - subscription_response = cls( - created_at=created_at, - id=id, - is_trial=is_trial, - plan_id=plan_id, - plan_name=plan_name, - status=status, - updated_at=updated_at, - billing_cycle_anchor=billing_cycle_anchor, - current_period_end=current_period_end, - current_period_start=current_period_start, - trial_end_date=trial_end_date, - ) - - subscription_response.additional_properties = d - return subscription_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/seclai/_generated/seclai_api_client/models/substitution_dependencies.py b/seclai/_generated/seclai_api_client/models/substitution_dependencies.py deleted file mode 100644 index 8fae891..0000000 --- a/seclai/_generated/seclai_api_client/models/substitution_dependencies.py +++ /dev/null @@ -1,94 +0,0 @@ -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 - -T = TypeVar("T", bound="SubstitutionDependencies") - - -@_attrs_define -class SubstitutionDependencies: - """Dependencies found in templates. - - Attributes: - agent_input_required (bool): Whether {{agent.input}} is used (original agent input) - current_step_input_required (bool): Whether {{input}} is used (previous step output) - metadata_fields (list[str]): Metadata fields referenced - step_inputs (list[str]): Step IDs referenced for input - step_outputs (list[str]): Step IDs referenced for output - """ - - agent_input_required: bool - current_step_input_required: bool - metadata_fields: list[str] - step_inputs: list[str] - step_outputs: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_input_required = self.agent_input_required - - current_step_input_required = self.current_step_input_required - - metadata_fields = self.metadata_fields - - step_inputs = self.step_inputs - - step_outputs = self.step_outputs - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_input_required": agent_input_required, - "current_step_input_required": current_step_input_required, - "metadata_fields": metadata_fields, - "step_inputs": step_inputs, - "step_outputs": step_outputs, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_input_required = d.pop("agent_input_required") - - current_step_input_required = d.pop("current_step_input_required") - - metadata_fields = cast(list[str], d.pop("metadata_fields")) - - step_inputs = cast(list[str], d.pop("step_inputs")) - - step_outputs = cast(list[str], d.pop("step_outputs")) - - substitution_dependencies = cls( - agent_input_required=agent_input_required, - current_step_input_required=current_step_input_required, - metadata_fields=metadata_fields, - step_inputs=step_inputs, - step_outputs=step_outputs, - ) - - substitution_dependencies.additional_properties = d - return substitution_dependencies - - @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/seclai/_generated/seclai_api_client/models/test_display_result_request.py b/seclai/_generated/seclai_api_client/models/test_display_result_request.py deleted file mode 100644 index 9bef91e..0000000 --- a/seclai/_generated/seclai_api_client/models/test_display_result_request.py +++ /dev/null @@ -1,93 +0,0 @@ -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="TestDisplayResultRequest") - - -@_attrs_define -class TestDisplayResultRequest: - """Request to test display result template. - - Attributes: - test_input (str): The test input to use in template substitution - html_format (bool | Unset): Whether to format as HTML or plain text Default: True. - template (None | str | Unset): Template string with substitution variables like {{input}} - """ - - test_input: str - html_format: bool | Unset = True - template: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - test_input = self.test_input - - html_format = self.html_format - - template: None | str | Unset - if isinstance(self.template, Unset): - template = UNSET - else: - template = self.template - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "test_input": test_input, - } - ) - if html_format is not UNSET: - field_dict["html_format"] = html_format - if template is not UNSET: - field_dict["template"] = template - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - test_input = d.pop("test_input") - - html_format = d.pop("html_format", UNSET) - - def _parse_template(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - template = _parse_template(d.pop("template", UNSET)) - - test_display_result_request = cls( - test_input=test_input, - html_format=html_format, - template=template, - ) - - test_display_result_request.additional_properties = d - return test_display_result_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/seclai/_generated/seclai_api_client/models/test_display_result_response.py b/seclai/_generated/seclai_api_client/models/test_display_result_response.py deleted file mode 100644 index 92b9fd5..0000000 --- a/seclai/_generated/seclai_api_client/models/test_display_result_response.py +++ /dev/null @@ -1,104 +0,0 @@ -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="TestDisplayResultResponse") - - -@_attrs_define -class TestDisplayResultResponse: - """Response from testing display result template. - - Attributes: - success (bool): Whether the template rendering was successful - error (None | str | Unset): Error message if template rendering failed - output (None | str | Unset): The rendered template output - """ - - success: bool - error: None | str | Unset = UNSET - output: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - output: None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - else: - output = self.output - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - if output is not UNSET: - field_dict["output"] = output - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - test_display_result_response = cls( - success=success, - error=error, - output=output, - ) - - test_display_result_response.additional_properties = d - return test_display_result_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/seclai/_generated/seclai_api_client/models/test_extract_html_request.py b/seclai/_generated/seclai_api_client/models/test_extract_html_request.py deleted file mode 100644 index a1184d9..0000000 --- a/seclai/_generated/seclai_api_client/models/test_extract_html_request.py +++ /dev/null @@ -1,84 +0,0 @@ -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="TestExtractHtmlRequest") - - -@_attrs_define -class TestExtractHtmlRequest: - """Request to test HTML extraction. - - Attributes: - test_input (str): The test input text to parse as HTML - expected_tag (None | str | Unset): Optional tag name to extract (e.g., 'div', 'body') - """ - - test_input: str - expected_tag: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - test_input = self.test_input - - expected_tag: None | str | Unset - if isinstance(self.expected_tag, Unset): - expected_tag = UNSET - else: - expected_tag = self.expected_tag - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "test_input": test_input, - } - ) - if expected_tag is not UNSET: - field_dict["expected_tag"] = expected_tag - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - test_input = d.pop("test_input") - - def _parse_expected_tag(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - expected_tag = _parse_expected_tag(d.pop("expected_tag", UNSET)) - - test_extract_html_request = cls( - test_input=test_input, - expected_tag=expected_tag, - ) - - test_extract_html_request.additional_properties = d - return test_extract_html_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/seclai/_generated/seclai_api_client/models/test_extract_html_response.py b/seclai/_generated/seclai_api_client/models/test_extract_html_response.py deleted file mode 100644 index 848833c..0000000 --- a/seclai/_generated/seclai_api_client/models/test_extract_html_response.py +++ /dev/null @@ -1,104 +0,0 @@ -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="TestExtractHtmlResponse") - - -@_attrs_define -class TestExtractHtmlResponse: - """Response from testing HTML extraction. - - Attributes: - success (bool): Whether the extraction was successful - error (None | str | Unset): Error message if extraction failed - output (None | str | Unset): The extracted HTML as prettified string - """ - - success: bool - error: None | str | Unset = UNSET - output: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - output: None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - else: - output = self.output - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - if output is not UNSET: - field_dict["output"] = output - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - test_extract_html_response = cls( - success=success, - error=error, - output=output, - ) - - test_extract_html_response.additional_properties = d - return test_extract_html_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/seclai/_generated/seclai_api_client/models/test_extract_json_request.py b/seclai/_generated/seclai_api_client/models/test_extract_json_request.py deleted file mode 100644 index a337cbb..0000000 --- a/seclai/_generated/seclai_api_client/models/test_extract_json_request.py +++ /dev/null @@ -1,93 +0,0 @@ -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 ..models.json_type import JsonType -from ..types import UNSET, Unset - -T = TypeVar("T", bound="TestExtractJsonRequest") - - -@_attrs_define -class TestExtractJsonRequest: - """Request to test JSON extraction. - - Attributes: - expected_type (JsonType): JSON types for extraction. - test_input (str): The test input text containing JSON - json_path (None | str | Unset): Optional JSONPath query to apply after extraction - """ - - expected_type: JsonType - test_input: str - json_path: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - expected_type = self.expected_type.value - - test_input = self.test_input - - json_path: None | str | Unset - if isinstance(self.json_path, Unset): - json_path = UNSET - else: - json_path = self.json_path - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "expected_type": expected_type, - "test_input": test_input, - } - ) - if json_path is not UNSET: - field_dict["json_path"] = json_path - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - expected_type = JsonType(d.pop("expected_type")) - - test_input = d.pop("test_input") - - def _parse_json_path(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - json_path = _parse_json_path(d.pop("json_path", UNSET)) - - test_extract_json_request = cls( - expected_type=expected_type, - test_input=test_input, - json_path=json_path, - ) - - test_extract_json_request.additional_properties = d - return test_extract_json_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/seclai/_generated/seclai_api_client/models/test_extract_json_response.py b/seclai/_generated/seclai_api_client/models/test_extract_json_response.py deleted file mode 100644 index de50fea..0000000 --- a/seclai/_generated/seclai_api_client/models/test_extract_json_response.py +++ /dev/null @@ -1,104 +0,0 @@ -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="TestExtractJsonResponse") - - -@_attrs_define -class TestExtractJsonResponse: - """Response from testing JSON extraction. - - Attributes: - success (bool): Whether the extraction was successful - error (None | str | Unset): Error message if extraction failed - output (None | str | Unset): The extracted JSON as formatted string - """ - - success: bool - error: None | str | Unset = UNSET - output: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - output: None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - else: - output = self.output - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - if output is not UNSET: - field_dict["output"] = output - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - test_extract_json_response = cls( - success=success, - error=error, - output=output, - ) - - test_extract_json_response.additional_properties = d - return test_extract_json_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/seclai/_generated/seclai_api_client/models/test_extract_xml_request.py b/seclai/_generated/seclai_api_client/models/test_extract_xml_request.py deleted file mode 100644 index 460c994..0000000 --- a/seclai/_generated/seclai_api_client/models/test_extract_xml_request.py +++ /dev/null @@ -1,104 +0,0 @@ -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="TestExtractXmlRequest") - - -@_attrs_define -class TestExtractXmlRequest: - """Request to test XML extraction. - - Attributes: - test_input (str): The test input text to parse as XML - expected_tag (None | str | Unset): Optional tag name to extract (e.g., 'root', 'item') - xml_path (None | str | Unset): Optional XPath query to extract specific elements - """ - - test_input: str - expected_tag: None | str | Unset = UNSET - xml_path: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - test_input = self.test_input - - expected_tag: None | str | Unset - if isinstance(self.expected_tag, Unset): - expected_tag = UNSET - else: - expected_tag = self.expected_tag - - xml_path: None | str | Unset - if isinstance(self.xml_path, Unset): - xml_path = UNSET - else: - xml_path = self.xml_path - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "test_input": test_input, - } - ) - if expected_tag is not UNSET: - field_dict["expected_tag"] = expected_tag - if xml_path is not UNSET: - field_dict["xml_path"] = xml_path - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - test_input = d.pop("test_input") - - def _parse_expected_tag(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - expected_tag = _parse_expected_tag(d.pop("expected_tag", UNSET)) - - def _parse_xml_path(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - xml_path = _parse_xml_path(d.pop("xml_path", UNSET)) - - test_extract_xml_request = cls( - test_input=test_input, - expected_tag=expected_tag, - xml_path=xml_path, - ) - - test_extract_xml_request.additional_properties = d - return test_extract_xml_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/seclai/_generated/seclai_api_client/models/test_extract_xml_response.py b/seclai/_generated/seclai_api_client/models/test_extract_xml_response.py deleted file mode 100644 index 0093eb1..0000000 --- a/seclai/_generated/seclai_api_client/models/test_extract_xml_response.py +++ /dev/null @@ -1,104 +0,0 @@ -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="TestExtractXmlResponse") - - -@_attrs_define -class TestExtractXmlResponse: - """Response from testing XML extraction. - - Attributes: - success (bool): Whether the extraction was successful - error (None | str | Unset): Error message if extraction failed - output (None | str | Unset): The extracted XML as prettified string - """ - - success: bool - error: None | str | Unset = UNSET - output: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - output: None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - else: - output = self.output - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - if output is not UNSET: - field_dict["output"] = output - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - test_extract_xml_response = cls( - success=success, - error=error, - output=output, - ) - - test_extract_xml_response.additional_properties = d - return test_extract_xml_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/seclai/_generated/seclai_api_client/models/test_prompt_call_request.py b/seclai/_generated/seclai_api_client/models/test_prompt_call_request.py deleted file mode 100644 index 39ccdc3..0000000 --- a/seclai/_generated/seclai_api_client/models/test_prompt_call_request.py +++ /dev/null @@ -1,327 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.test_prompt_call_request_json_template_type_0 import ( - TestPromptCallRequestJsonTemplateType0, - ) - from ..models.test_prompt_call_request_manual_inputs_type_0 import ( - TestPromptCallRequestManualInputsType0, - ) - - -T = TypeVar("T", bound="TestPromptCallRequest") - - -@_attrs_define -class TestPromptCallRequest: - """Request to test prompt call operation. - - Attributes: - model (str): The model identifier - test_input (str): The original agent input ({{agent.input}}) - agent_id (None | Unset | UUID): Optional agent id to attribute recorded usage to. When provided, prompt-call - usage is linked via agent_usages for reporting. - current_step_input (None | str | Unset): The previous step output ({{input}}) - json_template (None | TestPromptCallRequestJsonTemplateType0 | Unset): JSON template (JSON format) - manual_inputs (None | TestPromptCallRequestManualInputsType0 | Unset): Manual inputs for step outputs and other - substitutions - max_tokens (int | None | Unset): Max tokens setting - model_variant (None | str | Unset): Optional model variant - prompt_template (None | str | Unset): User prompt template (simple format) - simple_format (bool | Unset): Whether using simple text format (vs JSON) Default: True. - system_template (None | str | Unset): System prompt template (simple format) - temperature (float | None | Unset): Temperature setting - """ - - model: str - test_input: str - agent_id: None | Unset | UUID = UNSET - current_step_input: None | str | Unset = UNSET - json_template: None | TestPromptCallRequestJsonTemplateType0 | Unset = UNSET - manual_inputs: None | TestPromptCallRequestManualInputsType0 | Unset = UNSET - max_tokens: int | None | Unset = UNSET - model_variant: None | str | Unset = UNSET - prompt_template: None | str | Unset = UNSET - simple_format: bool | Unset = True - system_template: None | str | Unset = UNSET - temperature: float | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.test_prompt_call_request_json_template_type_0 import ( - TestPromptCallRequestJsonTemplateType0, - ) - from ..models.test_prompt_call_request_manual_inputs_type_0 import ( - TestPromptCallRequestManualInputsType0, - ) - - model = self.model - - test_input = self.test_input - - agent_id: None | str | Unset - if isinstance(self.agent_id, Unset): - agent_id = UNSET - elif isinstance(self.agent_id, UUID): - agent_id = str(self.agent_id) - else: - agent_id = self.agent_id - - current_step_input: None | str | Unset - if isinstance(self.current_step_input, Unset): - current_step_input = UNSET - else: - current_step_input = self.current_step_input - - json_template: dict[str, Any] | None | Unset - if isinstance(self.json_template, Unset): - json_template = UNSET - elif isinstance(self.json_template, TestPromptCallRequestJsonTemplateType0): - json_template = self.json_template.to_dict() - else: - json_template = self.json_template - - manual_inputs: dict[str, Any] | None | Unset - if isinstance(self.manual_inputs, Unset): - manual_inputs = UNSET - elif isinstance(self.manual_inputs, TestPromptCallRequestManualInputsType0): - manual_inputs = self.manual_inputs.to_dict() - else: - manual_inputs = self.manual_inputs - - max_tokens: int | None | Unset - if isinstance(self.max_tokens, Unset): - max_tokens = UNSET - else: - max_tokens = self.max_tokens - - model_variant: None | str | Unset - if isinstance(self.model_variant, Unset): - model_variant = UNSET - else: - model_variant = self.model_variant - - prompt_template: None | str | Unset - if isinstance(self.prompt_template, Unset): - prompt_template = UNSET - else: - prompt_template = self.prompt_template - - simple_format = self.simple_format - - system_template: None | str | Unset - if isinstance(self.system_template, Unset): - system_template = UNSET - else: - system_template = self.system_template - - temperature: float | None | Unset - if isinstance(self.temperature, Unset): - temperature = UNSET - else: - temperature = self.temperature - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "model": model, - "test_input": test_input, - } - ) - if agent_id is not UNSET: - field_dict["agent_id"] = agent_id - if current_step_input is not UNSET: - field_dict["current_step_input"] = current_step_input - if json_template is not UNSET: - field_dict["json_template"] = json_template - if manual_inputs is not UNSET: - field_dict["manual_inputs"] = manual_inputs - if max_tokens is not UNSET: - field_dict["max_tokens"] = max_tokens - if model_variant is not UNSET: - field_dict["model_variant"] = model_variant - if prompt_template is not UNSET: - field_dict["prompt_template"] = prompt_template - if simple_format is not UNSET: - field_dict["simple_format"] = simple_format - if system_template is not UNSET: - field_dict["system_template"] = system_template - if temperature is not UNSET: - field_dict["temperature"] = temperature - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.test_prompt_call_request_json_template_type_0 import ( - TestPromptCallRequestJsonTemplateType0, - ) - from ..models.test_prompt_call_request_manual_inputs_type_0 import ( - TestPromptCallRequestManualInputsType0, - ) - - d = dict(src_dict) - model = d.pop("model") - - test_input = d.pop("test_input") - - def _parse_agent_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() - agent_id_type_0 = UUID(data) - - return agent_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - agent_id = _parse_agent_id(d.pop("agent_id", UNSET)) - - def _parse_current_step_input(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - current_step_input = _parse_current_step_input( - d.pop("current_step_input", UNSET) - ) - - def _parse_json_template( - data: object, - ) -> None | TestPromptCallRequestJsonTemplateType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - json_template_type_0 = TestPromptCallRequestJsonTemplateType0.from_dict( - data - ) - - return json_template_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TestPromptCallRequestJsonTemplateType0 | Unset, data) - - json_template = _parse_json_template(d.pop("json_template", UNSET)) - - def _parse_manual_inputs( - data: object, - ) -> None | TestPromptCallRequestManualInputsType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - manual_inputs_type_0 = TestPromptCallRequestManualInputsType0.from_dict( - data - ) - - return manual_inputs_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TestPromptCallRequestManualInputsType0 | Unset, data) - - manual_inputs = _parse_manual_inputs(d.pop("manual_inputs", UNSET)) - - def _parse_max_tokens(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - max_tokens = _parse_max_tokens(d.pop("max_tokens", UNSET)) - - def _parse_model_variant(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - model_variant = _parse_model_variant(d.pop("model_variant", UNSET)) - - def _parse_prompt_template(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - prompt_template = _parse_prompt_template(d.pop("prompt_template", UNSET)) - - simple_format = d.pop("simple_format", UNSET) - - def _parse_system_template(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - system_template = _parse_system_template(d.pop("system_template", 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)) - - test_prompt_call_request = cls( - model=model, - test_input=test_input, - agent_id=agent_id, - current_step_input=current_step_input, - json_template=json_template, - manual_inputs=manual_inputs, - max_tokens=max_tokens, - model_variant=model_variant, - prompt_template=prompt_template, - simple_format=simple_format, - system_template=system_template, - temperature=temperature, - ) - - test_prompt_call_request.additional_properties = d - return test_prompt_call_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/seclai/_generated/seclai_api_client/models/test_prompt_call_request_json_template_type_0.py b/seclai/_generated/seclai_api_client/models/test_prompt_call_request_json_template_type_0.py deleted file mode 100644 index 8c933bb..0000000 --- a/seclai/_generated/seclai_api_client/models/test_prompt_call_request_json_template_type_0.py +++ /dev/null @@ -1,46 +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="TestPromptCallRequestJsonTemplateType0") - - -@_attrs_define -class TestPromptCallRequestJsonTemplateType0: - """ """ - - additional_properties: dict[str, Any] = _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) - test_prompt_call_request_json_template_type_0 = cls() - - test_prompt_call_request_json_template_type_0.additional_properties = d - return test_prompt_call_request_json_template_type_0 - - @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/seclai/_generated/seclai_api_client/models/test_prompt_call_request_manual_inputs_type_0.py b/seclai/_generated/seclai_api_client/models/test_prompt_call_request_manual_inputs_type_0.py deleted file mode 100644 index a98f1e5..0000000 --- a/seclai/_generated/seclai_api_client/models/test_prompt_call_request_manual_inputs_type_0.py +++ /dev/null @@ -1,46 +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="TestPromptCallRequestManualInputsType0") - - -@_attrs_define -class TestPromptCallRequestManualInputsType0: - """ """ - - additional_properties: dict[str, Any] = _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) - test_prompt_call_request_manual_inputs_type_0 = cls() - - test_prompt_call_request_manual_inputs_type_0.additional_properties = d - return test_prompt_call_request_manual_inputs_type_0 - - @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/seclai/_generated/seclai_api_client/models/test_prompt_call_response.py b/seclai/_generated/seclai_api_client/models/test_prompt_call_response.py deleted file mode 100644 index bf8eba6..0000000 --- a/seclai/_generated/seclai_api_client/models/test_prompt_call_response.py +++ /dev/null @@ -1,131 +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.test_prompt_call_response_result_type_0 import ( - TestPromptCallResponseResultType0, - ) - - -T = TypeVar("T", bound="TestPromptCallResponse") - - -@_attrs_define -class TestPromptCallResponse: - """Response from testing prompt call operation. - - Attributes: - success (bool): Whether the prompt call test was successful - error (None | str | Unset): Error message if test failed - result (None | TestPromptCallResponseResultType0 | Unset): Prompt call details (prompt, system, response, - tokens) - """ - - success: bool - error: None | str | Unset = UNSET - result: None | TestPromptCallResponseResultType0 | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.test_prompt_call_response_result_type_0 import ( - TestPromptCallResponseResultType0, - ) - - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - result: dict[str, Any] | None | Unset - if isinstance(self.result, Unset): - result = UNSET - elif isinstance(self.result, TestPromptCallResponseResultType0): - result = self.result.to_dict() - else: - result = self.result - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - if result is not UNSET: - field_dict["result"] = result - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.test_prompt_call_response_result_type_0 import ( - TestPromptCallResponseResultType0, - ) - - d = dict(src_dict) - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_result( - data: object, - ) -> None | TestPromptCallResponseResultType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - result_type_0 = TestPromptCallResponseResultType0.from_dict(data) - - return result_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TestPromptCallResponseResultType0 | Unset, data) - - result = _parse_result(d.pop("result", UNSET)) - - test_prompt_call_response = cls( - success=success, - error=error, - result=result, - ) - - test_prompt_call_response.additional_properties = d - return test_prompt_call_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/seclai/_generated/seclai_api_client/models/test_prompt_call_response_result_type_0.py b/seclai/_generated/seclai_api_client/models/test_prompt_call_response_result_type_0.py deleted file mode 100644 index b57500c..0000000 --- a/seclai/_generated/seclai_api_client/models/test_prompt_call_response_result_type_0.py +++ /dev/null @@ -1,46 +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="TestPromptCallResponseResultType0") - - -@_attrs_define -class TestPromptCallResponseResultType0: - """ """ - - additional_properties: dict[str, Any] = _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) - test_prompt_call_response_result_type_0 = cls() - - test_prompt_call_response_result_type_0.additional_properties = d - return test_prompt_call_response_result_type_0 - - @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/seclai/_generated/seclai_api_client/models/test_retrieval_request.py b/seclai/_generated/seclai_api_client/models/test_retrieval_request.py deleted file mode 100644 index 1ad3e84..0000000 --- a/seclai/_generated/seclai_api_client/models/test_retrieval_request.py +++ /dev/null @@ -1,251 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, 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 - -if TYPE_CHECKING: - from ..models.test_retrieval_request_metadata_filter_type_0 import ( - TestRetrievalRequestMetadataFilterType0, - ) - - -T = TypeVar("T", bound="TestRetrievalRequest") - - -@_attrs_define -class TestRetrievalRequest: - """Request to test retrieval step. - - Attributes: - knowledge_base_id (UUID): The knowledge base ID to retrieve content from - query (str): The query string for retrieval - added_after (None | str | Unset): Optional ISO 8601 datetime string for added_after filter - added_before (None | str | Unset): Optional ISO 8601 datetime string for added_before filter - agent_id (None | Unset | UUID): Optional agent id to attribute the retrieval test usage to. If provided, usage - is linked via agent_usages so it appears in the agent usage report. - content_type (str | Unset): Output content type (text/html, application/json, text/plain, application/xml) - Default: 'text/xml'. - metadata_filter (None | TestRetrievalRequestMetadataFilterType0 | Unset): Optional metadata filter - reranker_model (None | str | Unset): Optional reranker model - top_k (int | None | Unset): Number of results after reranking - top_n (int | Unset): Number of results to retrieve Default: 20. - """ - - knowledge_base_id: UUID - query: str - added_after: None | str | Unset = UNSET - added_before: None | str | Unset = UNSET - agent_id: None | Unset | UUID = UNSET - content_type: str | Unset = "text/xml" - metadata_filter: None | TestRetrievalRequestMetadataFilterType0 | Unset = UNSET - reranker_model: None | str | Unset = UNSET - top_k: int | None | Unset = UNSET - top_n: int | Unset = 20 - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.test_retrieval_request_metadata_filter_type_0 import ( - TestRetrievalRequestMetadataFilterType0, - ) - - knowledge_base_id = str(self.knowledge_base_id) - - query = self.query - - added_after: None | str | Unset - if isinstance(self.added_after, Unset): - added_after = UNSET - else: - added_after = self.added_after - - added_before: None | str | Unset - if isinstance(self.added_before, Unset): - added_before = UNSET - else: - added_before = self.added_before - - agent_id: None | str | Unset - if isinstance(self.agent_id, Unset): - agent_id = UNSET - elif isinstance(self.agent_id, UUID): - agent_id = str(self.agent_id) - else: - agent_id = self.agent_id - - content_type = self.content_type - - metadata_filter: dict[str, Any] | None | Unset - if isinstance(self.metadata_filter, Unset): - metadata_filter = UNSET - elif isinstance(self.metadata_filter, TestRetrievalRequestMetadataFilterType0): - metadata_filter = self.metadata_filter.to_dict() - else: - metadata_filter = self.metadata_filter - - reranker_model: None | str | Unset - if isinstance(self.reranker_model, Unset): - reranker_model = UNSET - else: - reranker_model = self.reranker_model - - top_k: int | None | Unset - if isinstance(self.top_k, Unset): - top_k = UNSET - else: - top_k = self.top_k - - top_n = self.top_n - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "knowledge_base_id": knowledge_base_id, - "query": query, - } - ) - if added_after is not UNSET: - field_dict["added_after"] = added_after - if added_before is not UNSET: - field_dict["added_before"] = added_before - if agent_id is not UNSET: - field_dict["agent_id"] = agent_id - if content_type is not UNSET: - field_dict["content_type"] = content_type - if metadata_filter is not UNSET: - field_dict["metadata_filter"] = metadata_filter - if reranker_model is not UNSET: - field_dict["reranker_model"] = reranker_model - if top_k is not UNSET: - field_dict["top_k"] = top_k - if top_n is not UNSET: - field_dict["top_n"] = top_n - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.test_retrieval_request_metadata_filter_type_0 import ( - TestRetrievalRequestMetadataFilterType0, - ) - - d = dict(src_dict) - knowledge_base_id = UUID(d.pop("knowledge_base_id")) - - query = d.pop("query") - - def _parse_added_after(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - added_after = _parse_added_after(d.pop("added_after", UNSET)) - - def _parse_added_before(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - added_before = _parse_added_before(d.pop("added_before", UNSET)) - - def _parse_agent_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() - agent_id_type_0 = UUID(data) - - return agent_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - agent_id = _parse_agent_id(d.pop("agent_id", UNSET)) - - content_type = d.pop("content_type", UNSET) - - def _parse_metadata_filter( - data: object, - ) -> None | TestRetrievalRequestMetadataFilterType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_filter_type_0 = ( - TestRetrievalRequestMetadataFilterType0.from_dict(data) - ) - - return metadata_filter_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TestRetrievalRequestMetadataFilterType0 | Unset, data) - - metadata_filter = _parse_metadata_filter(d.pop("metadata_filter", UNSET)) - - def _parse_reranker_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - reranker_model = _parse_reranker_model(d.pop("reranker_model", UNSET)) - - def _parse_top_k(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - top_k = _parse_top_k(d.pop("top_k", UNSET)) - - top_n = d.pop("top_n", UNSET) - - test_retrieval_request = cls( - knowledge_base_id=knowledge_base_id, - query=query, - added_after=added_after, - added_before=added_before, - agent_id=agent_id, - content_type=content_type, - metadata_filter=metadata_filter, - reranker_model=reranker_model, - top_k=top_k, - top_n=top_n, - ) - - test_retrieval_request.additional_properties = d - return test_retrieval_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/seclai/_generated/seclai_api_client/models/test_retrieval_request_metadata_filter_type_0.py b/seclai/_generated/seclai_api_client/models/test_retrieval_request_metadata_filter_type_0.py deleted file mode 100644 index e9fbd5b..0000000 --- a/seclai/_generated/seclai_api_client/models/test_retrieval_request_metadata_filter_type_0.py +++ /dev/null @@ -1,46 +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="TestRetrievalRequestMetadataFilterType0") - - -@_attrs_define -class TestRetrievalRequestMetadataFilterType0: - """ """ - - additional_properties: dict[str, Any] = _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) - test_retrieval_request_metadata_filter_type_0 = cls() - - test_retrieval_request_metadata_filter_type_0.additional_properties = d - return test_retrieval_request_metadata_filter_type_0 - - @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/seclai/_generated/seclai_api_client/models/test_retrieval_response.py b/seclai/_generated/seclai_api_client/models/test_retrieval_response.py deleted file mode 100644 index d6a5d7e..0000000 --- a/seclai/_generated/seclai_api_client/models/test_retrieval_response.py +++ /dev/null @@ -1,104 +0,0 @@ -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="TestRetrievalResponse") - - -@_attrs_define -class TestRetrievalResponse: - """Response from testing retrieval. - - Attributes: - success (bool): Whether the retrieval was successful - error (None | str | Unset): Error message if retrieval failed - output (None | str | Unset): The formatted retrieval results (pretty-printed for JSON/XML) - """ - - success: bool - error: None | str | Unset = UNSET - output: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - output: None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - else: - output = self.output - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - if output is not UNSET: - field_dict["output"] = output - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - test_retrieval_response = cls( - success=success, - error=error, - output=output, - ) - - test_retrieval_response.additional_properties = d - return test_retrieval_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/seclai/_generated/seclai_api_client/models/test_s3_write_request.py b/seclai/_generated/seclai_api_client/models/test_s3_write_request.py deleted file mode 100644 index df97f7e..0000000 --- a/seclai/_generated/seclai_api_client/models/test_s3_write_request.py +++ /dev/null @@ -1,97 +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 - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="TestS3WriteRequest") - - -@_attrs_define -class TestS3WriteRequest: - """Request to test S3 write operation. - - Attributes: - bucket_name (str): The S3 bucket name - content (str): Content to write - object_key (str): The S3 object key (path) - test_input (str): The test input to use in template substitution - content_type (str | Unset): Content-Type Default: 'text/plain'. - """ - - bucket_name: str - content: str - object_key: str - test_input: str - content_type: str | Unset = "text/plain" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - bucket_name = self.bucket_name - - content = self.content - - object_key = self.object_key - - test_input = self.test_input - - content_type = self.content_type - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "bucket_name": bucket_name, - "content": content, - "object_key": object_key, - "test_input": test_input, - } - ) - if content_type is not UNSET: - field_dict["content_type"] = content_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - bucket_name = d.pop("bucket_name") - - content = d.pop("content") - - object_key = d.pop("object_key") - - test_input = d.pop("test_input") - - content_type = d.pop("content_type", UNSET) - - test_s3_write_request = cls( - bucket_name=bucket_name, - content=content, - object_key=object_key, - test_input=test_input, - content_type=content_type, - ) - - test_s3_write_request.additional_properties = d - return test_s3_write_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/seclai/_generated/seclai_api_client/models/test_s3_write_response.py b/seclai/_generated/seclai_api_client/models/test_s3_write_response.py deleted file mode 100644 index 939b499..0000000 --- a/seclai/_generated/seclai_api_client/models/test_s3_write_response.py +++ /dev/null @@ -1,131 +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.test_s3_write_response_result_type_0 import ( - TestS3WriteResponseResultType0, - ) - - -T = TypeVar("T", bound="TestS3WriteResponse") - - -@_attrs_define -class TestS3WriteResponse: - """Response from testing S3 write operation. - - Attributes: - success (bool): Whether the S3 write test was successful - error (None | str | Unset): Error message if test failed - result (None | TestS3WriteResponseResultType0 | Unset): S3 write details (bucket_name, object_key, content_type, - content, content_size) - """ - - success: bool - error: None | str | Unset = UNSET - result: None | TestS3WriteResponseResultType0 | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.test_s3_write_response_result_type_0 import ( - TestS3WriteResponseResultType0, - ) - - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - result: dict[str, Any] | None | Unset - if isinstance(self.result, Unset): - result = UNSET - elif isinstance(self.result, TestS3WriteResponseResultType0): - result = self.result.to_dict() - else: - result = self.result - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - if result is not UNSET: - field_dict["result"] = result - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.test_s3_write_response_result_type_0 import ( - TestS3WriteResponseResultType0, - ) - - d = dict(src_dict) - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_result( - data: object, - ) -> None | TestS3WriteResponseResultType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - result_type_0 = TestS3WriteResponseResultType0.from_dict(data) - - return result_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TestS3WriteResponseResultType0 | Unset, data) - - result = _parse_result(d.pop("result", UNSET)) - - test_s3_write_response = cls( - success=success, - error=error, - result=result, - ) - - test_s3_write_response.additional_properties = d - return test_s3_write_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/seclai/_generated/seclai_api_client/models/test_s3_write_response_result_type_0.py b/seclai/_generated/seclai_api_client/models/test_s3_write_response_result_type_0.py deleted file mode 100644 index bf03a77..0000000 --- a/seclai/_generated/seclai_api_client/models/test_s3_write_response_result_type_0.py +++ /dev/null @@ -1,46 +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="TestS3WriteResponseResultType0") - - -@_attrs_define -class TestS3WriteResponseResultType0: - """ """ - - additional_properties: dict[str, Any] = _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) - test_s3_write_response_result_type_0 = cls() - - test_s3_write_response_result_type_0.additional_properties = d - return test_s3_write_response_result_type_0 - - @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/seclai/_generated/seclai_api_client/models/test_send_email_request.py b/seclai/_generated/seclai_api_client/models/test_send_email_request.py deleted file mode 100644 index f2b4420..0000000 --- a/seclai/_generated/seclai_api_client/models/test_send_email_request.py +++ /dev/null @@ -1,112 +0,0 @@ -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="TestSendEmailRequest") - - -@_attrs_define -class TestSendEmailRequest: - """Request to test send email operation. - - Attributes: - subject (str): The email subject line - test_input (str): The test input to use in template substitution - html_body (None | str | Unset): The HTML body content - text_body (None | str | Unset): The plain text body content (optional) - """ - - subject: str - test_input: str - html_body: None | str | Unset = UNSET - text_body: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - subject = self.subject - - test_input = self.test_input - - html_body: None | str | Unset - if isinstance(self.html_body, Unset): - html_body = UNSET - else: - html_body = self.html_body - - text_body: None | str | Unset - if isinstance(self.text_body, Unset): - text_body = UNSET - else: - text_body = self.text_body - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "subject": subject, - "test_input": test_input, - } - ) - if html_body is not UNSET: - field_dict["html_body"] = html_body - if text_body is not UNSET: - field_dict["text_body"] = text_body - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - subject = d.pop("subject") - - test_input = d.pop("test_input") - - def _parse_html_body(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - html_body = _parse_html_body(d.pop("html_body", UNSET)) - - def _parse_text_body(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - text_body = _parse_text_body(d.pop("text_body", UNSET)) - - test_send_email_request = cls( - subject=subject, - test_input=test_input, - html_body=html_body, - text_body=text_body, - ) - - test_send_email_request.additional_properties = d - return test_send_email_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/seclai/_generated/seclai_api_client/models/test_send_email_response.py b/seclai/_generated/seclai_api_client/models/test_send_email_response.py deleted file mode 100644 index a693029..0000000 --- a/seclai/_generated/seclai_api_client/models/test_send_email_response.py +++ /dev/null @@ -1,130 +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.test_send_email_response_result_type_0 import ( - TestSendEmailResponseResultType0, - ) - - -T = TypeVar("T", bound="TestSendEmailResponse") - - -@_attrs_define -class TestSendEmailResponse: - """Response from testing send email operation. - - Attributes: - success (bool): Whether the send email test was successful - error (None | str | Unset): Error message if test failed - result (None | TestSendEmailResponseResultType0 | Unset): Email details (subject, html_body, text_body, sizes) - """ - - success: bool - error: None | str | Unset = UNSET - result: None | TestSendEmailResponseResultType0 | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.test_send_email_response_result_type_0 import ( - TestSendEmailResponseResultType0, - ) - - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - result: dict[str, Any] | None | Unset - if isinstance(self.result, Unset): - result = UNSET - elif isinstance(self.result, TestSendEmailResponseResultType0): - result = self.result.to_dict() - else: - result = self.result - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - if result is not UNSET: - field_dict["result"] = result - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.test_send_email_response_result_type_0 import ( - TestSendEmailResponseResultType0, - ) - - d = dict(src_dict) - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_result( - data: object, - ) -> None | TestSendEmailResponseResultType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - result_type_0 = TestSendEmailResponseResultType0.from_dict(data) - - return result_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TestSendEmailResponseResultType0 | Unset, data) - - result = _parse_result(d.pop("result", UNSET)) - - test_send_email_response = cls( - success=success, - error=error, - result=result, - ) - - test_send_email_response.additional_properties = d - return test_send_email_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/seclai/_generated/seclai_api_client/models/test_send_email_response_result_type_0.py b/seclai/_generated/seclai_api_client/models/test_send_email_response_result_type_0.py deleted file mode 100644 index 905d4c2..0000000 --- a/seclai/_generated/seclai_api_client/models/test_send_email_response_result_type_0.py +++ /dev/null @@ -1,46 +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="TestSendEmailResponseResultType0") - - -@_attrs_define -class TestSendEmailResponseResultType0: - """ """ - - additional_properties: dict[str, Any] = _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) - test_send_email_response_result_type_0 = cls() - - test_send_email_response_result_type_0.additional_properties = d - return test_send_email_response_result_type_0 - - @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/seclai/_generated/seclai_api_client/models/test_transform_request.py b/seclai/_generated/seclai_api_client/models/test_transform_request.py deleted file mode 100644 index e0edee4..0000000 --- a/seclai/_generated/seclai_api_client/models/test_transform_request.py +++ /dev/null @@ -1,111 +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 - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.test_transform_request_placeholder_values import ( - TestTransformRequestPlaceholderValues, - ) - from ..models.transform_rule_test import TransformRuleTest - - -T = TypeVar("T", bound="TestTransformRequest") - - -@_attrs_define -class TestTransformRequest: - """Request to test transform rules. - - Attributes: - rules (list[TransformRuleTest]): List of transformation rules to apply sequentially - test_input (str): The test input text to transform - placeholder_values (TestTransformRequestPlaceholderValues | Unset): Values for {{...}} placeholders in the - substitution strings - """ - - rules: list[TransformRuleTest] - test_input: str - placeholder_values: TestTransformRequestPlaceholderValues | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rules = [] - for rules_item_data in self.rules: - rules_item = rules_item_data.to_dict() - rules.append(rules_item) - - test_input = self.test_input - - placeholder_values: dict[str, Any] | Unset = UNSET - if not isinstance(self.placeholder_values, Unset): - placeholder_values = self.placeholder_values.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rules": rules, - "test_input": test_input, - } - ) - if placeholder_values is not UNSET: - field_dict["placeholder_values"] = placeholder_values - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.test_transform_request_placeholder_values import ( - TestTransformRequestPlaceholderValues, - ) - from ..models.transform_rule_test import TransformRuleTest - - d = dict(src_dict) - rules = [] - _rules = d.pop("rules") - for rules_item_data in _rules: - rules_item = TransformRuleTest.from_dict(rules_item_data) - - rules.append(rules_item) - - test_input = d.pop("test_input") - - _placeholder_values = d.pop("placeholder_values", UNSET) - placeholder_values: TestTransformRequestPlaceholderValues | Unset - if isinstance(_placeholder_values, Unset): - placeholder_values = UNSET - else: - placeholder_values = TestTransformRequestPlaceholderValues.from_dict( - _placeholder_values - ) - - test_transform_request = cls( - rules=rules, - test_input=test_input, - placeholder_values=placeholder_values, - ) - - test_transform_request.additional_properties = d - return test_transform_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/seclai/_generated/seclai_api_client/models/test_transform_request_placeholder_values.py b/seclai/_generated/seclai_api_client/models/test_transform_request_placeholder_values.py deleted file mode 100644 index c1d87b1..0000000 --- a/seclai/_generated/seclai_api_client/models/test_transform_request_placeholder_values.py +++ /dev/null @@ -1,46 +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="TestTransformRequestPlaceholderValues") - - -@_attrs_define -class TestTransformRequestPlaceholderValues: - """Values for {{...}} placeholders in the substitution strings""" - - 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) - test_transform_request_placeholder_values = cls() - - test_transform_request_placeholder_values.additional_properties = d - return test_transform_request_placeholder_values - - @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/seclai/_generated/seclai_api_client/models/test_transform_response.py b/seclai/_generated/seclai_api_client/models/test_transform_response.py deleted file mode 100644 index 3fc184f..0000000 --- a/seclai/_generated/seclai_api_client/models/test_transform_response.py +++ /dev/null @@ -1,200 +0,0 @@ -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="TestTransformResponse") - - -@_attrs_define -class TestTransformResponse: - """Response from testing a transform rule. - - Attributes: - success (bool): Whether the transformation was successful - error (None | str | Unset): Error message if transformation failed - intermediate_outputs (list[str] | None | Unset): List of outputs after each rule is applied (for multi-rule - testing) - matched (bool | None | Unset): Whether the pattern matched the input - output (None | str | Unset): The transformed output text - required_placeholders (list[str] | Unset): List of placeholder names found in the substitution string - rule_matches (list[bool] | None | Unset): List of boolean values indicating whether each rule matched (in order) - """ - - success: bool - error: None | str | Unset = UNSET - intermediate_outputs: list[str] | None | Unset = UNSET - matched: bool | None | Unset = UNSET - output: None | str | Unset = UNSET - required_placeholders: list[str] | Unset = UNSET - rule_matches: list[bool] | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - intermediate_outputs: list[str] | None | Unset - if isinstance(self.intermediate_outputs, Unset): - intermediate_outputs = UNSET - elif isinstance(self.intermediate_outputs, list): - intermediate_outputs = self.intermediate_outputs - - else: - intermediate_outputs = self.intermediate_outputs - - matched: bool | None | Unset - if isinstance(self.matched, Unset): - matched = UNSET - else: - matched = self.matched - - output: None | str | Unset - if isinstance(self.output, Unset): - output = UNSET - else: - output = self.output - - required_placeholders: list[str] | Unset = UNSET - if not isinstance(self.required_placeholders, Unset): - required_placeholders = self.required_placeholders - - rule_matches: list[bool] | None | Unset - if isinstance(self.rule_matches, Unset): - rule_matches = UNSET - elif isinstance(self.rule_matches, list): - rule_matches = self.rule_matches - - else: - rule_matches = self.rule_matches - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - if intermediate_outputs is not UNSET: - field_dict["intermediate_outputs"] = intermediate_outputs - if matched is not UNSET: - field_dict["matched"] = matched - if output is not UNSET: - field_dict["output"] = output - if required_placeholders is not UNSET: - field_dict["required_placeholders"] = required_placeholders - if rule_matches is not UNSET: - field_dict["rule_matches"] = rule_matches - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_intermediate_outputs(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() - intermediate_outputs_type_0 = cast(list[str], data) - - return intermediate_outputs_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[str] | None | Unset, data) - - intermediate_outputs = _parse_intermediate_outputs( - d.pop("intermediate_outputs", UNSET) - ) - - def _parse_matched(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - matched = _parse_matched(d.pop("matched", UNSET)) - - def _parse_output(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - required_placeholders = cast(list[str], d.pop("required_placeholders", UNSET)) - - def _parse_rule_matches(data: object) -> list[bool] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - rule_matches_type_0 = cast(list[bool], data) - - return rule_matches_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[bool] | None | Unset, data) - - rule_matches = _parse_rule_matches(d.pop("rule_matches", UNSET)) - - test_transform_response = cls( - success=success, - error=error, - intermediate_outputs=intermediate_outputs, - matched=matched, - output=output, - required_placeholders=required_placeholders, - rule_matches=rule_matches, - ) - - test_transform_response.additional_properties = d - return test_transform_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/seclai/_generated/seclai_api_client/models/test_webhook_call_request.py b/seclai/_generated/seclai_api_client/models/test_webhook_call_request.py deleted file mode 100644 index 59e1f24..0000000 --- a/seclai/_generated/seclai_api_client/models/test_webhook_call_request.py +++ /dev/null @@ -1,156 +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.test_webhook_call_request_headers_type_0 import ( - TestWebhookCallRequestHeadersType0, - ) - - -T = TypeVar("T", bound="TestWebhookCallRequest") - - -@_attrs_define -class TestWebhookCallRequest: - """Request to test webhook call. - - Attributes: - test_input (str): The test input to use in template substitution - url (str): The webhook URL to call - content_type (str | Unset): Content-Type header value Default: 'application/json'. - headers (None | TestWebhookCallRequestHeadersType0 | Unset): Optional additional headers - method (str | Unset): HTTP method (POST or PUT) Default: 'POST'. - payload (None | str | Unset): Optional request payload template - """ - - test_input: str - url: str - content_type: str | Unset = "application/json" - headers: None | TestWebhookCallRequestHeadersType0 | Unset = UNSET - method: str | Unset = "POST" - payload: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.test_webhook_call_request_headers_type_0 import ( - TestWebhookCallRequestHeadersType0, - ) - - test_input = self.test_input - - url = self.url - - content_type = self.content_type - - headers: dict[str, Any] | None | Unset - if isinstance(self.headers, Unset): - headers = UNSET - elif isinstance(self.headers, TestWebhookCallRequestHeadersType0): - headers = self.headers.to_dict() - else: - headers = self.headers - - method = self.method - - payload: None | str | Unset - if isinstance(self.payload, Unset): - payload = UNSET - else: - payload = self.payload - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "test_input": test_input, - "url": url, - } - ) - if content_type is not UNSET: - field_dict["content_type"] = content_type - if headers is not UNSET: - field_dict["headers"] = headers - if method is not UNSET: - field_dict["method"] = method - if payload is not UNSET: - field_dict["payload"] = payload - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.test_webhook_call_request_headers_type_0 import ( - TestWebhookCallRequestHeadersType0, - ) - - d = dict(src_dict) - test_input = d.pop("test_input") - - url = d.pop("url") - - content_type = d.pop("content_type", UNSET) - - def _parse_headers( - data: object, - ) -> None | TestWebhookCallRequestHeadersType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - headers_type_0 = TestWebhookCallRequestHeadersType0.from_dict(data) - - return headers_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TestWebhookCallRequestHeadersType0 | Unset, data) - - headers = _parse_headers(d.pop("headers", UNSET)) - - method = d.pop("method", UNSET) - - def _parse_payload(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - payload = _parse_payload(d.pop("payload", UNSET)) - - test_webhook_call_request = cls( - test_input=test_input, - url=url, - content_type=content_type, - headers=headers, - method=method, - payload=payload, - ) - - test_webhook_call_request.additional_properties = d - return test_webhook_call_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/seclai/_generated/seclai_api_client/models/test_webhook_call_request_headers_type_0.py b/seclai/_generated/seclai_api_client/models/test_webhook_call_request_headers_type_0.py deleted file mode 100644 index d7b9dc0..0000000 --- a/seclai/_generated/seclai_api_client/models/test_webhook_call_request_headers_type_0.py +++ /dev/null @@ -1,46 +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="TestWebhookCallRequestHeadersType0") - - -@_attrs_define -class TestWebhookCallRequestHeadersType0: - """ """ - - 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) - test_webhook_call_request_headers_type_0 = cls() - - test_webhook_call_request_headers_type_0.additional_properties = d - return test_webhook_call_request_headers_type_0 - - @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/seclai/_generated/seclai_api_client/models/test_webhook_call_response.py b/seclai/_generated/seclai_api_client/models/test_webhook_call_response.py deleted file mode 100644 index 47a5c7c..0000000 --- a/seclai/_generated/seclai_api_client/models/test_webhook_call_response.py +++ /dev/null @@ -1,171 +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.test_webhook_call_response_request_type_0 import ( - TestWebhookCallResponseRequestType0, - ) - from ..models.test_webhook_call_response_response_type_0 import ( - TestWebhookCallResponseResponseType0, - ) - - -T = TypeVar("T", bound="TestWebhookCallResponse") - - -@_attrs_define -class TestWebhookCallResponse: - """Response from testing webhook call. - - Attributes: - success (bool): Whether the webhook call was successful - error (None | str | Unset): Error message if call failed - request (None | TestWebhookCallResponseRequestType0 | Unset): Request details (url, method, headers, body) - response (None | TestWebhookCallResponseResponseType0 | Unset): Response details (status_code, headers, body) - """ - - success: bool - error: None | str | Unset = UNSET - request: None | TestWebhookCallResponseRequestType0 | Unset = UNSET - response: None | TestWebhookCallResponseResponseType0 | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.test_webhook_call_response_request_type_0 import ( - TestWebhookCallResponseRequestType0, - ) - from ..models.test_webhook_call_response_response_type_0 import ( - TestWebhookCallResponseResponseType0, - ) - - success = self.success - - error: None | str | Unset - if isinstance(self.error, Unset): - error = UNSET - else: - error = self.error - - request: dict[str, Any] | None | Unset - if isinstance(self.request, Unset): - request = UNSET - elif isinstance(self.request, TestWebhookCallResponseRequestType0): - request = self.request.to_dict() - else: - request = self.request - - response: dict[str, Any] | None | Unset - if isinstance(self.response, Unset): - response = UNSET - elif isinstance(self.response, TestWebhookCallResponseResponseType0): - response = self.response.to_dict() - else: - response = self.response - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "success": success, - } - ) - if error is not UNSET: - field_dict["error"] = error - if request is not UNSET: - field_dict["request"] = request - if response is not UNSET: - field_dict["response"] = response - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.test_webhook_call_response_request_type_0 import ( - TestWebhookCallResponseRequestType0, - ) - from ..models.test_webhook_call_response_response_type_0 import ( - TestWebhookCallResponseResponseType0, - ) - - d = dict(src_dict) - success = d.pop("success") - - def _parse_error(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - error = _parse_error(d.pop("error", UNSET)) - - def _parse_request( - data: object, - ) -> None | TestWebhookCallResponseRequestType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - request_type_0 = TestWebhookCallResponseRequestType0.from_dict(data) - - return request_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TestWebhookCallResponseRequestType0 | Unset, data) - - request = _parse_request(d.pop("request", UNSET)) - - def _parse_response( - data: object, - ) -> None | TestWebhookCallResponseResponseType0 | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - response_type_0 = TestWebhookCallResponseResponseType0.from_dict(data) - - return response_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TestWebhookCallResponseResponseType0 | Unset, data) - - response = _parse_response(d.pop("response", UNSET)) - - test_webhook_call_response = cls( - success=success, - error=error, - request=request, - response=response, - ) - - test_webhook_call_response.additional_properties = d - return test_webhook_call_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/seclai/_generated/seclai_api_client/models/test_webhook_call_response_request_type_0.py b/seclai/_generated/seclai_api_client/models/test_webhook_call_response_request_type_0.py deleted file mode 100644 index 4bf485c..0000000 --- a/seclai/_generated/seclai_api_client/models/test_webhook_call_response_request_type_0.py +++ /dev/null @@ -1,46 +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="TestWebhookCallResponseRequestType0") - - -@_attrs_define -class TestWebhookCallResponseRequestType0: - """ """ - - additional_properties: dict[str, Any] = _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) - test_webhook_call_response_request_type_0 = cls() - - test_webhook_call_response_request_type_0.additional_properties = d - return test_webhook_call_response_request_type_0 - - @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/seclai/_generated/seclai_api_client/models/test_webhook_call_response_response_type_0.py b/seclai/_generated/seclai_api_client/models/test_webhook_call_response_response_type_0.py deleted file mode 100644 index e84b17a..0000000 --- a/seclai/_generated/seclai_api_client/models/test_webhook_call_response_response_type_0.py +++ /dev/null @@ -1,46 +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="TestWebhookCallResponseResponseType0") - - -@_attrs_define -class TestWebhookCallResponseResponseType0: - """ """ - - additional_properties: dict[str, Any] = _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) - test_webhook_call_response_response_type_0 = cls() - - test_webhook_call_response_response_type_0.additional_properties = d - return test_webhook_call_response_response_type_0 - - @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/seclai/_generated/seclai_api_client/models/transform_rule_test.py b/seclai/_generated/seclai_api_client/models/transform_rule_test.py deleted file mode 100644 index 78a5736..0000000 --- a/seclai/_generated/seclai_api_client/models/transform_rule_test.py +++ /dev/null @@ -1,70 +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="TransformRuleTest") - - -@_attrs_define -class TransformRuleTest: - r"""A single transform rule to test. - - Attributes: - pattern (str): The regex pattern to test - substitution (str): The substitution string (supports \1, \2, etc. and {{...}} placeholders) - """ - - pattern: str - substitution: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - pattern = self.pattern - - substitution = self.substitution - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "pattern": pattern, - "substitution": substitution, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - pattern = d.pop("pattern") - - substitution = d.pop("substitution") - - transform_rule_test = cls( - pattern=pattern, - substitution=substitution, - ) - - transform_rule_test.additional_properties = d - return transform_rule_test - - @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/seclai/_generated/seclai_api_client/models/trigger_response.py b/seclai/_generated/seclai_api_client/models/trigger_response.py deleted file mode 100644 index 211940b..0000000 --- a/seclai/_generated/seclai_api_client/models/trigger_response.py +++ /dev/null @@ -1,237 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.agent_trigger_type import AgentTriggerType - -if TYPE_CHECKING: - from ..models.trigger_response_metadata_type_0 import TriggerResponseMetadataType0 - - -T = TypeVar("T", bound="TriggerResponse") - - -@_attrs_define -class TriggerResponse: - """Response model for agent trigger data - - Attributes: - agent_id (UUID): - branch_id (None | UUID): - commit_id (None | UUID): - created_at (str): - id (UUID): - input_ (None | str): - knowledge_base_id (None | UUID): - metadata (None | TriggerResponseMetadataType0): - name (None | str): - trigger_type (AgentTriggerType): - updated_at (str): - """ - - agent_id: UUID - branch_id: None | UUID - commit_id: None | UUID - created_at: str - id: UUID - input_: None | str - knowledge_base_id: None | UUID - metadata: None | TriggerResponseMetadataType0 - name: None | str - trigger_type: AgentTriggerType - updated_at: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.trigger_response_metadata_type_0 import ( - TriggerResponseMetadataType0, - ) - - agent_id = str(self.agent_id) - - branch_id: None | str - if isinstance(self.branch_id, UUID): - branch_id = str(self.branch_id) - else: - branch_id = self.branch_id - - commit_id: None | str - if isinstance(self.commit_id, UUID): - commit_id = str(self.commit_id) - else: - commit_id = self.commit_id - - created_at = self.created_at - - id = str(self.id) - - input_: None | str - input_ = self.input_ - - knowledge_base_id: None | str - if isinstance(self.knowledge_base_id, UUID): - knowledge_base_id = str(self.knowledge_base_id) - else: - knowledge_base_id = self.knowledge_base_id - - metadata: dict[str, Any] | None - if isinstance(self.metadata, TriggerResponseMetadataType0): - metadata = self.metadata.to_dict() - else: - metadata = self.metadata - - name: None | str - name = self.name - - trigger_type = self.trigger_type.value - - updated_at = self.updated_at - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_id": agent_id, - "branch_id": branch_id, - "commit_id": commit_id, - "created_at": created_at, - "id": id, - "input": input_, - "knowledge_base_id": knowledge_base_id, - "metadata_": metadata, - "name": name, - "trigger_type": trigger_type, - "updated_at": updated_at, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.trigger_response_metadata_type_0 import ( - TriggerResponseMetadataType0, - ) - - d = dict(src_dict) - agent_id = UUID(d.pop("agent_id")) - - def _parse_branch_id(data: object) -> None | UUID: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - branch_id_type_0 = UUID(data) - - return branch_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UUID, data) - - branch_id = _parse_branch_id(d.pop("branch_id")) - - def _parse_commit_id(data: object) -> None | UUID: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - commit_id_type_0 = UUID(data) - - return commit_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UUID, data) - - commit_id = _parse_commit_id(d.pop("commit_id")) - - created_at = d.pop("created_at") - - id = UUID(d.pop("id")) - - def _parse_input_(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - input_ = _parse_input_(d.pop("input")) - - def _parse_knowledge_base_id(data: object) -> None | UUID: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - knowledge_base_id_type_0 = UUID(data) - - return knowledge_base_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | UUID, data) - - knowledge_base_id = _parse_knowledge_base_id(d.pop("knowledge_base_id")) - - def _parse_metadata(data: object) -> None | TriggerResponseMetadataType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_type_0 = TriggerResponseMetadataType0.from_dict(data) - - return metadata_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TriggerResponseMetadataType0, data) - - metadata = _parse_metadata(d.pop("metadata_")) - - def _parse_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - name = _parse_name(d.pop("name")) - - trigger_type = AgentTriggerType(d.pop("trigger_type")) - - updated_at = d.pop("updated_at") - - trigger_response = cls( - agent_id=agent_id, - branch_id=branch_id, - commit_id=commit_id, - created_at=created_at, - id=id, - input_=input_, - knowledge_base_id=knowledge_base_id, - metadata=metadata, - name=name, - trigger_type=trigger_type, - updated_at=updated_at, - ) - - trigger_response.additional_properties = d - return trigger_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/seclai/_generated/seclai_api_client/models/trigger_response_metadata_type_0.py b/seclai/_generated/seclai_api_client/models/trigger_response_metadata_type_0.py deleted file mode 100644 index 58a6270..0000000 --- a/seclai/_generated/seclai_api_client/models/trigger_response_metadata_type_0.py +++ /dev/null @@ -1,46 +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="TriggerResponseMetadataType0") - - -@_attrs_define -class TriggerResponseMetadataType0: - """ """ - - additional_properties: dict[str, Any] = _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) - trigger_response_metadata_type_0 = cls() - - trigger_response_metadata_type_0.additional_properties = d - return trigger_response_metadata_type_0 - - @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/seclai/_generated/seclai_api_client/models/trigger_schedule_response.py b/seclai/_generated/seclai_api_client/models/trigger_schedule_response.py deleted file mode 100644 index bde2da2..0000000 --- a/seclai/_generated/seclai_api_client/models/trigger_schedule_response.py +++ /dev/null @@ -1,175 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.agent_trigger_frequency import AgentTriggerFrequency - -T = TypeVar("T", bound="TriggerScheduleResponse") - - -@_attrs_define -class TriggerScheduleResponse: - """Response model for agent trigger schedule data - - Attributes: - agent_trigger_id (UUID): - created_at (str): - day_of_month (int | None): - day_of_week (int | None): - frequency (AgentTriggerFrequency): - hour_of_day (int | None): - id (UUID): - minute_of_hour (int | None): - repeat_interval (int): - updated_at (str): - weekday_of_month (int | None): - """ - - agent_trigger_id: UUID - created_at: str - day_of_month: int | None - day_of_week: int | None - frequency: AgentTriggerFrequency - hour_of_day: int | None - id: UUID - minute_of_hour: int | None - repeat_interval: int - updated_at: str - weekday_of_month: int | None - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - agent_trigger_id = str(self.agent_trigger_id) - - created_at = self.created_at - - day_of_month: int | None - day_of_month = self.day_of_month - - day_of_week: int | None - day_of_week = self.day_of_week - - frequency = self.frequency.value - - hour_of_day: int | None - hour_of_day = self.hour_of_day - - id = str(self.id) - - minute_of_hour: int | None - minute_of_hour = self.minute_of_hour - - repeat_interval = self.repeat_interval - - updated_at = self.updated_at - - weekday_of_month: int | None - weekday_of_month = self.weekday_of_month - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "agent_trigger_id": agent_trigger_id, - "created_at": created_at, - "day_of_month": day_of_month, - "day_of_week": day_of_week, - "frequency": frequency, - "hour_of_day": hour_of_day, - "id": id, - "minute_of_hour": minute_of_hour, - "repeat_interval": repeat_interval, - "updated_at": updated_at, - "weekday_of_month": weekday_of_month, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - agent_trigger_id = UUID(d.pop("agent_trigger_id")) - - created_at = d.pop("created_at") - - def _parse_day_of_month(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - day_of_month = _parse_day_of_month(d.pop("day_of_month")) - - def _parse_day_of_week(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - day_of_week = _parse_day_of_week(d.pop("day_of_week")) - - frequency = AgentTriggerFrequency(d.pop("frequency")) - - def _parse_hour_of_day(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - hour_of_day = _parse_hour_of_day(d.pop("hour_of_day")) - - id = UUID(d.pop("id")) - - def _parse_minute_of_hour(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - minute_of_hour = _parse_minute_of_hour(d.pop("minute_of_hour")) - - repeat_interval = d.pop("repeat_interval") - - updated_at = d.pop("updated_at") - - def _parse_weekday_of_month(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - weekday_of_month = _parse_weekday_of_month(d.pop("weekday_of_month")) - - trigger_schedule_response = cls( - agent_trigger_id=agent_trigger_id, - created_at=created_at, - day_of_month=day_of_month, - day_of_week=day_of_week, - frequency=frequency, - hour_of_day=hour_of_day, - id=id, - minute_of_hour=minute_of_hour, - repeat_interval=repeat_interval, - updated_at=updated_at, - weekday_of_month=weekday_of_month, - ) - - trigger_schedule_response.additional_properties = d - return trigger_schedule_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/seclai/_generated/seclai_api_client/models/update_agent_request.py b/seclai/_generated/seclai_api_client/models/update_agent_request.py deleted file mode 100644 index 710e188..0000000 --- a/seclai/_generated/seclai_api_client/models/update_agent_request.py +++ /dev/null @@ -1,94 +0,0 @@ -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="UpdateAgentRequest") - - -@_attrs_define -class UpdateAgentRequest: - """Request model for updating an agent - - Attributes: - description (None | str | Unset): Agent description (can be None to clear) - name (None | str | Unset): Agent name - """ - - description: None | str | Unset = UNSET - name: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if description is not UNSET: - field_dict["description"] = description - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - update_agent_request = cls( - description=description, - name=name, - ) - - update_agent_request.additional_properties = d - return update_agent_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/seclai/_generated/seclai_api_client/models/update_auto_purchase_request.py b/seclai/_generated/seclai_api_client/models/update_auto_purchase_request.py deleted file mode 100644 index c02381b..0000000 --- a/seclai/_generated/seclai_api_client/models/update_auto_purchase_request.py +++ /dev/null @@ -1,61 +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="UpdateAutoPurchaseRequest") - - -@_attrs_define -class UpdateAutoPurchaseRequest: - """ - Attributes: - auto_purchase_overages (bool): - """ - - auto_purchase_overages: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - auto_purchase_overages = self.auto_purchase_overages - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "auto_purchase_overages": auto_purchase_overages, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - auto_purchase_overages = d.pop("auto_purchase_overages") - - update_auto_purchase_request = cls( - auto_purchase_overages=auto_purchase_overages, - ) - - update_auto_purchase_request.additional_properties = d - return update_auto_purchase_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/seclai/_generated/seclai_api_client/models/update_branch_state_request.py b/seclai/_generated/seclai_api_client/models/update_branch_state_request.py deleted file mode 100644 index e9b63f4..0000000 --- a/seclai/_generated/seclai_api_client/models/update_branch_state_request.py +++ /dev/null @@ -1,81 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.update_branch_state_request_definition import ( - UpdateBranchStateRequestDefinition, - ) - - -T = TypeVar("T", bound="UpdateBranchStateRequest") - - -@_attrs_define -class UpdateBranchStateRequest: - """Request model for updating a branch's current state - - Attributes: - change_id (UUID): The expected current change_id (for optimistic locking) - definition (UpdateBranchStateRequestDefinition): The new agent definition - """ - - change_id: UUID - definition: UpdateBranchStateRequestDefinition - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - change_id = str(self.change_id) - - definition = self.definition.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "change_id": change_id, - "definition": definition, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_branch_state_request_definition import ( - UpdateBranchStateRequestDefinition, - ) - - d = dict(src_dict) - change_id = UUID(d.pop("change_id")) - - definition = UpdateBranchStateRequestDefinition.from_dict(d.pop("definition")) - - update_branch_state_request = cls( - change_id=change_id, - definition=definition, - ) - - update_branch_state_request.additional_properties = d - return update_branch_state_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/seclai/_generated/seclai_api_client/models/update_branch_state_request_definition.py b/seclai/_generated/seclai_api_client/models/update_branch_state_request_definition.py deleted file mode 100644 index d5675ba..0000000 --- a/seclai/_generated/seclai_api_client/models/update_branch_state_request_definition.py +++ /dev/null @@ -1,46 +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="UpdateBranchStateRequestDefinition") - - -@_attrs_define -class UpdateBranchStateRequestDefinition: - """The new agent definition""" - - additional_properties: dict[str, Any] = _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) - update_branch_state_request_definition = cls() - - update_branch_state_request_definition.additional_properties = d - return update_branch_state_request_definition - - @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/seclai/_generated/seclai_api_client/models/update_email_preference_request.py b/seclai/_generated/seclai_api_client/models/update_email_preference_request.py deleted file mode 100644 index a5979fb..0000000 --- a/seclai/_generated/seclai_api_client/models/update_email_preference_request.py +++ /dev/null @@ -1,62 +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="UpdateEmailPreferenceRequest") - - -@_attrs_define -class UpdateEmailPreferenceRequest: - """Request model for updating email preference - - Attributes: - subscribed (bool): Whether to subscribe or unsubscribe - """ - - subscribed: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - subscribed = self.subscribed - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "subscribed": subscribed, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - subscribed = d.pop("subscribed") - - update_email_preference_request = cls( - subscribed=subscribed, - ) - - update_email_preference_request.additional_properties = d - return update_email_preference_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/seclai/_generated/seclai_api_client/models/update_knowledge_base_request.py b/seclai/_generated/seclai_api_client/models/update_knowledge_base_request.py deleted file mode 100644 index f5d861a..0000000 --- a/seclai/_generated/seclai_api_client/models/update_knowledge_base_request.py +++ /dev/null @@ -1,242 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, 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="UpdateKnowledgeBaseRequest") - - -@_attrs_define -class UpdateKnowledgeBaseRequest: - """Request model for updating a knowledge base - - Attributes: - description (None | str | Unset): New description for the knowledge base - keyword_search_enabled (bool | None | Unset): Whether keyword search is enabled - knowledge_base_enabled (bool | None | Unset): Whether the knowledge base chat functionality is enabled - mcp_server_enabled (bool | None | Unset): Whether the MCP server functionality is enabled - name (None | str | Unset): New name for the knowledge base - reranker_model (None | str | Unset): Reranker model to use (empty string or null for no reranking) - semantic_search_enabled (bool | None | Unset): Whether semantic search is enabled - source_ids (list[UUID] | None | Unset): New list of source connection IDs to associate with the knowledge base - """ - - description: None | str | Unset = UNSET - keyword_search_enabled: bool | None | Unset = UNSET - knowledge_base_enabled: bool | None | Unset = UNSET - mcp_server_enabled: bool | None | Unset = UNSET - name: None | str | Unset = UNSET - reranker_model: None | str | Unset = UNSET - semantic_search_enabled: bool | None | Unset = UNSET - source_ids: list[UUID] | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - keyword_search_enabled: bool | None | Unset - if isinstance(self.keyword_search_enabled, Unset): - keyword_search_enabled = UNSET - else: - keyword_search_enabled = self.keyword_search_enabled - - knowledge_base_enabled: bool | None | Unset - if isinstance(self.knowledge_base_enabled, Unset): - knowledge_base_enabled = UNSET - else: - knowledge_base_enabled = self.knowledge_base_enabled - - mcp_server_enabled: bool | None | Unset - if isinstance(self.mcp_server_enabled, Unset): - mcp_server_enabled = UNSET - else: - mcp_server_enabled = self.mcp_server_enabled - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - reranker_model: None | str | Unset - if isinstance(self.reranker_model, Unset): - reranker_model = UNSET - else: - reranker_model = self.reranker_model - - semantic_search_enabled: bool | None | Unset - if isinstance(self.semantic_search_enabled, Unset): - semantic_search_enabled = UNSET - else: - semantic_search_enabled = self.semantic_search_enabled - - source_ids: list[str] | None | Unset - if isinstance(self.source_ids, Unset): - source_ids = UNSET - elif isinstance(self.source_ids, list): - source_ids = [] - for source_ids_type_0_item_data in self.source_ids: - source_ids_type_0_item = str(source_ids_type_0_item_data) - source_ids.append(source_ids_type_0_item) - - else: - source_ids = self.source_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if description is not UNSET: - field_dict["description"] = description - if keyword_search_enabled is not UNSET: - field_dict["keyword_search_enabled"] = keyword_search_enabled - if knowledge_base_enabled is not UNSET: - field_dict["knowledge_base_enabled"] = knowledge_base_enabled - if mcp_server_enabled is not UNSET: - field_dict["mcp_server_enabled"] = mcp_server_enabled - if name is not UNSET: - field_dict["name"] = name - if reranker_model is not UNSET: - field_dict["reranker_model"] = reranker_model - if semantic_search_enabled is not UNSET: - field_dict["semantic_search_enabled"] = semantic_search_enabled - if source_ids is not UNSET: - field_dict["source_ids"] = source_ids - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_keyword_search_enabled(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - keyword_search_enabled = _parse_keyword_search_enabled( - d.pop("keyword_search_enabled", UNSET) - ) - - def _parse_knowledge_base_enabled(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - knowledge_base_enabled = _parse_knowledge_base_enabled( - d.pop("knowledge_base_enabled", UNSET) - ) - - def _parse_mcp_server_enabled(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - mcp_server_enabled = _parse_mcp_server_enabled( - d.pop("mcp_server_enabled", UNSET) - ) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - def _parse_reranker_model(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - reranker_model = _parse_reranker_model(d.pop("reranker_model", UNSET)) - - def _parse_semantic_search_enabled(data: object) -> bool | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(bool | None | Unset, data) - - semantic_search_enabled = _parse_semantic_search_enabled( - d.pop("semantic_search_enabled", UNSET) - ) - - def _parse_source_ids(data: object) -> list[UUID] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - source_ids_type_0 = [] - _source_ids_type_0 = data - for source_ids_type_0_item_data in _source_ids_type_0: - source_ids_type_0_item = UUID(source_ids_type_0_item_data) - - source_ids_type_0.append(source_ids_type_0_item) - - return source_ids_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[UUID] | None | Unset, data) - - source_ids = _parse_source_ids(d.pop("source_ids", UNSET)) - - update_knowledge_base_request = cls( - description=description, - keyword_search_enabled=keyword_search_enabled, - knowledge_base_enabled=knowledge_base_enabled, - mcp_server_enabled=mcp_server_enabled, - name=name, - reranker_model=reranker_model, - semantic_search_enabled=semantic_search_enabled, - source_ids=source_ids, - ) - - update_knowledge_base_request.additional_properties = d - return update_knowledge_base_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/seclai/_generated/seclai_api_client/models/update_monthly_overage_budget_request.py b/seclai/_generated/seclai_api_client/models/update_monthly_overage_budget_request.py deleted file mode 100644 index 096088e..0000000 --- a/seclai/_generated/seclai_api_client/models/update_monthly_overage_budget_request.py +++ /dev/null @@ -1,61 +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="UpdateMonthlyOverageBudgetRequest") - - -@_attrs_define -class UpdateMonthlyOverageBudgetRequest: - """ - Attributes: - monthly_overage_budget (float): - """ - - monthly_overage_budget: float - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - monthly_overage_budget = self.monthly_overage_budget - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "monthly_overage_budget": monthly_overage_budget, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - monthly_overage_budget = d.pop("monthly_overage_budget") - - update_monthly_overage_budget_request = cls( - monthly_overage_budget=monthly_overage_budget, - ) - - update_monthly_overage_budget_request.additional_properties = d - return update_monthly_overage_budget_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/seclai/_generated/seclai_api_client/models/update_source_request.py b/seclai/_generated/seclai_api_client/models/update_source_request.py deleted file mode 100644 index 06676b0..0000000 --- a/seclai/_generated/seclai_api_client/models/update_source_request.py +++ /dev/null @@ -1,207 +0,0 @@ -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 ..models.content_filter_type import ContentFilterType -from ..models.polling_action import PollingAction -from ..models.polling_type import PollingType -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateSourceRequest") - - -@_attrs_define -class UpdateSourceRequest: - """Request model for updating an existing source - - Attributes: - content_filter (ContentFilterType | None | Unset): Content filtering strategy - name (None | str | Unset): Name of the source - polling (None | PollingType | Unset): Polling frequency: once, hourly, daily, weekly Default: PollingType.DAILY. - polling_action (None | PollingAction | Unset): Polling action to take - polling_max_items (int | None | Unset): Maximum items to fetch per poll - retention_days (int | None | Unset): Retention period in days (null for infinite) - """ - - content_filter: ContentFilterType | None | Unset = UNSET - name: None | str | Unset = UNSET - polling: None | PollingType | Unset = PollingType.DAILY - polling_action: None | PollingAction | Unset = UNSET - polling_max_items: int | None | Unset = UNSET - retention_days: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - content_filter: None | str | Unset - if isinstance(self.content_filter, Unset): - content_filter = UNSET - elif isinstance(self.content_filter, ContentFilterType): - content_filter = self.content_filter.value - else: - content_filter = self.content_filter - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - polling: None | str | Unset - if isinstance(self.polling, Unset): - polling = UNSET - elif isinstance(self.polling, PollingType): - polling = self.polling.value - else: - polling = self.polling - - polling_action: None | str | Unset - if isinstance(self.polling_action, Unset): - polling_action = UNSET - elif isinstance(self.polling_action, PollingAction): - polling_action = self.polling_action.value - else: - polling_action = self.polling_action - - polling_max_items: int | None | Unset - if isinstance(self.polling_max_items, Unset): - polling_max_items = UNSET - else: - polling_max_items = self.polling_max_items - - retention_days: int | None | Unset - if isinstance(self.retention_days, Unset): - retention_days = UNSET - else: - retention_days = self.retention_days - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if content_filter is not UNSET: - field_dict["content_filter"] = content_filter - if name is not UNSET: - field_dict["name"] = name - if polling is not UNSET: - field_dict["polling"] = polling - if polling_action is not UNSET: - field_dict["polling_action"] = polling_action - if polling_max_items is not UNSET: - field_dict["polling_max_items"] = polling_max_items - if retention_days is not UNSET: - field_dict["retention_days"] = retention_days - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_content_filter(data: object) -> ContentFilterType | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - content_filter_type_0 = ContentFilterType(data) - - return content_filter_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(ContentFilterType | None | Unset, data) - - content_filter = _parse_content_filter(d.pop("content_filter", UNSET)) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - def _parse_polling(data: object) -> None | PollingType | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - polling_type_0 = PollingType(data) - - return polling_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PollingType | Unset, data) - - polling = _parse_polling(d.pop("polling", UNSET)) - - def _parse_polling_action(data: object) -> None | PollingAction | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - polling_action_type_0 = PollingAction(data) - - return polling_action_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PollingAction | Unset, data) - - polling_action = _parse_polling_action(d.pop("polling_action", UNSET)) - - def _parse_polling_max_items(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - polling_max_items = _parse_polling_max_items(d.pop("polling_max_items", UNSET)) - - def _parse_retention_days(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - retention_days = _parse_retention_days(d.pop("retention_days", UNSET)) - - update_source_request = cls( - content_filter=content_filter, - name=name, - polling=polling, - polling_action=polling_action, - polling_max_items=polling_max_items, - retention_days=retention_days, - ) - - update_source_request.additional_properties = d - return update_source_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/seclai/_generated/seclai_api_client/models/update_stop_at_budget_limit_request.py b/seclai/_generated/seclai_api_client/models/update_stop_at_budget_limit_request.py deleted file mode 100644 index 86adcec..0000000 --- a/seclai/_generated/seclai_api_client/models/update_stop_at_budget_limit_request.py +++ /dev/null @@ -1,61 +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="UpdateStopAtBudgetLimitRequest") - - -@_attrs_define -class UpdateStopAtBudgetLimitRequest: - """ - Attributes: - stop_at_budget_limit (bool): - """ - - stop_at_budget_limit: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - stop_at_budget_limit = self.stop_at_budget_limit - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "stop_at_budget_limit": stop_at_budget_limit, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - stop_at_budget_limit = d.pop("stop_at_budget_limit") - - update_stop_at_budget_limit_request = cls( - stop_at_budget_limit=stop_at_budget_limit, - ) - - update_stop_at_budget_limit_request.additional_properties = d - return update_stop_at_budget_limit_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/seclai/_generated/seclai_api_client/models/update_trigger_request.py b/seclai/_generated/seclai_api_client/models/update_trigger_request.py deleted file mode 100644 index 65e26eb..0000000 --- a/seclai/_generated/seclai_api_client/models/update_trigger_request.py +++ /dev/null @@ -1,202 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.agent_trigger_type import AgentTriggerType -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.update_trigger_request_metadata_type_0 import ( - UpdateTriggerRequestMetadataType0, - ) - - -T = TypeVar("T", bound="UpdateTriggerRequest") - - -@_attrs_define -class UpdateTriggerRequest: - """Request model for updating an agent trigger - - Attributes: - input_ (None | str | Unset): Template input for TEMPLATE_INPUT trigger type - knowledge_base_id (None | Unset | UUID): Knowledge base for content triggers - metadata (None | Unset | UpdateTriggerRequestMetadataType0): Metadata for string substitutions - name (None | str | Unset): Trigger name - trigger_type (AgentTriggerType | None | Unset): The type of trigger - """ - - input_: None | str | Unset = UNSET - knowledge_base_id: None | Unset | UUID = UNSET - metadata: None | Unset | UpdateTriggerRequestMetadataType0 = UNSET - name: None | str | Unset = UNSET - trigger_type: AgentTriggerType | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.update_trigger_request_metadata_type_0 import ( - UpdateTriggerRequestMetadataType0, - ) - - input_: None | str | Unset - if isinstance(self.input_, Unset): - input_ = UNSET - else: - input_ = self.input_ - - knowledge_base_id: None | str | Unset - if isinstance(self.knowledge_base_id, Unset): - knowledge_base_id = UNSET - elif isinstance(self.knowledge_base_id, UUID): - knowledge_base_id = str(self.knowledge_base_id) - else: - knowledge_base_id = self.knowledge_base_id - - metadata: dict[str, Any] | None | Unset - if isinstance(self.metadata, Unset): - metadata = UNSET - elif isinstance(self.metadata, UpdateTriggerRequestMetadataType0): - metadata = self.metadata.to_dict() - else: - metadata = self.metadata - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - trigger_type: None | str | Unset - if isinstance(self.trigger_type, Unset): - trigger_type = UNSET - elif isinstance(self.trigger_type, AgentTriggerType): - trigger_type = self.trigger_type.value - else: - trigger_type = self.trigger_type - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if input_ is not UNSET: - field_dict["input"] = input_ - if knowledge_base_id is not UNSET: - field_dict["knowledge_base_id"] = knowledge_base_id - if metadata is not UNSET: - field_dict["metadata_"] = metadata - if name is not UNSET: - field_dict["name"] = name - if trigger_type is not UNSET: - field_dict["trigger_type"] = trigger_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_trigger_request_metadata_type_0 import ( - UpdateTriggerRequestMetadataType0, - ) - - d = dict(src_dict) - - def _parse_input_(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - input_ = _parse_input_(d.pop("input", UNSET)) - - def _parse_knowledge_base_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() - knowledge_base_id_type_0 = UUID(data) - - return knowledge_base_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - knowledge_base_id = _parse_knowledge_base_id(d.pop("knowledge_base_id", UNSET)) - - def _parse_metadata( - data: object, - ) -> None | Unset | UpdateTriggerRequestMetadataType0: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - metadata_type_0 = UpdateTriggerRequestMetadataType0.from_dict(data) - - return metadata_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UpdateTriggerRequestMetadataType0, data) - - metadata = _parse_metadata(d.pop("metadata_", UNSET)) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - def _parse_trigger_type(data: object) -> AgentTriggerType | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - trigger_type_type_0 = AgentTriggerType(data) - - return trigger_type_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentTriggerType | None | Unset, data) - - trigger_type = _parse_trigger_type(d.pop("trigger_type", UNSET)) - - update_trigger_request = cls( - input_=input_, - knowledge_base_id=knowledge_base_id, - metadata=metadata, - name=name, - trigger_type=trigger_type, - ) - - update_trigger_request.additional_properties = d - return update_trigger_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/seclai/_generated/seclai_api_client/models/update_trigger_request_metadata_type_0.py b/seclai/_generated/seclai_api_client/models/update_trigger_request_metadata_type_0.py deleted file mode 100644 index cac7b16..0000000 --- a/seclai/_generated/seclai_api_client/models/update_trigger_request_metadata_type_0.py +++ /dev/null @@ -1,46 +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="UpdateTriggerRequestMetadataType0") - - -@_attrs_define -class UpdateTriggerRequestMetadataType0: - """ """ - - additional_properties: dict[str, Any] = _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) - update_trigger_request_metadata_type_0 = cls() - - update_trigger_request_metadata_type_0.additional_properties = d - return update_trigger_request_metadata_type_0 - - @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/seclai/_generated/seclai_api_client/models/update_trigger_schedule_request.py b/seclai/_generated/seclai_api_client/models/update_trigger_schedule_request.py deleted file mode 100644 index c424565..0000000 --- a/seclai/_generated/seclai_api_client/models/update_trigger_schedule_request.py +++ /dev/null @@ -1,205 +0,0 @@ -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 ..models.agent_trigger_frequency import AgentTriggerFrequency -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateTriggerScheduleRequest") - - -@_attrs_define -class UpdateTriggerScheduleRequest: - """Request model for updating an agent trigger schedule - - Attributes: - day_of_month (int | None | Unset): Day of month (1-31 or negative) - day_of_week (int | None | Unset): Day of week (0=Monday) - frequency (AgentTriggerFrequency | None | Unset): The frequency of the schedule - hour_of_day (int | None | Unset): Hour of day - minute_of_hour (int | None | Unset): Minute of hour - repeat_interval (int | None | Unset): How often to repeat - weekday_of_month (int | None | Unset): Weekday of month - """ - - day_of_month: int | None | Unset = UNSET - day_of_week: int | None | Unset = UNSET - frequency: AgentTriggerFrequency | None | Unset = UNSET - hour_of_day: int | None | Unset = UNSET - minute_of_hour: int | None | Unset = UNSET - repeat_interval: int | None | Unset = UNSET - weekday_of_month: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - day_of_month: int | None | Unset - if isinstance(self.day_of_month, Unset): - day_of_month = UNSET - else: - day_of_month = self.day_of_month - - day_of_week: int | None | Unset - if isinstance(self.day_of_week, Unset): - day_of_week = UNSET - else: - day_of_week = self.day_of_week - - frequency: None | str | Unset - if isinstance(self.frequency, Unset): - frequency = UNSET - elif isinstance(self.frequency, AgentTriggerFrequency): - frequency = self.frequency.value - else: - frequency = self.frequency - - hour_of_day: int | None | Unset - if isinstance(self.hour_of_day, Unset): - hour_of_day = UNSET - else: - hour_of_day = self.hour_of_day - - minute_of_hour: int | None | Unset - if isinstance(self.minute_of_hour, Unset): - minute_of_hour = UNSET - else: - minute_of_hour = self.minute_of_hour - - repeat_interval: int | None | Unset - if isinstance(self.repeat_interval, Unset): - repeat_interval = UNSET - else: - repeat_interval = self.repeat_interval - - weekday_of_month: int | None | Unset - if isinstance(self.weekday_of_month, Unset): - weekday_of_month = UNSET - else: - weekday_of_month = self.weekday_of_month - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if day_of_month is not UNSET: - field_dict["day_of_month"] = day_of_month - if day_of_week is not UNSET: - field_dict["day_of_week"] = day_of_week - if frequency is not UNSET: - field_dict["frequency"] = frequency - if hour_of_day is not UNSET: - field_dict["hour_of_day"] = hour_of_day - if minute_of_hour is not UNSET: - field_dict["minute_of_hour"] = minute_of_hour - if repeat_interval is not UNSET: - field_dict["repeat_interval"] = repeat_interval - if weekday_of_month is not UNSET: - field_dict["weekday_of_month"] = weekday_of_month - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_day_of_month(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - day_of_month = _parse_day_of_month(d.pop("day_of_month", UNSET)) - - def _parse_day_of_week(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - day_of_week = _parse_day_of_week(d.pop("day_of_week", UNSET)) - - def _parse_frequency(data: object) -> AgentTriggerFrequency | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - frequency_type_0 = AgentTriggerFrequency(data) - - return frequency_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AgentTriggerFrequency | None | Unset, data) - - frequency = _parse_frequency(d.pop("frequency", UNSET)) - - def _parse_hour_of_day(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - hour_of_day = _parse_hour_of_day(d.pop("hour_of_day", UNSET)) - - def _parse_minute_of_hour(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - minute_of_hour = _parse_minute_of_hour(d.pop("minute_of_hour", UNSET)) - - def _parse_repeat_interval(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - repeat_interval = _parse_repeat_interval(d.pop("repeat_interval", UNSET)) - - def _parse_weekday_of_month(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - weekday_of_month = _parse_weekday_of_month(d.pop("weekday_of_month", UNSET)) - - update_trigger_schedule_request = cls( - day_of_month=day_of_month, - day_of_week=day_of_week, - frequency=frequency, - hour_of_day=hour_of_day, - minute_of_hour=minute_of_hour, - repeat_interval=repeat_interval, - weekday_of_month=weekday_of_month, - ) - - update_trigger_schedule_request.additional_properties = d - return update_trigger_schedule_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/seclai/_generated/seclai_api_client/models/update_user_profile_request.py b/seclai/_generated/seclai_api_client/models/update_user_profile_request.py deleted file mode 100644 index 15033db..0000000 --- a/seclai/_generated/seclai_api_client/models/update_user_profile_request.py +++ /dev/null @@ -1,70 +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="UpdateUserProfileRequest") - - -@_attrs_define -class UpdateUserProfileRequest: - """Request model for updating user profile. - - Attributes: - first_name (str): User's first name - last_name (str): User's last name - """ - - first_name: str - last_name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - first_name = self.first_name - - last_name = self.last_name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "first_name": first_name, - "last_name": last_name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - first_name = d.pop("first_name") - - last_name = d.pop("last_name") - - update_user_profile_request = cls( - first_name=first_name, - last_name=last_name, - ) - - update_user_profile_request.additional_properties = d - return update_user_profile_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/seclai/_generated/seclai_api_client/models/usage_detail_activity_response.py b/seclai/_generated/seclai_api_client/models/usage_detail_activity_response.py deleted file mode 100644 index 7f21ff3..0000000 --- a/seclai/_generated/seclai_api_client/models/usage_detail_activity_response.py +++ /dev/null @@ -1,69 +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="UsageDetailActivityResponse") - - -@_attrs_define -class UsageDetailActivityResponse: - """ - Attributes: - activity (str): - credits_ (float): - """ - - activity: str - credits_: float - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - activity = self.activity - - credits_ = self.credits_ - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "activity": activity, - "credits": credits_, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - activity = d.pop("activity") - - credits_ = d.pop("credits") - - usage_detail_activity_response = cls( - activity=activity, - credits_=credits_, - ) - - usage_detail_activity_response.additional_properties = d - return usage_detail_activity_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/seclai/_generated/seclai_api_client/models/usage_details_granularity.py b/seclai/_generated/seclai_api_client/models/usage_details_granularity.py deleted file mode 100644 index a65fabc..0000000 --- a/seclai/_generated/seclai_api_client/models/usage_details_granularity.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class UsageDetailsGranularity(str, Enum): - DAY = "day" - MONTH = "month" - WEEK = "week" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/usage_origin_slice_response.py b/seclai/_generated/seclai_api_client/models/usage_origin_slice_response.py deleted file mode 100644 index 45aa2a8..0000000 --- a/seclai/_generated/seclai_api_client/models/usage_origin_slice_response.py +++ /dev/null @@ -1,93 +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.usage_detail_activity_response import UsageDetailActivityResponse - - -T = TypeVar("T", bound="UsageOriginSliceResponse") - - -@_attrs_define -class UsageOriginSliceResponse: - """ - Attributes: - activities (list[UsageDetailActivityResponse]): - credits_ (float): - start (str): - """ - - activities: list[UsageDetailActivityResponse] - credits_: float - start: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - activities = [] - for activities_item_data in self.activities: - activities_item = activities_item_data.to_dict() - activities.append(activities_item) - - credits_ = self.credits_ - - start = self.start - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "activities": activities, - "credits": credits_, - "start": start, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.usage_detail_activity_response import UsageDetailActivityResponse - - d = dict(src_dict) - activities = [] - _activities = d.pop("activities") - for activities_item_data in _activities: - activities_item = UsageDetailActivityResponse.from_dict( - activities_item_data - ) - - activities.append(activities_item) - - credits_ = d.pop("credits") - - start = d.pop("start") - - usage_origin_slice_response = cls( - activities=activities, - credits_=credits_, - start=start, - ) - - usage_origin_slice_response.additional_properties = d - return usage_origin_slice_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/seclai/_generated/seclai_api_client/models/use_case_type.py b/seclai/_generated/seclai_api_client/models/use_case_type.py deleted file mode 100644 index 598aecd..0000000 --- a/seclai/_generated/seclai_api_client/models/use_case_type.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class UseCaseType(str, Enum): - OTHER = "other" - RAG_EVALUATION = "rag_evaluation" - RESEARCH = "research" - SEARCH_VIA_MCP = "search_via_mcp" - SERVERLESS_RAG = "serverless_rag" - - def __str__(self) -> str: - return str(self.value) diff --git a/seclai/_generated/seclai_api_client/models/user_profile_response.py b/seclai/_generated/seclai_api_client/models/user_profile_response.py deleted file mode 100644 index 4acb408..0000000 --- a/seclai/_generated/seclai_api_client/models/user_profile_response.py +++ /dev/null @@ -1,90 +0,0 @@ -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 - -T = TypeVar("T", bound="UserProfileResponse") - - -@_attrs_define -class UserProfileResponse: - """Response model for user profile information. - - Attributes: - email (str): - first_name (None | str): - last_name (None | str): - """ - - email: str - first_name: None | str - last_name: None | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - email = self.email - - first_name: None | str - first_name = self.first_name - - last_name: None | str - last_name = self.last_name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "email": email, - "first_name": first_name, - "last_name": last_name, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - email = d.pop("email") - - def _parse_first_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - first_name = _parse_first_name(d.pop("first_name")) - - def _parse_last_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - last_name = _parse_last_name(d.pop("last_name")) - - user_profile_response = cls( - email=email, - first_name=first_name, - last_name=last_name, - ) - - user_profile_response.additional_properties = d - return user_profile_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/seclai/_generated/seclai_api_client/models/user_response.py b/seclai/_generated/seclai_api_client/models/user_response.py deleted file mode 100644 index ac61d5d..0000000 --- a/seclai/_generated/seclai_api_client/models/user_response.py +++ /dev/null @@ -1,86 +0,0 @@ -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 - -T = TypeVar("T", bound="UserResponse") - - -@_attrs_define -class UserResponse: - """Response model for user information - - Attributes: - email (str): - is_active (bool): - roles (list[str]): - user_id (str): - """ - - email: str - is_active: bool - roles: list[str] - user_id: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - email = self.email - - is_active = self.is_active - - roles = self.roles - - user_id = self.user_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "email": email, - "is_active": is_active, - "roles": roles, - "user_id": user_id, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - email = d.pop("email") - - is_active = d.pop("is_active") - - roles = cast(list[str], d.pop("roles")) - - user_id = d.pop("user_id") - - user_response = cls( - email=email, - is_active=is_active, - roles=roles, - user_id=user_id, - ) - - user_response.additional_properties = d - return user_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/seclai/_generated/seclai_api_client/models/validation_error.py b/seclai/_generated/seclai_api_client/models/validation_error.py deleted file mode 100644 index cb0708f..0000000 --- a/seclai/_generated/seclai_api_client/models/validation_error.py +++ /dev/null @@ -1,90 +0,0 @@ -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 - -T = TypeVar("T", bound="ValidationError") - - -@_attrs_define -class ValidationError: - """ - Attributes: - loc (list[int | str]): - msg (str): - type_ (str): - """ - - loc: list[int | str] - msg: str - type_: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - loc = [] - for loc_item_data in self.loc: - loc_item: int | str - loc_item = loc_item_data - loc.append(loc_item) - - msg = self.msg - - type_ = self.type_ - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "loc": loc, - "msg": msg, - "type": type_, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - loc = [] - _loc = d.pop("loc") - for loc_item_data in _loc: - - def _parse_loc_item(data: object) -> int | str: - return cast(int | str, data) - - loc_item = _parse_loc_item(loc_item_data) - - loc.append(loc_item) - - msg = d.pop("msg") - - type_ = d.pop("type") - - validation_error = cls( - loc=loc, - msg=msg, - type_=type_, - ) - - validation_error.additional_properties = d - return validation_error - - @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/seclai/_generated/seclai_api_client/models/validation_error_response.py b/seclai/_generated/seclai_api_client/models/validation_error_response.py deleted file mode 100644 index cd9d0e7..0000000 --- a/seclai/_generated/seclai_api_client/models/validation_error_response.py +++ /dev/null @@ -1,97 +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 - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.validation_field_error import ValidationFieldError - - -T = TypeVar("T", bound="ValidationErrorResponse") - - -@_attrs_define -class ValidationErrorResponse: - """Response model for validation errors - - Attributes: - error (str): - validation_errors (list[ValidationFieldError]): - success (bool | Unset): Default: False. - """ - - error: str - validation_errors: list[ValidationFieldError] - success: bool | Unset = False - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - error = self.error - - validation_errors = [] - for validation_errors_item_data in self.validation_errors: - validation_errors_item = validation_errors_item_data.to_dict() - validation_errors.append(validation_errors_item) - - success = self.success - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "error": error, - "validation_errors": validation_errors, - } - ) - if success is not UNSET: - field_dict["success"] = success - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.validation_field_error import ValidationFieldError - - d = dict(src_dict) - error = d.pop("error") - - validation_errors = [] - _validation_errors = d.pop("validation_errors") - for validation_errors_item_data in _validation_errors: - validation_errors_item = ValidationFieldError.from_dict( - validation_errors_item_data - ) - - validation_errors.append(validation_errors_item) - - success = d.pop("success", UNSET) - - validation_error_response = cls( - error=error, - validation_errors=validation_errors, - success=success, - ) - - validation_error_response.additional_properties = d - return validation_error_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/seclai/_generated/seclai_api_client/models/validation_field_error.py b/seclai/_generated/seclai_api_client/models/validation_field_error.py deleted file mode 100644 index fac168f..0000000 --- a/seclai/_generated/seclai_api_client/models/validation_field_error.py +++ /dev/null @@ -1,70 +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="ValidationFieldError") - - -@_attrs_define -class ValidationFieldError: - """Validation error for a specific field - - Attributes: - field (str): - message (str): - """ - - field: str - message: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - field = self.field - - message = self.message - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "field": field, - "message": message, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - field = d.pop("field") - - message = d.pop("message") - - validation_field_error = cls( - field=field, - message=message, - ) - - validation_field_error.additional_properties = d - return validation_field_error - - @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/seclai/_generated/seclai_api_client/models/variant_category_response.py b/seclai/_generated/seclai_api_client/models/variant_category_response.py deleted file mode 100644 index f739bab..0000000 --- a/seclai/_generated/seclai_api_client/models/variant_category_response.py +++ /dev/null @@ -1,108 +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.variant_option_response import VariantOptionResponse - - -T = TypeVar("T", bound="VariantCategoryResponse") - - -@_attrs_define -class VariantCategoryResponse: - """Response model for a variant category - - Attributes: - category (str): - configurable (bool): - description (str): - options (list[VariantOptionResponse]): - title (str): - """ - - category: str - configurable: bool - description: str - options: list[VariantOptionResponse] - title: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - category = self.category - - configurable = self.configurable - - description = self.description - - options = [] - for options_item_data in self.options: - options_item = options_item_data.to_dict() - options.append(options_item) - - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "category": category, - "configurable": configurable, - "description": description, - "options": options, - "title": title, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.variant_option_response import VariantOptionResponse - - d = dict(src_dict) - category = d.pop("category") - - configurable = d.pop("configurable") - - description = d.pop("description") - - options = [] - _options = d.pop("options") - for options_item_data in _options: - options_item = VariantOptionResponse.from_dict(options_item_data) - - options.append(options_item) - - title = d.pop("title") - - variant_category_response = cls( - category=category, - configurable=configurable, - description=description, - options=options, - title=title, - ) - - variant_category_response.additional_properties = d - return variant_category_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/seclai/_generated/seclai_api_client/models/variant_option_response.py b/seclai/_generated/seclai_api_client/models/variant_option_response.py deleted file mode 100644 index 7d02688..0000000 --- a/seclai/_generated/seclai_api_client/models/variant_option_response.py +++ /dev/null @@ -1,236 +0,0 @@ -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="VariantOptionResponse") - - -@_attrs_define -class VariantOptionResponse: - """Response model for a variant option - - Attributes: - default (bool): - title (str): - value (str): - description (None | str | Unset): - input_1h_cache_write_credits_per_1000_tokens (float | None | Unset): - input_5m_cache_write_credits_per_1000_tokens (float | None | Unset): - input_cache_hit_credits_per_1000_tokens (float | None | Unset): - input_credits_per_1000_tokens (float | None | Unset): - output_credits_per_1000_tokens (float | None | Unset): - """ - - default: bool - title: str - value: str - description: None | str | Unset = UNSET - input_1h_cache_write_credits_per_1000_tokens: float | None | Unset = UNSET - input_5m_cache_write_credits_per_1000_tokens: float | None | Unset = UNSET - input_cache_hit_credits_per_1000_tokens: float | None | Unset = UNSET - input_credits_per_1000_tokens: float | None | Unset = UNSET - output_credits_per_1000_tokens: float | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - default = self.default - - title = self.title - - value = self.value - - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description - - input_1h_cache_write_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_1h_cache_write_credits_per_1000_tokens, Unset): - input_1h_cache_write_credits_per_1000_tokens = UNSET - else: - input_1h_cache_write_credits_per_1000_tokens = ( - self.input_1h_cache_write_credits_per_1000_tokens - ) - - input_5m_cache_write_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_5m_cache_write_credits_per_1000_tokens, Unset): - input_5m_cache_write_credits_per_1000_tokens = UNSET - else: - input_5m_cache_write_credits_per_1000_tokens = ( - self.input_5m_cache_write_credits_per_1000_tokens - ) - - input_cache_hit_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_cache_hit_credits_per_1000_tokens, Unset): - input_cache_hit_credits_per_1000_tokens = UNSET - else: - input_cache_hit_credits_per_1000_tokens = ( - self.input_cache_hit_credits_per_1000_tokens - ) - - input_credits_per_1000_tokens: float | None | Unset - if isinstance(self.input_credits_per_1000_tokens, Unset): - input_credits_per_1000_tokens = UNSET - else: - input_credits_per_1000_tokens = self.input_credits_per_1000_tokens - - output_credits_per_1000_tokens: float | None | Unset - if isinstance(self.output_credits_per_1000_tokens, Unset): - output_credits_per_1000_tokens = UNSET - else: - output_credits_per_1000_tokens = self.output_credits_per_1000_tokens - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "default": default, - "title": title, - "value": value, - } - ) - if description is not UNSET: - field_dict["description"] = description - if input_1h_cache_write_credits_per_1000_tokens is not UNSET: - field_dict["input_1h_cache_write_credits_per_1000_tokens"] = ( - input_1h_cache_write_credits_per_1000_tokens - ) - if input_5m_cache_write_credits_per_1000_tokens is not UNSET: - field_dict["input_5m_cache_write_credits_per_1000_tokens"] = ( - input_5m_cache_write_credits_per_1000_tokens - ) - if input_cache_hit_credits_per_1000_tokens is not UNSET: - field_dict["input_cache_hit_credits_per_1000_tokens"] = ( - input_cache_hit_credits_per_1000_tokens - ) - if input_credits_per_1000_tokens is not UNSET: - field_dict["input_credits_per_1000_tokens"] = input_credits_per_1000_tokens - if output_credits_per_1000_tokens is not UNSET: - field_dict["output_credits_per_1000_tokens"] = ( - output_credits_per_1000_tokens - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - default = d.pop("default") - - title = d.pop("title") - - value = d.pop("value") - - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) - - def _parse_input_1h_cache_write_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_1h_cache_write_credits_per_1000_tokens = ( - _parse_input_1h_cache_write_credits_per_1000_tokens( - d.pop("input_1h_cache_write_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_input_5m_cache_write_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_5m_cache_write_credits_per_1000_tokens = ( - _parse_input_5m_cache_write_credits_per_1000_tokens( - d.pop("input_5m_cache_write_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_input_cache_hit_credits_per_1000_tokens( - data: object, - ) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_cache_hit_credits_per_1000_tokens = ( - _parse_input_cache_hit_credits_per_1000_tokens( - d.pop("input_cache_hit_credits_per_1000_tokens", UNSET) - ) - ) - - def _parse_input_credits_per_1000_tokens(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - input_credits_per_1000_tokens = _parse_input_credits_per_1000_tokens( - d.pop("input_credits_per_1000_tokens", UNSET) - ) - - def _parse_output_credits_per_1000_tokens(data: object) -> float | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(float | None | Unset, data) - - output_credits_per_1000_tokens = _parse_output_credits_per_1000_tokens( - d.pop("output_credits_per_1000_tokens", UNSET) - ) - - variant_option_response = cls( - default=default, - title=title, - value=value, - description=description, - input_1h_cache_write_credits_per_1000_tokens=input_1h_cache_write_credits_per_1000_tokens, - input_5m_cache_write_credits_per_1000_tokens=input_5m_cache_write_credits_per_1000_tokens, - input_cache_hit_credits_per_1000_tokens=input_cache_hit_credits_per_1000_tokens, - input_credits_per_1000_tokens=input_credits_per_1000_tokens, - output_credits_per_1000_tokens=output_credits_per_1000_tokens, - ) - - variant_option_response.additional_properties = d - return variant_option_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/seclai/_generated/seclai_api_client/py.typed b/seclai/_generated/seclai_api_client/py.typed deleted file mode 100644 index 1aad327..0000000 --- a/seclai/_generated/seclai_api_client/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561 \ No newline at end of file diff --git a/seclai/_generated/seclai_api_client/types.py b/seclai/_generated/seclai_api_client/types.py deleted file mode 100644 index b64af09..0000000 --- a/seclai/_generated/seclai_api_client/types.py +++ /dev/null @@ -1,54 +0,0 @@ -"""Contains some shared types for properties""" - -from collections.abc import Mapping, MutableMapping -from http import HTTPStatus -from typing import IO, BinaryIO, Generic, Literal, TypeVar - -from attrs import define - - -class Unset: - def __bool__(self) -> Literal[False]: - return False - - -UNSET: Unset = Unset() - -# The types that `httpx.Client(files=)` can accept, copied from that library. -FileContent = IO[bytes] | bytes | str -FileTypes = ( - # (filename, file (or bytes), content_type) - tuple[str | None, FileContent, str | None] - # (filename, file (or bytes), content_type, headers) - | tuple[str | None, FileContent, str | None, Mapping[str, str]] -) -RequestFiles = list[tuple[str, FileTypes]] - - -@define -class File: - """Contains information for file uploads""" - - payload: BinaryIO - file_name: str | None = None - mime_type: str | None = None - - def to_tuple(self) -> FileTypes: - """Return a tuple representation that httpx will accept for multipart/form-data""" - return self.file_name, self.payload, self.mime_type - - -T = TypeVar("T") - - -@define -class Response(Generic[T]): - """A response from an endpoint""" - - status_code: HTTPStatus - content: bytes - headers: MutableMapping[str, str] - parsed: T | None - - -__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] diff --git a/seclai/_generated/types.py b/seclai/_generated/types.py deleted file mode 100644 index b64af09..0000000 --- a/seclai/_generated/types.py +++ /dev/null @@ -1,54 +0,0 @@ -"""Contains some shared types for properties""" - -from collections.abc import Mapping, MutableMapping -from http import HTTPStatus -from typing import IO, BinaryIO, Generic, Literal, TypeVar - -from attrs import define - - -class Unset: - def __bool__(self) -> Literal[False]: - return False - - -UNSET: Unset = Unset() - -# The types that `httpx.Client(files=)` can accept, copied from that library. -FileContent = IO[bytes] | bytes | str -FileTypes = ( - # (filename, file (or bytes), content_type) - tuple[str | None, FileContent, str | None] - # (filename, file (or bytes), content_type, headers) - | tuple[str | None, FileContent, str | None, Mapping[str, str]] -) -RequestFiles = list[tuple[str, FileTypes]] - - -@define -class File: - """Contains information for file uploads""" - - payload: BinaryIO - file_name: str | None = None - mime_type: str | None = None - - def to_tuple(self) -> FileTypes: - """Return a tuple representation that httpx will accept for multipart/form-data""" - return self.file_name, self.payload, self.mime_type - - -T = TypeVar("T") - - -@define -class Response(Generic[T]): - """A response from an endpoint""" - - status_code: HTTPStatus - content: bytes - headers: MutableMapping[str, str] - parsed: T | None - - -__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] diff --git a/seclai/auth.py b/seclai/auth.py deleted file mode 100644 index 34b0078..0000000 --- a/seclai/auth.py +++ /dev/null @@ -1,601 +0,0 @@ -"""SSO credential resolution: config file, token caching, and automatic refresh. - -This module implements the credential provider chain used by :class:`Seclai` -and :class:`AsyncSeclai`. - -The data classes :class:`SsoProfile` and :class:`SsoCacheEntry` are re-exported -from the top-level package as public API for callers that need to interact with -cached SSO tokens directly. All other symbols in this module are internal. -""" - -from __future__ import annotations - -import asyncio -import configparser -import hashlib -import json -import logging -import os -import tempfile -import threading -from collections.abc import Awaitable, Callable -from dataclasses import dataclass, field -from datetime import UTC, datetime, timedelta -from pathlib import Path -from typing import Any - -import httpx - -_DEFAULT_CONFIG_DIR = ".seclai" -_SSO_CACHE_DIR = "sso/cache" -_CONFIG_FILE = "config" -_EXPIRY_BUFFER_SECONDS = 30 - -_SSO_EXPIRED_MSG = ( - "SSO token is missing or has expired. Run `seclai auth login` to authenticate." -) - -#: Default SSO domain (production Cognito). Override with ``SECLAI_SSO_DOMAIN`` or config file. -DEFAULT_SSO_DOMAIN = "auth.seclai.com" -#: Default SSO client ID (production public client). Override with ``SECLAI_SSO_CLIENT_ID`` or config file. -DEFAULT_SSO_CLIENT_ID = "4bgf8v9qmc5puivbaqon9n5lmr" -#: Default SSO region. Override with ``SECLAI_SSO_REGION`` or config file. -DEFAULT_SSO_REGION = "us-west-2" - - -# ── Types ───────────────────────────────────────────────────────────────────── - - -@dataclass(frozen=True, slots=True) -class SsoProfile: - """Resolved SSO profile settings from the config file. - - Attributes: - sso_account_id: Account ID (resolved after login via ``/me``). - sso_region: AWS region for the Cognito user pool. - sso_client_id: Cognito app client ID. - sso_domain: Cognito domain (e.g. ``"auth.example.com"``). - """ - - sso_region: str - sso_client_id: str - sso_domain: str - sso_account_id: str | None = None - - -@dataclass(frozen=True, slots=True) -class SsoCacheEntry: - """Contents of a single SSO cache file. - - Attributes: - access_token: JWT access token. - refresh_token: Refresh token for obtaining new access tokens. - id_token: OIDC ID token (optional). - expires_at: ISO-8601 expiry timestamp for the access token. - client_id: Cognito app client ID. - region: AWS region. - cognito_domain: Cognito domain. - """ - - access_token: str - refresh_token: str | None - id_token: str | None - expires_at: str # ISO-8601 - client_id: str - region: str - cognito_domain: str - - def to_dict(self) -> dict[str, Any]: - """Serialize to a JSON-compatible dict with camelCase keys.""" - d: dict[str, Any] = { - "accessToken": self.access_token, - "expiresAt": self.expires_at, - "clientId": self.client_id, - "region": self.region, - "cognitoDomain": self.cognito_domain, - } - if self.refresh_token is not None: - d["refreshToken"] = self.refresh_token - if self.id_token is not None: - d["idToken"] = self.id_token - return d - - @classmethod - def from_dict(cls, data: dict[str, Any]) -> SsoCacheEntry: - """Deserialize from a JSON dict with camelCase keys.""" - return cls( - access_token=data["accessToken"], - refresh_token=data.get("refreshToken"), - id_token=data.get("idToken"), - expires_at=data["expiresAt"], - client_id=data["clientId"], - region=data["region"], - cognito_domain=data["cognitoDomain"], - ) - - -@dataclass(slots=True) -class AuthState: - """Resolved authentication state used throughout the client lifecycle. - - Attributes: - mode: Auth mode — one of ``"api_key"``, ``"bearer_static"``, - ``"bearer_provider"``, or ``"sso"``. - api_key: API key value (for ``api_key`` mode). - api_key_header: Header name for API key auth. - access_token: Static bearer token (for ``bearer_static`` mode). - access_token_provider: Callable returning a token string or awaitable - (for ``bearer_provider`` mode). - account_id: Account ID sent as ``X-Account-Id`` header. - sso_profile: Resolved SSO profile (for ``sso`` mode). - config_dir: Config directory path (for SSO cache lookup). - auto_refresh: Whether to auto-refresh expired SSO tokens. - """ - - mode: str # "api_key" | "bearer_static" | "bearer_provider" | "sso" - api_key: str | None = None - api_key_header: str = "x-api-key" - access_token: str | None = None - access_token_provider: Callable[[], str | Awaitable[str]] | None = None - account_id: str | None = None - sso_profile: SsoProfile | None = None - config_dir: str | None = None - auto_refresh: bool = True - _sync_refresh_lock: threading.Lock = field( - default_factory=threading.Lock, repr=False - ) - _async_refresh_lock: asyncio.Lock = field(default_factory=asyncio.Lock, repr=False) - - -# ── Helpers ─────────────────────────────────────────────────────────────────── - - -def cache_file_name(domain: str, client_id: str) -> str: - """Compute SHA-1 hex digest of ``domain|client_id`` for cache filename.""" - return hashlib.sha1(f"{domain}|{client_id}".encode()).hexdigest() - - -def resolve_config_dir(override: str | None = None) -> Path: - """Resolve the config directory path.""" - if override: - return Path(override) - env_dir = os.getenv("SECLAI_CONFIG_DIR") - if env_dir: - return Path(env_dir) - home = Path.home() - return home / _DEFAULT_CONFIG_DIR - - -def parse_ini_config(config_path: Path) -> configparser.ConfigParser: - """Read an INI config file with AWS-style ``[profile X]`` sections.""" - cp = configparser.ConfigParser() - if config_path.exists(): - cp.read(str(config_path)) - return cp - - -def load_sso_profile(config_dir: Path, profile_name: str) -> SsoProfile: - """Load and resolve an SSO profile from the config file. - - Non-default profiles inherit unset values from ``[default]``. - All profiles fall back to built-in defaults and environment variable - overrides (``SECLAI_SSO_DOMAIN``, ``SECLAI_SSO_CLIENT_ID``, - ``SECLAI_SSO_REGION``). Always returns a valid profile. - """ - config_path = config_dir / _CONFIG_FILE - - merged: dict[str, str] = {} - - if config_path.exists(): - cp = parse_ini_config(config_path) - - default_section: dict[str, str] = {} - if cp.has_section("default"): - default_section = dict(cp.items("default")) - - if profile_name == "default": - merged = default_section - else: - section_name = f"profile {profile_name}" - if cp.has_section(section_name): - merged = {**default_section, **dict(cp.items(section_name))} - else: - logging.getLogger(__name__).warning( - "SSO profile '%s' not found in config; using defaults", - profile_name, - ) - - # Environment variables override config file values - sso_domain = ( - os.getenv("SECLAI_SSO_DOMAIN") or merged.get("sso_domain") or DEFAULT_SSO_DOMAIN - ) - sso_client_id = ( - os.getenv("SECLAI_SSO_CLIENT_ID") - or merged.get("sso_client_id") - or DEFAULT_SSO_CLIENT_ID - ) - sso_region = ( - os.getenv("SECLAI_SSO_REGION") or merged.get("sso_region") or DEFAULT_SSO_REGION - ) - sso_account_id = merged.get("sso_account_id") or None - - return SsoProfile( - sso_region=sso_region, - sso_client_id=sso_client_id, - sso_domain=sso_domain, - sso_account_id=sso_account_id, - ) - - -# ── Cache I/O ───────────────────────────────────────────────────────────────── - - -def _sso_cache_path(config_dir: Path, profile: SsoProfile) -> Path: - """Resolve the full path to a profile's SSO cache file.""" - hash_name = cache_file_name(profile.sso_domain, profile.sso_client_id) - return config_dir / _SSO_CACHE_DIR / f"{hash_name}.json" - - -def read_sso_cache(config_dir: Path, profile: SsoProfile) -> SsoCacheEntry | None: - """Read a cached SSO token from disk.""" - cache_path = _sso_cache_path(config_dir, profile) - if not cache_path.exists(): - return None - try: - data = json.loads(cache_path.read_text()) - return SsoCacheEntry.from_dict(data) - except (json.JSONDecodeError, KeyError, OSError): - return None - - -def write_sso_cache( - config_dir: Path, profile: SsoProfile, entry: SsoCacheEntry -) -> None: - """Write a cached SSO token to disk atomically.""" - cache_dir = config_dir / _SSO_CACHE_DIR - cache_dir.mkdir(parents=True, exist_ok=True) - os.chmod(str(cache_dir), 0o700) - - hash_name = cache_file_name(profile.sso_domain, profile.sso_client_id) - cache_path = cache_dir / f"{hash_name}.json" - - fd, tmp_path = tempfile.mkstemp(dir=str(cache_dir), suffix=".tmp") - try: - with os.fdopen(fd, "w") as f: - json.dump(entry.to_dict(), f, indent=2) - os.chmod(tmp_path, 0o600) - os.replace(tmp_path, str(cache_path)) - except Exception: - try: - os.unlink(tmp_path) - except OSError: - pass - raise - - -def delete_sso_cache(config_dir: Path, profile: SsoProfile) -> None: - """Delete a cached SSO token file.""" - cache_path = _sso_cache_path(config_dir, profile) - if cache_path.exists(): - cache_path.unlink() - - -# ── Token validation ────────────────────────────────────────────────────────── - - -def is_token_valid(entry: SsoCacheEntry) -> bool: - """Check if a cached token is still valid (with 30s buffer).""" - try: - expires_at = datetime.fromisoformat(entry.expires_at.replace("Z", "+00:00")) - except ValueError: - return False - now = datetime.now(UTC) - return now + timedelta(seconds=_EXPIRY_BUFFER_SECONDS) < expires_at - - -# ── Token refresh helpers ─────────────────────────────────────────────────── - - -def _build_refresh_request( - profile: SsoProfile, refresh_token_value: str -) -> tuple[str, dict[str, str]]: - """Build the token refresh URL and form body.""" - token_url = f"https://{profile.sso_domain}/oauth2/token" - body = { - "grant_type": "refresh_token", - "client_id": profile.sso_client_id, - "refresh_token": refresh_token_value, - } - return token_url, body - - -def _parse_refresh_response( - data: dict[str, Any], profile: SsoProfile, refresh_token_value: str -) -> SsoCacheEntry: - """Parse a Cognito token response into an SsoCacheEntry.""" - expires_at = (datetime.now(UTC) + timedelta(seconds=data["expires_in"])).isoformat() - - return SsoCacheEntry( - access_token=data["access_token"], - refresh_token=data.get("refresh_token", refresh_token_value), - id_token=data.get("id_token"), - expires_at=expires_at, - client_id=profile.sso_client_id, - region=profile.sso_region, - cognito_domain=profile.sso_domain, - ) - - -# ── Token refresh (sync) ───────────────────────────────────────────────────── - - -def refresh_token_sync( - profile: SsoProfile, - refresh_token_value: str, - http_client: httpx.Client | None = None, -) -> SsoCacheEntry: - """Refresh an access token using a Cognito ``refresh_token`` grant (sync). - - Args: - profile: SSO profile with Cognito domain and client ID. - refresh_token_value: The refresh token to exchange. - http_client: Optional pre-configured HTTP client. - - Returns: - A fresh :class:`SsoCacheEntry` with the new tokens. - - Raises: - httpx.HTTPStatusError: If the Cognito token endpoint returns a non-2xx status. - """ - token_url, body = _build_refresh_request(profile, refresh_token_value) - - client = http_client or httpx.Client() - try: - response = client.post( - token_url, - data=body, - headers={"content-type": "application/x-www-form-urlencoded"}, - ) - response.raise_for_status() - finally: - if http_client is None: - client.close() - - return _parse_refresh_response(response.json(), profile, refresh_token_value) - - -# ── Token refresh (async) ──────────────────────────────────────────────────── - - -async def refresh_token_async( - profile: SsoProfile, - refresh_token_value: str, - http_client: httpx.AsyncClient | None = None, -) -> SsoCacheEntry: - """Refresh an access token using a Cognito ``refresh_token`` grant (async). - - Args: - profile: SSO profile with Cognito domain and client ID. - refresh_token_value: The refresh token to exchange. - http_client: Optional pre-configured async HTTP client. - - Returns: - A fresh :class:`SsoCacheEntry` with the new tokens. - - Raises: - httpx.HTTPStatusError: If the Cognito token endpoint returns a non-2xx status. - """ - token_url, body = _build_refresh_request(profile, refresh_token_value) - - client = http_client or httpx.AsyncClient() - try: - response = await client.post( - token_url, - data=body, - headers={"content-type": "application/x-www-form-urlencoded"}, - ) - response.raise_for_status() - finally: - if http_client is None: - await client.aclose() - - return _parse_refresh_response(response.json(), profile, refresh_token_value) - - -# ── Credential chain ───────────────────────────────────────────────────────── - - -def resolve_credential_chain( - *, - api_key: str | None = None, - access_token: str | None = None, - access_token_provider: Callable[[], str | Awaitable[str]] | None = None, - profile: str | None = None, - config_dir: str | None = None, - auto_refresh: bool = True, - account_id: str | None = None, - api_key_header: str = "x-api-key", -) -> AuthState: - """Resolve the credential chain (synchronous). - - Resolution order: - 1. Explicit ``api_key`` - 2. Explicit ``access_token`` (static string) - 3. Explicit ``access_token_provider`` (callback) - 4. ``SECLAI_API_KEY`` environment variable - 5. SSO profile from config file + cached tokens (always available via built-in defaults) - """ - # 1. Explicit API key - stripped_api_key = api_key.strip() if api_key else "" - if stripped_api_key: - return AuthState( - mode="api_key", - api_key=stripped_api_key, - api_key_header=api_key_header, - account_id=account_id, - auto_refresh=False, - ) - - # 2. Static access token - stripped_access_token = access_token.strip() if access_token else "" - if stripped_access_token: - return AuthState( - mode="bearer_static", - access_token=stripped_access_token, - api_key_header=api_key_header, - account_id=account_id, - auto_refresh=False, - ) - - # 3. Access token provider - if access_token_provider: - return AuthState( - mode="bearer_provider", - access_token_provider=access_token_provider, - api_key_header=api_key_header, - account_id=account_id, - auto_refresh=False, - ) - - # 4. SECLAI_API_KEY env var - env_key = os.getenv("SECLAI_API_KEY", "").strip() - if env_key: - return AuthState( - mode="api_key", - api_key=env_key, - api_key_header=api_key_header, - account_id=account_id, - auto_refresh=False, - ) - - # 5. SSO profile (always available via built-in defaults) - resolved_dir = resolve_config_dir(config_dir) - profile_name = profile or os.getenv("SECLAI_PROFILE") or "default" - sso = load_sso_profile(resolved_dir, profile_name) - return AuthState( - mode="sso", - api_key_header=api_key_header, - account_id=account_id or sso.sso_account_id, - sso_profile=sso, - config_dir=str(resolved_dir), - auto_refresh=auto_refresh, - ) - - -# ── Per-request auth header resolution ──────────────────────────────────────── - - -def resolve_auth_headers_sync(state: AuthState) -> dict[str, str]: - """Resolve auth headers for a sync request. - - Args: - state: Resolved authentication state. - - Returns: - Header dict with the appropriate auth header(s). - - Raises: - TypeError: If an async ``access_token_provider`` is used with a sync client. - """ - headers: dict[str, str] = {} - - if state.mode == "api_key": - headers[state.api_key_header] = state.api_key # type: ignore[assignment] - elif state.mode == "bearer_static": - headers["authorization"] = f"Bearer {state.access_token}" - elif state.mode == "bearer_provider": - token = state.access_token_provider() # type: ignore[misc] - if hasattr(token, "__await__"): - raise TypeError( - "Async access_token_provider used with sync Seclai client. " - "Use a sync provider or switch to AsyncSeclai." - ) - headers["authorization"] = f"Bearer {token}" - elif state.mode == "sso": - token = _resolve_sso_token_sync(state) - headers["authorization"] = f"Bearer {token}" - - if state.account_id: - headers["x-account-id"] = state.account_id - - return headers - - -async def resolve_auth_headers_async(state: AuthState) -> dict[str, str]: - """Resolve auth headers for an async request. - - Args: - state: Resolved authentication state. - - Returns: - Header dict with the appropriate auth header(s). - """ - headers: dict[str, str] = {} - - if state.mode == "api_key": - headers[state.api_key_header] = state.api_key # type: ignore[assignment] - elif state.mode == "bearer_static": - headers["authorization"] = f"Bearer {state.access_token}" - elif state.mode == "bearer_provider": - token = state.access_token_provider() # type: ignore[misc] - if hasattr(token, "__await__"): - token = await token - headers["authorization"] = f"Bearer {token}" - elif state.mode == "sso": - token = await _resolve_sso_token_async(state) - headers["authorization"] = f"Bearer {token}" - - if state.account_id: - headers["x-account-id"] = state.account_id - - return headers - - -def _resolve_sso_token_sync(state: AuthState) -> str: - """Resolve a valid SSO token, refreshing from cache if needed (sync).""" - profile = state.sso_profile - assert profile is not None - config_dir = Path(state.config_dir) if state.config_dir else resolve_config_dir() - - cached = read_sso_cache(config_dir, profile) - - if cached and is_token_valid(cached): - return cached.access_token - - if cached and cached.refresh_token and state.auto_refresh: - with state._sync_refresh_lock: - # Re-check after acquiring lock — another thread may have refreshed - cached = read_sso_cache(config_dir, profile) - if cached and is_token_valid(cached): - return cached.access_token - if cached and cached.refresh_token: - refreshed = refresh_token_sync(profile, cached.refresh_token) - write_sso_cache(config_dir, profile, refreshed) - return refreshed.access_token - - raise RuntimeError(_SSO_EXPIRED_MSG) - - -async def _resolve_sso_token_async(state: AuthState) -> str: - """Resolve a valid SSO token, refreshing from cache if needed (async).""" - profile = state.sso_profile - assert profile is not None - config_dir = Path(state.config_dir) if state.config_dir else resolve_config_dir() - - cached = read_sso_cache(config_dir, profile) - - if cached and is_token_valid(cached): - return cached.access_token - - if cached and cached.refresh_token and state.auto_refresh: - async with state._async_refresh_lock: - # Re-check after acquiring lock — another task may have refreshed - cached = read_sso_cache(config_dir, profile) - if cached and is_token_valid(cached): - return cached.access_token - if cached and cached.refresh_token: - refreshed = await refresh_token_async(profile, cached.refresh_token) - write_sso_cache(config_dir, profile, refreshed) - return refreshed.access_token - - raise RuntimeError(_SSO_EXPIRED_MSG) diff --git a/seclai/py.typed b/seclai/py.typed deleted file mode 100644 index e69de29..0000000 diff --git a/seclai/seclai.py b/seclai/seclai.py deleted file mode 100644 index 80269dc..0000000 --- a/seclai/seclai.py +++ /dev/null @@ -1,8691 +0,0 @@ -"""Seclai Python SDK. - -This package provides two primary clients: - -- `Seclai`: synchronous client (uses `httpx.Client`) -- `AsyncSeclai`: asynchronous client (uses `httpx.AsyncClient`) - -Authentication --------------- -Pass `api_key=...` when constructing a client, or set `SECLAI_API_KEY`. - -Configuration -------------- -Set `SECLAI_API_URL` to override the API base URL. - -Errors ------- -Convenience endpoint methods raise SDK exceptions instead of returning “error models”: - -- `SeclaiAPIStatusError`: non-success HTTP status codes -- `SeclaiAPIValidationError`: validation error payloads (typically HTTP 422) - -Quickstart ----------- -Sync: - - from seclai import Seclai - - client = Seclai(api_key="...") - run = client.run_agent("agent_123", body=...) - -Async: - - from seclai import AsyncSeclai - - async with AsyncSeclai(api_key="...") as client: - run = await client.run_agent("agent_123", body=...) -""" - -import logging -import mimetypes -import os -import time -from collections.abc import AsyncGenerator, Awaitable, Callable, Generator, Mapping -from dataclasses import dataclass -from http import HTTPStatus -from io import BytesIO -from pathlib import Path -from typing import Any, BinaryIO, Self, TypedDict, cast, overload - -import httpx - -from seclai._generated.client import Client as GeneratedClient -from seclai._generated.models.agent_run_list_response import AgentRunListResponse -from seclai._generated.models.agent_run_request import AgentRunRequest -from seclai._generated.models.agent_run_response import AgentRunResponse -from seclai._generated.models.content_detail_response import ContentDetailResponse -from seclai._generated.models.content_embeddings_list_response import ( - ContentEmbeddingsListResponse, -) -from seclai._generated.models.file_upload_response import FileUploadResponse -from seclai._generated.models.http_validation_error import HTTPValidationError -from seclai._generated.models.source_list_response import SourceListResponse -from seclai._generated.types import Response as OpenAPIResponse -from seclai.auth import ( - AuthState, - resolve_auth_headers_async, - resolve_auth_headers_sync, - resolve_credential_chain, -) -from seclai.versions import validate_api_version - -logger = logging.getLogger(__name__) - - -#: Recursive type alias for JSON-serializable values. -#: Used as the return type for methods that return raw JSON payloads. -JSONValue = dict[str, "JSONValue"] | list["JSONValue"] | str | int | float | bool | None - - -class AgentRunStreamRequest(TypedDict): - """Request body for streaming agent runs. - - This matches the API schema for POST /agents/{agent_id}/runs/stream. - """ - - input: str | None - metadata: dict[str, JSONValue] - - -#: Default API base URL. Override via the ``SECLAI_API_URL`` environment variable. -SECLAI_API_URL = os.getenv("SECLAI_API_URL", "https://seclai.com") - - -def unwrap_items(payload: Any, *legacy_keys: str) -> list[dict[str, Any]]: - """Return the items of a version-gated list endpoint, whichever shape it used. - - Six endpoints key their list differently depending on the ``Seclai-Version`` - the request resolves to. On the legacy baseline it is a bare JSON array or a - per-resource key (``configs``, ``alerts``, ``tiers``, ``experiments``); from - ``2026-07-27`` it is the canonical - ``{"data": [...], "pagination": {...}}`` envelope. Both are live during the - rollout, so reading only one breaks the day the other arrives. - - Args: - payload: The decoded response body. - legacy_keys: Per-resource keys this endpoint uses before ``2026-07-27``, - tried in order after ``data``. - - Returns: - The items. Never ``None`` — an explicit ``{"data": null}`` yields ``[]``. - - Raises: - SeclaiError: If the payload is neither a list nor an object carrying one - of the expected keys. Returning ``[]`` for an unrecognised envelope - would report "no results" for what is really a shape the client - cannot read, which is indistinguishable from a genuinely empty page. - """ - if isinstance(payload, list): - return cast(list[dict[str, Any]], payload) - if isinstance(payload, dict): - for key in ("data", *legacy_keys): - if key in payload: - items = payload[key] - if items is None: - return [] - if isinstance(items, list): - return cast(list[dict[str, Any]], items) - raise SeclaiError( - f"Expected a list under {key!r}, got {type(items).__name__}." - ) - expected = ", ".join(repr(k) for k in ("data", *legacy_keys)) - raise SeclaiError( - f"Unrecognised list response: expected a bare array or an object " - f"with one of {expected}, got keys {sorted(payload)}." - ) - raise SeclaiError( - f"Unrecognised list response: expected a list or object, " - f"got {type(payload).__name__}." - ) - - -#: Deprecated alias kept for internal call sites; use :func:`unwrap_items`. -_unwrap_data = unwrap_items - - -def _strip_none(params: dict[str, Any]) -> dict[str, Any]: - """Remove keys with ``None`` values from a parameter dictionary.""" - return {k: v for k, v in params.items() if v is not None} - - -class SeclaiError(Exception): - """Base error for the Seclai SDK.""" - - -class SeclaiConfigurationError(SeclaiError): - """Raised when the client is misconfigured (e.g., missing API key).""" - - -class SeclaiAPIStatusError(SeclaiError): - """Raised when the Seclai API returns a non-success status code. - - Attributes: - status_code: HTTP status code returned by the API. - method: HTTP method used for the request. - url: Full request URL. - response_text: Best-effort response body text, if available. - """ - - def __init__( - self, - *, - message: str, - status_code: int, - method: str, - url: str, - response_text: str | None, - ) -> None: - """Create a status error for a non-2xx API response.""" - super().__init__(message) - self.message = message - self.status_code = status_code - self.method = method - self.url = url - self.response_text = response_text - - -class SeclaiAPIValidationError(SeclaiAPIStatusError): - """Raised when the API returns a validation error response (typically HTTP 422). - - Attributes: - validation_error: Parsed validation details returned by the API. - """ - - def __init__( - self, - *, - message: str, - status_code: int, - method: str, - url: str, - response_text: str | None, - validation_error: HTTPValidationError, - ) -> None: - """Initialize with validation error details.""" - super().__init__( - message=message, - status_code=status_code, - method=method, - url=url, - response_text=response_text, - ) - self.validation_error = validation_error - - -class SeclaiStreamingError(SeclaiError): - """Raised when an error event is received during a streaming agent run. - - Attributes: - message: Human-readable error message from the stream. - run_id: Agent run identifier, if available. - """ - - def __init__(self, message: str, *, run_id: str | None = None) -> None: - """Initialize with stream error message and optional run ID.""" - super().__init__(message) - self.message = message - self.run_id = run_id - - -def _guess_mime_type(file_name: str | None) -> str | None: - """Guess the MIME type from a filename, or return ``None``.""" - if not file_name: - return None - guessed, _ = mimetypes.guess_type(file_name) - return guessed - - -def _resolve_api_key(api_key: str | None) -> str: - """Resolve the API key from an explicit value or `SECLAI_API_KEY`. - - Raises: - SeclaiConfigurationError: If no API key is provided or present in the environment. - """ - resolved = (api_key or os.getenv("SECLAI_API_KEY") or "").strip() - if not resolved: - raise SeclaiConfigurationError( - "Missing API key. Pass api_key=... or set SECLAI_API_KEY." - ) - return resolved - - -@dataclass(frozen=True, slots=True) -class ClientOptions: - """Resolved client configuration options. - - All values are resolved at construction time and immutable thereafter. - - Attributes: - auth_state: Resolved authentication state. - timeout: Request timeout in seconds. - api_key_header: HTTP header name used to transmit the API key. - default_headers: Extra headers included on every request. - api_version: Dated API version sent as ``Seclai-Version``, or ``None``. - allow_unknown_api_version: Whether a version this release was not built - against is permitted, for the header and for ``update_api_version``. - """ - - auth_state: AuthState - timeout: float - api_key_header: str - default_headers: Mapping[str, str] - api_version: str | None = None - allow_unknown_api_version: bool = False - - -def _build_default_headers( - *, - auth_state: AuthState, - default_headers: Mapping[str, str] | None, - api_version: str | None = None, -) -> dict[str, str]: - """Build default request headers including auth and user-agent.""" - headers: dict[str, str] = { - "user-agent": "seclai-python", - } - # Add static auth headers (for api_key and bearer_static modes). - # Dynamic modes (bearer_provider, sso) are resolved per-request. - if auth_state.mode == "api_key": - headers[auth_state.api_key_header] = auth_state.api_key # type: ignore[assignment] - elif auth_state.mode == "bearer_static": - headers["authorization"] = f"Bearer {auth_state.access_token}" - # X-Account-Id is only meaningful for bearer/SSO modes. - # For api_key mode the key's account is always used. - if auth_state.account_id and auth_state.mode in ( - "bearer_static", - "bearer_provider", - "sso", - ): - headers["x-account-id"] = auth_state.account_id - # Omitted unless the caller opts in: with no header the account's pinned - # baseline applies and responses keep the shapes this release was built - # against, so upgrading the SDK alone never changes the wire contract. - if api_version: - headers["seclai-version"] = api_version - if default_headers: - # Case-insensitively, so a caller-supplied `Seclai-Version` (or any other - # differently-cased default) replaces ours rather than joining it. httpx - # emits both keys otherwise and the server picks one arbitrarily. - # - # Recomputed per key rather than once up front: `default_headers` may - # itself carry two spellings of one header, and a snapshot taken before - # the loop would not see the first of them being added. - for key, value in default_headers.items(): - for existing in [k for k in headers if k.lower() == key.lower()]: - del headers[existing] - headers[key] = value - return headers - - -def _merge_request_headers( - *, - options: ClientOptions, - request_headers: Mapping[str, str] | None, -) -> dict[str, str]: - """Merge client default headers with per-request overrides including dynamic auth.""" - merged = _build_default_headers( - auth_state=options.auth_state, - default_headers=options.default_headers, - api_version=options.api_version, - ) - # For dynamic auth modes, resolve per-request headers - if options.auth_state.mode in ("bearer_provider", "sso"): - try: - auth_headers = resolve_auth_headers_sync(options.auth_state) - except (RuntimeError, TypeError) as exc: - raise SeclaiConfigurationError(str(exc)) from exc - except Exception as exc: - raise SeclaiConfigurationError(f"Auth resolution failed: {exc}") from exc - merged.update(auth_headers) - if request_headers: - merged.update(request_headers) - return merged - - -async def _merge_request_headers_async( - *, - options: ClientOptions, - request_headers: Mapping[str, str] | None, -) -> dict[str, str]: - """Merge client default headers with per-request overrides including dynamic auth (async).""" - merged = _build_default_headers( - auth_state=options.auth_state, - default_headers=options.default_headers, - api_version=options.api_version, - ) - # For dynamic auth modes, resolve per-request headers asynchronously - if options.auth_state.mode in ("bearer_provider", "sso"): - try: - auth_headers = await resolve_auth_headers_async(options.auth_state) - except (RuntimeError, TypeError) as exc: - raise SeclaiConfigurationError(str(exc)) from exc - except Exception as exc: - raise SeclaiConfigurationError(f"Auth resolution failed: {exc}") from exc - merged.update(auth_headers) - if request_headers: - merged.update(request_headers) - return merged - - -def _raise_for_status(response: httpx.Response) -> None: - """Raise on a non-success status, `SeclaiAPIValidationError` for a 422. - - The generated-client path has always distinguished the two; this one did not, - so every method built on :meth:`Seclai.request` — most of the SDK — reported a - validation failure as a bare status error and discarded the field-level - detail the API returned. - """ - if 200 <= response.status_code < 400: - return - try: - response_text = response.text - except Exception: - response_text = None - if response.status_code == 422: - try: - payload = response.json() - except Exception: - payload = None - if isinstance(payload, dict) and "detail" in payload: - raise SeclaiAPIValidationError( - message="Validation error", - status_code=response.status_code, - method=response.request.method, - url=str(response.request.url), - response_text=response_text, - validation_error=HTTPValidationError.from_dict(payload), - ) - raise SeclaiAPIStatusError( - message=f"Request failed with status {response.status_code}", - status_code=response.status_code, - method=response.request.method, - url=str(response.request.url), - response_text=response_text, - ) - - -class _SeclaiBase: - """Shared implementation for Seclai sync/async clients. - - This class centralizes credential resolution, option storage, and configuration of - the generated OpenAPI client. - """ - - def __init__( - self, - *, - api_key: str | None, - access_token: str | Callable[[], str | Awaitable[str]] | None, - timeout: float, - api_key_header: str, - default_headers: Mapping[str, str] | None, - profile: str | None, - config_dir: str | None, - auto_refresh: bool, - account_id: str | None, - api_version: str | None = None, - allow_unknown_api_version: bool = False, - ) -> None: - """Initialize shared client state. - - Args: - api_key: API key used for authentication. If omitted, ``SECLAI_API_KEY`` is used. - access_token: Static bearer token string or a provider callable. - Mutually exclusive with ``api_key``. - timeout: Request timeout (seconds). - api_key_header: Header name to use for the API key. - default_headers: Extra headers to include on every request. - profile: SSO profile name from ``~/.seclai/config``. - config_dir: Override the config directory path. - auto_refresh: Whether to auto-refresh expired SSO tokens. Defaults to ``True``. - account_id: Target organization account ID (``X-Account-Id`` header). - api_version: Dated API version (``YYYY-MM-DD``) sent as the - ``Seclai-Version`` header, opting into backward-incompatible - changes released on or before that date. Omitted by default, - so upgrading the SDK alone never changes response shapes. - - Raises: - SeclaiConfigurationError: If no credentials are found or if both ``api_key`` - and ``access_token`` are provided. - """ - if api_key and access_token: - raise SeclaiConfigurationError( - "Provide either api_key or access_token, not both." - ) - - # Determine access_token vs provider - access_token_str: str | None = None - access_token_provider: Callable[[], str | Awaitable[str]] | None = None - if callable(access_token): - access_token_provider = access_token - elif isinstance(access_token, str): - access_token_str = access_token - - try: - auth_state = resolve_credential_chain( - api_key=api_key, - access_token=access_token_str, - access_token_provider=access_token_provider, - profile=profile, - config_dir=config_dir, - auto_refresh=auto_refresh, - account_id=account_id, - api_key_header=api_key_header, - ) - except RuntimeError as e: - raise SeclaiConfigurationError(str(e)) from e - - # `default_headers` is applied last so an explicit header wins, which - # means it can also carry a Seclai-Version. Validate whichever value - # actually reaches the wire, not just the argument — otherwise the guard - # is one header away from being bypassed. - # The LAST matching key, because that is the one the header merge keeps. - # Taking the first match would approve a value the client never sends - # when `default_headers` carries two spellings of the same header. - header_version = None - for k, v in (default_headers or {}).items(): - if k.lower() == "seclai-version": - header_version = v - try: - validate_api_version( - header_version or api_version, allow_unknown=allow_unknown_api_version - ) - except ValueError as e: - source = ( - "default_headers['Seclai-Version']" if header_version else "api_version" - ) - raise SeclaiConfigurationError(f"{e} (via {source})") from e - - self._options = ClientOptions( - auth_state=auth_state, - timeout=timeout, - api_key_header=api_key_header, - default_headers=default_headers or {}, - api_version=api_version, - allow_unknown_api_version=allow_unknown_api_version, - ) - - self._generated_client_instance: GeneratedClient | None = None - self._owns_generated_client = False - - @property - def api_key(self) -> str | None: - """Return the resolved API key used for authentication, or ``None`` for bearer auth.""" - return self._options.auth_state.api_key - - def _default_headers(self) -> dict[str, str]: - """Build default request headers for the underlying HTTP clients. - - Returns: - A header dictionary containing auth, user-agent, and any configured defaults. - """ - return _build_default_headers( - auth_state=self._options.auth_state, - default_headers=self._options.default_headers, - api_version=self._options.api_version, - ) - - def _generated_client(self) -> GeneratedClient: - """Return a cached generated OpenAPI client configured with this client's auth. - - This is primarily used internally by the wrapper methods in this file. Advanced - usage may call this to access generated request helpers. - """ - if self._generated_client_instance is None: - self._generated_client_instance = GeneratedClient( - base_url=SECLAI_API_URL, - headers=self._default_headers(), - ) - self._owns_generated_client = True - return self._generated_client_instance - - def _sync_generated_client(self) -> GeneratedClient: - """Return the generated client with dynamic auth headers applied (sync). - - For ``bearer_provider`` and ``sso`` modes, this resolves fresh auth headers - and updates the generated client before returning it. For static modes - (``api_key``, ``bearer_static``) this is identical to :meth:`_generated_client`. - """ - gc = self._generated_client() - if self._options.auth_state.mode in ("bearer_provider", "sso"): - try: - auth_headers = resolve_auth_headers_sync(self._options.auth_state) - except (RuntimeError, TypeError) as exc: - raise SeclaiConfigurationError(str(exc)) from exc - except Exception as exc: - raise SeclaiConfigurationError( - f"Auth resolution failed: {exc}" - ) from exc - # with_headers() mutates existing httpx clients in-place and - # returns an evolved copy with updated _headers. We keep the - # original instance (preserving any user-set httpx client) but - # store the evolved copy so get_httpx_client() will use the - # refreshed headers when it lazily creates an httpx.Client. - evolved = gc.with_headers(auth_headers) - self._generated_client_instance = evolved - # Re-attach the existing httpx client to the evolved instance - # so pre-configured transports (e.g. in tests) aren't lost. - if gc._client is not None: - evolved.set_httpx_client(gc._client) - return self._generated_client_instance # type: ignore[return-value] - - async def _async_generated_client(self) -> GeneratedClient: - """Return the generated client with dynamic auth headers applied (async). - - For ``bearer_provider`` and ``sso`` modes, this resolves fresh auth headers - and updates the generated client before returning it. For static modes - (``api_key``, ``bearer_static``) this is identical to :meth:`_generated_client`. - """ - gc = self._generated_client() - if self._options.auth_state.mode in ("bearer_provider", "sso"): - try: - auth_headers = await resolve_auth_headers_async( - self._options.auth_state - ) - except (RuntimeError, TypeError) as exc: - raise SeclaiConfigurationError(str(exc)) from exc - except Exception as exc: - raise SeclaiConfigurationError( - f"Auth resolution failed: {exc}" - ) from exc - evolved = gc.with_headers(auth_headers) - self._generated_client_instance = evolved - if gc._async_client is not None: - evolved.set_async_httpx_client(gc._async_client) - return self._generated_client_instance # type: ignore[return-value] - - def _build_url(self, path: str) -> str: - """Build an absolute URL string from a request path. - - Args: - path: API path (with or without a leading `/`). - - Returns: - Absolute URL combining the configured base URL and the given path. - """ - base = SECLAI_API_URL.rstrip("/") - rel = path if path.startswith("/") else f"/{path}" - return f"{base}{rel}" - - def _raise_for_openapi_response( - self, - *, - method: str, - path: str, - response: OpenAPIResponse[Any], - ok_statuses: set[HTTPStatus], - ) -> None: - """Raise an SDK exception if an OpenAPI response is not an expected success. - - Args: - method: HTTP method used (e.g. `"GET"`). - path: API path used (e.g. `"/sources/"`). - response: The generated client's detailed response object. - ok_statuses: Acceptable HTTP status codes for this operation. - - Raises: - SeclaiAPIValidationError: If the API returned a validation error payload. - SeclaiAPIStatusError: For any other non-success status. - """ - if response.status_code in ok_statuses: - return - - response_text: str | None - try: - response_text = response.content.decode("utf-8") - except Exception: - response_text = None - - if isinstance(response.parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message=f"Request failed with status {int(response.status_code)}", - status_code=int(response.status_code), - method=method, - url=self._build_url(path), - response_text=response_text, - validation_error=response.parsed, - ) - - raise SeclaiAPIStatusError( - message=f"Request failed with status {int(response.status_code)}", - status_code=int(response.status_code), - method=method, - url=self._build_url(path), - response_text=response_text, - ) - - -class Seclai(_SeclaiBase): - """Seclai synchronous client. - - Most users should prefer the typed convenience methods (e.g. `run_agent`, `list_sources`) - which raise SDK exceptions on failures. - - This client can be used as a context manager: - - with Seclai(api_key="...") as client: - sources = client.list_sources() - """ - - def __init__( - self, - *, - api_key: str | None = None, - access_token: str | Callable[[], str] | None = None, - timeout: float = 30.0, - api_key_header: str = "x-api-key", - default_headers: Mapping[str, str] | None = None, - http_client: httpx.Client | None = None, - profile: str | None = None, - config_dir: str | None = None, - auto_refresh: bool = True, - account_id: str | None = None, - api_version: str | None = None, - allow_unknown_api_version: bool = False, - ) -> None: - """Create a synchronous Seclai client. - - Credentials are resolved via a chain (first match wins): - - 1. Explicit ``api_key`` - 2. Explicit ``access_token`` (static string or provider callable) - 3. ``SECLAI_API_KEY`` environment variable - 4. SSO profile from ``~/.seclai/config`` + cached tokens - - Args: - api_key: API key used for authentication. If omitted, ``SECLAI_API_KEY`` is used. - access_token: Static bearer token string or a callable returning one. - Mutually exclusive with ``api_key``. - timeout: Request timeout (seconds). - api_key_header: Header name to use for the API key. - default_headers: Extra headers to include on every request. - http_client: Optional pre-configured ``httpx.Client`` to use. - profile: SSO profile name from ``~/.seclai/config``. - config_dir: Override the config directory path. - auto_refresh: Auto-refresh expired SSO tokens. Defaults to ``True``. - account_id: Target organization account ID (``X-Account-Id`` header). - api_version: Dated API version (``YYYY-MM-DD``) sent as the - ``Seclai-Version`` header, opting into backward-incompatible - changes released on or before that date. Omitted by default, - so upgrading the SDK alone never changes response shapes. - - Raises: - SeclaiConfigurationError: If no credentials are found. - """ - super().__init__( - api_key=api_key, - access_token=access_token, - timeout=timeout, - api_key_header=api_key_header, - default_headers=default_headers, - profile=profile, - config_dir=config_dir, - auto_refresh=auto_refresh, - account_id=account_id, - api_version=api_version, - allow_unknown_api_version=allow_unknown_api_version, - ) - self._client = http_client or httpx.Client( - base_url=SECLAI_API_URL, - timeout=self._options.timeout, - headers=self._default_headers(), - ) - self._owns_client = http_client is None - - def close(self) -> None: - """Close underlying HTTP resources owned by this client. - - If you created the client with a custom ``http_client``, this is a no-op - for that client (you remain responsible for closing it). - """ - if self._owns_client: - self._client.close() - if self._owns_generated_client and self._generated_client_instance is not None: - self._generated_client_instance.get_httpx_client().close() - - def __enter__(self) -> Self: - """Enter a context manager and return self.""" - return self - - def __exit__(self, exc_type: object, exc: object, tb: object) -> None: - """Exit the context manager and close resources. - - Args: - exc_type: Exception type (if any). - exc: Exception instance (if any). - tb: Traceback (if any). - """ - self.close() - - def request( - self, - method: str, - path: str, - *, - params: Mapping[str, Any] | None = None, - json: JSONValue | None = None, - headers: Mapping[str, str] | None = None, - ) -> JSONValue | str | None: - """Make a raw HTTP request to the Seclai API. - - This is a low-level escape hatch. For most operations, prefer the typed - convenience methods on this client. - - Args: - method: HTTP method (e.g. `"GET"`, `"POST"`). - path: Request path relative to `SECLAI_API_URL` (e.g. `"/sources/"`). - params: Query parameters. - json: JSON body to send. - headers: Per-request header overrides. - - Returns: - Parsed JSON for JSON responses, raw text for non-JSON responses, or `None` for empty bodies. - - Raises: - SeclaiAPIStatusError: If the response status code is not successful. - """ - response = self._client.request( - method, - path, - params=params, - json=json, - headers=_merge_request_headers( - options=self._options, request_headers=headers - ), - ) - _raise_for_status(response) - if not response.content: - return None - content_type = response.headers.get("content-type", "") - if "application/json" in content_type: - return cast(JSONValue, response.json()) - return response.text - - def run_agent(self, agent_id: str, body: AgentRunRequest) -> AgentRunResponse: - """Run an agent. - - Starts a new agent run for the given agent and returns the run record. You'll need the agent run ID to track the run's progress and fetch the result of completed runs. - - Args: - agent_id: Agent identifier. - body: Agent run request payload. - - Returns: - The created agent run. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - from seclai._generated.api.agents.run_agent_api_agents_agent_id_runs_post import ( - sync_detailed, - ) - - path = f"/agents/{agent_id}/runs" - response = sync_detailed( - agent_id=agent_id, client=self._sync_generated_client(), body=body - ) - self._raise_for_openapi_response( - method="POST", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="POST", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="POST", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - # ``parsed`` can only be the success model here: _raise_for_openapi_response - # already raised for any non-200 status, including the 402 - # InsufficientCreditsResponse envelope. - return cast(AgentRunResponse, parsed) - - def run_streaming_agent_and_wait( - self, - agent_id: str, - body: AgentRunStreamRequest, - *, - timeout: float | None = None, - headers: Mapping[str, str] | None = None, - ) -> AgentRunResponse: - """Run an agent via SSE streaming and block until completion. - - This uses POST /agents/{agent_id}/runs/stream and consumes Server-Sent Events (SSE). - The method returns when an `event: done` message is received. - - Args: - agent_id: Agent identifier. - body: Streaming agent run request payload. - timeout: Max time (seconds) to wait for the final result (client-side). Defaults to this - client's configured timeout. - headers: Optional extra headers for this request. - - Returns: - The final agent run payload from the `done` event. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - SeclaiError: If the stream ends early or times out. - """ - import json as _json - import time as _time - - path = f"/agents/{agent_id}/runs/stream" - - merged_headers = _merge_request_headers( - options=self._options, request_headers=headers - ) - merged_headers.setdefault("accept", "text/event-stream") - - timeout_seconds = self._options.timeout if timeout is None else timeout - start = _time.monotonic() - - try: - with self._client.stream( - "POST", - path, - json=body, - headers=merged_headers, - timeout=timeout_seconds, - ) as response: - if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: - payload = response.json() - raise SeclaiAPIValidationError( - message=f"Request failed with status {response.status_code}", - status_code=int(response.status_code), - method="POST", - url=self._build_url(path), - response_text=response.text, - validation_error=HTTPValidationError.from_dict(payload), - ) - _raise_for_status(response) - - current_event: str | None = None - data_lines: list[str] = [] - last_seen: AgentRunResponse | None = None - - def dispatch() -> AgentRunResponse | None: - nonlocal current_event, data_lines, last_seen - if current_event is None and not data_lines: - return None - data = "\n".join(data_lines) - evt = current_event - current_event = None - data_lines = [] - if not data: - return None - if evt not in {"init", "done"}: - return None - try: - parsed_dict = cast(dict[str, Any], _json.loads(data)) - parsed = AgentRunResponse.from_dict(parsed_dict) - last_seen = parsed - if evt == "done": - return parsed - except Exception: - return None - return None - - for line in response.iter_lines(): - if _time.monotonic() - start > timeout_seconds: - raise SeclaiError( - f"Timed out after {timeout_seconds}s waiting for streaming agent run to complete." - ) - - if line == "": - done = dispatch() - if done is not None: - return done - continue - if line.startswith(":"): - continue - if line.startswith("event:"): - current_event = line[len("event:") :].strip() or None - continue - if line.startswith("data:"): - data_lines.append(line[len("data:") :].lstrip()) - continue - - done = dispatch() - if done is not None: - return done - if last_seen is not None: - return last_seen - raise SeclaiError("Stream ended before receiving a 'done' event.") - except httpx.TimeoutException as e: - raise SeclaiError( - f"Timed out after {timeout_seconds}s waiting for streaming agent run to complete." - ) from e - - def list_agent_runs( - self, agent_id: str, *, page: int = 1, limit: int = 50 - ) -> AgentRunListResponse: - """List agent runs. - - Returns paginated runs for a single agent. - - Args: - agent_id: Agent identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - A paginated list of runs. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - from seclai._generated.api.agents.list_agent_runs_api_agents_agent_id_runs_get import ( - sync_detailed, - ) - - path = f"/agents/{agent_id}/runs" - response = sync_detailed( - agent_id=agent_id, - client=self._sync_generated_client(), - page=page, - limit=limit, - ) - self._raise_for_openapi_response( - method="GET", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - return parsed - - @overload - def get_agent_run( - self, run_id: str, /, *, include_step_outputs: bool = False - ) -> AgentRunResponse: ... - - @overload - def get_agent_run( - self, agent_id: str, run_id: str, /, *, include_step_outputs: bool = False - ) -> AgentRunResponse: ... - - def get_agent_run( - self, *args: str, include_step_outputs: bool = False - ) -> AgentRunResponse: - """Get details of a specific agent run. - - Fetches the current state and details for a previously created run. - - Args: - run_id: Run identifier. - agent_id: Deprecated. Ignored if provided; maintained for backwards compatibility. - include_step_outputs: If true, include per-step outputs with timing, - durations, and credits. Defaults to False. - - Returns: - Agent run details. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - if len(args) == 1: - run_id = args[0] - elif len(args) == 2: - # Backwards compatible: get_agent_run(agent_id, run_id) - run_id = args[1] - else: - raise TypeError("get_agent_run expects (run_id) or (agent_id, run_id)") - - from seclai._generated.api.agents.get_agent_run_api_agents_runs_run_id_get import ( - sync_detailed, - ) - - path = f"/agents/runs/{run_id}" - response = sync_detailed( - run_id=run_id, - client=self._sync_generated_client(), - include_step_outputs=include_step_outputs, - ) - self._raise_for_openapi_response( - method="GET", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - return parsed - - @overload - def delete_agent_run(self, run_id: str, /) -> AgentRunResponse: ... - - @overload - def delete_agent_run(self, agent_id: str, run_id: str, /) -> AgentRunResponse: ... - - def delete_agent_run(self, *args: str) -> AgentRunResponse: - """Cancel an agent run. - - Requests cancellation of a run and returns the updated run record. Note: cancellation will not stop the currently executing step, but will prevent any further steps from running. - - Args: - run_id: Run identifier. - agent_id: Deprecated. Ignored if provided; maintained for backwards compatibility. - - Returns: - The updated agent run. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - if len(args) == 1: - run_id = args[0] - elif len(args) == 2: - # Backwards compatible: delete_agent_run(agent_id, run_id) - run_id = args[1] - else: - raise TypeError("delete_agent_run expects (run_id) or (agent_id, run_id)") - - from seclai._generated.api.agents.delete_agent_run_api_agents_runs_run_id_delete import ( - sync_detailed, - ) - - path = f"/agents/runs/{run_id}" - response = sync_detailed(run_id=run_id, client=self._sync_generated_client()) - self._raise_for_openapi_response( - method="DELETE", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="DELETE", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="DELETE", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - return parsed - - def get_content_detail( - self, - source_connection_content_version: str, - *, - start: int = 0, - end: int = 5000, - ) -> ContentDetailResponse: - """Get content detail. - - Fetches a slice of a content version (use `start`/`end` to page through large content). - - Args: - source_connection_content_version: Content version identifier. - start: Start offset for returned content detail. - end: End offset for returned content detail. - - Returns: - Content details for the requested range. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - from seclai._generated.api.contents.get_content_detail_api_contents_source_connection_content_version_get import ( - sync_detailed, - ) - - path = f"/contents/{source_connection_content_version}" - response = sync_detailed( - source_connection_content_version=source_connection_content_version, - client=self._sync_generated_client(), - start=start, - end=end, - ) - self._raise_for_openapi_response( - method="GET", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - return parsed - - def delete_content(self, source_connection_content_version: str) -> None: - """Delete a specific content version. - - Permanently removes a content version identified by `source_connection_content_version`. - - Args: - source_connection_content_version: Content version identifier. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - from seclai._generated.api.contents.delete_content_api_contents_source_connection_content_version_delete import ( - sync_detailed, - ) - - path = f"/contents/{source_connection_content_version}" - response = sync_detailed( - source_connection_content_version=source_connection_content_version, - client=self._sync_generated_client(), - ) - self._raise_for_openapi_response( - method="DELETE", - path=path, - response=response, - ok_statuses={HTTPStatus.NO_CONTENT}, - ) - return None - - def list_content_embeddings( - self, - source_connection_content_version: str, - *, - page: int = 1, - limit: int = 20, - ) -> ContentEmbeddingsListResponse: - """List embeddings for a content version. - - Returns paginated embeddings that were computed for the given content version. - - Args: - source_connection_content_version: Content version identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - A paginated list of embeddings. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - from seclai._generated.api.contents.list_content_embeddings_api_contents_source_connection_content_version_embeddings_get import ( - sync_detailed, - ) - - path = f"/contents/{source_connection_content_version}/embeddings" - response = sync_detailed( - source_connection_content_version=source_connection_content_version, - client=self._sync_generated_client(), - page=page, - limit=limit, - ) - self._raise_for_openapi_response( - method="GET", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - return parsed - - def list_sources( - self, - *, - page: int = 1, - limit: int = 20, - sort: str = "created_at", - order: str = "desc", - account_id: str | None = None, - ) -> SourceListResponse: - """List sources. - - Returns the sources visible to your account (optionally filtered by `account_id`). - - Args: - page: Page number (1-indexed). - limit: Items per page. - sort: Sort field. - order: Sort order (e.g. `"asc"` or `"desc"`). - account_id: Optional account id; defaults to the API key's account. - - Returns: - A paginated list of sources. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - from seclai._generated.api.sources.list_sources_api_sources_get import ( - sync_detailed, - ) - - path = "/sources" - response = sync_detailed( - client=self._sync_generated_client(), - page=page, - limit=limit, - sort=sort, - order=order, - account_id=account_id, - ) - self._raise_for_openapi_response( - method="GET", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - return parsed - - def upload_file_to_source( - self, - source_connection_id: str, - *, - file: bytes | str | os.PathLike[str] | BinaryIO, - title: str | None = None, - metadata: Mapping[str, Any] | None = None, - file_name: str | None = None, - mime_type: str | None = None, - ) -> FileUploadResponse: - """Upload a file to a specific source connection. - - Sends a file to be ingested under the given source connection. - - Maximum file size: 200 MiB. - - Supported MIME types: - - `application/epub+zip` - - `application/json` - - `application/msword` - - `application/pdf` - - `application/vnd.ms-excel` - - `application/vnd.ms-outlook` - - `application/vnd.ms-powerpoint` - - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - - `application/xml` - - `application/zip` - - `audio/flac` - - `audio/mp4` - - `audio/mpeg` - - `audio/ogg` - - `audio/wav` - - `image/bmp` - - `image/gif` - - `image/jpeg` - - `image/png` - - `image/tiff` - - `image/webp` - - `text/csv` - - `text/html` - - `text/markdown` / `text/x-markdown` - - `text/plain` - - `text/xml` - - `video/mp4` - - `video/quicktime` - - `video/x-msvideo` - - If `mime_type` is omitted and a filename is available, the SDK tries to infer it. - If the upload is sent as `application/octet-stream`, the server attempts to infer - the type from the file extension. - - Notes: - - If `file` is a path or `bytes`, this method creates an in-memory/file handle and - closes it before returning. - - If `file` is a file-like object, the caller owns its lifecycle. - - Args: - source_connection_id: Source connection identifier. - file: File payload. Accepts raw bytes, a filesystem path, or a binary file-like. - title: Optional title for the uploaded file. - metadata: Optional metadata dictionary to associate with the uploaded content. - file_name: Optional filename to send when `file` is bytes or a file-like. - mime_type: Optional MIME type to send. - - Returns: - Upload response details. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - import json as _json - - from seclai._generated.models.body_upload_file_to_source_api_sources_source_connection_id_upload_post import ( - BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, - ) - from seclai._generated.types import UNSET, File - - created_payload: BinaryIO | None = None - try: - upload_file: File - if isinstance(file, File): - upload_file = file - elif isinstance(file, (str, os.PathLike)): - file_path = Path(file) - resolved_file_name = file_name or file_path.name - resolved_mime_type = mime_type or _guess_mime_type(resolved_file_name) - created_payload = file_path.open("rb") - upload_file = File( - payload=created_payload, - file_name=resolved_file_name, - mime_type=resolved_mime_type, - ) - elif isinstance(file, bytes): - created_payload = BytesIO(file) - resolved_mime_type = mime_type or _guess_mime_type(file_name) - upload_file = File( - payload=created_payload, - file_name=file_name, - mime_type=resolved_mime_type, - ) - else: - resolved_mime_type = mime_type or _guess_mime_type(file_name) - upload_file = File( - payload=file, - file_name=file_name, - mime_type=resolved_mime_type, - ) - - body = BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost( - file=upload_file, - title=UNSET if title is None else title, - ) - - if metadata is not None: - body["metadata"] = _json.dumps(metadata) - - endpoint_path = f"/sources/{source_connection_id}/upload" - - # Note: openapi-python-client currently struggles with Seclai's spec for this endpoint - # due to duplicate schema names, so we send the multipart request directly and parse - # into our SDK model types. - http = self._sync_generated_client().get_httpx_client() - raw = http.request( - "POST", - endpoint_path, - files=body.to_multipart(), - ) - - parsed: FileUploadResponse | HTTPValidationError | None = None - if raw.status_code == 200: - payload = cast(dict[str, Any], raw.json()) - parsed = FileUploadResponse.from_dict(payload) - elif raw.status_code == 422: - payload = cast(dict[str, Any], raw.json()) - parsed = HTTPValidationError.from_dict(payload) - - response = OpenAPIResponse( - status_code=HTTPStatus(raw.status_code), - content=raw.content, - headers=raw.headers, - parsed=parsed, - ) - self._raise_for_openapi_response( - method="POST", - path=endpoint_path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="POST", - url=self._build_url(endpoint_path), - response_text=None, - ) - parsed_response = cast( - FileUploadResponse | HTTPValidationError, response.parsed - ) - if isinstance(parsed_response, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="POST", - url=self._build_url(endpoint_path), - response_text=None, - validation_error=parsed_response, - ) - if not isinstance(parsed_response, FileUploadResponse): - raise SeclaiAPIStatusError( - message="Unexpected response shape", - status_code=int(response.status_code), - method="POST", - url=self._build_url(endpoint_path), - response_text=None, - ) - return parsed_response - finally: - if created_payload is not None: - created_payload.close() - - def upload_file_to_content( - self, - source_connection_content_version: str, - *, - file: bytes | str | os.PathLike[str] | BinaryIO, - title: str | None = None, - metadata: Mapping[str, Any] | None = None, - file_name: str | None = None, - mime_type: str | None = None, - ) -> FileUploadResponse: - """Replace an existing content version with a new file upload. - - This uploads a new file to `/contents/{source_connection_content_version}/upload` and replaces - the content backing that existing content version. - - Args: - source_connection_content_version: Source connection content version identifier. - file: File payload. Accepts raw bytes, a filesystem path, or a binary file-like. - title: Optional title for the uploaded file. - metadata: Optional metadata dictionary to associate with the uploaded content. - file_name: Optional filename to send when `file` is bytes or a file-like. - mime_type: Optional MIME type to send. - - Returns: - Upload response details. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - import json as _json - - from seclai._generated.api.contents.upload_file_to_content_api_contents_source_connection_content_version_upload_post import ( - sync_detailed, - ) - from seclai._generated.models.body_upload_file_to_content_api_contents_source_connection_content_version_upload_post import ( - BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, - ) - from seclai._generated.types import UNSET, File - - created_payload: BinaryIO | None = None - try: - upload_file: File - if isinstance(file, File): - upload_file = file - elif isinstance(file, (str, os.PathLike)): - file_path = Path(file) - resolved_file_name = file_name or file_path.name - resolved_mime_type = mime_type or _guess_mime_type(resolved_file_name) - created_payload = file_path.open("rb") - upload_file = File( - payload=created_payload, - file_name=resolved_file_name, - mime_type=resolved_mime_type, - ) - elif isinstance(file, bytes): - created_payload = BytesIO(file) - resolved_mime_type = mime_type or _guess_mime_type(file_name) - upload_file = File( - payload=created_payload, - file_name=file_name, - mime_type=resolved_mime_type, - ) - else: - resolved_mime_type = mime_type or _guess_mime_type(file_name) - upload_file = File( - payload=file, - file_name=file_name, - mime_type=resolved_mime_type, - ) - - body = BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost( - file=upload_file, - title=UNSET if title is None else title, - metadata=UNSET if metadata is None else _json.dumps(metadata), - ) - endpoint_path = f"/contents/{source_connection_content_version}/upload" - response = sync_detailed( - source_connection_content_version=source_connection_content_version, - client=self._sync_generated_client(), - body=body, - ) - self._raise_for_openapi_response( - method="POST", - path=endpoint_path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="POST", - url=self._build_url(endpoint_path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="POST", - url=self._build_url(endpoint_path), - response_text=None, - validation_error=parsed, - ) - return parsed - finally: - if created_payload is not None: - created_payload.close() - - # ── Identity ────────────────────────────────────────────────────────────────── - - def get_me(self) -> dict[str, Any]: - """Get the authenticated user's identity. - - Returns: - The caller's personal ``account_id`` and the organizations they belong to. - - """ - return cast(dict[str, Any], self.request("GET", "/me")) - - # ── API Version ─────────────────────────────────────────────────────────── - - def get_api_version(self) -> dict[str, Any]: - """Get the API version this request resolved to, and the versions available. - - Returns: - ``pinned_version`` (the account's sticky pin, or ``None``), - ``effective_version`` for THIS request, plus ``default_version``, - ``latest_version`` and ``known_versions``. Resolution order is the - ``Seclai-Version`` header, then the account pin, then the default, so - ``effective_version`` reflects the client's ``api_version`` when set. - """ - return cast(dict[str, Any], self.request("GET", "/version")) - - def update_api_version(self, version: str | None) -> dict[str, Any]: - """Pin the account to a dated API version, or clear the pin. - - Owner/admin only. - - Args: - version: A ``YYYY-MM-DD`` date to pin to, or ``None`` to clear the pin - and revert to the default baseline. - - Returns: - The updated version state. ``effective_version`` describes this - request, not the pin just written — a ``Seclai-Version`` header still - overrides the pin. - - Raises: - SeclaiConfigurationError: If ``version`` is one this release was not - built against. The pin is account-wide and sticky, so an unknown - version here would silently reshape responses for every - header-less caller on the account, not just this client — a wider - blast radius than the ``api_version`` option the constructor - already guards. Pass ``allow_unknown_api_version=True`` to the - client to override. - """ - try: - validate_api_version( - version, allow_unknown=self._options.allow_unknown_api_version - ) - except ValueError as e: - raise SeclaiConfigurationError(str(e)) from e - return cast( - dict[str, Any], - self.request("PUT", "/version", json={"version": version}), - ) - - # ── Agents ──────────────────────────────────────────────────────────────── - - def list_agents(self, *, page: int = 1, limit: int = 50) -> dict[str, Any]: - """List all agents. - - Args: - page: Page number (1-indexed). - limit: Items per page. - - Returns: - Paginated list of agents. - """ - return cast( - dict[str, Any], - self.request( - "GET", - "/agents", - params=_strip_none({"page": page, "limit": limit}), - ), - ) - - def create_agent(self, body: dict[str, Any]) -> dict[str, Any]: - """Create a new agent. - - Args: - body: Agent creation payload (name, description, etc.). - - Returns: - The created agent. - """ - return cast(dict[str, Any], self.request("POST", "/agents", json=body)) - - def get_agent(self, agent_id: str) -> dict[str, Any]: - """Get an agent by ID. - - Args: - agent_id: Agent identifier. - - Returns: - Agent details. - """ - return cast(dict[str, Any], self.request("GET", f"/agents/{agent_id}")) - - def update_agent(self, agent_id: str, body: dict[str, Any]) -> dict[str, Any]: - """Update an agent. - - Args: - agent_id: Agent identifier. - body: Fields to update. - - Returns: - The updated agent. - """ - return cast( - dict[str, Any], self.request("PUT", f"/agents/{agent_id}", json=body) - ) - - def delete_agent(self, agent_id: str) -> None: - """Delete an agent. - - Args: - agent_id: Agent identifier. - """ - self.request("DELETE", f"/agents/{agent_id}") - - def disable_agent(self, agent_id: str) -> dict[str, Any]: - """Pause (disable) an agent so it stops firing from every trigger path. - - Args: - agent_id: Agent identifier. - - Returns: - The updated agent summary. - - """ - return cast(dict[str, Any], self.request("POST", f"/agents/{agent_id}/disable")) - - def enable_agent(self, agent_id: str) -> dict[str, Any]: - """Resume (enable) a paused agent. - - Args: - agent_id: Agent identifier. - - Returns: - The updated agent summary. - - """ - return cast(dict[str, Any], self.request("POST", f"/agents/{agent_id}/enable")) - - def get_agent_callers(self, agent_id: str) -> list[dict[str, Any]]: - """List the live agents that call this agent via a ``call_agent`` step. - - Args: - agent_id: Agent identifier. - - Returns: - The calling agents; each must be disabled before this agent can be paused. - - """ - return cast( - list[dict[str, Any]], - self.request("GET", f"/agents/{agent_id}/callers"), - ) - - # ── Agent Export ──────────────────────────────────────────────────────────── - - def export_agent(self, agent_id: str, *, download: bool = True) -> dict[str, Any]: - """Export an agent definition as a portable JSON snapshot. - - Args: - agent_id: Agent identifier. - download: When True (default), the server sets Content-Disposition: attachment. - - Returns: - The exported agent snapshot. - """ - params = _strip_none({"download": download}) - return cast( - dict[str, Any], - self.request("GET", f"/agents/{agent_id}/export", params=params), - ) - - def preview_import_agent(self, body: dict[str, Any]) -> dict[str, Any]: - """Validate an ``agent_definition`` payload without creating an agent. - - Use before :meth:`create_agent` or :meth:`update_agent` with an - ``agent_definition`` to surface ``unresolved_refs`` — workflow - references to knowledge bases, memory banks, source connections, or - sub-agents that don't exist in the target account. Pass the returned - ids back in ``entity_remap`` on the commit call to substitute them. - - Args: - body: ``{"agent_definition": ...}`` — same shape produced by - :meth:`export_agent`. - - Returns: - Summary with step/schedule/alert/criteria/policy counts and any - ``unresolved_refs``. - - Raises: - SeclaiAPIStatusError: For any non-success response, including - HTTP 422 when the ``agent_definition`` fails validation. - On 422 the response body (available as - ``SeclaiAPIStatusError.response_text``) is an - ``AgentDefinitionImportErrorResponse`` listing each field - error with a 1-indexed line/column anchored to the canonical - ``source`` echo. - """ - return cast( - dict[str, Any], - self.request("POST", "/agents/preview-import", json=body), - ) - - # ── Agent Definitions ───────────────────────────────────────────────────── - - def get_agent_definition(self, agent_id: str) -> dict[str, Any]: - """Get the step definition for an agent. - - Args: - agent_id: Agent identifier. - - Returns: - The agent's step definition. - """ - return cast( - dict[str, Any], self.request("GET", f"/agents/{agent_id}/definition") - ) - - def update_agent_definition( - self, agent_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Update the step definition for an agent. - - Args: - agent_id: Agent identifier. - body: New definition payload (must include ``change_id`` for optimistic locking). - - Returns: - The updated agent definition. - """ - return cast( - dict[str, Any], - self.request( - "PUT", - f"/agents/{agent_id}/definition", - json=body, - ), - ) - - # ── Agent Runs (additional) ─────────────────────────────────────────────── - - def search_agent_runs(self, body: dict[str, Any]) -> dict[str, Any]: - """Search agent runs across agents. - - Args: - body: Search request with query filters. - - Returns: - Search results with matching runs. - """ - return cast( - dict[str, Any], self.request("POST", "/agents/runs/search", json=body) - ) - - def cancel_agent_run(self, run_id: str) -> dict[str, Any]: - """Cancel an in-progress agent run. - - Cancellation is ``DELETE`` on the run resource — the API exposes no - ``POST .../cancel`` route, and no operation that deletes a run. - Rejected when the run has already reached a terminal state. - - Hits the same endpoint as :meth:`delete_agent_run`, but through - :meth:`request` rather than the generated client, so a caller-supplied - ``http_client`` applies. Both now surface a 422 as - :class:`SeclaiAPIValidationError`. - - Args: - run_id: Run identifier. - - Returns: - The updated agent run, as a plain dict. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - return cast(dict[str, Any], self.request("DELETE", f"/agents/runs/{run_id}")) - - # ── Agent Input Uploads ─────────────────────────────────────────────────── - - def upload_agent_input( - self, - agent_id: str, - *, - file: bytes | str | os.PathLike[str] | BinaryIO, - file_name: str | None = None, - mime_type: str | None = None, - ) -> dict[str, Any]: - """Upload a file as input for an agent run. - - Args: - agent_id: Agent identifier. - file: File payload (bytes, path, or file-like). - file_name: Filename to send. - mime_type: MIME type of the file. - - Returns: - Upload response with the input upload ID. - """ - payload, created = self._prepare_upload_payload(file, file_name, mime_type) - try: - response = self._client.post( - f"/agents/{agent_id}/upload-input", - files={"file": payload}, - headers=_merge_request_headers( - options=self._options, request_headers=None - ), - ) - _raise_for_status(response) - return cast(dict[str, Any], response.json()) - finally: - if created is not None: - created.close() - - def get_agent_input_upload_status( - self, agent_id: str, upload_id: str - ) -> dict[str, Any]: - """Get the status of an agent input upload. - - Args: - agent_id: Agent identifier. - upload_id: Upload identifier. - - Returns: - Upload status details. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/agents/{agent_id}/input-uploads/{upload_id}", - ), - ) - - def get_agent_attachment_references(self, agent_id: str) -> dict[str, Any]: - """Get the static attachment-reference contract for an agent. - - Call this before staging uploads to learn whether the agent accepts - files at all (``requires_uploads``) and which specific filenames, - indexes, or glob patterns its templates reference. A run-time upload - batch that does not satisfy every declared selector is rejected with - HTTP 400. - - Args: - agent_id: Agent identifier. - - Returns: - The agent's attachment-reference contract. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/agents/{agent_id}/attachment-references", - ), - ) - - def download_agent_run_attachment( - self, - run_id: str, - attachment_id: str, - *, - download_name: str | None = None, - ) -> httpx.Response: - """Download an attachment emitted by a step in an agent run. - - Returns a **streaming** response. The caller is responsible for - consuming and closing the response:: - - response = client.download_agent_run_attachment("run", "att") - with response: - for chunk in response.iter_bytes(): - f.write(chunk) - - Args: - run_id: Run identifier. - attachment_id: URL-safe-base64-encoded ``storage_key`` of the - attachment (as surfaced in webhook/email payloads and run - output manifests). - download_name: Optional filename hint for the download disposition. - - Returns: - A streaming ``httpx.Response``. Must be closed by the caller. - """ - request = self._client.build_request( - "GET", - f"/v2/agent-runs/{run_id}/attachments/{attachment_id}", - params=_strip_none({"download_name": download_name}), - headers=_merge_request_headers(options=self._options, request_headers=None), - ) - response = self._client.send(request, stream=True) - if response.is_error: - # Read the body for a useful error message, then release the - # connection before raising — the caller never receives the - # streaming response on the error path. - response.read() - response.close() - _raise_for_status(response) - return response - - # ── Agent AI Assistant ──────────────────────────────────────────────────── - - def generate_agent_steps( - self, agent_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Use the AI assistant to generate agent steps. - - Args: - agent_id: Agent identifier. - body: Prompt and context for step generation. - - Returns: - Generated steps suggestion. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/agents/{agent_id}/ai-assistant/generate-steps", - json=body, - ), - ) - - def generate_step_config( - self, agent_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Use the AI assistant to generate configuration for a single step. - - Args: - agent_id: Agent identifier. - body: Step type and context for config generation. - - Returns: - Generated step configuration. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/agents/{agent_id}/ai-assistant/step-config", - json=body, - ), - ) - - def get_agent_ai_conversation_history( - self, - agent_id: str, - *, - step_type: str | None = None, - step_id: str | None = None, - limit: int | None = None, - offset: int | None = None, - ) -> dict[str, Any]: - """Get the AI assistant conversation history for an agent. - - Args: - agent_id: Agent identifier. - step_type: Step type to look up. Required by the API. Keyword-only - with no default so the released one-argument signature still - imports, but a call that omits it cannot succeed. - step_id: Filter to a single step. - limit: Max turns to return (1-50, default 10). - offset: Number of recent turns to skip. - - Returns: - Conversation history with the AI assistant. - - Raises: - ValueError: If ``step_type`` is missing. The API marks it required, - so omitting it answers 422 naming the wire parameter; failing - here names the argument instead, and makes the broken call - obvious rather than deferring it to the server. - """ - if not step_type: - raise ValueError( - "step_type is required by the API; pass e.g. step_type='llm'." - ) - return cast( - dict[str, Any], - self.request( - "GET", - f"/agents/{agent_id}/ai-assistant/conversations", - params=_strip_none( - { - "step_type": step_type, - "step_id": step_id, - "limit": limit, - "offset": offset, - } - ), - ), - ) - - def mark_agent_ai_suggestion( - self, agent_id: str, conversation_id: str, body: dict[str, Any] - ) -> None: - """Mark an AI assistant suggestion as accepted or rejected. - - Args: - agent_id: Agent identifier. - conversation_id: Conversation identifier. - body: Acceptance/rejection payload. - """ - self.request( - "PATCH", - f"/agents/{agent_id}/ai-assistant/{conversation_id}", - json=body, - ) - - # ── Agent Evaluations ───────────────────────────────────────────────────── - - def list_evaluation_criteria( - self, agent_id: str, *, page: int = 1, limit: int = 50 - ) -> list[dict[str, Any]]: - """List evaluation criteria for an agent. - - Args: - agent_id: Agent identifier. - page: Page number (1-indexed). **Ignored** unless the client opts in - with ``api_version="2026-07-27"`` or later — the legacy response - is unpaginated and always contains every criterion, so a - paginate-until-empty loop over it never terminates. - limit: Items per page. Ignored on the legacy shape, as above. - - Returns: - The evaluation criteria. Either wire shape is accepted: a bare array - by default, the canonical ``{data, pagination}`` envelope once opted - in. Use :meth:`list_evaluation_criteria_page` for the metadata. - """ - page_result = self.list_evaluation_criteria_page( - agent_id, page=page, limit=limit - ) - return _unwrap_data(page_result) - - def list_evaluation_criteria_page( - self, agent_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List evaluation criteria for an agent with pagination metadata. - - Args: - agent_id: Agent identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - ``{"data": [...], "pagination": {"page", "limit", "total", "pages", - "has_next", "has_prev"}}`` when the client opts in with - ``api_version="2026-07-27"`` or later. - - Without that opt-in the endpoint answers with a bare, **unpaginated** - array of every criterion, which is returned as ``{"data": [...]}`` - with no ``pagination`` key — so read it with ``.get("pagination")`` - rather than indexing. - """ - result = self.request( - "GET", - f"/agents/{agent_id}/evaluation-criteria", - params=_strip_none({"page": page, "limit": limit}), - ) - if isinstance(result, dict): - return cast(dict[str, Any], result) - return {"data": result} - - def create_evaluation_criteria( - self, agent_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Create evaluation criteria for an agent. - - Args: - agent_id: Agent identifier. - body: Criteria definition. - - Returns: - The created evaluation criteria. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/agents/{agent_id}/evaluation-criteria", - json=body, - ), - ) - - def get_evaluation_criteria(self, criteria_id: str) -> dict[str, Any]: - """Get evaluation criteria by ID. - - Args: - criteria_id: Evaluation criteria identifier. - - Returns: - Evaluation criteria details. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/agents/evaluation-criteria/{criteria_id}", - ), - ) - - def update_evaluation_criteria( - self, criteria_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Update evaluation criteria. - - Args: - criteria_id: Evaluation criteria identifier. - body: Fields to update. - - Returns: - The updated evaluation criteria. - """ - return cast( - dict[str, Any], - self.request( - "PATCH", - f"/agents/evaluation-criteria/{criteria_id}", - json=body, - ), - ) - - def delete_evaluation_criteria(self, criteria_id: str) -> None: - """Delete evaluation criteria. - - Args: - criteria_id: Evaluation criteria identifier. - """ - self.request("DELETE", f"/agents/evaluation-criteria/{criteria_id}") - - def get_evaluation_criteria_summary(self, criteria_id: str) -> dict[str, Any]: - """Get the result summary for evaluation criteria. - - Args: - criteria_id: Evaluation criteria identifier. - - Returns: - Summary of evaluation results. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/agents/evaluation-criteria/{criteria_id}/summary", - ), - ) - - def list_evaluation_results( - self, criteria_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List evaluation results for criteria. - - Args: - criteria_id: Evaluation criteria identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - Paginated evaluation results. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/agents/evaluation-criteria/{criteria_id}/results", - params=_strip_none({"page": page, "limit": limit}), - ), - ) - - def create_evaluation_result( - self, criteria_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Create a manual evaluation result. - - Args: - criteria_id: Evaluation criteria identifier. - body: Evaluation result payload. - - Returns: - The created evaluation result. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/agents/evaluation-criteria/{criteria_id}/results", - json=body, - ), - ) - - def list_compatible_runs( - self, criteria_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List agent runs compatible with evaluation criteria. - - Args: - criteria_id: Evaluation criteria identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - Paginated list of compatible runs. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/agents/evaluation-criteria/{criteria_id}/compatible-runs", - params=_strip_none({"page": page, "limit": limit}), - ), - ) - - def test_draft_evaluation( - self, agent_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Test a draft evaluation criteria without persisting. - - Args: - agent_id: Agent identifier. - body: Draft evaluation criteria and test run. - - Returns: - Test evaluation result. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/agents/{agent_id}/evaluation-criteria/test-draft", - json=body, - ), - ) - - def list_agent_evaluation_results( - self, agent_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List all evaluation results for an agent. - - Args: - agent_id: Agent identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - Paginated evaluation results with criteria. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/agents/{agent_id}/evaluation-results", - params=_strip_none({"page": page, "limit": limit}), - ), - ) - - def list_run_evaluation_results( - self, agent_id: str, run_id: str, *, page: int = 1, limit: int = 50 - ) -> list[dict[str, Any]]: - """List evaluation results for a specific agent run. - - Args: - agent_id: Agent identifier. - run_id: Run identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - The evaluation results. Either wire shape is accepted: a bare array - by default, the canonical ``{data, pagination}`` envelope once the - client opts in with ``api_version="2026-07-27"`` or later. Use - :meth:`list_run_evaluation_results_page` for the metadata. - """ - page_result = self.list_run_evaluation_results_page( - agent_id, run_id, page=page, limit=limit - ) - return _unwrap_data(page_result) - - def list_run_evaluation_results_page( - self, agent_id: str, run_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List evaluation results for a run, with pagination metadata. - - Args: - agent_id: Agent identifier. - run_id: Run identifier. - page: Page number (1-indexed). Ignored unless the client opts in with - ``api_version="2026-07-27"`` or later; the legacy response is - unpaginated and always contains every result for the run. - limit: Items per page. Ignored on the legacy shape, as above. - - Returns: - ``{"data": [...], "pagination": {...}}`` when opted in, otherwise - ``{"data": [...]}`` with no ``pagination`` key. - """ - result = self.request( - "GET", - f"/agents/{agent_id}/runs/{run_id}/evaluation-results", - params=_strip_none({"page": page, "limit": limit}), - ) - if isinstance(result, dict): - return cast(dict[str, Any], result) - return {"data": result} - - def list_evaluation_runs( - self, agent_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List evaluation run summaries for an agent. - - Args: - agent_id: Agent identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - Paginated evaluation run summaries. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/agents/{agent_id}/evaluation-runs", - params=_strip_none({"page": page, "limit": limit}), - ), - ) - - def get_non_manual_evaluation_summary(self, agent_id: str) -> dict[str, Any]: - """Get the non-manual evaluation summary, scoped to an agent when opted in. - - Args: - agent_id: Agent identifier. Scoping is part of the ``2026-07-27`` - changeset: on the legacy baseline the API **ignores** it and - always returns the account-wide rollup, so set - ``api_version="2026-07-27"`` (or pin the account) to get - per-agent numbers. - - Returns: - Summary of automated evaluation results — for ``agent_id`` when the - client has opted in, account-wide otherwise. The two are - indistinguishable in the payload, so check the client's - ``api_version`` rather than the response. - """ - return cast( - dict[str, Any], - self.request( - "GET", - "/agents/evaluation-results/non-manual-summary", - params={"agent_id": agent_id}, - ), - ) - - # ── Agent Email Governance ──────────────────────────────────────────────────── - - def list_agent_email_optouts( - self, - *, - agent_id: str | None = None, - limit: int | None = None, - offset: int | None = None, - ) -> dict[str, Any]: - """List recipients who have opted out of this account's agent emails. - - Args: - agent_id: Filter to one agent (account-wide opt-outs still apply). - limit: Page size (1-200, default 50). - offset: Rows to skip. - - Returns: - The page of opt-outs plus the total count. - - """ - return cast( - dict[str, Any], - self.request( - "GET", - "/agents/agent-email-optouts", - params=_strip_none( - {"agent_id": agent_id, "limit": limit, "offset": offset} - ), - ), - ) - - def remove_agent_email_optout(self, optout_id: str) -> None: - """Revoke an opt-out, opting the recipient back in to agent emails. - - Args: - optout_id: Opt-out identifier. - - """ - self.request("DELETE", f"/agents/agent-email-optouts/{optout_id}") - - def list_blocked_email_senders( - self, - *, - limit: int | None = None, - offset: int | None = None, - ) -> dict[str, Any]: - """List the account's blocked inbound email senders and the auto-block mode. - - Args: - limit: Page size (1-200, default 50). - offset: Rows to skip. - - Returns: - The page of blocked senders plus ``auto_block_mode``. - - """ - return cast( - dict[str, Any], - self.request( - "GET", - "/agents/blocked-email-senders", - params=_strip_none({"limit": limit, "offset": offset}), - ), - ) - - def block_email_sender(self, body: dict[str, Any]) -> dict[str, Any]: - """Add a sender address or a whole domain to the account blocklist. - - Args: - body: ``sender_email`` plus optional ``match_type`` (``address`` - default, or ``domain``) and ``note``. - - Returns: - The blocked-sender entry. - - """ - return cast( - dict[str, Any], - self.request("POST", "/agents/blocked-email-senders", json=body), - ) - - def unblock_email_sender(self, blocked_id: str) -> None: - """Remove a blocked sender by id. - - Args: - blocked_id: Blocked-sender identifier. - - """ - self.request("DELETE", f"/agents/blocked-email-senders/{blocked_id}") - - def set_auto_block_mode(self, body: dict[str, Any]) -> dict[str, Any]: - """Set whether a governance BLOCK auto-adds the sender to the blocklist. - - Args: - body: ``mode``: ``disabled``, ``input``, or ``input_and_output``. - - Returns: - The updated blocked-sender list. - - """ - return cast( - dict[str, Any], - self.request("PUT", "/agents/blocked-email-senders/mode", json=body), - ) - - def list_inbound_email_rejections( - self, - *, - agent_id: str | None = None, - limit: int | None = None, - ) -> list[dict[str, Any]]: - """List recent inbound emails discarded before running an agent. - - Args: - agent_id: Filter to a single agent's rejections. - limit: Maximum results (1-200, default 50). - - Returns: - The discarded inbound emails. - - """ - return cast( - list[dict[str, Any]], - self.request( - "GET", - "/agents/inbound-email-rejections", - params=_strip_none({"agent_id": agent_id, "limit": limit}), - ), - ) - - def get_inbound_email_status(self) -> dict[str, Any]: - """Get the account's inbound-email overload status. - - Returns: - Whether the breaker has paused inbound mail, and the queued backlog size. - - """ - return cast(dict[str, Any], self.request("GET", "/agents/inbound-email-status")) - - def cancel_queued_email_runs(self) -> dict[str, Any]: - """Fail all of the account's QUEUED (over-quota parked) inbound-email runs. - - Returns: - The count cancelled. - - """ - return cast( - dict[str, Any], - self.request("POST", "/agents/inbound-email-status/cancel-queued"), - ) - - def resume_inbound_email(self) -> dict[str, Any]: - """Manually lift the account-wide inbound-email pause. - - Returns: - Whether the pause was lifted. One-shot: the breaker re-arms if still overloaded. - - """ - return cast( - dict[str, Any], - self.request("POST", "/agents/inbound-email-status/resume"), - ) - - # ── Agent Email Triggers ────────────────────────────────────────────────────── - - def set_email_trigger_config( - self, - agent_id: str, - trigger_id: str, - body: dict[str, Any], - ) -> dict[str, Any]: - """Configure an agent's EMAIL_RECEIVED trigger. - - Args: - agent_id: Agent identifier. - trigger_id: Trigger identifier. - body: Fields to set (alias, allowed_senders, ignore_auto_generated, - require_sender_auth, queue_on_quota). Omitted fields are unchanged. - - Returns: - The trigger's resolved email address(es) and config. - - """ - return cast( - dict[str, Any], - self.request( - "PUT", - f"/agents/{agent_id}/triggers/{trigger_id}/email-config", - json=body, - ), - ) - - # ── Knowledge Bases ─────────────────────────────────────────────────────── - - def list_knowledge_bases( - self, - *, - page: int = 1, - limit: int = 50, - sort: str = "created_at", - order: str = "desc", - ) -> dict[str, Any]: - """List knowledge bases. - - Args: - page: Page number (1-indexed). - limit: Items per page. - sort: Sort field. - order: Sort order (``"asc"`` or ``"desc"``). - - Returns: - Paginated list of knowledge bases. - """ - return cast( - dict[str, Any], - self.request( - "GET", - "/knowledge_bases", - params=_strip_none( - {"page": page, "limit": limit, "sort": sort, "order": order} - ), - ), - ) - - def create_knowledge_base(self, body: dict[str, Any]) -> dict[str, Any]: - """Create a knowledge base. - - Args: - body: Knowledge base creation payload. - - Returns: - The created knowledge base. - """ - return cast(dict[str, Any], self.request("POST", "/knowledge_bases", json=body)) - - def get_knowledge_base(self, knowledge_base_id: str) -> dict[str, Any]: - """Get a knowledge base by ID. - - Args: - knowledge_base_id: Knowledge base identifier. - - Returns: - Knowledge base details. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/knowledge_bases/{knowledge_base_id}", - ), - ) - - def update_knowledge_base( - self, knowledge_base_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Update a knowledge base. - - Args: - knowledge_base_id: Knowledge base identifier. - body: Fields to update. - - Returns: - The updated knowledge base. - """ - return cast( - dict[str, Any], - self.request( - "PUT", - f"/knowledge_bases/{knowledge_base_id}", - json=body, - ), - ) - - def delete_knowledge_base(self, knowledge_base_id: str) -> None: - """Delete a knowledge base. - - Args: - knowledge_base_id: Knowledge base identifier. - """ - self.request("DELETE", f"/knowledge_bases/{knowledge_base_id}") - - # ── Memory Banks ────────────────────────────────────────────────────────── - - def list_memory_banks( - self, - *, - page: int = 1, - limit: int = 50, - sort: str = "created_at", - order: str = "desc", - ) -> dict[str, Any]: - """List memory banks. - - Args: - page: Page number (1-indexed). - limit: Items per page. - sort: Sort field. - order: Sort order (``"asc"`` or ``"desc"``). - - Returns: - Paginated list of memory banks. - """ - return cast( - dict[str, Any], - self.request( - "GET", - "/memory_banks", - params=_strip_none( - {"page": page, "limit": limit, "sort": sort, "order": order} - ), - ), - ) - - def create_memory_bank(self, body: dict[str, Any]) -> dict[str, Any]: - """Create a memory bank. - - Args: - body: Memory bank creation payload (name, type, config, etc.). - - Returns: - The created memory bank. - """ - return cast(dict[str, Any], self.request("POST", "/memory_banks", json=body)) - - def get_memory_bank(self, memory_bank_id: str) -> dict[str, Any]: - """Get a memory bank by ID. - - Args: - memory_bank_id: Memory bank identifier. - - Returns: - Memory bank details. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/memory_banks/{memory_bank_id}", - ), - ) - - def update_memory_bank( - self, memory_bank_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Update a memory bank. - - Args: - memory_bank_id: Memory bank identifier. - body: Fields to update. - - Returns: - The updated memory bank. - """ - return cast( - dict[str, Any], - self.request( - "PUT", - f"/memory_banks/{memory_bank_id}", - json=body, - ), - ) - - def delete_memory_bank(self, memory_bank_id: str) -> None: - """Delete a memory bank. - - Args: - memory_bank_id: Memory bank identifier. - """ - self.request("DELETE", f"/memory_banks/{memory_bank_id}") - - def get_agents_using_memory_bank(self, memory_bank_id: str) -> JSONValue: - """Get agents that use a specific memory bank. - - Args: - memory_bank_id: Memory bank identifier. - - Returns: - List of agents using this memory bank. - """ - return self.request("GET", f"/memory_banks/{memory_bank_id}/agents") - - def get_memory_bank_stats(self, memory_bank_id: str) -> JSONValue: - """Get statistics for a memory bank. - - Args: - memory_bank_id: Memory bank identifier. - - Returns: - Memory bank statistics. - """ - return self.request("GET", f"/memory_banks/{memory_bank_id}/stats") - - def compact_memory_bank(self, memory_bank_id: str) -> None: - """Trigger compaction of a memory bank. - - Args: - memory_bank_id: Memory bank identifier. - """ - self.request("POST", f"/memory_banks/{memory_bank_id}/compact") - - def delete_memory_bank_source(self, memory_bank_id: str) -> None: - """Delete the source backing a memory bank. - - Args: - memory_bank_id: Memory bank identifier. - """ - self.request("DELETE", f"/memory_banks/{memory_bank_id}/source") - - def test_memory_bank_compaction( - self, memory_bank_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Test compaction of a memory bank without applying. - - Args: - memory_bank_id: Memory bank identifier. - body: Test compaction parameters. - - Returns: - Compaction test result. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/memory_banks/{memory_bank_id}/test-compaction", - json=body, - ), - ) - - def test_compaction_prompt_standalone(self, body: dict[str, Any]) -> dict[str, Any]: - """Test a compaction prompt without an existing memory bank. - - Args: - body: Standalone test compaction parameters. - - Returns: - Compaction test result. - """ - return cast( - dict[str, Any], - self.request( - "POST", - "/memory_banks/test-compaction", - json=body, - ), - ) - - def list_memory_bank_templates(self) -> JSONValue: - """List available memory bank templates. - - Returns: - Available templates. - """ - return self.request("GET", "/memory_banks/templates") - - def generate_memory_bank_config(self, body: dict[str, Any]) -> dict[str, Any]: - """Use the AI assistant to generate memory bank configuration. - - Args: - body: Prompt and context for config generation. - - Returns: - Generated memory bank configuration. - """ - return cast( - dict[str, Any], - self.request( - "POST", - "/memory_banks/ai-assistant", - json=body, - ), - ) - - def get_memory_bank_ai_last_conversation(self) -> dict[str, Any]: - """Get the last AI assistant conversation for memory banks. - - Returns: - Last conversation with the memory bank AI assistant. - """ - return cast( - dict[str, Any], - self.request( - "GET", - "/memory_banks/ai-assistant/last-conversation", - ), - ) - - def accept_memory_bank_ai_suggestion( - self, conversation_id: str, body: dict[str, Any] - ) -> JSONValue: - """Accept an AI assistant suggestion for a memory bank. - - Args: - conversation_id: Conversation identifier. - body: Acceptance payload. - - Returns: - Acceptance result. - """ - return self.request( - "PATCH", - f"/memory_banks/ai-assistant/{conversation_id}", - json=body, - ) - - # ── Sources (additional) ────────────────────────────────────────────────── - - def create_source(self, body: dict[str, Any]) -> dict[str, Any]: - """Create a new source. - - Args: - body: Source creation payload. - - Returns: - The created source. - """ - return cast(dict[str, Any], self.request("POST", "/sources", json=body)) - - def get_source(self, source_id: str) -> dict[str, Any]: - """Get a source by ID. - - Args: - source_id: Source identifier. - - Returns: - Source details. - """ - return cast(dict[str, Any], self.request("GET", f"/sources/{source_id}")) - - def update_source(self, source_id: str, body: dict[str, Any]) -> dict[str, Any]: - """Update a source. - - Args: - source_id: Source identifier. - body: Fields to update. - - Returns: - The updated source. - """ - return cast( - dict[str, Any], - self.request( - "PUT", - f"/sources/{source_id}", - json=body, - ), - ) - - def delete_source(self, source_id: str) -> None: - """Delete a source. - - Args: - source_id: Source identifier. - """ - self.request("DELETE", f"/sources/{source_id}") - - def upload_inline_text_to_source( - self, source_connection_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Upload inline text content to a source connection. - - Args: - source_connection_id: Source connection identifier. - body: Inline text payload with title and content. - - Returns: - Upload response details. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/sources/{source_connection_id}", - json=body, - ), - ) - - # ── Source Exports ──────────────────────────────────────────────────────── - - def list_source_exports( - self, source_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List exports for a source. - - Args: - source_id: Source identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - Paginated list of exports. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/sources/{source_id}/exports", - params=_strip_none({"page": page, "limit": limit}), - ), - ) - - def create_source_export( - self, source_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Create an export for a source. - - Args: - source_id: Source identifier. - body: Export configuration (format, filters, etc.). - - Returns: - The created export. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/sources/{source_id}/exports", - json=body, - ), - ) - - def get_source_export(self, source_id: str, export_id: str) -> dict[str, Any]: - """Get details of a source export. - - Args: - source_id: Source identifier. - export_id: Export identifier. - - Returns: - Export details. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/sources/{source_id}/exports/{export_id}", - ), - ) - - def cancel_source_export(self, source_id: str, export_id: str) -> dict[str, Any]: - """Cancel a source export. - - Args: - source_id: Source identifier. - export_id: Export identifier. - - Returns: - The updated export. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/sources/{source_id}/exports/{export_id}/cancel", - ), - ) - - def delete_source_export(self, source_id: str, export_id: str) -> None: - """Delete a source export. - - Args: - source_id: Source identifier. - export_id: Export identifier. - """ - self.request("DELETE", f"/sources/{source_id}/exports/{export_id}") - - def download_source_export(self, source_id: str, export_id: str) -> httpx.Response: - """Download a completed source export. - - Returns a **streaming** response. The caller is responsible for - consuming and closing the response:: - - response = client.download_source_export("src", "exp") - with response: - for chunk in response.iter_bytes(): - f.write(chunk) - - Args: - source_id: Source identifier. - export_id: Export identifier. - - Returns: - A streaming ``httpx.Response``. Must be closed by the caller. - """ - request = self._client.build_request( - "GET", - f"/sources/{source_id}/exports/{export_id}/download", - headers=_merge_request_headers(options=self._options, request_headers=None), - ) - response = self._client.send(request, stream=True) - if response.is_error: - # Read the body for a useful error message, then release the - # connection before raising — the caller never receives the - # streaming response on the error path. - response.read() - response.close() - _raise_for_status(response) - return response - - def estimate_source_export( - self, source_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Estimate the size/cost of a source export. - - Args: - source_id: Source identifier. - body: Export estimation parameters. - - Returns: - Export estimate. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/sources/{source_id}/exports/estimate", - json=body, - ), - ) - - # ── Source Embedding Migrations ─────────────────────────────────────────── - - def get_source_embedding_migration(self, source_id: str) -> dict[str, Any]: - """Get the embedding migration status for a source. - - Args: - source_id: Source identifier. - - Returns: - Migration status. - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/sources/{source_id}/embedding-migration", - ), - ) - - def start_source_embedding_migration( - self, source_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Start an embedding migration for a source. - - Args: - source_id: Source identifier. - body: Migration configuration. - - Returns: - The started migration. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/sources/{source_id}/embedding-migration", - json=body, - ), - ) - - def cancel_source_embedding_migration(self, source_id: str) -> dict[str, Any]: - """Cancel an in-progress embedding migration for a source. - - Args: - source_id: Source identifier. - - Returns: - The cancelled migration. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/sources/{source_id}/embedding-migration/cancel", - ), - ) - - # ── Content (additional) ────────────────────────────────────────────────── - - def replace_content_with_inline_text( - self, content_version_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Replace content with inline text. - - Args: - content_version_id: Content version identifier. - body: Inline text payload. - - Returns: - Upload response. - """ - return cast( - dict[str, Any], - self.request( - "PUT", - f"/contents/{content_version_id}", - json=body, - ), - ) - - # ── Solutions ───────────────────────────────────────────────────────────── - - def list_solutions( - self, - *, - page: int = 1, - limit: int = 50, - sort: str = "created_at", - order: str = "desc", - ) -> dict[str, Any]: - """List solutions. - - Args: - page: Page number (1-indexed). - limit: Items per page. - sort: Sort field. - order: Sort order (``"asc"`` or ``"desc"``). - - Returns: - Paginated list of solutions. - """ - return cast( - dict[str, Any], - self.request( - "GET", - "/solutions", - params=_strip_none( - {"page": page, "limit": limit, "sort": sort, "order": order} - ), - ), - ) - - def create_solution(self, body: dict[str, Any]) -> dict[str, Any]: - """Create a solution. - - Args: - body: Solution creation payload. - - Returns: - The created solution. - """ - return cast(dict[str, Any], self.request("POST", "/solutions", json=body)) - - def get_solution(self, solution_id: str) -> dict[str, Any]: - """Get a solution by ID. - - Args: - solution_id: Solution identifier. - - Returns: - Solution details. - """ - return cast(dict[str, Any], self.request("GET", f"/solutions/{solution_id}")) - - def update_solution(self, solution_id: str, body: dict[str, Any]) -> dict[str, Any]: - """Update a solution. - - Args: - solution_id: Solution identifier. - body: Fields to update. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - self.request( - "PATCH", - f"/solutions/{solution_id}", - json=body, - ), - ) - - def delete_solution(self, solution_id: str) -> None: - """Delete a solution. - - Args: - solution_id: Solution identifier. - """ - self.request("DELETE", f"/solutions/{solution_id}") - - def link_agents_to_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Link agents to a solution. - - Args: - solution_id: Solution identifier. - body: Resource IDs to link. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/solutions/{solution_id}/agents", - json=body, - ), - ) - - def unlink_agents_from_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Unlink agents from a solution. - - Args: - solution_id: Solution identifier. - body: Resource IDs to unlink. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - self.request( - "DELETE", - f"/solutions/{solution_id}/agents", - json=body, - ), - ) - - def link_knowledge_bases_to_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Link knowledge bases to a solution. - - Args: - solution_id: Solution identifier. - body: Resource IDs to link. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/solutions/{solution_id}/knowledge-bases", - json=body, - ), - ) - - def unlink_knowledge_bases_from_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Unlink knowledge bases from a solution. - - Args: - solution_id: Solution identifier. - body: Resource IDs to unlink. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - self.request( - "DELETE", - f"/solutions/{solution_id}/knowledge-bases", - json=body, - ), - ) - - def link_source_connections_to_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Link source connections to a solution. - - Args: - solution_id: Solution identifier. - body: Resource IDs to link. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/solutions/{solution_id}/source-connections", - json=body, - ), - ) - - def unlink_source_connections_from_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Unlink source connections from a solution. - - Args: - solution_id: Solution identifier. - body: Resource IDs to unlink. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - self.request( - "DELETE", - f"/solutions/{solution_id}/source-connections", - json=body, - ), - ) - - def list_solution_conversations(self, solution_id: str) -> list[dict[str, Any]]: - """List AI assistant conversations for a solution. - - Args: - solution_id: Solution identifier. - - Returns: - List of conversations. - """ - return cast( - list[dict[str, Any]], - self.request( - "GET", - f"/solutions/{solution_id}/conversations", - ), - ) - - def add_solution_conversation_turn( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Add a turn to a solution AI conversation. - - Args: - solution_id: Solution identifier. - body: Conversation turn payload. - - Returns: - The conversation response. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/solutions/{solution_id}/conversations", - json=body, - ), - ) - - def mark_solution_conversation_turn( - self, solution_id: str, conversation_id: str, body: dict[str, Any] - ) -> None: - """Mark a solution conversation turn as accepted or rejected. - - Args: - solution_id: Solution identifier. - conversation_id: Conversation identifier. - body: Acceptance/rejection payload. - """ - self.request( - "PATCH", - f"/solutions/{solution_id}/conversations/{conversation_id}", - json=body, - ) - - def generate_solution_ai_plan( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Use the AI assistant to generate a solution plan. - - Args: - solution_id: Solution identifier. - body: Prompt and context. - - Returns: - Generated plan with proposed actions. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/solutions/{solution_id}/ai-assistant/generate", - json=body, - ), - ) - - def generate_solution_ai_knowledge_base( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Use the AI assistant to generate a knowledge base plan for a solution. - - Args: - solution_id: Solution identifier. - body: Prompt and context. - - Returns: - Generated knowledge base plan. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/solutions/{solution_id}/ai-assistant/knowledge-base", - json=body, - ), - ) - - def generate_solution_ai_source( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Use the AI assistant to generate a source plan for a solution. - - Args: - solution_id: Solution identifier. - body: Prompt and context. - - Returns: - Generated source plan. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/solutions/{solution_id}/ai-assistant/source", - json=body, - ), - ) - - def accept_solution_ai_plan( - self, solution_id: str, conversation_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Accept an AI-generated solution plan. - - Args: - solution_id: Solution identifier. - conversation_id: Conversation identifier. - body: Acceptance payload. - - Returns: - Result of applying the plan. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/solutions/{solution_id}/ai-assistant/{conversation_id}/accept", - json=body, - ), - ) - - def decline_solution_ai_plan(self, solution_id: str, conversation_id: str) -> None: - """Decline an AI-generated solution plan. - - Args: - solution_id: Solution identifier. - conversation_id: Conversation identifier. - """ - self.request( - "POST", - f"/solutions/{solution_id}/ai-assistant/{conversation_id}/decline", - ) - - # ── Governance AI ───────────────────────────────────────────────────────── - - def generate_governance_ai_plan(self, body: dict[str, Any]) -> dict[str, Any]: - """Use the AI assistant to generate a governance plan. - - Args: - body: Prompt and context for governance policy management. - - Returns: - Generated governance plan with proposed actions. - """ - return cast( - dict[str, Any], - self.request( - "POST", - "/governance/ai-assistant", - json=body, - ), - ) - - def list_governance_ai_conversations(self) -> list[dict[str, Any]]: - """List governance AI assistant conversations. - - Returns: - List of governance conversations. - """ - return cast( - list[dict[str, Any]], - self.request( - "GET", - "/governance/ai-assistant/conversations", - ), - ) - - def accept_governance_ai_plan(self, conversation_id: str) -> dict[str, Any]: - """Accept an AI-generated governance plan. - - Args: - conversation_id: Conversation identifier. - - Returns: - Result of applying the governance plan. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/governance/ai-assistant/{conversation_id}/accept", - ), - ) - - def decline_governance_ai_plan(self, conversation_id: str) -> None: - """Decline an AI-generated governance plan. - - Args: - conversation_id: Conversation identifier. - """ - self.request( - "POST", - f"/governance/ai-assistant/{conversation_id}/decline", - ) - - # ── Alerts ──────────────────────────────────────────────────────────────── - - def list_alerts( - self, - *, - page: int = 1, - limit: int = 50, - status: str | None = None, - severity: str | None = None, - ) -> JSONValue: - """List alerts. - - Args: - page: Page number (1-indexed). - limit: Items per page. - status: Filter by alert status. - severity: Deprecated and ignored. The API declares no severity filter - on this endpoint, so it never filtered anything, and sending it - is a 422 once ``api_version`` is ``2026-07-27`` or later. It is - accepted and dropped so existing call sites keep working. - - Returns: - Paginated list of alerts. - """ - return self.request( - "GET", - "/alerts", - params=_strip_none({"page": page, "limit": limit, "status": status}), - ) - - def get_alert(self, alert_id: str) -> JSONValue: - """Get an alert by ID. - - Args: - alert_id: Alert identifier. - - Returns: - Alert details. - """ - return self.request("GET", f"/alerts/{alert_id}") - - def change_alert_status(self, alert_id: str, body: dict[str, Any]) -> JSONValue: - """Change the status of an alert. - - Args: - alert_id: Alert identifier. - body: New status payload. - - Returns: - Updated alert. - """ - return self.request("POST", f"/alerts/{alert_id}/status", json=body) - - def add_alert_comment(self, alert_id: str, body: dict[str, Any]) -> JSONValue: - """Add a comment to an alert. - - Args: - alert_id: Alert identifier. - body: Comment payload. - - Returns: - Comment result. - """ - return self.request("POST", f"/alerts/{alert_id}/comments", json=body) - - def subscribe_to_alert(self, alert_id: str) -> JSONValue: - """Subscribe to an alert. - - Args: - alert_id: Alert identifier. - - Returns: - Subscription result. - """ - return self.request("POST", f"/alerts/{alert_id}/subscribe") - - def unsubscribe_from_alert(self, alert_id: str) -> JSONValue: - """Unsubscribe from an alert. - - Args: - alert_id: Alert identifier. - - Returns: - Unsubscription result. - """ - return self.request("POST", f"/alerts/{alert_id}/unsubscribe") - - # ── Alert Configs ───────────────────────────────────────────────────────── - - def list_alert_configs(self, *, page: int = 1, limit: int = 50) -> JSONValue: - """List alert configurations. - - Args: - page: Page number (1-indexed). - limit: Items per page. - - Returns: - The configurations, under ``configs`` alongside ``total`` by default, - and under ``data`` with ``pagination`` once the client opts in with - ``api_version="2026-07-27"`` or later. Read either with - :func:`unwrap_items`:: - - items = unwrap_items(client.list_alert_configs(), "configs") - """ - return self.request( - "GET", - "/alerts/configs", - params=_strip_none({"page": page, "limit": limit}), - ) - - def create_alert_config(self, body: dict[str, Any]) -> JSONValue: - """Create an alert configuration. - - Args: - body: Alert config creation payload. - - Returns: - The created alert configuration. - """ - return self.request("POST", "/alerts/configs", json=body) - - def get_alert_config(self, config_id: str) -> JSONValue: - """Get an alert configuration by ID. - - Args: - config_id: Alert config identifier. - - Returns: - Alert configuration details. - """ - return self.request("GET", f"/alerts/configs/{config_id}") - - def update_alert_config(self, config_id: str, body: dict[str, Any]) -> JSONValue: - """Update an alert configuration. - - Args: - config_id: Alert config identifier. - body: Fields to update. - - Returns: - The updated alert configuration. - """ - return self.request("PATCH", f"/alerts/configs/{config_id}", json=body) - - def delete_alert_config(self, config_id: str) -> None: - """Delete an alert configuration. - - Args: - config_id: Alert config identifier. - """ - self.request("DELETE", f"/alerts/configs/{config_id}") - - # ── Alert Preferences ───────────────────────────────────────────────────── - - def list_organization_alert_preferences(self) -> dict[str, Any]: - """List organization alert preferences. - - Returns: - Alert preferences for the organization. - """ - return cast( - dict[str, Any], - self.request( - "GET", - "/alerts/organization-preferences/list", - ), - ) - - def update_organization_alert_preference( - self, organization_id: str, alert_type: str, body: dict[str, Any] - ) -> JSONValue: - """Update an organization alert preference. - - Args: - organization_id: Organization identifier. - alert_type: Alert type to configure. - body: Preference update payload. - - Returns: - Updated preference. - """ - return self.request( - "PATCH", - f"/alerts/organization-preferences/{organization_id}/{alert_type}", - json=body, - ) - - # ── Model Alerts ────────────────────────────────────────────────────────── - - def list_model_alerts(self, *, page: int = 1, limit: int = 50) -> JSONValue: - """List model alerts. - - Args: - page: Page number (1-indexed). Translated to the ``offset`` the - endpoint actually declares; it does not accept ``page``, so - every page but the first previously returned page 1. - limit: Items per page. - - Returns: - The alerts, under ``alerts`` alongside ``total`` by default, and under - ``data`` with ``pagination`` once the client opts in with - ``api_version="2026-07-27"`` or later. Read either with - :func:`unwrap_items`:: - - items = unwrap_items(client.list_model_alerts(), "alerts") - """ - # `offset` is declared `minimum: 0`, so a defensive caller passing page=0 - # would turn a previously-ignored parameter into a hard 422. - offset = max(page - 1, 0) * limit - return self.request( - "GET", - "/models/alerts", - params=_strip_none({"offset": offset, "limit": limit}), - ) - - def mark_all_model_alerts_read(self) -> None: - """Mark all model alerts as read for the current account.""" - self.request("POST", "/models/alerts/mark-all-read") - - def get_unread_model_alert_count(self) -> JSONValue: - """Get the count of unread model alerts. - - Returns: - Unread alert count. - """ - return self.request("GET", "/models/alerts/unread-count") - - def mark_model_alert_read(self, alert_id: str) -> None: - """Mark a model alert as read. - - Args: - alert_id: Alert identifier. - """ - self.request("PATCH", f"/models/alerts/{alert_id}/read") - - # ── Models ──────────────────────────────────────────────────────────────── - - def get_model_recommendations(self, model_id: str) -> JSONValue: - """Get recommendations for a model. - - Args: - model_id: Model identifier. - - Returns: - Model recommendations. - """ - return self.request("GET", f"/models/{model_id}/recommendations") - - def list_models( - self, - *, - provider: str | None = None, - supports_tool_use: bool | None = None, - supports_thinking: bool | None = None, - ) -> JSONValue: - """List all enabled LLM models grouped by provider. - - Args: - provider: Filter by provider name. - supports_tool_use: Filter to models that support tool use. - supports_thinking: Filter to models that support extended thinking. - - Returns: - List of provider groups with their models. - """ - return self.request( - "GET", - "/models", - params=_strip_none( - { - "provider": provider, - "supports_tool_use": supports_tool_use, - "supports_thinking": supports_thinking, - } - ), - ) - - def get_model(self, model_id: str) -> JSONValue: - """Get full details for a specific model. - - Args: - model_id: Model identifier. - - Returns: - Model details including capabilities, pricing, and lifecycle status. - """ - return self.request("GET", f"/models/{model_id}/details") - - def get_generation_tiers(self) -> dict[str, Any]: - """List the media-generation quality tiers and what each resolves to. - - Returns: - Each ``(modality, tier)`` mapped to its generator, credits, and price - label — under ``tiers`` by default, and under ``data`` with - ``pagination`` once the client opts in with - ``api_version="2026-07-27"`` or later. Read either with - :func:`unwrap_items`:: - - items = unwrap_items(client.get_generation_tiers(), "tiers") - """ - return cast(dict[str, Any], self.request("GET", "/models/generation-tiers")) - - # ── Model Playground Experiments ────────────────────────────────────────── - - def list_experiments( - self, - *, - days: int | None = None, - start_date: str | None = None, - end_date: str | None = None, - limit: int | None = None, - offset: int | None = None, - ) -> JSONValue: - """List model playground experiments. - - Args: - days: Look-back window in days (1-730, default 30). - start_date: Start date filter (YYYY-MM-DD). - end_date: End date filter (YYYY-MM-DD). - limit: Maximum number of results. - offset: Pagination offset. - - Returns: - The experiments, under ``experiments`` alongside ``total`` by default, - and under ``data`` with ``pagination`` once the client opts in with - ``api_version="2026-07-27"`` or later. Read either with - :func:`unwrap_items`:: - - items = unwrap_items(client.list_experiments(), "experiments") - """ - return self.request( - "GET", - "/models/playground/experiments", - params=_strip_none( - { - "days": days, - "start_date": start_date, - "end_date": end_date, - "limit": limit, - "offset": offset, - } - ), - ) - - def create_experiment(self, body: dict[str, Any]) -> JSONValue: - """Create a model playground experiment. - - Args: - body: Experiment configuration including prompt, model_ids, etc. - - Returns: - Created experiment details. - """ - return self.request("POST", "/models/playground/experiments", json=body) - - def get_experiment(self, experiment_id: str) -> JSONValue: - """Get a model playground experiment by ID. - - Args: - experiment_id: Experiment identifier. - - Returns: - Experiment details. - """ - return self.request("GET", f"/models/playground/experiments/{experiment_id}") - - def cancel_experiment(self, experiment_id: str) -> JSONValue: - """Cancel a running model playground experiment. - - Args: - experiment_id: Experiment identifier. - - Returns: - Cancellation confirmation. - """ - return self.request( - "POST", f"/models/playground/experiments/{experiment_id}/cancel" - ) - - def delete_experiment(self, experiment_id: str) -> None: - """Soft-delete a model playground experiment. - - Removes the experiment from list/detail views while preserving audit - history. - - Args: - experiment_id: Experiment identifier. - """ - self.request("DELETE", f"/models/playground/experiments/{experiment_id}") - - # ── Search ──────────────────────────────────────────────────────────────── - - def search( - self, - *, - query: str, - limit: int = 10, - entity_type: str | None = None, - ) -> JSONValue: - """Search across the Seclai platform. - - Args: - query: Search query string. - limit: Maximum results to return. - entity_type: Optional entity type filter. - - Returns: - Search results. - """ - return self.request( - "GET", - "/search", - params=_strip_none( - {"q": query, "limit": limit, "entity_type": entity_type} - ), - ) - - # ── Email Domains ───────────────────────────────────────────────────────────── - - def list_email_domains(self) -> dict[str, Any]: - """List the account's agent-email domains and plan capabilities. - - Returns: - Domains with verification status and required DNS records. - - """ - return cast(dict[str, Any], self.request("GET", "/email-domains")) - - def add_email_domain(self, body: dict[str, Any]) -> dict[str, Any]: - """Add and provision a vanity or custom agent-email domain. - - Args: - body: ``kind`` (``vanity``/``custom``) and ``value``; optional - ``delegated`` (default false) to let Seclai manage the zone. - - Returns: - The new domain, including the DNS records to publish. - - """ - return cast(dict[str, Any], self.request("POST", "/email-domains", json=body)) - - def remove_email_domain(self, domain_id: str) -> dict[str, Any]: - """Remove a domain and tear down its SES identity and DNS. - - Args: - domain_id: Domain identifier. - - Returns: - ``removed``, plus a ``cleanup_note`` when the domain was Seclai-managed. - - """ - return cast( - dict[str, Any], - self.request("DELETE", f"/email-domains/{domain_id}"), - ) - - def verify_email_domain(self, domain_id: str) -> dict[str, Any]: - """Re-poll SES and DNS for this domain now ('Check now'). - - Args: - domain_id: Domain identifier. - - Returns: - The updated status and DNS-record check results. - - """ - return cast( - dict[str, Any], - self.request("POST", f"/email-domains/{domain_id}/verify"), - ) - - def set_primary_email_domain(self, domain_id: str) -> dict[str, Any]: - """Promote a verified domain to the account's primary domain. - - Args: - domain_id: Domain identifier; must already be verified. - - Returns: - The updated domain. - - """ - return cast( - dict[str, Any], - self.request("POST", f"/email-domains/{domain_id}/primary"), - ) - - def use_shared_email_domain(self) -> None: - """Revert to the shared ``agent.seclai.com`` sending/inbound domain.""" - self.request("POST", "/email-domains/use-shared-domain") - - def send_email_domain_test_email(self, domain_id: str) -> dict[str, Any]: - """Send a test message from a verified domain to the account owner. - - Args: - domain_id: Domain identifier. - - Returns: - Whether the message was sent. - - """ - return cast( - dict[str, Any], - self.request("POST", f"/email-domains/{domain_id}/test-email"), - ) - - def get_dmarc_summary( - self, - domain_id: str, - *, - days: int | None = None, - top_sources: int | None = None, - ) -> dict[str, Any]: - """Get the DMARC aggregate-report summary for a domain. - - Args: - domain_id: Domain identifier. - days: Window length in days (default 30). - top_sources: Number of top failing sources to return (default 10). - - Returns: - Pass rate, disposition breakdown, and top failing source IPs. - - """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/email-domains/{domain_id}/dmarc", - params=_strip_none({"days": days, "top_sources": top_sources}), - ), - ) - - def search_docs( - self, - query: str, - *, - mode: str | None = None, - limit: int | None = None, - ) -> dict[str, Any]: - """Search the Seclai documentation by content. - - Args: - query: Search query (1-200 chars). - mode: ``keyword`` (default; titles and summaries) or ``semantic`` (body). - limit: Maximum results (1-20, default 8). - - Returns: - Matching pages, each with a ``doc_slug`` and optional section ``anchor``. - - """ - return cast( - dict[str, Any], - self.request( - "GET", - "/docs-search", - params=_strip_none({"q": query, "mode": mode, "limit": limit}), - ), - ) - - # ── Top-level AI Assistant ───────────────────────────────────────────────── - - def submit_ai_feedback(self, body: dict[str, Any]) -> dict[str, Any]: - """Submit feedback to the AI assistant. - - Args: - body: Feedback payload. - - Returns: - Feedback response. - """ - return cast( - dict[str, Any], self.request("POST", "/ai-assistant/feedback", json=body) - ) - - def ai_assistant_knowledge_base(self, body: dict[str, Any]) -> dict[str, Any]: - """Generate a knowledge base plan via the top-level AI assistant. - - Args: - body: Prompt and context. - - Returns: - Generated plan. - """ - return cast( - dict[str, Any], - self.request( - "POST", - "/ai-assistant/knowledge-base", - json=body, - ), - ) - - def ai_assistant_source(self, body: dict[str, Any]) -> dict[str, Any]: - """Generate a source plan via the top-level AI assistant. - - Args: - body: Prompt and context. - - Returns: - Generated plan. - """ - return cast( - dict[str, Any], - self.request( - "POST", - "/ai-assistant/source", - json=body, - ), - ) - - def ai_assistant_solution(self, body: dict[str, Any]) -> dict[str, Any]: - """Generate a solution plan via the top-level AI assistant. - - Args: - body: Prompt and context. - - Returns: - Generated plan. - """ - return cast( - dict[str, Any], - self.request( - "POST", - "/ai-assistant/solution", - json=body, - ), - ) - - def ai_assistant_memory_bank(self, body: dict[str, Any]) -> dict[str, Any]: - """Generate a memory bank plan via the top-level AI assistant. - - Args: - body: Prompt and context. - - Returns: - Generated plan. - """ - return cast( - dict[str, Any], - self.request( - "POST", - "/ai-assistant/memory-bank", - json=body, - ), - ) - - def get_ai_assistant_memory_bank_history(self) -> dict[str, Any]: - """Get the last AI assistant memory bank conversation. - - Returns: - Last conversation. - """ - return cast( - dict[str, Any], - self.request( - "GET", - "/ai-assistant/memory-bank/last-conversation", - ), - ) - - def accept_ai_assistant_plan( - self, conversation_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Accept a top-level AI assistant plan. - - Args: - conversation_id: Conversation identifier. - body: Acceptance payload. - - Returns: - Result of applying the plan. - """ - return cast( - dict[str, Any], - self.request( - "POST", - f"/ai-assistant/{conversation_id}/accept", - json=body, - ), - ) - - def decline_ai_assistant_plan(self, conversation_id: str) -> None: - """Decline a top-level AI assistant plan. - - Args: - conversation_id: Conversation identifier. - """ - self.request("POST", f"/ai-assistant/{conversation_id}/decline") - - def accept_ai_memory_bank_suggestion( - self, conversation_id: str, body: dict[str, Any] - ) -> JSONValue: - """Accept a top-level AI memory bank suggestion. - - Args: - conversation_id: Conversation identifier. - body: Acceptance payload. - - Returns: - Acceptance result. - """ - return self.request( - "PATCH", - f"/ai-assistant/memory-bank/{conversation_id}", - json=body, - ) - - # ── Pagination helper ───────────────────────────────────────────────────── - - def paginate( - self, - method: str, - path: str, - *, - params: dict[str, Any] | None = None, - limit: int = 50, - items_key: str = "data", - ) -> Generator[dict[str, Any]]: - """Auto-paginate a list endpoint. - - Yields individual items from each page. - Stops when a page returns fewer items than ``limit`` or the items list is empty. - - Args: - method: HTTP method (typically ``"GET"``). - path: API path. - params: Extra query parameters (``page`` and ``limit`` are managed automatically). - limit: Items per page. - items_key: JSON key containing the list of items (default ``"data"``). - - Yields: - Individual item dicts from each page. - """ - page = 1 - base_params = dict(params) if params else {} - while True: - base_params["page"] = page - base_params["limit"] = limit - result = self.request(method, path, params=base_params) - if not isinstance(result, dict): - return - items = result.get(items_key, []) - if not isinstance(items, list): - return - for item in items: - yield cast(dict[str, Any], item) - if len(items) < limit: - return - page += 1 - - # ── High-level Abstractions ─────────────────────────────────────────────── - - def run_agent_and_poll( - self, - agent_id: str, - body: AgentRunRequest, - *, - poll_interval: float = 2.0, - include_step_outputs: bool = False, - ) -> AgentRunResponse: - """Run an agent and poll until it reaches a terminal status. - - Starts the agent run and then repeatedly polls ``get_agent_run`` until - the status is ``"completed"`` or ``"failed"``. - - Args: - agent_id: Agent identifier. - body: Agent run request payload. - poll_interval: Seconds between poll attempts (default 2.0). - include_step_outputs: Include per-step outputs when polling. - - Returns: - The final agent run (completed or failed). - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - run = self.run_agent(agent_id, body) - while run.status not in ("completed", "failed"): - time.sleep(poll_interval) - run = self.get_agent_run( - run.run_id, include_step_outputs=include_step_outputs - ) - return run - - def run_streaming_agent( - self, - agent_id: str, - body: AgentRunStreamRequest, - *, - timeout: float | None = None, - headers: Mapping[str, str] | None = None, - ) -> Generator[tuple[str, dict[str, Any]]]: - """Run an agent via SSE streaming, yielding events as they arrive. - - This is a generator that yields ``(event_type, data)`` tuples for each - SSE event received. Event types include ``"init"`` and ``"done"``. - - Args: - agent_id: Agent identifier. - body: Streaming agent run request payload. - timeout: Max time (seconds) to wait. Defaults to this client's timeout. - headers: Optional extra headers. - - Yields: - Tuples of ``(event_type, parsed_data)`` for each SSE event. - - Raises: - SeclaiAPIStatusError: If the API returns a non-success status code. - SeclaiStreamingError: If an error event is received. - SeclaiError: If the stream times out. - """ - import json as _json - - path = f"/agents/{agent_id}/runs/stream" - merged_headers = _merge_request_headers( - options=self._options, request_headers=headers - ) - merged_headers.setdefault("accept", "text/event-stream") - timeout_seconds = self._options.timeout if timeout is None else timeout - start = time.monotonic() - - try: - with self._client.stream( - "POST", - path, - json=body, - headers=merged_headers, - timeout=timeout_seconds, - ) as response: - _raise_for_status(response) - current_event: str | None = None - data_lines: list[str] = [] - - for line in response.iter_lines(): - if time.monotonic() - start > timeout_seconds: - raise SeclaiError( - f"Timed out after {timeout_seconds}s waiting for streaming agent run." - ) - if line == "": - if current_event and data_lines: - data = "\n".join(data_lines) - try: - parsed = cast(dict[str, Any], _json.loads(data)) - except Exception: - parsed = {"raw": data} - if current_event == "error": - raise SeclaiStreamingError( - parsed.get("message", data), - run_id=parsed.get("run_id"), - ) - yield (current_event, parsed) - current_event = None - data_lines = [] - continue - if line.startswith(":"): - continue - if line.startswith("event:"): - current_event = line[len("event:") :].strip() or None - continue - if line.startswith("data:"): - data_lines.append(line[len("data:") :].lstrip()) - continue - - # Flush any final event - if current_event and data_lines: - data = "\n".join(data_lines) - try: - parsed = cast(dict[str, Any], _json.loads(data)) - except Exception: - parsed = {"raw": data} - if current_event == "error": - raise SeclaiStreamingError( - parsed.get("message", data), - run_id=parsed.get("run_id"), - ) - yield (current_event, parsed) - except httpx.TimeoutException as e: - raise SeclaiError( - f"Timed out after {timeout_seconds}s waiting for streaming agent run." - ) from e - - # ── Upload Helper ───────────────────────────────────────────────────────── - - def _prepare_upload_payload( - self, - file: bytes | str | os.PathLike[str] | BinaryIO, - file_name: str | None, - mime_type: str | None, - ) -> tuple[tuple[str | None, BinaryIO, str | None], BinaryIO | None]: - """Prepare a file for multipart upload. - - Returns: - A ``(file_tuple, created_handle)`` pair. ``created_handle`` must be - closed by the caller when non-``None``. - """ - created: BinaryIO | None = None - if isinstance(file, (str, os.PathLike)): - file_path = Path(file) - resolved_name = file_name or file_path.name - resolved_mime = mime_type or _guess_mime_type(resolved_name) - created = file_path.open("rb") - return (resolved_name, created, resolved_mime), created - if isinstance(file, bytes): - created = BytesIO(file) - resolved_mime = mime_type or _guess_mime_type(file_name) - return (file_name, created, resolved_mime), created - resolved_mime = mime_type or _guess_mime_type(file_name) - return (file_name, file, resolved_mime), None - - -class AsyncSeclai(_SeclaiBase): - """Seclai asynchronous client. - - Most users should prefer the typed convenience methods (e.g. `run_agent`, `list_sources`) - which raise SDK exceptions on failures. - - This client can be used as an async context manager: - - async with AsyncSeclai(api_key="...") as client: - sources = await client.list_sources() - """ - - def __init__( - self, - *, - api_key: str | None = None, - access_token: str | Callable[[], str | Awaitable[str]] | None = None, - timeout: float = 30.0, - api_key_header: str = "x-api-key", - default_headers: Mapping[str, str] | None = None, - http_client: httpx.AsyncClient | None = None, - profile: str | None = None, - config_dir: str | None = None, - auto_refresh: bool = True, - account_id: str | None = None, - api_version: str | None = None, - allow_unknown_api_version: bool = False, - ) -> None: - """Create an asynchronous Seclai client. - - Credentials are resolved via a chain (first match wins): - - 1. Explicit ``api_key`` - 2. Explicit ``access_token`` (static string or provider callable) - 3. ``SECLAI_API_KEY`` environment variable - 4. SSO profile from ``~/.seclai/config`` + cached tokens - - Args: - api_key: API key used for authentication. If omitted, ``SECLAI_API_KEY`` is used. - access_token: Static bearer token string or a callable returning one - (sync or async). Mutually exclusive with ``api_key``. - timeout: Request timeout (seconds). - api_key_header: Header name to use for the API key. - default_headers: Extra headers to include on every request. - http_client: Optional pre-configured ``httpx.AsyncClient`` to use. - profile: SSO profile name from ``~/.seclai/config``. - config_dir: Override the config directory path. - auto_refresh: Auto-refresh expired SSO tokens. Defaults to ``True``. - account_id: Target organization account ID (``X-Account-Id`` header). - api_version: Dated API version (``YYYY-MM-DD``) sent as the - ``Seclai-Version`` header, opting into backward-incompatible - changes released on or before that date. Omitted by default, - so upgrading the SDK alone never changes response shapes. - - Raises: - SeclaiConfigurationError: If no credentials are found. - """ - super().__init__( - api_key=api_key, - access_token=access_token, - timeout=timeout, - api_key_header=api_key_header, - default_headers=default_headers, - profile=profile, - config_dir=config_dir, - auto_refresh=auto_refresh, - account_id=account_id, - api_version=api_version, - allow_unknown_api_version=allow_unknown_api_version, - ) - self._client = http_client or httpx.AsyncClient( - base_url=SECLAI_API_URL, - timeout=self._options.timeout, - headers=self._default_headers(), - ) - self._owns_client = http_client is None - - async def aclose(self) -> None: - """Close underlying HTTP resources owned by this client. - - If you created the client with a custom ``http_client``, this is a no-op - for that client (you remain responsible for closing it). - """ - if self._owns_client: - await self._client.aclose() - if self._owns_generated_client and self._generated_client_instance is not None: - await self._generated_client_instance.get_async_httpx_client().aclose() - - async def __aenter__(self) -> Self: - """Enter an async context manager and return self.""" - return self - - async def __aexit__(self, exc_type: object, exc: object, tb: object) -> None: - """Exit the async context manager and close resources. - - Args: - exc_type: Exception type (if any). - exc: Exception instance (if any). - tb: Traceback (if any). - """ - await self.aclose() - - async def request( - self, - method: str, - path: str, - *, - params: Mapping[str, Any] | None = None, - json: JSONValue | None = None, - headers: Mapping[str, str] | None = None, - ) -> JSONValue | str | None: - """Make a raw HTTP request to the Seclai API. - - This is a low-level escape hatch. For most operations, prefer the typed - convenience methods on this client. - - Args: - method: HTTP method (e.g. `"GET"`, `"POST"`). - path: Request path relative to `SECLAI_API_URL` (e.g. `"/sources/"`). - params: Query parameters. - json: JSON body to send. - headers: Per-request header overrides. - - Returns: - Parsed JSON for JSON responses, raw text for non-JSON responses, or `None` for empty bodies. - - Raises: - SeclaiAPIStatusError: If the response status code is not successful. - """ - response = await self._client.request( - method, - path, - params=params, - json=json, - headers=await _merge_request_headers_async( - options=self._options, request_headers=headers - ), - ) - _raise_for_status(response) - if not response.content: - return None - content_type = response.headers.get("content-type", "") - if "application/json" in content_type: - return cast(JSONValue, response.json()) - return response.text - - async def run_agent(self, agent_id: str, body: AgentRunRequest) -> AgentRunResponse: - """Run an agent. - - Starts a new agent run for the given agent and returns the run record. - - Args: - agent_id: Agent identifier. - body: Agent run request payload. - - Returns: - The created agent run. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - from seclai._generated.api.agents.run_agent_api_agents_agent_id_runs_post import ( - asyncio_detailed, - ) - - path = f"/agents/{agent_id}/runs" - response = await asyncio_detailed( - agent_id=agent_id, client=(await self._async_generated_client()), body=body - ) - self._raise_for_openapi_response( - method="POST", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="POST", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="POST", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - # ``parsed`` can only be the success model here: _raise_for_openapi_response - # already raised for any non-200 status, including the 402 - # InsufficientCreditsResponse envelope. - return cast(AgentRunResponse, parsed) - - async def run_streaming_agent_and_wait( - self, - agent_id: str, - body: AgentRunStreamRequest, - *, - timeout: float | None = None, - headers: Mapping[str, str] | None = None, - ) -> AgentRunResponse: - """Run an agent via SSE streaming and block until completion (async). - - This uses POST /agents/{agent_id}/runs/stream and consumes Server-Sent Events (SSE). - The method returns when an `event: done` message is received. - """ - import json as _json - import time as _time - - path = f"/agents/{agent_id}/runs/stream" - - merged_headers = await _merge_request_headers_async( - options=self._options, request_headers=headers - ) - merged_headers.setdefault("accept", "text/event-stream") - - timeout_seconds = self._options.timeout if timeout is None else timeout - start = _time.monotonic() - - try: - async with self._client.stream( - "POST", - path, - json=body, - headers=merged_headers, - timeout=timeout_seconds, - ) as response: - if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: - payload = response.json() - raise SeclaiAPIValidationError( - message=f"Request failed with status {response.status_code}", - status_code=int(response.status_code), - method="POST", - url=self._build_url(path), - response_text=response.text, - validation_error=HTTPValidationError.from_dict(payload), - ) - _raise_for_status(response) - - current_event: str | None = None - data_lines: list[str] = [] - last_seen: AgentRunResponse | None = None - - def dispatch() -> AgentRunResponse | None: - nonlocal current_event, data_lines, last_seen - if current_event is None and not data_lines: - return None - data = "\n".join(data_lines) - evt = current_event - current_event = None - data_lines = [] - if not data: - return None - if evt not in {"init", "done"}: - return None - try: - parsed_dict = cast(dict[str, Any], _json.loads(data)) - parsed = AgentRunResponse.from_dict(parsed_dict) - last_seen = parsed - if evt == "done": - return parsed - except Exception: - return None - return None - - async for line in response.aiter_lines(): - if _time.monotonic() - start > timeout_seconds: - raise SeclaiError( - f"Timed out after {timeout_seconds}s waiting for streaming agent run to complete." - ) - - if line == "": - done = dispatch() - if done is not None: - return done - continue - if line.startswith(":"): - continue - if line.startswith("event:"): - current_event = line[len("event:") :].strip() or None - continue - if line.startswith("data:"): - data_lines.append(line[len("data:") :].lstrip()) - continue - - done = dispatch() - if done is not None: - return done - if last_seen is not None: - return last_seen - raise SeclaiError("Stream ended before receiving a 'done' event.") - except httpx.TimeoutException as e: - raise SeclaiError( - f"Timed out after {timeout_seconds}s waiting for streaming agent run to complete." - ) from e - - async def list_agent_runs( - self, agent_id: str, *, page: int = 1, limit: int = 50 - ) -> AgentRunListResponse: - """List agent runs. - - Returns paginated runs for a single agent. - - Args: - agent_id: Agent identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - A paginated list of runs. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - from seclai._generated.api.agents.list_agent_runs_api_agents_agent_id_runs_get import ( - asyncio_detailed, - ) - - path = f"/agents/{agent_id}/runs" - response = await asyncio_detailed( - agent_id=agent_id, - client=(await self._async_generated_client()), - page=page, - limit=limit, - ) - self._raise_for_openapi_response( - method="GET", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - return parsed - - @overload - async def get_agent_run( - self, run_id: str, /, *, include_step_outputs: bool = False - ) -> AgentRunResponse: ... - - @overload - async def get_agent_run( - self, agent_id: str, run_id: str, /, *, include_step_outputs: bool = False - ) -> AgentRunResponse: ... - - async def get_agent_run( - self, *args: str, include_step_outputs: bool = False - ) -> AgentRunResponse: - """Get details of a specific agent run. - - Fetches the current state and details for a previously created run. - - Args: - run_id: Run identifier. - agent_id: Deprecated. Ignored if provided; maintained for backwards compatibility. - include_step_outputs: If true, include per-step outputs with timing, - durations, and credits. Defaults to False. - - Returns: - Agent run details. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - if len(args) == 1: - run_id = args[0] - elif len(args) == 2: - # Backwards compatible: get_agent_run(agent_id, run_id) - run_id = args[1] - else: - raise TypeError("get_agent_run expects (run_id) or (agent_id, run_id)") - - from seclai._generated.api.agents.get_agent_run_api_agents_runs_run_id_get import ( - asyncio_detailed, - ) - - path = f"/agents/runs/{run_id}" - response = await asyncio_detailed( - run_id=run_id, - client=(await self._async_generated_client()), - include_step_outputs=include_step_outputs, - ) - self._raise_for_openapi_response( - method="GET", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - return parsed - - @overload - async def delete_agent_run(self, run_id: str, /) -> AgentRunResponse: ... - - @overload - async def delete_agent_run( - self, agent_id: str, run_id: str, / - ) -> AgentRunResponse: ... - - async def delete_agent_run(self, *args: str) -> AgentRunResponse: - """Cancel an agent run. - - Requests cancellation of a run and returns the updated run record. - - Args: - run_id: Run identifier. - agent_id: Deprecated. Ignored if provided; maintained for backwards compatibility. - - Returns: - The updated agent run. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - if len(args) == 1: - run_id = args[0] - elif len(args) == 2: - # Backwards compatible: delete_agent_run(agent_id, run_id) - run_id = args[1] - else: - raise TypeError("delete_agent_run expects (run_id) or (agent_id, run_id)") - - from seclai._generated.api.agents.delete_agent_run_api_agents_runs_run_id_delete import ( - asyncio_detailed, - ) - - path = f"/agents/runs/{run_id}" - response = await asyncio_detailed( - run_id=run_id, - client=(await self._async_generated_client()), - ) - self._raise_for_openapi_response( - method="DELETE", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="DELETE", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="DELETE", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - return parsed - - async def get_content_detail( - self, - source_connection_content_version: str, - *, - start: int = 0, - end: int = 5000, - ) -> ContentDetailResponse: - """Get content detail. - - Fetches a slice of a content version (use `start`/`end` to page through large content). - - Args: - source_connection_content_version: Content version identifier. - start: Start offset for returned content detail. - end: End offset for returned content detail. - - Returns: - Content details for the requested range. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - from seclai._generated.api.contents.get_content_detail_api_contents_source_connection_content_version_get import ( - asyncio_detailed, - ) - - path = f"/contents/{source_connection_content_version}" - response = await asyncio_detailed( - source_connection_content_version=source_connection_content_version, - client=(await self._async_generated_client()), - start=start, - end=end, - ) - self._raise_for_openapi_response( - method="GET", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - return parsed - - async def delete_content(self, source_connection_content_version: str) -> None: - """Delete a specific content version. - - Permanently removes a content version identified by `source_connection_content_version`. - - Args: - source_connection_content_version: Content version identifier. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - from seclai._generated.api.contents.delete_content_api_contents_source_connection_content_version_delete import ( - asyncio_detailed, - ) - - path = f"/contents/{source_connection_content_version}" - response = await asyncio_detailed( - source_connection_content_version=source_connection_content_version, - client=(await self._async_generated_client()), - ) - self._raise_for_openapi_response( - method="DELETE", - path=path, - response=response, - ok_statuses={HTTPStatus.NO_CONTENT}, - ) - return None - - async def list_content_embeddings( - self, - source_connection_content_version: str, - *, - page: int = 1, - limit: int = 20, - ) -> ContentEmbeddingsListResponse: - """List embeddings for a content version. - - Returns paginated embeddings that were computed for the given content version. - - Args: - source_connection_content_version: Content version identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - A paginated list of embeddings. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - from seclai._generated.api.contents.list_content_embeddings_api_contents_source_connection_content_version_embeddings_get import ( - asyncio_detailed, - ) - - path = f"/contents/{source_connection_content_version}/embeddings" - response = await asyncio_detailed( - source_connection_content_version=source_connection_content_version, - client=(await self._async_generated_client()), - page=page, - limit=limit, - ) - self._raise_for_openapi_response( - method="GET", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - return parsed - - async def list_sources( - self, - *, - page: int = 1, - limit: int = 20, - sort: str = "created_at", - order: str = "desc", - account_id: str | None = None, - ) -> SourceListResponse: - """List sources. - - Returns the sources visible to your account (optionally filtered by `account_id`). - - Args: - page: Page number (1-indexed). - limit: Items per page. - sort: Sort field. - order: Sort order (e.g. `"asc"` or `"desc"`). - account_id: Optional account id; defaults to the API key's account. - - Returns: - A paginated list of sources. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - from seclai._generated.api.sources.list_sources_api_sources_get import ( - asyncio_detailed, - ) - - path = "/sources" - response = await asyncio_detailed( - client=(await self._async_generated_client()), - page=page, - limit=limit, - sort=sort, - order=order, - account_id=account_id, - ) - self._raise_for_openapi_response( - method="GET", - path=path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="GET", - url=self._build_url(path), - response_text=None, - validation_error=parsed, - ) - return parsed - - async def upload_file_to_source( - self, - source_connection_id: str, - *, - file: bytes | str | os.PathLike[str] | BinaryIO, - title: str | None = None, - metadata: Mapping[str, Any] | None = None, - file_name: str | None = None, - mime_type: str | None = None, - ) -> FileUploadResponse: - """Upload a file to a specific source connection. - - Sends a file to be ingested under the given source connection. - - Maximum file size: 200 MiB. - - Supported MIME types: - - `application/epub+zip` - - `application/json` - - `application/msword` - - `application/pdf` - - `application/vnd.ms-excel` - - `application/vnd.ms-outlook` - - `application/vnd.ms-powerpoint` - - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - - `application/xml` - - `application/zip` - - `audio/flac` - - `audio/mp4` - - `audio/mpeg` - - `audio/ogg` - - `audio/wav` - - `image/bmp` - - `image/gif` - - `image/jpeg` - - `image/png` - - `image/tiff` - - `image/webp` - - `text/csv` - - `text/html` - - `text/markdown` / `text/x-markdown` - - `text/plain` - - `text/xml` - - `video/mp4` - - `video/quicktime` - - `video/x-msvideo` - - If `mime_type` is omitted and a filename is available, the SDK tries to infer it. - If the upload is sent as `application/octet-stream`, the server attempts to infer - the type from the file extension. - - Notes: - - If `file` is a path or `bytes`, this method creates an in-memory/file handle and - closes it before returning. - - If `file` is a file-like object, the caller owns its lifecycle. - - Args: - source_connection_id: Source connection identifier. - file: File payload. Accepts raw bytes, a filesystem path, or a binary file-like. - title: Optional title for the uploaded file. - metadata: Optional metadata dictionary to associate with the uploaded content. - file_name: Optional filename to send when `file` is bytes or a file-like. - mime_type: Optional MIME type to send. - - Returns: - Upload response details. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - import json as _json - - from seclai._generated.models.body_upload_file_to_source_api_sources_source_connection_id_upload_post import ( - BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost, - ) - from seclai._generated.types import UNSET, File - - created_payload: BinaryIO | None = None - try: - upload_file: File - if isinstance(file, File): - upload_file = file - elif isinstance(file, (str, os.PathLike)): - file_path = Path(file) - resolved_file_name = file_name or file_path.name - resolved_mime_type = mime_type or _guess_mime_type(resolved_file_name) - created_payload = file_path.open("rb") - upload_file = File( - payload=created_payload, - file_name=resolved_file_name, - mime_type=resolved_mime_type, - ) - elif isinstance(file, bytes): - created_payload = BytesIO(file) - resolved_mime_type = mime_type or _guess_mime_type(file_name) - upload_file = File( - payload=created_payload, - file_name=file_name, - mime_type=resolved_mime_type, - ) - else: - resolved_mime_type = mime_type or _guess_mime_type(file_name) - upload_file = File( - payload=file, - file_name=file_name, - mime_type=resolved_mime_type, - ) - - body = BodyUploadFileToSourceApiSourcesSourceConnectionIdUploadPost( - file=upload_file, - title=UNSET if title is None else title, - ) - - if metadata is not None: - body["metadata"] = _json.dumps(metadata) - - endpoint_path = f"/sources/{source_connection_id}/upload" - - http = (await self._async_generated_client()).get_async_httpx_client() - raw = await http.request( - "POST", - endpoint_path, - files=body.to_multipart(), - ) - - parsed: FileUploadResponse | HTTPValidationError | None = None - if raw.status_code == 200: - payload = cast(dict[str, Any], raw.json()) - parsed = FileUploadResponse.from_dict(payload) - elif raw.status_code == 422: - payload = cast(dict[str, Any], raw.json()) - parsed = HTTPValidationError.from_dict(payload) - - response = OpenAPIResponse( - status_code=HTTPStatus(raw.status_code), - content=raw.content, - headers=raw.headers, - parsed=parsed, - ) - self._raise_for_openapi_response( - method="POST", - path=endpoint_path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="POST", - url=self._build_url(endpoint_path), - response_text=None, - ) - parsed_response = cast( - FileUploadResponse | HTTPValidationError, response.parsed - ) - if isinstance(parsed_response, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="POST", - url=self._build_url(endpoint_path), - response_text=None, - validation_error=parsed_response, - ) - if not isinstance(parsed_response, FileUploadResponse): - raise SeclaiAPIStatusError( - message="Unexpected response shape", - status_code=int(response.status_code), - method="POST", - url=self._build_url(endpoint_path), - response_text=None, - ) - return parsed_response - finally: - if created_payload is not None: - created_payload.close() - - async def upload_file_to_content( - self, - source_connection_content_version: str, - *, - file: bytes | str | os.PathLike[str] | BinaryIO, - title: str | None = None, - metadata: Mapping[str, Any] | None = None, - file_name: str | None = None, - mime_type: str | None = None, - ) -> FileUploadResponse: - """Replace an existing content version with a new file upload. - - This uploads a new file to `/contents/{source_connection_content_version}/upload` and replaces - the content backing that existing content version. - - Args: - source_connection_content_version: Source connection content version identifier. - file: File payload. Accepts raw bytes, a filesystem path, or a binary file-like. - title: Optional title for the uploaded file. - metadata: Optional metadata dictionary to associate with the uploaded content. - file_name: Optional filename to send when `file` is bytes or a file-like. - mime_type: Optional MIME type to send. - - Returns: - Upload response details. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - import json as _json - - from seclai._generated.api.contents.upload_file_to_content_api_contents_source_connection_content_version_upload_post import ( - asyncio_detailed, - ) - from seclai._generated.models.body_upload_file_to_content_api_contents_source_connection_content_version_upload_post import ( - BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost, - ) - from seclai._generated.types import UNSET, File - - created_payload: BinaryIO | None = None - try: - upload_file: File - if isinstance(file, File): - upload_file = file - elif isinstance(file, (str, os.PathLike)): - file_path = Path(file) - resolved_file_name = file_name or file_path.name - resolved_mime_type = mime_type or _guess_mime_type(resolved_file_name) - created_payload = file_path.open("rb") - upload_file = File( - payload=created_payload, - file_name=resolved_file_name, - mime_type=resolved_mime_type, - ) - elif isinstance(file, bytes): - created_payload = BytesIO(file) - resolved_mime_type = mime_type or _guess_mime_type(file_name) - upload_file = File( - payload=created_payload, - file_name=file_name, - mime_type=resolved_mime_type, - ) - else: - resolved_mime_type = mime_type or _guess_mime_type(file_name) - upload_file = File( - payload=file, - file_name=file_name, - mime_type=resolved_mime_type, - ) - - body = BodyUploadFileToContentApiContentsSourceConnectionContentVersionUploadPost( - file=upload_file, - title=UNSET if title is None else title, - metadata=UNSET if metadata is None else _json.dumps(metadata), - ) - endpoint_path = f"/contents/{source_connection_content_version}/upload" - response = await asyncio_detailed( - source_connection_content_version=source_connection_content_version, - client=(await self._async_generated_client()), - body=body, - ) - self._raise_for_openapi_response( - method="POST", - path=endpoint_path, - response=response, - ok_statuses={HTTPStatus.OK}, - ) - if response.parsed is None: - raise SeclaiAPIStatusError( - message="Empty response", - status_code=int(response.status_code), - method="POST", - url=self._build_url(endpoint_path), - response_text=None, - ) - parsed = response.parsed - if isinstance(parsed, HTTPValidationError): - raise SeclaiAPIValidationError( - message="Validation error", - status_code=int(response.status_code), - method="POST", - url=self._build_url(endpoint_path), - response_text=None, - validation_error=parsed, - ) - return parsed - finally: - if created_payload is not None: - created_payload.close() - - # ── Identity ────────────────────────────────────────────────────────────────── - - async def get_me(self) -> dict[str, Any]: - """Get the authenticated user's identity. - - Returns: - The caller's personal ``account_id`` and the organizations they belong to. - - """ - return cast(dict[str, Any], await self.request("GET", "/me")) - - # ── API Version ─────────────────────────────────────────────────────────── - - async def get_api_version(self) -> dict[str, Any]: - """Get the API version this request resolved to, and the versions available. - - Returns: - ``pinned_version`` (the account's sticky pin, or ``None``), - ``effective_version`` for THIS request, plus ``default_version``, - ``latest_version`` and ``known_versions``. Resolution order is the - ``Seclai-Version`` header, then the account pin, then the default, so - ``effective_version`` reflects the client's ``api_version`` when set. - """ - return cast(dict[str, Any], await self.request("GET", "/version")) - - async def update_api_version(self, version: str | None) -> dict[str, Any]: - """Pin the account to a dated API version, or clear the pin. - - Owner/admin only. - - Args: - version: A ``YYYY-MM-DD`` date to pin to, or ``None`` to clear the pin - and revert to the default baseline. - - Returns: - The updated version state. ``effective_version`` describes this - request, not the pin just written — a ``Seclai-Version`` header still - overrides the pin. - - Raises: - SeclaiConfigurationError: If ``version`` is one this release was not - built against. The pin is account-wide and sticky, so an unknown - version here would silently reshape responses for every - header-less caller on the account, not just this client — a wider - blast radius than the ``api_version`` option the constructor - already guards. Pass ``allow_unknown_api_version=True`` to the - client to override. - """ - try: - validate_api_version( - version, allow_unknown=self._options.allow_unknown_api_version - ) - except ValueError as e: - raise SeclaiConfigurationError(str(e)) from e - return cast( - dict[str, Any], - await self.request("PUT", "/version", json={"version": version}), - ) - - # ── Agents ──────────────────────────────────────────────────────────────── - - async def list_agents(self, *, page: int = 1, limit: int = 50) -> dict[str, Any]: - """List all agents. - - Args: - page: Page number (1-indexed). - limit: Items per page. - - Returns: - Paginated list of agents. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - "/agents", - params=_strip_none({"page": page, "limit": limit}), - ), - ) - - async def create_agent(self, body: dict[str, Any]) -> dict[str, Any]: - """Create a new agent. - - Args: - body: Agent creation payload (name, description, etc.). - - Returns: - The created agent. - """ - return cast(dict[str, Any], await self.request("POST", "/agents", json=body)) - - async def get_agent(self, agent_id: str) -> dict[str, Any]: - """Get an agent by ID. - - Args: - agent_id: Agent identifier. - - Returns: - Agent details. - """ - return cast(dict[str, Any], await self.request("GET", f"/agents/{agent_id}")) - - async def update_agent(self, agent_id: str, body: dict[str, Any]) -> dict[str, Any]: - """Update an agent. - - Args: - agent_id: Agent identifier. - body: Fields to update. - - Returns: - The updated agent. - """ - return cast( - dict[str, Any], await self.request("PUT", f"/agents/{agent_id}", json=body) - ) - - async def delete_agent(self, agent_id: str) -> None: - """Delete an agent. - - Args: - agent_id: Agent identifier. - """ - await self.request("DELETE", f"/agents/{agent_id}") - - async def disable_agent(self, agent_id: str) -> dict[str, Any]: - """Pause (disable) an agent so it stops firing from every trigger path. - - Args: - agent_id: Agent identifier. - - Returns: - The updated agent summary. - - """ - return cast( - dict[str, Any], - await self.request("POST", f"/agents/{agent_id}/disable"), - ) - - async def enable_agent(self, agent_id: str) -> dict[str, Any]: - """Resume (enable) a paused agent. - - Args: - agent_id: Agent identifier. - - Returns: - The updated agent summary. - - """ - return cast( - dict[str, Any], - await self.request("POST", f"/agents/{agent_id}/enable"), - ) - - async def get_agent_callers(self, agent_id: str) -> list[dict[str, Any]]: - """List the live agents that call this agent via a ``call_agent`` step. - - Args: - agent_id: Agent identifier. - - Returns: - The calling agents; each must be disabled before this agent can be paused. - - """ - return cast( - list[dict[str, Any]], - await self.request("GET", f"/agents/{agent_id}/callers"), - ) - - # ── Agent Export ────────────────────────────────────────────────────────── - - async def export_agent( - self, agent_id: str, *, download: bool = True - ) -> dict[str, Any]: - """Export an agent definition as a portable JSON snapshot. - - Args: - agent_id: Agent identifier. - download: When True (default), the server sets Content-Disposition: attachment. - - Returns: - The exported agent snapshot. - """ - params = _strip_none({"download": download}) - return cast( - dict[str, Any], - await self.request("GET", f"/agents/{agent_id}/export", params=params), - ) - - async def preview_import_agent(self, body: dict[str, Any]) -> dict[str, Any]: - """Validate an ``agent_definition`` payload without creating an agent. - - Use before :meth:`create_agent` or :meth:`update_agent` with an - ``agent_definition`` to surface ``unresolved_refs`` — workflow - references to knowledge bases, memory banks, source connections, or - sub-agents that don't exist in the target account. Pass the returned - ids back in ``entity_remap`` on the commit call to substitute them. - - Args: - body: ``{"agent_definition": ...}`` — same shape produced by - :meth:`export_agent`. - - Returns: - Summary with step/schedule/alert/criteria/policy counts and any - ``unresolved_refs``. - - Raises: - SeclaiAPIStatusError: For any non-success response, including - HTTP 422 when the ``agent_definition`` fails validation. - On 422 the response body (available as - ``SeclaiAPIStatusError.response_text``) is an - ``AgentDefinitionImportErrorResponse`` listing each field - error with a 1-indexed line/column anchored to the canonical - ``source`` echo. - """ - return cast( - dict[str, Any], - await self.request("POST", "/agents/preview-import", json=body), - ) - - # ── Agent Definitions ───────────────────────────────────────────────────── - - async def get_agent_definition(self, agent_id: str) -> dict[str, Any]: - """Get the step definition for an agent. - - Args: - agent_id: Agent identifier. - - Returns: - The agent's step definition. - """ - return cast( - dict[str, Any], await self.request("GET", f"/agents/{agent_id}/definition") - ) - - async def update_agent_definition( - self, agent_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Update the step definition for an agent. - - Args: - agent_id: Agent identifier. - body: New definition payload (must include ``change_id`` for optimistic locking). - - Returns: - The updated agent definition. - """ - return cast( - dict[str, Any], - await self.request( - "PUT", - f"/agents/{agent_id}/definition", - json=body, - ), - ) - - # ── Agent Runs (additional) ─────────────────────────────────────────────── - - async def search_agent_runs(self, body: dict[str, Any]) -> dict[str, Any]: - """Search agent runs across agents. - - Args: - body: Search request with query filters. - - Returns: - Search results with matching runs. - """ - return cast( - dict[str, Any], await self.request("POST", "/agents/runs/search", json=body) - ) - - async def cancel_agent_run(self, run_id: str) -> dict[str, Any]: - """Cancel an in-progress agent run. - - Cancellation is ``DELETE`` on the run resource — the API exposes no - ``POST .../cancel`` route, and no operation that deletes a run. - Rejected when the run has already reached a terminal state. - - Hits the same endpoint as :meth:`delete_agent_run`, but through - :meth:`request` rather than the generated client, so a caller-supplied - ``http_client`` applies. Both now surface a 422 as - :class:`SeclaiAPIValidationError`. - - Args: - run_id: Run identifier. - - Returns: - The updated agent run, as a plain dict. - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - return cast( - dict[str, Any], await self.request("DELETE", f"/agents/runs/{run_id}") - ) - - # ── Agent Input Uploads ─────────────────────────────────────────────────── - - async def upload_agent_input( - self, - agent_id: str, - *, - file: bytes | str | os.PathLike[str] | BinaryIO, - file_name: str | None = None, - mime_type: str | None = None, - ) -> dict[str, Any]: - """Upload a file as input for an agent run. - - Args: - agent_id: Agent identifier. - file: File payload (bytes, path, or file-like). - file_name: Filename to send. - mime_type: MIME type of the file. - - Returns: - Upload response with the input upload ID. - """ - payload, created = Seclai._prepare_upload_payload( - self, # type: ignore[arg-type] # reuse sync helper from async context - file, - file_name, - mime_type, - ) - try: - response = await self._client.post( - f"/agents/{agent_id}/upload-input", - files={"file": payload}, - headers=await _merge_request_headers_async( - options=self._options, request_headers=None - ), - ) - _raise_for_status(response) - return cast(dict[str, Any], response.json()) - finally: - if created is not None: - created.close() - - async def get_agent_input_upload_status( - self, agent_id: str, upload_id: str - ) -> dict[str, Any]: - """Get the status of an agent input upload. - - Args: - agent_id: Agent identifier. - upload_id: Upload identifier. - - Returns: - Upload status details. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/agents/{agent_id}/input-uploads/{upload_id}", - ), - ) - - async def get_agent_attachment_references(self, agent_id: str) -> dict[str, Any]: - """Get the static attachment-reference contract for an agent. - - Call this before staging uploads to learn whether the agent accepts - files at all (``requires_uploads``) and which specific filenames, - indexes, or glob patterns its templates reference. A run-time upload - batch that does not satisfy every declared selector is rejected with - HTTP 400. - - Args: - agent_id: Agent identifier. - - Returns: - The agent's attachment-reference contract. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/agents/{agent_id}/attachment-references", - ), - ) - - async def download_agent_run_attachment( - self, - run_id: str, - attachment_id: str, - *, - download_name: str | None = None, - ) -> httpx.Response: - """Download an attachment emitted by a step in an agent run. - - Returns a **streaming** response. The caller is responsible for - consuming and closing the response:: - - response = await client.download_agent_run_attachment("run", "att") - async with response: - async for chunk in response.aiter_bytes(): - f.write(chunk) - - Args: - run_id: Run identifier. - attachment_id: URL-safe-base64-encoded ``storage_key`` of the - attachment (as surfaced in webhook/email payloads and run - output manifests). - download_name: Optional filename hint for the download disposition. - - Returns: - A streaming ``httpx.Response``. Must be closed by the caller. - """ - headers = await _merge_request_headers_async( - options=self._options, request_headers=None - ) - request = self._client.build_request( - "GET", - f"/v2/agent-runs/{run_id}/attachments/{attachment_id}", - params=_strip_none({"download_name": download_name}), - headers=headers, - ) - response = await self._client.send(request, stream=True) - if response.is_error: - # Read the body for a useful error message, then release the - # connection before raising — the caller never receives the - # streaming response on the error path. - await response.aread() - await response.aclose() - _raise_for_status(response) - return response - - # ── Agent AI Assistant ──────────────────────────────────────────────────── - - async def generate_agent_steps( - self, agent_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Use the AI assistant to generate agent steps. - - Args: - agent_id: Agent identifier. - body: Prompt and context for step generation. - - Returns: - Generated steps suggestion. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/agents/{agent_id}/ai-assistant/generate-steps", - json=body, - ), - ) - - async def generate_step_config( - self, agent_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Use the AI assistant to generate configuration for a single step. - - Args: - agent_id: Agent identifier. - body: Step type and context for config generation. - - Returns: - Generated step configuration. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/agents/{agent_id}/ai-assistant/step-config", - json=body, - ), - ) - - async def get_agent_ai_conversation_history( - self, - agent_id: str, - *, - step_type: str | None = None, - step_id: str | None = None, - limit: int | None = None, - offset: int | None = None, - ) -> dict[str, Any]: - """Get the AI assistant conversation history for an agent. - - Args: - agent_id: Agent identifier. - step_type: Step type to look up. Required by the API. Keyword-only - with no default so the released one-argument signature still - imports, but a call that omits it cannot succeed. - step_id: Filter to a single step. - limit: Max turns to return (1-50, default 10). - offset: Number of recent turns to skip. - - Returns: - Conversation history with the AI assistant. - - Raises: - ValueError: If ``step_type`` is missing. The API marks it required, - so omitting it answers 422 naming the wire parameter; failing - here names the argument instead, and makes the broken call - obvious rather than deferring it to the server. - """ - if not step_type: - raise ValueError( - "step_type is required by the API; pass e.g. step_type='llm'." - ) - return cast( - dict[str, Any], - await self.request( - "GET", - f"/agents/{agent_id}/ai-assistant/conversations", - params=_strip_none( - { - "step_type": step_type, - "step_id": step_id, - "limit": limit, - "offset": offset, - } - ), - ), - ) - - async def mark_agent_ai_suggestion( - self, agent_id: str, conversation_id: str, body: dict[str, Any] - ) -> None: - """Mark an AI assistant suggestion as accepted or rejected. - - Args: - agent_id: Agent identifier. - conversation_id: Conversation identifier. - body: Acceptance/rejection payload. - """ - await self.request( - "PATCH", - f"/agents/{agent_id}/ai-assistant/{conversation_id}", - json=body, - ) - - # ── Agent Evaluations ───────────────────────────────────────────────────── - - async def list_evaluation_criteria( - self, agent_id: str, *, page: int = 1, limit: int = 50 - ) -> list[dict[str, Any]]: - """List evaluation criteria for an agent. - - Args: - agent_id: Agent identifier. - page: Page number (1-indexed). **Ignored** unless the client opts in - with ``api_version="2026-07-27"`` or later — the legacy response - is unpaginated and always contains every criterion, so a - paginate-until-empty loop over it never terminates. - limit: Items per page. Ignored on the legacy shape, as above. - - Returns: - The evaluation criteria. Either wire shape is accepted: a bare array - by default, the canonical ``{data, pagination}`` envelope once opted - in. Use :meth:`list_evaluation_criteria_page` for the metadata. - """ - page_result = await self.list_evaluation_criteria_page( - agent_id, page=page, limit=limit - ) - return _unwrap_data(page_result) - - async def list_evaluation_criteria_page( - self, agent_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List evaluation criteria for an agent with pagination metadata. - - Args: - agent_id: Agent identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - ``{"data": [...], "pagination": {"page", "limit", "total", "pages", - "has_next", "has_prev"}}`` when the client opts in with - ``api_version="2026-07-27"`` or later. - - Without that opt-in the endpoint answers with a bare, **unpaginated** - array of every criterion, which is returned as ``{"data": [...]}`` - with no ``pagination`` key — so read it with ``.get("pagination")`` - rather than indexing. - """ - result = await self.request( - "GET", - f"/agents/{agent_id}/evaluation-criteria", - params=_strip_none({"page": page, "limit": limit}), - ) - if isinstance(result, dict): - return cast(dict[str, Any], result) - return {"data": result} - - async def create_evaluation_criteria( - self, agent_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Create evaluation criteria for an agent. - - Args: - agent_id: Agent identifier. - body: Criteria definition. - - Returns: - The created evaluation criteria. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/agents/{agent_id}/evaluation-criteria", - json=body, - ), - ) - - async def get_evaluation_criteria(self, criteria_id: str) -> dict[str, Any]: - """Get evaluation criteria by ID. - - Args: - criteria_id: Evaluation criteria identifier. - - Returns: - Evaluation criteria details. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/agents/evaluation-criteria/{criteria_id}", - ), - ) - - async def update_evaluation_criteria( - self, criteria_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Update evaluation criteria. - - Args: - criteria_id: Evaluation criteria identifier. - body: Fields to update. - - Returns: - The updated evaluation criteria. - """ - return cast( - dict[str, Any], - await self.request( - "PATCH", - f"/agents/evaluation-criteria/{criteria_id}", - json=body, - ), - ) - - async def delete_evaluation_criteria(self, criteria_id: str) -> None: - """Delete evaluation criteria. - - Args: - criteria_id: Evaluation criteria identifier. - """ - await self.request("DELETE", f"/agents/evaluation-criteria/{criteria_id}") - - async def get_evaluation_criteria_summary(self, criteria_id: str) -> dict[str, Any]: - """Get the result summary for evaluation criteria. - - Args: - criteria_id: Evaluation criteria identifier. - - Returns: - Summary of evaluation results. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/agents/evaluation-criteria/{criteria_id}/summary", - ), - ) - - async def list_evaluation_results( - self, criteria_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List evaluation results for criteria. - - Args: - criteria_id: Evaluation criteria identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - Paginated evaluation results. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/agents/evaluation-criteria/{criteria_id}/results", - params=_strip_none({"page": page, "limit": limit}), - ), - ) - - async def create_evaluation_result( - self, criteria_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Create a manual evaluation result. - - Args: - criteria_id: Evaluation criteria identifier. - body: Evaluation result payload. - - Returns: - The created evaluation result. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/agents/evaluation-criteria/{criteria_id}/results", - json=body, - ), - ) - - async def list_compatible_runs( - self, criteria_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List agent runs compatible with evaluation criteria. - - Args: - criteria_id: Evaluation criteria identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - Paginated list of compatible runs. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/agents/evaluation-criteria/{criteria_id}/compatible-runs", - params=_strip_none({"page": page, "limit": limit}), - ), - ) - - async def test_draft_evaluation( - self, agent_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Test a draft evaluation criteria without persisting. - - Args: - agent_id: Agent identifier. - body: Draft evaluation criteria and test run. - - Returns: - Test evaluation result. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/agents/{agent_id}/evaluation-criteria/test-draft", - json=body, - ), - ) - - async def list_agent_evaluation_results( - self, agent_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List all evaluation results for an agent. - - Args: - agent_id: Agent identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - Paginated evaluation results with criteria. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/agents/{agent_id}/evaluation-results", - params=_strip_none({"page": page, "limit": limit}), - ), - ) - - async def list_run_evaluation_results( - self, agent_id: str, run_id: str, *, page: int = 1, limit: int = 50 - ) -> list[dict[str, Any]]: - """List evaluation results for a specific agent run. - - Args: - agent_id: Agent identifier. - run_id: Run identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - The evaluation results. Either wire shape is accepted: a bare array - by default, the canonical ``{data, pagination}`` envelope once the - client opts in with ``api_version="2026-07-27"`` or later. Use - :meth:`list_run_evaluation_results_page` for the metadata. - """ - page_result = await self.list_run_evaluation_results_page( - agent_id, run_id, page=page, limit=limit - ) - return _unwrap_data(page_result) - - async def list_run_evaluation_results_page( - self, agent_id: str, run_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List evaluation results for a run, with pagination metadata. - - Args: - agent_id: Agent identifier. - run_id: Run identifier. - page: Page number (1-indexed). Ignored unless the client opts in with - ``api_version="2026-07-27"`` or later; the legacy response is - unpaginated and always contains every result for the run. - limit: Items per page. Ignored on the legacy shape, as above. - - Returns: - ``{"data": [...], "pagination": {...}}`` when opted in, otherwise - ``{"data": [...]}`` with no ``pagination`` key. - """ - result = await self.request( - "GET", - f"/agents/{agent_id}/runs/{run_id}/evaluation-results", - params=_strip_none({"page": page, "limit": limit}), - ) - if isinstance(result, dict): - return cast(dict[str, Any], result) - return {"data": result} - - async def list_evaluation_runs( - self, agent_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List evaluation run summaries for an agent. - - Args: - agent_id: Agent identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - Paginated evaluation run summaries. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/agents/{agent_id}/evaluation-runs", - params=_strip_none({"page": page, "limit": limit}), - ), - ) - - async def get_non_manual_evaluation_summary(self, agent_id: str) -> dict[str, Any]: - """Get the non-manual evaluation summary, scoped to an agent when opted in. - - Args: - agent_id: Agent identifier. Scoping is part of the ``2026-07-27`` - changeset: on the legacy baseline the API **ignores** it and - always returns the account-wide rollup, so set - ``api_version="2026-07-27"`` (or pin the account) to get - per-agent numbers. - - Returns: - Summary of automated evaluation results — for ``agent_id`` when the - client has opted in, account-wide otherwise. The two are - indistinguishable in the payload, so check the client's - ``api_version`` rather than the response. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - "/agents/evaluation-results/non-manual-summary", - params={"agent_id": agent_id}, - ), - ) - - # ── Agent Email Governance ──────────────────────────────────────────────────── - - async def list_agent_email_optouts( - self, - *, - agent_id: str | None = None, - limit: int | None = None, - offset: int | None = None, - ) -> dict[str, Any]: - """List recipients who have opted out of this account's agent emails. - - Args: - agent_id: Filter to one agent (account-wide opt-outs still apply). - limit: Page size (1-200, default 50). - offset: Rows to skip. - - Returns: - The page of opt-outs plus the total count. - - """ - return cast( - dict[str, Any], - await self.request( - "GET", - "/agents/agent-email-optouts", - params=_strip_none( - {"agent_id": agent_id, "limit": limit, "offset": offset} - ), - ), - ) - - async def remove_agent_email_optout(self, optout_id: str) -> None: - """Revoke an opt-out, opting the recipient back in to agent emails. - - Args: - optout_id: Opt-out identifier. - - """ - await self.request("DELETE", f"/agents/agent-email-optouts/{optout_id}") - - async def list_blocked_email_senders( - self, - *, - limit: int | None = None, - offset: int | None = None, - ) -> dict[str, Any]: - """List the account's blocked inbound email senders and the auto-block mode. - - Args: - limit: Page size (1-200, default 50). - offset: Rows to skip. - - Returns: - The page of blocked senders plus ``auto_block_mode``. - - """ - return cast( - dict[str, Any], - await self.request( - "GET", - "/agents/blocked-email-senders", - params=_strip_none({"limit": limit, "offset": offset}), - ), - ) - - async def block_email_sender(self, body: dict[str, Any]) -> dict[str, Any]: - """Add a sender address or a whole domain to the account blocklist. - - Args: - body: ``sender_email`` plus optional ``match_type`` (``address`` - default, or ``domain``) and ``note``. - - Returns: - The blocked-sender entry. - - """ - return cast( - dict[str, Any], - await self.request("POST", "/agents/blocked-email-senders", json=body), - ) - - async def unblock_email_sender(self, blocked_id: str) -> None: - """Remove a blocked sender by id. - - Args: - blocked_id: Blocked-sender identifier. - - """ - await self.request("DELETE", f"/agents/blocked-email-senders/{blocked_id}") - - async def set_auto_block_mode(self, body: dict[str, Any]) -> dict[str, Any]: - """Set whether a governance BLOCK auto-adds the sender to the blocklist. - - Args: - body: ``mode``: ``disabled``, ``input``, or ``input_and_output``. - - Returns: - The updated blocked-sender list. - - """ - return cast( - dict[str, Any], - await self.request("PUT", "/agents/blocked-email-senders/mode", json=body), - ) - - async def list_inbound_email_rejections( - self, - *, - agent_id: str | None = None, - limit: int | None = None, - ) -> list[dict[str, Any]]: - """List recent inbound emails discarded before running an agent. - - Args: - agent_id: Filter to a single agent's rejections. - limit: Maximum results (1-200, default 50). - - Returns: - The discarded inbound emails. - - """ - return cast( - list[dict[str, Any]], - await self.request( - "GET", - "/agents/inbound-email-rejections", - params=_strip_none({"agent_id": agent_id, "limit": limit}), - ), - ) - - async def get_inbound_email_status(self) -> dict[str, Any]: - """Get the account's inbound-email overload status. - - Returns: - Whether the breaker has paused inbound mail, and the queued backlog size. - - """ - return cast( - dict[str, Any], - await self.request("GET", "/agents/inbound-email-status"), - ) - - async def cancel_queued_email_runs(self) -> dict[str, Any]: - """Fail all of the account's QUEUED (over-quota parked) inbound-email runs. - - Returns: - The count cancelled. - - """ - return cast( - dict[str, Any], - await self.request("POST", "/agents/inbound-email-status/cancel-queued"), - ) - - async def resume_inbound_email(self) -> dict[str, Any]: - """Manually lift the account-wide inbound-email pause. - - Returns: - Whether the pause was lifted. One-shot: the breaker re-arms if still overloaded. - - """ - return cast( - dict[str, Any], - await self.request("POST", "/agents/inbound-email-status/resume"), - ) - - # ── Agent Email Triggers ────────────────────────────────────────────────────── - - async def set_email_trigger_config( - self, - agent_id: str, - trigger_id: str, - body: dict[str, Any], - ) -> dict[str, Any]: - """Configure an agent's EMAIL_RECEIVED trigger. - - Args: - agent_id: Agent identifier. - trigger_id: Trigger identifier. - body: Fields to set (alias, allowed_senders, ignore_auto_generated, - require_sender_auth, queue_on_quota). Omitted fields are unchanged. - - Returns: - The trigger's resolved email address(es) and config. - - """ - return cast( - dict[str, Any], - await self.request( - "PUT", - f"/agents/{agent_id}/triggers/{trigger_id}/email-config", - json=body, - ), - ) - - # ── Knowledge Bases ─────────────────────────────────────────────────────── - - async def list_knowledge_bases( - self, - *, - page: int = 1, - limit: int = 50, - sort: str = "created_at", - order: str = "desc", - ) -> dict[str, Any]: - """List knowledge bases. - - Args: - page: Page number (1-indexed). - limit: Items per page. - sort: Sort field. - order: Sort order (``"asc"`` or ``"desc"``). - - Returns: - Paginated list of knowledge bases. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - "/knowledge_bases", - params=_strip_none( - {"page": page, "limit": limit, "sort": sort, "order": order} - ), - ), - ) - - async def create_knowledge_base(self, body: dict[str, Any]) -> dict[str, Any]: - """Create a knowledge base. - - Args: - body: Knowledge base creation payload. - - Returns: - The created knowledge base. - """ - return cast( - dict[str, Any], await self.request("POST", "/knowledge_bases", json=body) - ) - - async def get_knowledge_base(self, knowledge_base_id: str) -> dict[str, Any]: - """Get a knowledge base by ID. - - Args: - knowledge_base_id: Knowledge base identifier. - - Returns: - Knowledge base details. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/knowledge_bases/{knowledge_base_id}", - ), - ) - - async def update_knowledge_base( - self, knowledge_base_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Update a knowledge base. - - Args: - knowledge_base_id: Knowledge base identifier. - body: Fields to update. - - Returns: - The updated knowledge base. - """ - return cast( - dict[str, Any], - await self.request( - "PUT", - f"/knowledge_bases/{knowledge_base_id}", - json=body, - ), - ) - - async def delete_knowledge_base(self, knowledge_base_id: str) -> None: - """Delete a knowledge base. - - Args: - knowledge_base_id: Knowledge base identifier. - """ - await self.request("DELETE", f"/knowledge_bases/{knowledge_base_id}") - - # ── Memory Banks ────────────────────────────────────────────────────────── - - async def list_memory_banks( - self, - *, - page: int = 1, - limit: int = 50, - sort: str = "created_at", - order: str = "desc", - ) -> dict[str, Any]: - """List memory banks. - - Args: - page: Page number (1-indexed). - limit: Items per page. - sort: Sort field. - order: Sort order (``"asc"`` or ``"desc"``). - - Returns: - Paginated list of memory banks. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - "/memory_banks", - params=_strip_none( - {"page": page, "limit": limit, "sort": sort, "order": order} - ), - ), - ) - - async def create_memory_bank(self, body: dict[str, Any]) -> dict[str, Any]: - """Create a memory bank. - - Args: - body: Memory bank creation payload (name, type, config, etc.). - - Returns: - The created memory bank. - """ - return cast( - dict[str, Any], await self.request("POST", "/memory_banks", json=body) - ) - - async def get_memory_bank(self, memory_bank_id: str) -> dict[str, Any]: - """Get a memory bank by ID. - - Args: - memory_bank_id: Memory bank identifier. - - Returns: - Memory bank details. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/memory_banks/{memory_bank_id}", - ), - ) - - async def update_memory_bank( - self, memory_bank_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Update a memory bank. - - Args: - memory_bank_id: Memory bank identifier. - body: Fields to update. - - Returns: - The updated memory bank. - """ - return cast( - dict[str, Any], - await self.request( - "PUT", - f"/memory_banks/{memory_bank_id}", - json=body, - ), - ) - - async def delete_memory_bank(self, memory_bank_id: str) -> None: - """Delete a memory bank. - - Args: - memory_bank_id: Memory bank identifier. - """ - await self.request("DELETE", f"/memory_banks/{memory_bank_id}") - - async def get_agents_using_memory_bank(self, memory_bank_id: str) -> JSONValue: - """Get agents that use a specific memory bank. - - Args: - memory_bank_id: Memory bank identifier. - - Returns: - List of agents using this memory bank. - """ - return await self.request("GET", f"/memory_banks/{memory_bank_id}/agents") - - async def get_memory_bank_stats(self, memory_bank_id: str) -> JSONValue: - """Get statistics for a memory bank. - - Args: - memory_bank_id: Memory bank identifier. - - Returns: - Memory bank statistics. - """ - return await self.request("GET", f"/memory_banks/{memory_bank_id}/stats") - - async def compact_memory_bank(self, memory_bank_id: str) -> None: - """Trigger compaction of a memory bank. - - Args: - memory_bank_id: Memory bank identifier. - """ - await self.request("POST", f"/memory_banks/{memory_bank_id}/compact") - - async def delete_memory_bank_source(self, memory_bank_id: str) -> None: - """Delete the source backing a memory bank. - - Args: - memory_bank_id: Memory bank identifier. - """ - await self.request("DELETE", f"/memory_banks/{memory_bank_id}/source") - - async def test_memory_bank_compaction( - self, memory_bank_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Test compaction of a memory bank without applying. - - Args: - memory_bank_id: Memory bank identifier. - body: Test compaction parameters. - - Returns: - Compaction test result. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/memory_banks/{memory_bank_id}/test-compaction", - json=body, - ), - ) - - async def test_compaction_prompt_standalone( - self, body: dict[str, Any] - ) -> dict[str, Any]: - """Test a compaction prompt without an existing memory bank. - - Args: - body: Standalone test compaction parameters. - - Returns: - Compaction test result. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - "/memory_banks/test-compaction", - json=body, - ), - ) - - async def list_memory_bank_templates(self) -> JSONValue: - """List available memory bank templates. - - Returns: - Available templates. - """ - return await self.request("GET", "/memory_banks/templates") - - async def generate_memory_bank_config(self, body: dict[str, Any]) -> dict[str, Any]: - """Use the AI assistant to generate memory bank configuration. - - Args: - body: Prompt and context for config generation. - - Returns: - Generated memory bank configuration. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - "/memory_banks/ai-assistant", - json=body, - ), - ) - - async def get_memory_bank_ai_last_conversation(self) -> dict[str, Any]: - """Get the last AI assistant conversation for memory banks. - - Returns: - Last conversation with the memory bank AI assistant. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - "/memory_banks/ai-assistant/last-conversation", - ), - ) - - async def accept_memory_bank_ai_suggestion( - self, conversation_id: str, body: dict[str, Any] - ) -> JSONValue: - """Accept an AI assistant suggestion for a memory bank. - - Args: - conversation_id: Conversation identifier. - body: Acceptance payload. - - Returns: - Acceptance result. - """ - return await self.request( - "PATCH", - f"/memory_banks/ai-assistant/{conversation_id}", - json=body, - ) - - # ── Sources (additional) ────────────────────────────────────────────────── - - async def create_source(self, body: dict[str, Any]) -> dict[str, Any]: - """Create a new source. - - Args: - body: Source creation payload. - - Returns: - The created source. - """ - return cast(dict[str, Any], await self.request("POST", "/sources", json=body)) - - async def get_source(self, source_id: str) -> dict[str, Any]: - """Get a source by ID. - - Args: - source_id: Source identifier. - - Returns: - Source details. - """ - return cast(dict[str, Any], await self.request("GET", f"/sources/{source_id}")) - - async def update_source( - self, source_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Update a source. - - Args: - source_id: Source identifier. - body: Fields to update. - - Returns: - The updated source. - """ - return cast( - dict[str, Any], - await self.request( - "PUT", - f"/sources/{source_id}", - json=body, - ), - ) - - async def delete_source(self, source_id: str) -> None: - """Delete a source. - - Args: - source_id: Source identifier. - """ - await self.request("DELETE", f"/sources/{source_id}") - - async def upload_inline_text_to_source( - self, source_connection_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Upload inline text content to a source connection. - - Args: - source_connection_id: Source connection identifier. - body: Inline text payload with title and content. - - Returns: - Upload response details. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/sources/{source_connection_id}", - json=body, - ), - ) - - # ── Source Exports ──────────────────────────────────────────────────────── - - async def list_source_exports( - self, source_id: str, *, page: int = 1, limit: int = 50 - ) -> dict[str, Any]: - """List exports for a source. - - Args: - source_id: Source identifier. - page: Page number (1-indexed). - limit: Items per page. - - Returns: - Paginated list of exports. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/sources/{source_id}/exports", - params=_strip_none({"page": page, "limit": limit}), - ), - ) - - async def create_source_export( - self, source_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Create an export for a source. - - Args: - source_id: Source identifier. - body: Export configuration (format, filters, etc.). - - Returns: - The created export. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/sources/{source_id}/exports", - json=body, - ), - ) - - async def get_source_export(self, source_id: str, export_id: str) -> dict[str, Any]: - """Get details of a source export. - - Args: - source_id: Source identifier. - export_id: Export identifier. - - Returns: - Export details. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/sources/{source_id}/exports/{export_id}", - ), - ) - - async def cancel_source_export( - self, source_id: str, export_id: str - ) -> dict[str, Any]: - """Cancel a source export. - - Args: - source_id: Source identifier. - export_id: Export identifier. - - Returns: - The updated export. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/sources/{source_id}/exports/{export_id}/cancel", - ), - ) - - async def delete_source_export(self, source_id: str, export_id: str) -> None: - """Delete a source export. - - Args: - source_id: Source identifier. - export_id: Export identifier. - """ - await self.request("DELETE", f"/sources/{source_id}/exports/{export_id}") - - async def download_source_export( - self, source_id: str, export_id: str - ) -> httpx.Response: - """Download a completed source export. - - Returns a **streaming** response. The caller is responsible for - consuming and closing the response:: - - response = await client.download_source_export("src", "exp") - async with response: - async for chunk in response.aiter_bytes(): - f.write(chunk) - - Args: - source_id: Source identifier. - export_id: Export identifier. - - Returns: - A streaming ``httpx.Response``. Must be closed by the caller. - """ - headers = await _merge_request_headers_async( - options=self._options, request_headers=None - ) - request = self._client.build_request( - "GET", - f"/sources/{source_id}/exports/{export_id}/download", - headers=headers, - ) - response = await self._client.send(request, stream=True) - if response.is_error: - # Read the body for a useful error message, then release the - # connection before raising — the caller never receives the - # streaming response on the error path. - await response.aread() - await response.aclose() - _raise_for_status(response) - return response - - async def estimate_source_export( - self, source_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Estimate the size/cost of a source export. - - Args: - source_id: Source identifier. - body: Export estimation parameters. - - Returns: - Export estimate. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/sources/{source_id}/exports/estimate", - json=body, - ), - ) - - # ── Source Embedding Migrations ─────────────────────────────────────────── - - async def get_source_embedding_migration(self, source_id: str) -> dict[str, Any]: - """Get the embedding migration status for a source. - - Args: - source_id: Source identifier. - - Returns: - Migration status. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/sources/{source_id}/embedding-migration", - ), - ) - - async def start_source_embedding_migration( - self, source_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Start an embedding migration for a source. - - Args: - source_id: Source identifier. - body: Migration configuration. - - Returns: - The started migration. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/sources/{source_id}/embedding-migration", - json=body, - ), - ) - - async def cancel_source_embedding_migration(self, source_id: str) -> dict[str, Any]: - """Cancel an in-progress embedding migration for a source. - - Args: - source_id: Source identifier. - - Returns: - The cancelled migration. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/sources/{source_id}/embedding-migration/cancel", - ), - ) - - # ── Content (additional) ────────────────────────────────────────────────── - - async def replace_content_with_inline_text( - self, content_version_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Replace content with inline text. - - Args: - content_version_id: Content version identifier. - body: Inline text payload. - - Returns: - Upload response. - """ - return cast( - dict[str, Any], - await self.request( - "PUT", - f"/contents/{content_version_id}", - json=body, - ), - ) - - # ── Solutions ───────────────────────────────────────────────────────────── - - async def list_solutions( - self, - *, - page: int = 1, - limit: int = 50, - sort: str = "created_at", - order: str = "desc", - ) -> dict[str, Any]: - """List solutions. - - Args: - page: Page number (1-indexed). - limit: Items per page. - sort: Sort field. - order: Sort order (``"asc"`` or ``"desc"``). - - Returns: - Paginated list of solutions. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - "/solutions", - params=_strip_none( - {"page": page, "limit": limit, "sort": sort, "order": order} - ), - ), - ) - - async def create_solution(self, body: dict[str, Any]) -> dict[str, Any]: - """Create a solution. - - Args: - body: Solution creation payload. - - Returns: - The created solution. - """ - return cast(dict[str, Any], await self.request("POST", "/solutions", json=body)) - - async def get_solution(self, solution_id: str) -> dict[str, Any]: - """Get a solution by ID. - - Args: - solution_id: Solution identifier. - - Returns: - Solution details. - """ - return cast( - dict[str, Any], await self.request("GET", f"/solutions/{solution_id}") - ) - - async def update_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Update a solution. - - Args: - solution_id: Solution identifier. - body: Fields to update. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - await self.request( - "PATCH", - f"/solutions/{solution_id}", - json=body, - ), - ) - - async def delete_solution(self, solution_id: str) -> None: - """Delete a solution. - - Args: - solution_id: Solution identifier. - """ - await self.request("DELETE", f"/solutions/{solution_id}") - - async def link_agents_to_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Link agents to a solution. - - Args: - solution_id: Solution identifier. - body: Resource IDs to link. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/solutions/{solution_id}/agents", - json=body, - ), - ) - - async def unlink_agents_from_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Unlink agents from a solution. - - Args: - solution_id: Solution identifier. - body: Resource IDs to unlink. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - await self.request( - "DELETE", - f"/solutions/{solution_id}/agents", - json=body, - ), - ) - - async def link_knowledge_bases_to_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Link knowledge bases to a solution. - - Args: - solution_id: Solution identifier. - body: Resource IDs to link. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/solutions/{solution_id}/knowledge-bases", - json=body, - ), - ) - - async def unlink_knowledge_bases_from_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Unlink knowledge bases from a solution. - - Args: - solution_id: Solution identifier. - body: Resource IDs to unlink. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - await self.request( - "DELETE", - f"/solutions/{solution_id}/knowledge-bases", - json=body, - ), - ) - - async def link_source_connections_to_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Link source connections to a solution. - - Args: - solution_id: Solution identifier. - body: Resource IDs to link. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/solutions/{solution_id}/source-connections", - json=body, - ), - ) - - async def unlink_source_connections_from_solution( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Unlink source connections from a solution. - - Args: - solution_id: Solution identifier. - body: Resource IDs to unlink. - - Returns: - The updated solution. - """ - return cast( - dict[str, Any], - await self.request( - "DELETE", - f"/solutions/{solution_id}/source-connections", - json=body, - ), - ) - - async def list_solution_conversations( - self, solution_id: str - ) -> list[dict[str, Any]]: - """List AI assistant conversations for a solution. - - Args: - solution_id: Solution identifier. - - Returns: - List of conversations. - """ - return cast( - list[dict[str, Any]], - await self.request( - "GET", - f"/solutions/{solution_id}/conversations", - ), - ) - - async def add_solution_conversation_turn( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Add a turn to a solution AI conversation. - - Args: - solution_id: Solution identifier. - body: Conversation turn payload. - - Returns: - The conversation response. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/solutions/{solution_id}/conversations", - json=body, - ), - ) - - async def mark_solution_conversation_turn( - self, solution_id: str, conversation_id: str, body: dict[str, Any] - ) -> None: - """Mark a solution conversation turn as accepted or rejected. - - Args: - solution_id: Solution identifier. - conversation_id: Conversation identifier. - body: Acceptance/rejection payload. - """ - await self.request( - "PATCH", - f"/solutions/{solution_id}/conversations/{conversation_id}", - json=body, - ) - - async def generate_solution_ai_plan( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Use the AI assistant to generate a solution plan. - - Args: - solution_id: Solution identifier. - body: Prompt and context. - - Returns: - Generated plan with proposed actions. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/solutions/{solution_id}/ai-assistant/generate", - json=body, - ), - ) - - async def generate_solution_ai_knowledge_base( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Use the AI assistant to generate a knowledge base plan for a solution. - - Args: - solution_id: Solution identifier. - body: Prompt and context. - - Returns: - Generated knowledge base plan. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/solutions/{solution_id}/ai-assistant/knowledge-base", - json=body, - ), - ) - - async def generate_solution_ai_source( - self, solution_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Use the AI assistant to generate a source plan for a solution. - - Args: - solution_id: Solution identifier. - body: Prompt and context. - - Returns: - Generated source plan. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/solutions/{solution_id}/ai-assistant/source", - json=body, - ), - ) - - async def accept_solution_ai_plan( - self, solution_id: str, conversation_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Accept an AI-generated solution plan. - - Args: - solution_id: Solution identifier. - conversation_id: Conversation identifier. - body: Acceptance payload. - - Returns: - Result of applying the plan. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/solutions/{solution_id}/ai-assistant/{conversation_id}/accept", - json=body, - ), - ) - - async def decline_solution_ai_plan( - self, solution_id: str, conversation_id: str - ) -> None: - """Decline an AI-generated solution plan. - - Args: - solution_id: Solution identifier. - conversation_id: Conversation identifier. - """ - await self.request( - "POST", - f"/solutions/{solution_id}/ai-assistant/{conversation_id}/decline", - ) - - # ── Governance AI ───────────────────────────────────────────────────────── - - async def generate_governance_ai_plan(self, body: dict[str, Any]) -> dict[str, Any]: - """Use the AI assistant to generate a governance plan. - - Args: - body: Prompt and context for governance policy management. - - Returns: - Generated governance plan with proposed actions. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - "/governance/ai-assistant", - json=body, - ), - ) - - async def list_governance_ai_conversations(self) -> list[dict[str, Any]]: - """List governance AI assistant conversations. - - Returns: - List of governance conversations. - """ - return cast( - list[dict[str, Any]], - await self.request( - "GET", - "/governance/ai-assistant/conversations", - ), - ) - - async def accept_governance_ai_plan(self, conversation_id: str) -> dict[str, Any]: - """Accept an AI-generated governance plan. - - Args: - conversation_id: Conversation identifier. - - Returns: - Result of applying the governance plan. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/governance/ai-assistant/{conversation_id}/accept", - ), - ) - - async def decline_governance_ai_plan(self, conversation_id: str) -> None: - """Decline an AI-generated governance plan. - - Args: - conversation_id: Conversation identifier. - """ - await self.request( - "POST", - f"/governance/ai-assistant/{conversation_id}/decline", - ) - - # ── Alerts ──────────────────────────────────────────────────────────────── - - async def list_alerts( - self, - *, - page: int = 1, - limit: int = 50, - status: str | None = None, - severity: str | None = None, - ) -> JSONValue: - """List alerts. - - Args: - page: Page number (1-indexed). - limit: Items per page. - status: Filter by alert status. - severity: Deprecated and ignored. The API declares no severity filter - on this endpoint, so it never filtered anything, and sending it - is a 422 once ``api_version`` is ``2026-07-27`` or later. It is - accepted and dropped so existing call sites keep working. - - Returns: - Paginated list of alerts. - """ - return await self.request( - "GET", - "/alerts", - params=_strip_none({"page": page, "limit": limit, "status": status}), - ) - - async def get_alert(self, alert_id: str) -> JSONValue: - """Get an alert by ID. - - Args: - alert_id: Alert identifier. - - Returns: - Alert details. - """ - return await self.request("GET", f"/alerts/{alert_id}") - - async def change_alert_status( - self, alert_id: str, body: dict[str, Any] - ) -> JSONValue: - """Change the status of an alert. - - Args: - alert_id: Alert identifier. - body: New status payload. - - Returns: - Updated alert. - """ - return await self.request("POST", f"/alerts/{alert_id}/status", json=body) - - async def add_alert_comment(self, alert_id: str, body: dict[str, Any]) -> JSONValue: - """Add a comment to an alert. - - Args: - alert_id: Alert identifier. - body: Comment payload. - - Returns: - Comment result. - """ - return await self.request("POST", f"/alerts/{alert_id}/comments", json=body) - - async def subscribe_to_alert(self, alert_id: str) -> JSONValue: - """Subscribe to an alert. - - Args: - alert_id: Alert identifier. - - Returns: - Subscription result. - """ - return await self.request("POST", f"/alerts/{alert_id}/subscribe") - - async def unsubscribe_from_alert(self, alert_id: str) -> JSONValue: - """Unsubscribe from an alert. - - Args: - alert_id: Alert identifier. - - Returns: - Unsubscription result. - """ - return await self.request("POST", f"/alerts/{alert_id}/unsubscribe") - - # ── Alert Configs ───────────────────────────────────────────────────────── - - async def list_alert_configs(self, *, page: int = 1, limit: int = 50) -> JSONValue: - """List alert configurations. - - Args: - page: Page number (1-indexed). - limit: Items per page. - - Returns: - The configurations, under ``configs`` alongside ``total`` by default, - and under ``data`` with ``pagination`` once the client opts in with - ``api_version="2026-07-27"`` or later. Read either with - :func:`unwrap_items`:: - - items = unwrap_items(client.list_alert_configs(), "configs") - """ - return await self.request( - "GET", - "/alerts/configs", - params=_strip_none({"page": page, "limit": limit}), - ) - - async def create_alert_config(self, body: dict[str, Any]) -> JSONValue: - """Create an alert configuration. - - Args: - body: Alert config creation payload. - - Returns: - The created alert configuration. - """ - return await self.request("POST", "/alerts/configs", json=body) - - async def get_alert_config(self, config_id: str) -> JSONValue: - """Get an alert configuration by ID. - - Args: - config_id: Alert config identifier. - - Returns: - Alert configuration details. - """ - return await self.request("GET", f"/alerts/configs/{config_id}") - - async def update_alert_config( - self, config_id: str, body: dict[str, Any] - ) -> JSONValue: - """Update an alert configuration. - - Args: - config_id: Alert config identifier. - body: Fields to update. - - Returns: - The updated alert configuration. - """ - return await self.request("PATCH", f"/alerts/configs/{config_id}", json=body) - - async def delete_alert_config(self, config_id: str) -> None: - """Delete an alert configuration. - - Args: - config_id: Alert config identifier. - """ - await self.request("DELETE", f"/alerts/configs/{config_id}") - - # ── Alert Preferences ───────────────────────────────────────────────────── - - async def list_organization_alert_preferences(self) -> dict[str, Any]: - """List organization alert preferences. - - Returns: - Alert preferences for the organization. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - "/alerts/organization-preferences/list", - ), - ) - - async def update_organization_alert_preference( - self, organization_id: str, alert_type: str, body: dict[str, Any] - ) -> JSONValue: - """Update an organization alert preference. - - Args: - organization_id: Organization identifier. - alert_type: Alert type to configure. - body: Preference update payload. - - Returns: - Updated preference. - """ - return await self.request( - "PATCH", - f"/alerts/organization-preferences/{organization_id}/{alert_type}", - json=body, - ) - - # ── Model Alerts ────────────────────────────────────────────────────────── - - async def list_model_alerts(self, *, page: int = 1, limit: int = 50) -> JSONValue: - """List model alerts. - - Args: - page: Page number (1-indexed). Translated to the ``offset`` the - endpoint actually declares; it does not accept ``page``, so - every page but the first previously returned page 1. - limit: Items per page. - - Returns: - The alerts, under ``alerts`` alongside ``total`` by default, and under - ``data`` with ``pagination`` once the client opts in with - ``api_version="2026-07-27"`` or later. Read either with - :func:`unwrap_items`:: - - items = unwrap_items(await client.list_model_alerts(), "alerts") - """ - # `offset` is declared `minimum: 0`, so a defensive caller passing page=0 - # would turn a previously-ignored parameter into a hard 422. - offset = max(page - 1, 0) * limit - return await self.request( - "GET", - "/models/alerts", - params=_strip_none({"offset": offset, "limit": limit}), - ) - - async def mark_all_model_alerts_read(self) -> None: - """Mark all model alerts as read for the current account.""" - await self.request("POST", "/models/alerts/mark-all-read") - - async def get_unread_model_alert_count(self) -> JSONValue: - """Get the count of unread model alerts. - - Returns: - Unread alert count. - """ - return await self.request("GET", "/models/alerts/unread-count") - - async def mark_model_alert_read(self, alert_id: str) -> None: - """Mark a model alert as read. - - Args: - alert_id: Alert identifier. - """ - await self.request("PATCH", f"/models/alerts/{alert_id}/read") - - # ── Models ──────────────────────────────────────────────────────────────── - - async def get_model_recommendations(self, model_id: str) -> JSONValue: - """Get recommendations for a model. - - Args: - model_id: Model identifier. - - Returns: - Model recommendations. - """ - return await self.request("GET", f"/models/{model_id}/recommendations") - - async def list_models( - self, - *, - provider: str | None = None, - supports_tool_use: bool | None = None, - supports_thinking: bool | None = None, - ) -> JSONValue: - """List all enabled LLM models grouped by provider. - - Args: - provider: Filter by provider name. - supports_tool_use: Filter to models that support tool use. - supports_thinking: Filter to models that support extended thinking. - - Returns: - List of provider groups with their models. - """ - return await self.request( - "GET", - "/models", - params=_strip_none( - { - "provider": provider, - "supports_tool_use": supports_tool_use, - "supports_thinking": supports_thinking, - } - ), - ) - - async def get_model(self, model_id: str) -> JSONValue: - """Get full details for a specific model. - - Args: - model_id: Model identifier. - - Returns: - Model details including capabilities, pricing, and lifecycle status. - """ - return await self.request("GET", f"/models/{model_id}/details") - - async def get_generation_tiers(self) -> dict[str, Any]: - """List the media-generation quality tiers and what each resolves to. - - Returns: - Each ``(modality, tier)`` mapped to its generator, credits, and price - label — under ``tiers`` by default, and under ``data`` with - ``pagination`` once the client opts in with - ``api_version="2026-07-27"`` or later. Read either with - :func:`unwrap_items`:: - - items = unwrap_items(client.get_generation_tiers(), "tiers") - """ - return cast( - dict[str, Any], - await self.request("GET", "/models/generation-tiers"), - ) - - # ── Model Playground Experiments ────────────────────────────────────────── - - async def list_experiments( - self, - *, - days: int | None = None, - start_date: str | None = None, - end_date: str | None = None, - limit: int | None = None, - offset: int | None = None, - ) -> JSONValue: - """List model playground experiments. - - Args: - days: Look-back window in days (1-730, default 30). - start_date: Start date filter (YYYY-MM-DD). - end_date: End date filter (YYYY-MM-DD). - limit: Maximum number of results. - offset: Pagination offset. - - Returns: - Paginated list of experiments. - """ - return await self.request( - "GET", - "/models/playground/experiments", - params=_strip_none( - { - "days": days, - "start_date": start_date, - "end_date": end_date, - "limit": limit, - "offset": offset, - } - ), - ) - - async def create_experiment(self, body: dict[str, Any]) -> JSONValue: - """Create a model playground experiment. - - Args: - body: Experiment configuration including prompt, model_ids, etc. - - Returns: - Created experiment details. - """ - return await self.request("POST", "/models/playground/experiments", json=body) - - async def get_experiment(self, experiment_id: str) -> JSONValue: - """Get a model playground experiment by ID. - - Args: - experiment_id: Experiment identifier. - - Returns: - Experiment details. - """ - return await self.request( - "GET", f"/models/playground/experiments/{experiment_id}" - ) - - async def cancel_experiment(self, experiment_id: str) -> JSONValue: - """Cancel a running model playground experiment. - - Args: - experiment_id: Experiment identifier. - - Returns: - Cancellation confirmation. - """ - return await self.request( - "POST", f"/models/playground/experiments/{experiment_id}/cancel" - ) - - async def delete_experiment(self, experiment_id: str) -> None: - """Soft-delete a model playground experiment. - - Removes the experiment from list/detail views while preserving audit - history. - - Args: - experiment_id: Experiment identifier. - """ - await self.request("DELETE", f"/models/playground/experiments/{experiment_id}") - - # ── Search ──────────────────────────────────────────────────────────────── - - async def search( - self, - *, - query: str, - limit: int = 10, - entity_type: str | None = None, - ) -> JSONValue: - """Search across the Seclai platform. - - Args: - query: Search query string. - limit: Maximum results to return. - entity_type: Optional entity type filter. - - Returns: - Search results. - """ - return await self.request( - "GET", - "/search", - params=_strip_none( - {"q": query, "limit": limit, "entity_type": entity_type} - ), - ) - - # ── Email Domains ───────────────────────────────────────────────────────────── - - async def list_email_domains(self) -> dict[str, Any]: - """List the account's agent-email domains and plan capabilities. - - Returns: - Domains with verification status and required DNS records. - - """ - return cast(dict[str, Any], await self.request("GET", "/email-domains")) - - async def add_email_domain(self, body: dict[str, Any]) -> dict[str, Any]: - """Add and provision a vanity or custom agent-email domain. - - Args: - body: ``kind`` (``vanity``/``custom``) and ``value``; optional - ``delegated`` (default false) to let Seclai manage the zone. - - Returns: - The new domain, including the DNS records to publish. - - """ - return cast( - dict[str, Any], - await self.request("POST", "/email-domains", json=body), - ) - - async def remove_email_domain(self, domain_id: str) -> dict[str, Any]: - """Remove a domain and tear down its SES identity and DNS. - - Args: - domain_id: Domain identifier. - - Returns: - ``removed``, plus a ``cleanup_note`` when the domain was Seclai-managed. - - """ - return cast( - dict[str, Any], - await self.request("DELETE", f"/email-domains/{domain_id}"), - ) - - async def verify_email_domain(self, domain_id: str) -> dict[str, Any]: - """Re-poll SES and DNS for this domain now ('Check now'). - - Args: - domain_id: Domain identifier. - - Returns: - The updated status and DNS-record check results. - - """ - return cast( - dict[str, Any], - await self.request("POST", f"/email-domains/{domain_id}/verify"), - ) - - async def set_primary_email_domain(self, domain_id: str) -> dict[str, Any]: - """Promote a verified domain to the account's primary domain. - - Args: - domain_id: Domain identifier; must already be verified. - - Returns: - The updated domain. - - """ - return cast( - dict[str, Any], - await self.request("POST", f"/email-domains/{domain_id}/primary"), - ) - - async def use_shared_email_domain(self) -> None: - """Revert to the shared ``agent.seclai.com`` sending/inbound domain.""" - await self.request("POST", "/email-domains/use-shared-domain") - - async def send_email_domain_test_email(self, domain_id: str) -> dict[str, Any]: - """Send a test message from a verified domain to the account owner. - - Args: - domain_id: Domain identifier. - - Returns: - Whether the message was sent. - - """ - return cast( - dict[str, Any], - await self.request("POST", f"/email-domains/{domain_id}/test-email"), - ) - - async def get_dmarc_summary( - self, - domain_id: str, - *, - days: int | None = None, - top_sources: int | None = None, - ) -> dict[str, Any]: - """Get the DMARC aggregate-report summary for a domain. - - Args: - domain_id: Domain identifier. - days: Window length in days (default 30). - top_sources: Number of top failing sources to return (default 10). - - Returns: - Pass rate, disposition breakdown, and top failing source IPs. - - """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/email-domains/{domain_id}/dmarc", - params=_strip_none({"days": days, "top_sources": top_sources}), - ), - ) - - async def search_docs( - self, - query: str, - *, - mode: str | None = None, - limit: int | None = None, - ) -> dict[str, Any]: - """Search the Seclai documentation by content. - - Args: - query: Search query (1-200 chars). - mode: ``keyword`` (default; titles and summaries) or ``semantic`` (body). - limit: Maximum results (1-20, default 8). - - Returns: - Matching pages, each with a ``doc_slug`` and optional section ``anchor``. - - """ - return cast( - dict[str, Any], - await self.request( - "GET", - "/docs-search", - params=_strip_none({"q": query, "mode": mode, "limit": limit}), - ), - ) - - # ── Top-level AI Assistant ───────────────────────────────────────────────── - - async def submit_ai_feedback(self, body: dict[str, Any]) -> dict[str, Any]: - """Submit feedback to the AI assistant. - - Args: - body: Feedback payload. - - Returns: - Feedback response. - """ - return cast( - dict[str, Any], - await self.request("POST", "/ai-assistant/feedback", json=body), - ) - - async def ai_assistant_knowledge_base(self, body: dict[str, Any]) -> dict[str, Any]: - """Generate a knowledge base plan via the top-level AI assistant. - - Args: - body: Prompt and context. - - Returns: - Generated plan. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - "/ai-assistant/knowledge-base", - json=body, - ), - ) - - async def ai_assistant_source(self, body: dict[str, Any]) -> dict[str, Any]: - """Generate a source plan via the top-level AI assistant. - - Args: - body: Prompt and context. - - Returns: - Generated plan. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - "/ai-assistant/source", - json=body, - ), - ) - - async def ai_assistant_solution(self, body: dict[str, Any]) -> dict[str, Any]: - """Generate a solution plan via the top-level AI assistant. - - Args: - body: Prompt and context. - - Returns: - Generated plan. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - "/ai-assistant/solution", - json=body, - ), - ) - - async def ai_assistant_memory_bank(self, body: dict[str, Any]) -> dict[str, Any]: - """Generate a memory bank plan via the top-level AI assistant. - - Args: - body: Prompt and context. - - Returns: - Generated plan. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - "/ai-assistant/memory-bank", - json=body, - ), - ) - - async def get_ai_assistant_memory_bank_history(self) -> dict[str, Any]: - """Get the last AI assistant memory bank conversation. - - Returns: - Last conversation. - """ - return cast( - dict[str, Any], - await self.request( - "GET", - "/ai-assistant/memory-bank/last-conversation", - ), - ) - - async def accept_ai_assistant_plan( - self, conversation_id: str, body: dict[str, Any] - ) -> dict[str, Any]: - """Accept a top-level AI assistant plan. - - Args: - conversation_id: Conversation identifier. - body: Acceptance payload. - - Returns: - Result of applying the plan. - """ - return cast( - dict[str, Any], - await self.request( - "POST", - f"/ai-assistant/{conversation_id}/accept", - json=body, - ), - ) - - async def decline_ai_assistant_plan(self, conversation_id: str) -> None: - """Decline a top-level AI assistant plan. - - Args: - conversation_id: Conversation identifier. - """ - await self.request("POST", f"/ai-assistant/{conversation_id}/decline") - - async def accept_ai_memory_bank_suggestion( - self, conversation_id: str, body: dict[str, Any] - ) -> JSONValue: - """Accept a top-level AI memory bank suggestion. - - Args: - conversation_id: Conversation identifier. - body: Acceptance payload. - - Returns: - Acceptance result. - """ - return await self.request( - "PATCH", - f"/ai-assistant/memory-bank/{conversation_id}", - json=body, - ) - - # ── Pagination helper ───────────────────────────────────────────────────── - - async def paginate( - self, - method: str, - path: str, - *, - params: dict[str, Any] | None = None, - limit: int = 50, - items_key: str = "data", - ) -> AsyncGenerator[dict[str, Any]]: - """Auto-paginate a list endpoint, yielding items lazily. - - Fetches pages sequentially until a page returns fewer items than ``limit`` - or the items list is empty. Use ``async for item in client.paginate(...):`` - to iterate. - - Args: - method: HTTP method (typically ``"GET"``). - path: API path. - params: Extra query parameters (``page`` and ``limit`` are managed automatically). - limit: Items per page. - items_key: JSON key containing the list of items (default ``"data"``). - - Yields: - Individual items from each page. - """ - page = 1 - base_params = dict(params) if params else {} - while True: - base_params["page"] = page - base_params["limit"] = limit - result = await self.request(method, path, params=base_params) - if not isinstance(result, dict): - break - items = result.get(items_key, []) - if not isinstance(items, list): - break - for item in items: - yield cast(dict[str, Any], item) - if len(items) < limit: - break - page += 1 - - # ── High-level Abstractions ─────────────────────────────────────────────── - - async def run_agent_and_poll( - self, - agent_id: str, - body: AgentRunRequest, - *, - poll_interval: float = 2.0, - include_step_outputs: bool = False, - ) -> AgentRunResponse: - """Run an agent and poll until it reaches a terminal status. - - Starts the agent run and then repeatedly polls ``get_agent_run`` until - the status is ``"completed"`` or ``"failed"``. - - Args: - agent_id: Agent identifier. - body: Agent run request payload. - poll_interval: Seconds between poll attempts (default 2.0). - include_step_outputs: Include per-step outputs when polling. - - Returns: - The final agent run (completed or failed). - - Raises: - SeclaiAPIValidationError: If the API returns a validation error. - SeclaiAPIStatusError: If the API returns a non-success status code. - """ - import asyncio - - run = await self.run_agent(agent_id, body) - while run.status not in ("completed", "failed"): - await asyncio.sleep(poll_interval) - run = await self.get_agent_run( - run.run_id, include_step_outputs=include_step_outputs - ) - return run - - async def run_streaming_agent( - self, - agent_id: str, - body: AgentRunStreamRequest, - *, - timeout: float | None = None, - headers: Mapping[str, str] | None = None, - ) -> AsyncGenerator[tuple[str, dict[str, Any]]]: - """Run an agent via SSE streaming and yield events as they arrive. - - Use ``async for event_type, data in client.run_streaming_agent(...)`` to - process events lazily without buffering the entire stream. - - Args: - agent_id: Agent identifier. - body: Streaming agent run request payload. - timeout: Max time (seconds) to wait. Defaults to this client's timeout. - headers: Optional extra headers. - - Yields: - ``(event_type, parsed_data)`` tuples for each SSE event. - - Raises: - SeclaiAPIStatusError: If the API returns a non-success status code. - SeclaiStreamingError: If an error event is received. - SeclaiError: If the stream times out. - """ - import json as _json - - path = f"/agents/{agent_id}/runs/stream" - merged_headers = await _merge_request_headers_async( - options=self._options, request_headers=headers - ) - merged_headers.setdefault("accept", "text/event-stream") - timeout_seconds = self._options.timeout if timeout is None else timeout - start = time.monotonic() - - try: - async with self._client.stream( - "POST", - path, - json=body, - headers=merged_headers, - timeout=timeout_seconds, - ) as response: - _raise_for_status(response) - current_event: str | None = None - data_lines: list[str] = [] - - async for line in response.aiter_lines(): - if time.monotonic() - start > timeout_seconds: - raise SeclaiError( - f"Timed out after {timeout_seconds}s waiting for streaming agent run." - ) - if line == "": - if current_event and data_lines: - data = "\n".join(data_lines) - try: - parsed = cast(dict[str, Any], _json.loads(data)) - except Exception: - parsed = {"raw": data} - if current_event == "error": - raise SeclaiStreamingError( - parsed.get("message", data), - run_id=parsed.get("run_id"), - ) - yield (current_event, parsed) - current_event = None - data_lines = [] - continue - if line.startswith(":"): - continue - if line.startswith("event:"): - current_event = line[len("event:") :].strip() or None - continue - if line.startswith("data:"): - data_lines.append(line[len("data:") :].lstrip()) - continue - - if current_event and data_lines: - data = "\n".join(data_lines) - try: - parsed = cast(dict[str, Any], _json.loads(data)) - except Exception: - parsed = {"raw": data} - if current_event == "error": - raise SeclaiStreamingError( - parsed.get("message", data), - run_id=parsed.get("run_id"), - ) - yield (current_event, parsed) - except httpx.TimeoutException as e: - raise SeclaiError( - f"Timed out after {timeout_seconds}s waiting for streaming agent run." - ) from e diff --git a/seclai/versions.py b/seclai/versions.py deleted file mode 100644 index 6305958..0000000 --- a/seclai/versions.py +++ /dev/null @@ -1,53 +0,0 @@ -"""Dated API versions known to this release. - -The set is open: the API adds versions without an SDK release, and the -``api_version`` client option is typed ``str | None``, so a date newer than this -release knows about can be passed directly. Treat these as convenience constants -rather than an exhaustive list — :meth:`Seclai.get_api_version` reports what the -server actually supports. -""" - -from __future__ import annotations - -from enum import StrEnum - - -class ApiVersion(StrEnum): - """A dated API version. Members are plain strings, so they can be passed - anywhere ``api_version`` is accepted.""" - - V2026_07_01 = "2026-07-01" - V2026_07_27 = "2026-07-27" - - -#: Baseline applied to an unpinned, header-less caller. -DEFAULT_API_VERSION = ApiVersion.V2026_07_01 - -#: Newest version known to this SDK release. May lag the server. -LATEST_API_VERSION = ApiVersion.V2026_07_27 - - -def validate_api_version(version: str | None, *, allow_unknown: bool) -> str | None: - """Reject a version this release was not built against. - - A newer server version can change response shapes. Request-side mistakes - surface as a 422, but a changed response just mis-decodes: renamed keys read - as absent and reshaped payloads land as ``None``, silently. Opting into a - version the SDK has never seen therefore fails closed unless asked otherwise. - - This guards the header only. An account pinned server-side can still be newer - than this release — read :meth:`Seclai.get_api_version` and compare - ``effective_version`` against :data:`LATEST_API_VERSION` to detect that. - """ - if version is None or allow_unknown: - return version - known = [v.value for v in ApiVersion] - if version not in known: - raise ValueError( - f"Unknown api_version {version!r}. This release was built against " - f"{', '.join(known)}. A newer API version can change response shapes, " - "which this client would decode incorrectly rather than reject. " - "Upgrade the SDK, or pass allow_unknown_api_version=True to proceed " - "anyway." - ) - return version diff --git a/tests/test_auth_and_headers.py b/tests/test_auth_and_headers.py deleted file mode 100644 index e5efb21..0000000 --- a/tests/test_auth_and_headers.py +++ /dev/null @@ -1,235 +0,0 @@ -import httpx -import pytest - -from seclai import AsyncSeclai, Seclai, SeclaiConfigurationError - - -def test_api_key_from_env(monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.setenv("SECLAI_API_KEY", "env-key") - client = Seclai() - assert client.api_key == "env-key" - - -def test_api_key_param_takes_precedence(monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.setenv("SECLAI_API_KEY", "env-key") - client = Seclai(api_key="param-key") - assert client.api_key == "param-key" - - -def test_missing_api_key_falls_back_to_sso( - monkeypatch: pytest.MonkeyPatch, tmp_path: pytest.TempPathFactory -) -> None: - monkeypatch.delenv("SECLAI_API_KEY", raising=False) - monkeypatch.setenv("SECLAI_CONFIG_DIR", str(tmp_path)) - client = Seclai() - # With built-in SSO defaults, client succeeds and falls back to SSO mode - assert client._options.auth_state.mode == "sso" - - -def test_both_api_key_and_access_token_raises(monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.delenv("SECLAI_API_KEY", raising=False) - with pytest.raises(SeclaiConfigurationError, match="not both"): - _ = Seclai(api_key="k", access_token="t") - - -def test_header_injected_sync(monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.setenv("SECLAI_API_KEY", "env-key") - - def handler(request: httpx.Request) -> httpx.Response: - assert request.headers.get("x-api-key") == "env-key" - return httpx.Response(200, json={"ok": True}) - - transport = httpx.MockTransport(handler) - http_client = httpx.Client(transport=transport, base_url="https://example.invalid") - client = Seclai(http_client=http_client) - assert client.request("GET", "/ping") == {"ok": True} - - -@pytest.mark.asyncio -async def test_header_injected_async(monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.setenv("SECLAI_API_KEY", "env-key") - - async def handler(request: httpx.Request) -> httpx.Response: - assert request.headers.get("x-api-key") == "env-key" - return httpx.Response(200, json={"ok": True}) - - transport = httpx.MockTransport(handler) - http_client = httpx.AsyncClient( - transport=transport, base_url="https://example.invalid" - ) - client = AsyncSeclai(http_client=http_client) - assert await client.request("GET", "/ping") == {"ok": True} - await http_client.aclose() - - -# ── Bearer Token Auth ──────────────────────────────────────────────────────── - - -def test_bearer_token_sync(monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.delenv("SECLAI_API_KEY", raising=False) - - def handler(request: httpx.Request) -> httpx.Response: - assert request.headers.get("authorization") == "Bearer my-jwt" - assert "x-api-key" not in request.headers - return httpx.Response(200, json={"ok": True}) - - transport = httpx.MockTransport(handler) - http_client = httpx.Client(transport=transport, base_url="https://example.invalid") - client = Seclai(access_token="my-jwt", http_client=http_client) - assert client.request("GET", "/ping") == {"ok": True} - - -def test_bearer_provider_sync(monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.delenv("SECLAI_API_KEY", raising=False) - - call_count = 0 - - def provider() -> str: - nonlocal call_count - call_count += 1 - return f"token-{call_count}" - - def handler(request: httpx.Request) -> httpx.Response: - assert request.headers.get("authorization", "").startswith("Bearer token-") - return httpx.Response(200, json={"ok": True}) - - transport = httpx.MockTransport(handler) - http_client = httpx.Client(transport=transport, base_url="https://example.invalid") - client = Seclai(access_token=provider, http_client=http_client) - client.request("GET", "/ping1") - client.request("GET", "/ping2") - assert call_count == 2 - - -def test_account_id_header_sync(monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.delenv("SECLAI_API_KEY", raising=False) - - def handler(request: httpx.Request) -> httpx.Response: - assert request.headers.get("x-account-id") == "acct-123" - assert request.headers.get("authorization") == "Bearer tok" - return httpx.Response(200, json={"ok": True}) - - transport = httpx.MockTransport(handler) - http_client = httpx.Client(transport=transport, base_url="https://example.invalid") - client = Seclai(access_token="tok", account_id="acct-123", http_client=http_client) - assert client.request("GET", "/ping") == {"ok": True} - - -@pytest.mark.asyncio -async def test_bearer_token_async(monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.delenv("SECLAI_API_KEY", raising=False) - - async def handler(request: httpx.Request) -> httpx.Response: - assert request.headers.get("authorization") == "Bearer async-jwt" - return httpx.Response(200, json={"ok": True}) - - transport = httpx.MockTransport(handler) - http_client = httpx.AsyncClient( - transport=transport, base_url="https://example.invalid" - ) - client = AsyncSeclai(access_token="async-jwt", http_client=http_client) - assert await client.request("GET", "/ping") == {"ok": True} - await http_client.aclose() - - -# ── Bearer auth on typed (generated-client) methods ────────────────────────── - - -def test_bearer_token_on_typed_method_sync(monkeypatch: pytest.MonkeyPatch) -> None: - """Typed wrapper methods (list_sources etc.) must send bearer auth headers.""" - monkeypatch.delenv("SECLAI_API_KEY", raising=False) - - def handler(request: httpx.Request) -> httpx.Response: - assert request.headers.get("authorization") == "Bearer typed-jwt" - assert "x-api-key" not in request.headers - return httpx.Response( - 200, - json={ - "data": [], - "pagination": { - "page": 1, - "limit": 20, - "total": 0, - "pages": 0, - "has_next": False, - "has_prev": False, - }, - }, - ) - - transport = httpx.MockTransport(handler) - http_client = httpx.Client(transport=transport, base_url="https://example.invalid") - client = Seclai(access_token="typed-jwt", http_client=http_client) - # Also wire mock transport into the generated client used by typed methods - gc = client._generated_client() - gc.set_httpx_client( - httpx.Client( - transport=transport, - base_url="https://example.invalid", - headers=dict(gc._headers), - ) - ) - result = client.list_sources() - assert result.data == [] - - -def test_bearer_provider_on_typed_method_sync(monkeypatch: pytest.MonkeyPatch) -> None: - """Typed wrapper methods must resolve dynamic bearer providers per-request.""" - monkeypatch.delenv("SECLAI_API_KEY", raising=False) - - call_count = 0 - - def provider() -> str: - nonlocal call_count - call_count += 1 - return f"dyn-token-{call_count}" - - def handler(request: httpx.Request) -> httpx.Response: - assert request.headers.get("authorization", "").startswith("Bearer dyn-token-") - return httpx.Response( - 200, - json={ - "data": [], - "pagination": { - "page": 1, - "limit": 20, - "total": 0, - "pages": 0, - "has_next": False, - "has_prev": False, - }, - }, - ) - - transport = httpx.MockTransport(handler) - http_client = httpx.Client(transport=transport, base_url="https://example.invalid") - client = Seclai(access_token=provider, http_client=http_client) - # Also wire mock transport into the generated client used by typed methods - gc = client._generated_client() - gc.set_httpx_client( - httpx.Client( - transport=transport, - base_url="https://example.invalid", - headers=dict(gc._headers), - ) - ) - client.list_sources() - client.list_sources() - assert call_count == 2 - - -# ── X-Account-Id only for bearer/SSO ───────────────────────────────────────── - - -def test_account_id_not_sent_for_api_key(monkeypatch: pytest.MonkeyPatch) -> None: - """X-Account-Id should NOT be sent when using api_key auth.""" - monkeypatch.delenv("SECLAI_API_KEY", raising=False) - - def handler(request: httpx.Request) -> httpx.Response: - assert "x-account-id" not in request.headers - return httpx.Response(200, json={"ok": True}) - - transport = httpx.MockTransport(handler) - http_client = httpx.Client(transport=transport, base_url="https://example.invalid") - client = Seclai(api_key="k", account_id="acct-123", http_client=http_client) - assert client.request("GET", "/ping") == {"ok": True} diff --git a/tests/test_convenience_methods.py b/tests/test_convenience_methods.py deleted file mode 100644 index 773dba8..0000000 --- a/tests/test_convenience_methods.py +++ /dev/null @@ -1,266 +0,0 @@ -import json - -import httpx -import pytest - -from seclai import AsyncSeclai, Seclai - - -def _extract_multipart_field( - *, body: bytes, boundary: str, field_name: str -) -> bytes | None: - marker = f'name="{field_name}"'.encode() - delim = ("--" + boundary).encode() - for part in body.split(delim): - if marker not in part: - continue - header_end = part.find(b"\r\n\r\n") - if header_end == -1: - continue - value = part[header_end + 4 :] - value = value.strip(b"\r\n") - # Trim possible terminating boundary markers. - value = value.strip(b"-") - return value - return None - - -def test_convenience_delete_content_uses_generated_client_transport() -> None: - seen: dict[str, str] = {} - - def handler(request: httpx.Request) -> httpx.Response: - seen["method"] = request.method - seen["path"] = request.url.path - return httpx.Response(status_code=204) - - transport = httpx.MockTransport(handler) - - client = Seclai(api_key="test") - gen = client._generated_client() - gen.set_httpx_client( - httpx.Client(base_url="https://api.seclai.com", transport=transport) - ) - - client.delete_content("sc_cv_123") - assert seen == {"method": "DELETE", "path": "/contents/sc_cv_123"} - - -def test_convenience_upload_file_to_source_sends_metadata_and_uses_generated_client_transport() -> ( - None -): - seen: dict[str, object] = {} - - def handler(request: httpx.Request) -> httpx.Response: - seen["method"] = request.method - seen["path"] = request.url.path - ct = request.headers.get("content-type", "") - assert "multipart/form-data" in ct - boundary = ct.split("boundary=")[-1] - metadata_bytes = _extract_multipart_field( - body=request.content, boundary=boundary, field_name="metadata" - ) - assert metadata_bytes is not None - seen["metadata"] = json.loads(metadata_bytes.decode("utf-8")) - return httpx.Response( - status_code=200, - json={ - "content_version_id": "cv_1", - "source_connection_content_version_id": "sc_cv_1", - "filename": "hello.txt", - "status": "uploaded", - }, - ) - - transport = httpx.MockTransport(handler) - - client = Seclai(api_key="test") - gen = client._generated_client() - gen.set_httpx_client( - httpx.Client(base_url="https://api.seclai.com", transport=transport) - ) - - resp = client.upload_file_to_source( - "sc_1", - file=b"hello", - file_name="hello.txt", - mime_type="text/plain", - metadata={"category": "docs", "author": "Ada"}, - ) - assert resp.filename == "hello.txt" - assert seen == { - "method": "POST", - "path": "/sources/sc_1/upload", - "metadata": {"category": "docs", "author": "Ada"}, - } - - -def test_convenience_upload_file_to_content_sends_metadata_and_uses_generated_client_transport() -> ( - None -): - seen: dict[str, object] = {} - - def handler(request: httpx.Request) -> httpx.Response: - seen["method"] = request.method - seen["path"] = request.url.path - ct = request.headers.get("content-type", "") - assert "multipart/form-data" in ct - boundary = ct.split("boundary=")[-1] - metadata_bytes = _extract_multipart_field( - body=request.content, boundary=boundary, field_name="metadata" - ) - assert metadata_bytes is not None - seen["metadata"] = json.loads(metadata_bytes.decode("utf-8")) - return httpx.Response( - status_code=200, - json={ - "content_version_id": "cv_1", - "source_connection_content_version_id": "sc_cv_1", - "filename": "updated.pdf", - "status": "pending", - }, - ) - - transport = httpx.MockTransport(handler) - - client = Seclai(api_key="test") - gen = client._generated_client() - gen.set_httpx_client( - httpx.Client(base_url="https://api.seclai.com", transport=transport) - ) - - resp = client.upload_file_to_content( - "sc_cv_1", - file=b"%PDF", - file_name="updated.pdf", - mime_type="application/pdf", - metadata={"revision": 2}, - ) - assert resp.filename == "updated.pdf" - assert seen == { - "method": "POST", - "path": "/contents/sc_cv_1/upload", - "metadata": {"revision": 2}, - } - - -@pytest.mark.asyncio -async def test_async_convenience_delete_content_uses_generated_client_transport() -> ( - None -): - seen: dict[str, str] = {} - - async def handler(request: httpx.Request) -> httpx.Response: - seen["method"] = request.method - seen["path"] = request.url.path - return httpx.Response(status_code=204) - - transport = httpx.MockTransport(handler) - - client = AsyncSeclai(api_key="test") - gen = client._generated_client() - gen.set_async_httpx_client( - httpx.AsyncClient(base_url="https://api.seclai.com", transport=transport) - ) - - await client.delete_content("sc_cv_123") - assert seen == {"method": "DELETE", "path": "/contents/sc_cv_123"} - - -@pytest.mark.asyncio -async def test_async_convenience_upload_file_to_source_sends_metadata_and_uses_generated_client_transport() -> ( - None -): - seen: dict[str, object] = {} - - async def handler(request: httpx.Request) -> httpx.Response: - seen["method"] = request.method - seen["path"] = request.url.path - ct = request.headers.get("content-type", "") - assert "multipart/form-data" in ct - boundary = ct.split("boundary=")[-1] - metadata_bytes = _extract_multipart_field( - body=request.content, boundary=boundary, field_name="metadata" - ) - assert metadata_bytes is not None - seen["metadata"] = json.loads(metadata_bytes.decode("utf-8")) - return httpx.Response( - status_code=200, - json={ - "content_version_id": "cv_1", - "source_connection_content_version_id": "sc_cv_1", - "filename": "hello.txt", - "status": "uploaded", - }, - ) - - transport = httpx.MockTransport(handler) - - client = AsyncSeclai(api_key="test") - gen = client._generated_client() - gen.set_async_httpx_client( - httpx.AsyncClient(base_url="https://api.seclai.com", transport=transport) - ) - - resp = await client.upload_file_to_source( - "sc_1", - file=b"hello", - file_name="hello.txt", - mime_type="text/plain", - metadata={"category": "docs", "author": "Ada"}, - ) - assert resp.filename == "hello.txt" - assert seen == { - "method": "POST", - "path": "/sources/sc_1/upload", - "metadata": {"category": "docs", "author": "Ada"}, - } - - -@pytest.mark.asyncio -async def test_async_convenience_upload_file_to_content_sends_metadata_and_uses_generated_client_transport() -> ( - None -): - seen: dict[str, object] = {} - - async def handler(request: httpx.Request) -> httpx.Response: - seen["method"] = request.method - seen["path"] = request.url.path - ct = request.headers.get("content-type", "") - assert "multipart/form-data" in ct - boundary = ct.split("boundary=")[-1] - metadata_bytes = _extract_multipart_field( - body=request.content, boundary=boundary, field_name="metadata" - ) - assert metadata_bytes is not None - seen["metadata"] = json.loads(metadata_bytes.decode("utf-8")) - return httpx.Response( - status_code=200, - json={ - "content_version_id": "cv_1", - "source_connection_content_version_id": "sc_cv_1", - "filename": "updated.pdf", - "status": "pending", - }, - ) - - transport = httpx.MockTransport(handler) - - client = AsyncSeclai(api_key="test") - gen = client._generated_client() - gen.set_async_httpx_client( - httpx.AsyncClient(base_url="https://api.seclai.com", transport=transport) - ) - - resp = await client.upload_file_to_content( - "sc_cv_1", - file=b"%PDF", - file_name="updated.pdf", - mime_type="application/pdf", - metadata={"revision": 2}, - ) - assert resp.filename == "updated.pdf" - assert seen == { - "method": "POST", - "path": "/contents/sc_cv_1/upload", - "metadata": {"revision": 2}, - } diff --git a/tests/test_generated_bridge.py b/tests/test_generated_bridge.py deleted file mode 100644 index b3a223d..0000000 --- a/tests/test_generated_bridge.py +++ /dev/null @@ -1,17 +0,0 @@ -import pytest - -from seclai import Seclai -from seclai import seclai as seclai_module - - -def test_generated_client_get_httpx_client_has_api_key_header( - monkeypatch: pytest.MonkeyPatch, -) -> None: - monkeypatch.setenv("SECLAI_API_KEY", "k") - monkeypatch.setattr(seclai_module, "SECLAI_API_URL", "https://example.invalid") - client = Seclai() - - gen = client._generated_client() - http = gen.get_httpx_client() - - assert http.headers.get("x-api-key") == "k" diff --git a/tests/test_new_methods.py b/tests/test_new_methods.py deleted file mode 100644 index 19644e9..0000000 --- a/tests/test_new_methods.py +++ /dev/null @@ -1,3657 +0,0 @@ -"""Tests for all new convenience methods added to Seclai / AsyncSeclai. - -Each group covers one resource area. Tests verify the correct HTTP method, path, -query parameters, and JSON body are sent via ``MockTransport``. -""" - -from __future__ import annotations - -import json -import pathlib -from typing import Any - -import httpx -import pytest - -import seclai -from seclai import AsyncSeclai, Seclai -from seclai import versions as seclai_versions - -# --------------------------------------------------------------------------- -# Helpers -# --------------------------------------------------------------------------- - - -def _sync_client(handler, **options: Any) -> Seclai: - """A client wired to a MockTransport, with teardown. - - Takes **options so a test needing `api_version` or - `allow_unknown_api_version` does not have to hand-build a client — three - that did leaked their httpx client, and one reached the live base URL - because it passed no transport at all. - """ - transport = httpx.MockTransport(handler) - http_client = httpx.Client(base_url="https://example.invalid", transport=transport) - client = Seclai(api_key="test", http_client=http_client, **options) - # Ensure the externally-provided httpx client is closed when the SDK client closes. - client._owns_client = True - return client - - -def _async_client(handler, **options: Any) -> AsyncSeclai: - transport = httpx.MockTransport(handler) - http_client = httpx.AsyncClient( - base_url="https://example.invalid", transport=transport - ) - client = AsyncSeclai(api_key="test", http_client=http_client, **options) - client._owns_client = True - return client - - -def _json_response(body: Any = None, status: int = 200) -> httpx.Response: - if body is None: - return httpx.Response(status_code=status) - return httpx.Response(status_code=status, json=body) - - -# --------------------------------------------------------------------------- -# Agents -# --------------------------------------------------------------------------- - - -class TestAgents: - def test_list_agents(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["page"] = req.url.params.get("page") - return _json_response({"items": [], "total": 0}) - - client = _sync_client(handler) - result = client.list_agents(page=2, limit=10) - assert seen["method"] == "GET" - assert seen["path"] == "/agents" - assert seen["page"] == "2" - assert result == {"items": [], "total": 0} - - def test_create_agent(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response({"id": "a1", "name": "Test"}) - - client = _sync_client(handler) - result = client.create_agent({"name": "Test"}) - assert seen == {"method": "POST", "path": "/agents", "body": {"name": "Test"}} - assert result["id"] == "a1" - - def test_get_agent(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "a1"}) - - client = _sync_client(handler) - result = client.get_agent("a1") - assert seen == {"method": "GET", "path": "/agents/a1"} - assert result["id"] == "a1" - - def test_update_agent(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response({"id": "a1", "name": "Updated"}) - - client = _sync_client(handler) - result = client.update_agent("a1", {"name": "Updated"}) - assert seen["method"] == "PUT" - assert seen["path"] == "/agents/a1" - assert result["name"] == "Updated" - - def test_delete_agent(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.delete_agent("a1") - assert seen == {"method": "DELETE", "path": "/agents/a1"} - - def test_preview_import_agent(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response( - { - "ok": True, - "agent_name": "n", - "description": None, - "step_count": 0, - "schedules": 0, - "alert_configs": 0, - "evaluation_criteria": 0, - "governance_policies": 0, - } - ) - - client = _sync_client(handler) - result = client.preview_import_agent( - {"agent_definition": {"agent": {"name": "n"}}} - ) - assert seen["method"] == "POST" - assert seen["path"] == "/agents/preview-import" - assert seen["body"] == {"agent_definition": {"agent": {"name": "n"}}} - assert result["ok"] is True - - -# --------------------------------------------------------------------------- -# Agent Definitions -# --------------------------------------------------------------------------- - - -class TestAgentDefinitions: - def test_get_agent_definition(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"steps": []}) - - client = _sync_client(handler) - result = client.get_agent_definition("a1") - assert seen == {"method": "GET", "path": "/agents/a1/definition"} - assert result == {"steps": []} - - def test_update_agent_definition(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response({"steps": [{"type": "llm"}]}) - - client = _sync_client(handler) - body = {"change_id": "c1", "steps": [{"type": "llm"}]} - client.update_agent_definition("a1", body) - assert seen["method"] == "PUT" - assert seen["path"] == "/agents/a1/definition" - - -# --------------------------------------------------------------------------- -# Agent Runs (additional) -# --------------------------------------------------------------------------- - - -class TestAgentRunsAdditional: - def test_search_agent_runs(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response({"results": []}) - - client = _sync_client(handler) - client.search_agent_runs({"query": "test"}) - assert seen == { - "method": "POST", - "path": "/agents/runs/search", - "body": {"query": "test"}, - } - - def test_cancel_agent_run(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"run_id": "r1", "status": "cancelled"}) - - client = _sync_client(handler) - client.cancel_agent_run("r1") - # Cancellation is DELETE on the run resource. This asserted - # POST /agents/runs/{id}/cancel, a path the API has never had, so it - # confirmed a 404-ing method rather than catching it. - assert seen == {"method": "DELETE", "path": "/agents/runs/r1"} - - -# --------------------------------------------------------------------------- -# Agent Input Uploads -# --------------------------------------------------------------------------- - - -class TestAgentInputUploads: - def test_upload_agent_input(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - ct = req.headers.get("content-type", "") - seen["has_multipart"] = "multipart/form-data" in ct - return _json_response({"upload_id": "u1"}) - - client = _sync_client(handler) - result = client.upload_agent_input("a1", file=b"hello", file_name="test.txt") - assert seen["method"] == "POST" - assert seen["path"] == "/agents/a1/upload-input" - assert seen["has_multipart"] is True - assert result["upload_id"] == "u1" - - def test_get_agent_input_upload_status(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"upload_id": "u1", "status": "completed"}) - - client = _sync_client(handler) - client.get_agent_input_upload_status("a1", "u1") - assert seen == {"method": "GET", "path": "/agents/a1/input-uploads/u1"} - - def test_get_agent_attachment_references(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"requires_uploads": False}) - - client = _sync_client(handler) - result = client.get_agent_attachment_references("a1") - assert seen == {"method": "GET", "path": "/agents/a1/attachment-references"} - assert result["requires_uploads"] is False - - def test_download_agent_run_attachment(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["download_name"] = req.url.params.get("download_name") - return httpx.Response(status_code=200, content=b"file-bytes") - - client = _sync_client(handler) - resp = client.download_agent_run_attachment( - "r1", "att1", download_name="report.pdf" - ) - assert seen == { - "method": "GET", - "path": "/v2/agent-runs/r1/attachments/att1", - "download_name": "report.pdf", - } - resp.read() - assert resp.content == b"file-bytes" - resp.close() - - def test_download_agent_run_attachment_error_closes_stream(self) -> None: - """On an error status the streaming response is closed before raising.""" - from seclai import SeclaiAPIStatusError - - captured: dict[str, httpx.Response] = {} - - def handler(req: httpx.Request) -> httpx.Response: - resp = httpx.Response(status_code=404, content=b"not found") - captured["resp"] = resp - return resp - - client = _sync_client(handler) - with pytest.raises(SeclaiAPIStatusError) as exc: - client.download_agent_run_attachment("r1", "missing") - # Body was read so the error carries detail, and the stream is released. - assert exc.value.status_code == 404 - assert captured["resp"].is_closed - - -# --------------------------------------------------------------------------- -# Agent AI Assistant -# --------------------------------------------------------------------------- - - -class TestAgentAIAssistant: - def test_generate_agent_steps(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"steps": []}) - - client = _sync_client(handler) - client.generate_agent_steps("a1", {"user_input": "Build a chatbot"}) - assert seen == { - "method": "POST", - "path": "/agents/a1/ai-assistant/generate-steps", - } - - def test_generate_step_config(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"config": {}}) - - client = _sync_client(handler) - client.generate_step_config("a1", {"step_type": "llm"}) - assert seen == {"method": "POST", "path": "/agents/a1/ai-assistant/step-config"} - - def test_get_agent_ai_conversation_history(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - seen["query"] = dict(req.url.params) - return _json_response({"conversations": []}) - - client = _sync_client(handler) - client.get_agent_ai_conversation_history("a1", step_type="llm", limit=5) - assert seen["path"] == "/agents/a1/ai-assistant/conversations" - # The API marks step_type required; asserting only the path is what let - # this method ship unable to send it. - assert seen["query"] == {"step_type": "llm", "limit": "5"} - - def test_get_agent_ai_conversation_history_requires_step_type(self) -> None: - client = _sync_client(lambda req: _json_response({"conversations": []})) - with pytest.raises(ValueError, match="step_type is required"): - client.get_agent_ai_conversation_history("a1") - - def test_mark_agent_ai_suggestion(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.mark_agent_ai_suggestion("a1", "c1", {"accepted": True}) - assert seen == {"method": "PATCH", "path": "/agents/a1/ai-assistant/c1"} - - -# --------------------------------------------------------------------------- -# Agent Evaluations -# --------------------------------------------------------------------------- - - -class TestAgentEvaluations: - def test_list_evaluation_criteria(self) -> None: - # Asserting only the path let the 2026-07 change through: the endpoint - # started returning a paginated envelope instead of a bare list and this - # test, which discarded the body, stayed green while callers broke. - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - seen["query"] = dict(req.url.params) - return _json_response( - { - "data": [{"id": "ec1"}], - "pagination": { - "page": 2, - "limit": 25, - "total": 7, - "pages": 1, - "has_next": False, - "has_prev": True, - }, - } - ) - - client = _sync_client(handler) - result = client.list_evaluation_criteria("a1", page=2, limit=25) - assert seen["path"] == "/agents/a1/evaluation-criteria" - assert seen["query"] == {"page": "2", "limit": "25"} - assert result == [{"id": "ec1"}] - - def test_list_evaluation_criteria_accepts_a_bare_list(self) -> None: - # The endpoint answered with a bare array before 2026-07 and that change - # is not deployed yet, so both shapes are live. Decoding only one breaks - # the client the day the other ships. - def handler(req: httpx.Request) -> httpx.Response: - return _json_response([{"id": "ec1"}]) - - client = _sync_client(handler) - assert client.list_evaluation_criteria("a1") == [{"id": "ec1"}] - - def test_list_evaluation_criteria_page_exposes_metadata(self) -> None: - def handler(req: httpx.Request) -> httpx.Response: - return _json_response( - { - "data": [{"id": "ec1"}], - "pagination": { - "page": 2, - "limit": 25, - "total": 7, - "pages": 1, - "has_next": False, - "has_prev": True, - }, - } - ) - - client = _sync_client(handler) - page = client.list_evaluation_criteria_page("a1", page=2, limit=25) - assert page["data"] == [{"id": "ec1"}] - assert page["pagination"]["total"] == 7 - - def test_create_evaluation_criteria(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "ec1"}) - - client = _sync_client(handler) - client.create_evaluation_criteria("a1", {"name": "accuracy"}) - assert seen == {"method": "POST", "path": "/agents/a1/evaluation-criteria"} - - def test_get_evaluation_criteria(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"id": "ec1"}) - - client = _sync_client(handler) - client.get_evaluation_criteria("ec1") - assert seen["path"] == "/agents/evaluation-criteria/ec1" - - def test_update_evaluation_criteria(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "ec1"}) - - client = _sync_client(handler) - client.update_evaluation_criteria("ec1", {"name": "updated"}) - assert seen == {"method": "PATCH", "path": "/agents/evaluation-criteria/ec1"} - - def test_delete_evaluation_criteria(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.delete_evaluation_criteria("ec1") - assert seen == {"method": "DELETE", "path": "/agents/evaluation-criteria/ec1"} - - def test_get_evaluation_criteria_summary(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"total": 5}) - - client = _sync_client(handler) - client.get_evaluation_criteria_summary("ec1") - assert seen["path"] == "/agents/evaluation-criteria/ec1/summary" - - def test_list_evaluation_results(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _sync_client(handler) - client.list_evaluation_results("ec1") - assert seen["path"] == "/agents/evaluation-criteria/ec1/results" - - def test_create_evaluation_result(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "er1"}) - - client = _sync_client(handler) - client.create_evaluation_result("ec1", {"run_id": "r1", "score": 0.9}) - assert seen == { - "method": "POST", - "path": "/agents/evaluation-criteria/ec1/results", - } - - def test_list_compatible_runs(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _sync_client(handler) - client.list_compatible_runs("ec1") - assert seen["path"] == "/agents/evaluation-criteria/ec1/compatible-runs" - - def test_test_draft_evaluation(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"score": 0.8}) - - client = _sync_client(handler) - client.test_draft_evaluation("a1", {"criteria": {}, "run_id": "r1"}) - assert seen == { - "method": "POST", - "path": "/agents/a1/evaluation-criteria/test-draft", - } - - def test_list_agent_evaluation_results(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _sync_client(handler) - client.list_agent_evaluation_results("a1") - assert seen["path"] == "/agents/a1/evaluation-results" - - def test_list_run_evaluation_results(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - # A bare array: the legacy shape this endpoint actually returns. The - # previous fixture used `{"items": []}`, a shape the API never sends, - # and passed only because the unwrap helper failed open. - return _json_response([{"id": "er1"}]) - - client = _sync_client(handler) - result = client.list_run_evaluation_results("a1", "r1") - assert seen["path"] == "/agents/a1/runs/r1/evaluation-results" - assert result == [{"id": "er1"}] - - def test_list_evaluation_runs(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _sync_client(handler) - client.list_evaluation_runs("a1") - assert seen["path"] == "/agents/a1/evaluation-runs" - - def test_get_non_manual_evaluation_summary(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - seen["agent_id"] = req.url.params.get("agent_id") - return _json_response({"total": 0}) - - client = _sync_client(handler) - client.get_non_manual_evaluation_summary("a1") - assert seen["path"] == "/agents/evaluation-results/non-manual-summary" - assert seen["agent_id"] == "a1" - - -# --------------------------------------------------------------------------- -# Knowledge Bases -# --------------------------------------------------------------------------- - - -class TestKnowledgeBases: - def test_list_knowledge_bases(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _sync_client(handler) - client.list_knowledge_bases() - assert seen == {"method": "GET", "path": "/knowledge_bases"} - - def test_create_knowledge_base(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "kb1"}) - - client = _sync_client(handler) - client.create_knowledge_base({"name": "KB"}) - assert seen == {"method": "POST", "path": "/knowledge_bases"} - - def test_get_knowledge_base(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"id": "kb1"}) - - client = _sync_client(handler) - client.get_knowledge_base("kb1") - assert seen["path"] == "/knowledge_bases/kb1" - - def test_update_knowledge_base(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "kb1"}) - - client = _sync_client(handler) - client.update_knowledge_base("kb1", {"name": "Updated"}) - assert seen == {"method": "PUT", "path": "/knowledge_bases/kb1"} - - def test_delete_knowledge_base(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.delete_knowledge_base("kb1") - assert seen == {"method": "DELETE", "path": "/knowledge_bases/kb1"} - - -# --------------------------------------------------------------------------- -# Memory Banks -# --------------------------------------------------------------------------- - - -class TestMemoryBanks: - def test_list_memory_banks(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _sync_client(handler) - client.list_memory_banks() - assert seen["path"] == "/memory_banks" - - def test_create_memory_bank(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "mb1"}) - - client = _sync_client(handler) - client.create_memory_bank({"name": "MB", "type": "conversation"}) - assert seen == {"method": "POST", "path": "/memory_banks"} - - def test_get_memory_bank(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"id": "mb1"}) - - client = _sync_client(handler) - client.get_memory_bank("mb1") - assert seen["path"] == "/memory_banks/mb1" - - def test_update_memory_bank(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "mb1"}) - - client = _sync_client(handler) - client.update_memory_bank("mb1", {"name": "Updated"}) - assert seen == {"method": "PUT", "path": "/memory_banks/mb1"} - - def test_delete_memory_bank(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.delete_memory_bank("mb1") - assert seen == {"method": "DELETE", "path": "/memory_banks/mb1"} - - def test_get_agents_using_memory_bank(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response([]) - - client = _sync_client(handler) - client.get_agents_using_memory_bank("mb1") - assert seen["path"] == "/memory_banks/mb1/agents" - - def test_get_memory_bank_stats(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"entries": 0}) - - client = _sync_client(handler) - client.get_memory_bank_stats("mb1") - assert seen["path"] == "/memory_banks/mb1/stats" - - def test_compact_memory_bank(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.compact_memory_bank("mb1") - assert seen == {"method": "POST", "path": "/memory_banks/mb1/compact"} - - def test_delete_memory_bank_source(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.delete_memory_bank_source("mb1") - assert seen == {"method": "DELETE", "path": "/memory_banks/mb1/source"} - - def test_test_memory_bank_compaction(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"result": "ok"}) - - client = _sync_client(handler) - client.test_memory_bank_compaction("mb1", {"entries": []}) - assert seen == {"method": "POST", "path": "/memory_banks/mb1/test-compaction"} - - def test_test_compaction_prompt_standalone(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"result": "ok"}) - - client = _sync_client(handler) - client.test_compaction_prompt_standalone({"prompt": "test"}) - assert seen == {"method": "POST", "path": "/memory_banks/test-compaction"} - - def test_list_memory_bank_templates(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response([]) - - client = _sync_client(handler) - client.list_memory_bank_templates() - assert seen["path"] == "/memory_banks/templates" - - def test_generate_memory_bank_config(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"config": {}}) - - client = _sync_client(handler) - client.generate_memory_bank_config({"user_input": "Create a bank"}) - assert seen == {"method": "POST", "path": "/memory_banks/ai-assistant"} - - -# --------------------------------------------------------------------------- -# Sources (additional) -# --------------------------------------------------------------------------- - - -class TestSourcesAdditional: - def test_create_source(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "s1"}) - - client = _sync_client(handler) - client.create_source({"name": "S1"}) - assert seen == {"method": "POST", "path": "/sources"} - - def test_get_source(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"id": "s1"}) - - client = _sync_client(handler) - client.get_source("s1") - assert seen["path"] == "/sources/s1" - - def test_update_source(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "s1"}) - - client = _sync_client(handler) - client.update_source("s1", {"name": "Updated"}) - assert seen == {"method": "PUT", "path": "/sources/s1"} - - def test_delete_source(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.delete_source("s1") - assert seen == {"method": "DELETE", "path": "/sources/s1"} - - def test_upload_inline_text_to_source(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "c1"}) - - client = _sync_client(handler) - client.upload_inline_text_to_source("sc1", {"title": "T", "content": "C"}) - assert seen == {"method": "POST", "path": "/sources/sc1"} - - -# --------------------------------------------------------------------------- -# Source Exports -# --------------------------------------------------------------------------- - - -class TestSourceExports: - def test_list_source_exports(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _sync_client(handler) - client.list_source_exports("s1") - assert seen["path"] == "/sources/s1/exports" - - def test_create_source_export(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "e1"}) - - client = _sync_client(handler) - client.create_source_export("s1", {"format": "json"}) - assert seen == {"method": "POST", "path": "/sources/s1/exports"} - - def test_get_source_export(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"id": "e1"}) - - client = _sync_client(handler) - client.get_source_export("s1", "e1") - assert seen["path"] == "/sources/s1/exports/e1" - - def test_cancel_source_export(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "e1", "status": "cancelled"}) - - client = _sync_client(handler) - client.cancel_source_export("s1", "e1") - assert seen == {"method": "POST", "path": "/sources/s1/exports/e1/cancel"} - - def test_delete_source_export(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.delete_source_export("s1", "e1") - assert seen == {"method": "DELETE", "path": "/sources/s1/exports/e1"} - - def test_download_source_export(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=200, content=b"csv-data") - - client = _sync_client(handler) - resp = client.download_source_export("s1", "e1") - assert seen == {"method": "GET", "path": "/sources/s1/exports/e1/download"} - resp.read() - assert resp.content == b"csv-data" - resp.close() - - def test_estimate_source_export(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"estimated_bytes": 1024}) - - client = _sync_client(handler) - client.estimate_source_export("s1", {"format": "json"}) - assert seen == {"method": "POST", "path": "/sources/s1/exports/estimate"} - - -# --------------------------------------------------------------------------- -# Source Embedding Migrations -# --------------------------------------------------------------------------- - - -class TestSourceEmbeddingMigrations: - def test_get_source_embedding_migration(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"status": "idle"}) - - client = _sync_client(handler) - client.get_source_embedding_migration("s1") - assert seen["path"] == "/sources/s1/embedding-migration" - - def test_start_source_embedding_migration(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"status": "in_progress"}) - - client = _sync_client(handler) - client.start_source_embedding_migration("s1", {"target_model": "v2"}) - assert seen == {"method": "POST", "path": "/sources/s1/embedding-migration"} - - def test_cancel_source_embedding_migration(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"status": "cancelled"}) - - client = _sync_client(handler) - client.cancel_source_embedding_migration("s1") - assert seen == { - "method": "POST", - "path": "/sources/s1/embedding-migration/cancel", - } - - -# --------------------------------------------------------------------------- -# Content (additional) -# --------------------------------------------------------------------------- - - -class TestContentAdditional: - def test_replace_content_with_inline_text(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "cv1"}) - - client = _sync_client(handler) - client.replace_content_with_inline_text("cv1", {"title": "T", "content": "C"}) - assert seen == {"method": "PUT", "path": "/contents/cv1"} - - -# --------------------------------------------------------------------------- -# Solutions -# --------------------------------------------------------------------------- - - -class TestSolutions: - def test_list_solutions(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _sync_client(handler) - client.list_solutions() - assert seen["path"] == "/solutions" - - def test_create_solution(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "sol1"}) - - client = _sync_client(handler) - client.create_solution({"name": "Sol"}) - assert seen == {"method": "POST", "path": "/solutions"} - - def test_get_solution(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"id": "sol1"}) - - client = _sync_client(handler) - client.get_solution("sol1") - assert seen["path"] == "/solutions/sol1" - - def test_update_solution(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "sol1"}) - - client = _sync_client(handler) - client.update_solution("sol1", {"name": "Updated"}) - assert seen == {"method": "PATCH", "path": "/solutions/sol1"} - - def test_delete_solution(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.delete_solution("sol1") - assert seen == {"method": "DELETE", "path": "/solutions/sol1"} - - def test_link_agents_to_solution(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "sol1"}) - - client = _sync_client(handler) - client.link_agents_to_solution("sol1", {"agent_ids": ["a1"]}) - assert seen == {"method": "POST", "path": "/solutions/sol1/agents"} - - def test_unlink_agents_from_solution(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "sol1"}) - - client = _sync_client(handler) - client.unlink_agents_from_solution("sol1", {"agent_ids": ["a1"]}) - assert seen == {"method": "DELETE", "path": "/solutions/sol1/agents"} - - def test_link_knowledge_bases_to_solution(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "sol1"}) - - client = _sync_client(handler) - client.link_knowledge_bases_to_solution("sol1", {"kb_ids": ["kb1"]}) - assert seen == {"method": "POST", "path": "/solutions/sol1/knowledge-bases"} - - def test_unlink_knowledge_bases_from_solution(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "sol1"}) - - client = _sync_client(handler) - client.unlink_knowledge_bases_from_solution("sol1", {"kb_ids": ["kb1"]}) - assert seen == {"method": "DELETE", "path": "/solutions/sol1/knowledge-bases"} - - def test_link_source_connections_to_solution(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "sol1"}) - - client = _sync_client(handler) - client.link_source_connections_to_solution("sol1", {"sc_ids": ["sc1"]}) - assert seen == {"method": "POST", "path": "/solutions/sol1/source-connections"} - - def test_generate_solution_ai_plan(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"plan": {}}) - - client = _sync_client(handler) - client.generate_solution_ai_plan("sol1", {"user_input": "Build it"}) - assert seen == { - "method": "POST", - "path": "/solutions/sol1/ai-assistant/generate", - } - - def test_accept_solution_ai_plan(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"result": "applied"}) - - client = _sync_client(handler) - client.accept_solution_ai_plan("sol1", "c1", {}) - assert seen == { - "method": "POST", - "path": "/solutions/sol1/ai-assistant/c1/accept", - } - - def test_decline_solution_ai_plan(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.decline_solution_ai_plan("sol1", "c1") - assert seen == { - "method": "POST", - "path": "/solutions/sol1/ai-assistant/c1/decline", - } - - -# --------------------------------------------------------------------------- -# Governance AI -# --------------------------------------------------------------------------- - - -class TestGovernanceAI: - def test_generate_governance_ai_plan(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"plan": {}}) - - client = _sync_client(handler) - client.generate_governance_ai_plan({"user_input": "Create a policy"}) - assert seen == {"method": "POST", "path": "/governance/ai-assistant"} - - def test_list_governance_ai_conversations(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response([]) - - client = _sync_client(handler) - client.list_governance_ai_conversations() - assert seen["path"] == "/governance/ai-assistant/conversations" - - def test_accept_governance_ai_plan(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"result": "applied"}) - - client = _sync_client(handler) - client.accept_governance_ai_plan("c1") - assert seen == {"method": "POST", "path": "/governance/ai-assistant/c1/accept"} - - def test_decline_governance_ai_plan(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.decline_governance_ai_plan("c1") - assert seen == {"method": "POST", "path": "/governance/ai-assistant/c1/decline"} - - -# --------------------------------------------------------------------------- -# Alerts -# --------------------------------------------------------------------------- - - -class TestAlerts: - def test_list_alerts(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _sync_client(handler) - client.list_alerts() - assert seen["path"] == "/alerts" - - def test_get_alert(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"id": "al1"}) - - client = _sync_client(handler) - client.get_alert("al1") - assert seen["path"] == "/alerts/al1" - - def test_change_alert_status(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "al1"}) - - client = _sync_client(handler) - client.change_alert_status("al1", {"status": "resolved"}) - assert seen == {"method": "POST", "path": "/alerts/al1/status"} - - def test_add_alert_comment(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "co1"}) - - client = _sync_client(handler) - client.add_alert_comment("al1", {"text": "Looking into it"}) - assert seen == {"method": "POST", "path": "/alerts/al1/comments"} - - def test_subscribe_to_alert(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"ok": True}) - - client = _sync_client(handler) - client.subscribe_to_alert("al1") - assert seen == {"method": "POST", "path": "/alerts/al1/subscribe"} - - def test_unsubscribe_from_alert(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"ok": True}) - - client = _sync_client(handler) - client.unsubscribe_from_alert("al1") - assert seen == {"method": "POST", "path": "/alerts/al1/unsubscribe"} - - -# --------------------------------------------------------------------------- -# Alert Configs -# --------------------------------------------------------------------------- - - -class TestAlertConfigs: - def test_list_alert_configs(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _sync_client(handler) - client.list_alert_configs() - assert seen["path"] == "/alerts/configs" - - def test_create_alert_config(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "ac1"}) - - client = _sync_client(handler) - client.create_alert_config({"name": "Config"}) - assert seen == {"method": "POST", "path": "/alerts/configs"} - - def test_get_alert_config(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"id": "ac1"}) - - client = _sync_client(handler) - client.get_alert_config("ac1") - assert seen["path"] == "/alerts/configs/ac1" - - def test_update_alert_config(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "ac1"}) - - client = _sync_client(handler) - client.update_alert_config("ac1", {"name": "Updated"}) - assert seen == {"method": "PATCH", "path": "/alerts/configs/ac1"} - - def test_delete_alert_config(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.delete_alert_config("ac1") - assert seen == {"method": "DELETE", "path": "/alerts/configs/ac1"} - - -# --------------------------------------------------------------------------- -# Alert Preferences -# --------------------------------------------------------------------------- - - -class TestAlertPreferences: - def test_list_organization_alert_preferences(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"preferences": []}) - - client = _sync_client(handler) - client.list_organization_alert_preferences() - assert seen["path"] == "/alerts/organization-preferences/list" - - def test_update_organization_alert_preference(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"ok": True}) - - client = _sync_client(handler) - client.update_organization_alert_preference( - "org1", "anomaly", {"enabled": True} - ) - assert seen == { - "method": "PATCH", - "path": "/alerts/organization-preferences/org1/anomaly", - } - - -# --------------------------------------------------------------------------- -# Model Alerts -# --------------------------------------------------------------------------- - - -class TestModelAlerts: - def test_list_model_alerts(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _sync_client(handler) - client.list_model_alerts() - assert seen["path"] == "/models/alerts" - - def test_mark_all_model_alerts_read(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.mark_all_model_alerts_read() - assert seen == {"method": "POST", "path": "/models/alerts/mark-all-read"} - - def test_get_unread_model_alert_count(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"count": 3}) - - client = _sync_client(handler) - client.get_unread_model_alert_count() - assert seen["path"] == "/models/alerts/unread-count" - - def test_mark_model_alert_read(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.mark_model_alert_read("ma1") - assert seen == {"method": "PATCH", "path": "/models/alerts/ma1/read"} - - -# --------------------------------------------------------------------------- -# Models -# --------------------------------------------------------------------------- - - -class TestModels: - def test_get_model_recommendations(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"models": []}) - - client = _sync_client(handler) - client.get_model_recommendations("m1") - assert seen["path"] == "/models/m1/recommendations" - - def test_delete_experiment(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.delete_experiment("exp1") - assert seen == { - "method": "DELETE", - "path": "/models/playground/experiments/exp1", - } - - -# --------------------------------------------------------------------------- -# Search -# --------------------------------------------------------------------------- - - -class TestSearch: - def test_search(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - seen["q"] = req.url.params.get("q") - seen["query"] = req.url.params.get("query") - return _json_response({"results": []}) - - client = _sync_client(handler) - client.search(query="hello") - assert seen["path"] == "/search" - # The spec names this parameter `q` and marks it required; sending - # `query` instead produced a 422 on every call. - assert seen["q"] == "hello" - assert seen["query"] is None - - -# --------------------------------------------------------------------------- -# High-level: run_streaming_agent (new generator) -# --------------------------------------------------------------------------- - - -class TestRunStreamingAgent: - def test_run_streaming_agent_generator(self) -> None: - def handler(req: httpx.Request) -> httpx.Response: - assert req.url.path == "/agents/a1/runs/stream" - init_data = json.dumps({"run_id": "r1", "status": "processing"}) - done_data = json.dumps( - {"run_id": "r1", "status": "completed", "output": "ok"} - ) - content = ( - f"event: init\ndata: {init_data}\n\n" - f"event: done\ndata: {done_data}\n\n" - ).encode() - return httpx.Response( - status_code=200, - headers={"content-type": "text/event-stream"}, - content=content, - ) - - client = _sync_client(handler) - from seclai import AgentRunStreamRequest - - events = list( - client.run_streaming_agent( - "a1", AgentRunStreamRequest(input="hi", metadata={}) - ) - ) - assert len(events) == 2 - assert events[0][0] == "init" - assert events[1][0] == "done" - assert events[1][1]["output"] == "ok" - - -# --------------------------------------------------------------------------- -# Async counterparts (spot-check a few resource areas) -# --------------------------------------------------------------------------- - - -class TestAsyncMethods: - @pytest.mark.asyncio - async def test_async_list_agents(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _async_client(handler) - result = await client.list_agents() - assert seen == {"method": "GET", "path": "/agents"} - assert result == {"items": []} - - @pytest.mark.asyncio - async def test_async_create_agent(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "a1"}) - - client = _async_client(handler) - result = await client.create_agent({"name": "Test"}) - assert seen == {"method": "POST", "path": "/agents"} - assert result["id"] == "a1" - - @pytest.mark.asyncio - async def test_async_preview_import_agent(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response({"ok": True}) - - client = _async_client(handler) - await client.preview_import_agent( - {"agent_definition": {"agent": {"name": "n"}}} - ) - assert seen["method"] == "POST" - assert seen["path"] == "/agents/preview-import" - assert seen["body"] == {"agent_definition": {"agent": {"name": "n"}}} - - @pytest.mark.asyncio - async def test_async_delete_agent(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _async_client(handler) - await client.delete_agent("a1") - assert seen == {"method": "DELETE", "path": "/agents/a1"} - - @pytest.mark.asyncio - async def test_async_list_knowledge_bases(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _async_client(handler) - await client.list_knowledge_bases() - assert seen["path"] == "/knowledge_bases" - - @pytest.mark.asyncio - async def test_async_create_solution(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "sol1"}) - - client = _async_client(handler) - await client.create_solution({"name": "Sol"}) - assert seen == {"method": "POST", "path": "/solutions"} - - @pytest.mark.asyncio - async def test_async_list_alerts(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"items": []}) - - client = _async_client(handler) - await client.list_alerts() - assert seen["path"] == "/alerts" - - @pytest.mark.asyncio - async def test_async_search(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - seen["q"] = req.url.params.get("q") - seen["query"] = req.url.params.get("query") - return _json_response({"results": []}) - - client = _async_client(handler) - await client.search(query="test") - assert seen["path"] == "/search" - assert seen["q"] == "test" - assert seen["query"] is None - - @pytest.mark.asyncio - async def test_async_create_memory_bank(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "mb1"}) - - client = _async_client(handler) - await client.create_memory_bank({"name": "MB", "type": "general"}) - assert seen == {"method": "POST", "path": "/memory_banks"} - - @pytest.mark.asyncio - async def test_async_generate_governance_ai_plan(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"plan": {}}) - - client = _async_client(handler) - await client.generate_governance_ai_plan({"user_input": "Create policy"}) - assert seen == {"method": "POST", "path": "/governance/ai-assistant"} - - @pytest.mark.asyncio - async def test_async_cancel_agent_run(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"status": "cancelled"}) - - client = _async_client(handler) - await client.cancel_agent_run("r1") - assert seen == {"method": "DELETE", "path": "/agents/runs/r1"} - - @pytest.mark.asyncio - async def test_async_get_agent_attachment_references(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"requires_uploads": True}) - - client = _async_client(handler) - result = await client.get_agent_attachment_references("a1") - assert seen == {"method": "GET", "path": "/agents/a1/attachment-references"} - assert result["requires_uploads"] is True - - @pytest.mark.asyncio - async def test_async_download_agent_run_attachment(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=200, content=b"file-bytes") - - client = _async_client(handler) - resp = await client.download_agent_run_attachment("r1", "att1") - assert seen == { - "method": "GET", - "path": "/v2/agent-runs/r1/attachments/att1", - } - await resp.aread() - assert resp.content == b"file-bytes" - await resp.aclose() - - @pytest.mark.asyncio - async def test_async_delete_experiment(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _async_client(handler) - await client.delete_experiment("exp1") - assert seen == { - "method": "DELETE", - "path": "/models/playground/experiments/exp1", - } - - @pytest.mark.asyncio - async def test_async_run_streaming_agent(self) -> None: - async def handler(req: httpx.Request) -> httpx.Response: - init_data = json.dumps({"run_id": "r1", "status": "processing"}) - done_data = json.dumps({"run_id": "r1", "status": "completed"}) - content = ( - f"event: init\ndata: {init_data}\n\n" - f"event: done\ndata: {done_data}\n\n" - ).encode() - return httpx.Response( - status_code=200, - headers={"content-type": "text/event-stream"}, - content=content, - ) - - client = _async_client(handler) - from seclai import AgentRunStreamRequest - - events = [ - ev - async for ev in client.run_streaming_agent( - "a1", AgentRunStreamRequest(input="hi", metadata={}) - ) - ] - assert len(events) == 2 - assert events[0][0] == "init" - assert events[1][0] == "done" - - @pytest.mark.asyncio - async def test_async_download_source_export(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["has_api_key"] = "x-api-key" in req.headers - return httpx.Response(status_code=200, content=b"csv-data") - - client = _async_client(handler) - resp = await client.download_source_export("s1", "e1") - assert seen == { - "method": "GET", - "path": "/sources/s1/exports/e1/download", - "has_api_key": True, - } - await resp.aread() - assert resp.content == b"csv-data" - await resp.aclose() - - -# --------------------------------------------------------------------------- -# Top-level AI Assistant -# --------------------------------------------------------------------------- - - -class TestTopLevelAIAssistant: - def test_submit_ai_feedback(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"ok": True}) - - client = _sync_client(handler) - client.submit_ai_feedback({"rating": 5, "comment": "Great!"}) - assert seen == {"method": "POST", "path": "/ai-assistant/feedback"} - - def test_ai_assistant_knowledge_base(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"plan": {}}) - - client = _sync_client(handler) - client.ai_assistant_knowledge_base({"user_input": "Create a KB"}) - assert seen == {"method": "POST", "path": "/ai-assistant/knowledge-base"} - - def test_ai_assistant_source(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"plan": {}}) - - client = _sync_client(handler) - client.ai_assistant_source({"user_input": "Create a source"}) - assert seen == {"method": "POST", "path": "/ai-assistant/source"} - - def test_ai_assistant_solution(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"plan": {}}) - - client = _sync_client(handler) - client.ai_assistant_solution({"user_input": "Create a solution"}) - assert seen == {"method": "POST", "path": "/ai-assistant/solution"} - - def test_ai_assistant_memory_bank(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"plan": {}}) - - client = _sync_client(handler) - client.ai_assistant_memory_bank({"user_input": "Create a bank"}) - assert seen == {"method": "POST", "path": "/ai-assistant/memory-bank"} - - def test_get_ai_assistant_memory_bank_history(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"conversations": []}) - - client = _sync_client(handler) - client.get_ai_assistant_memory_bank_history() - assert seen["path"] == "/ai-assistant/memory-bank/last-conversation" - - def test_accept_ai_assistant_plan(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"result": "applied"}) - - client = _sync_client(handler) - client.accept_ai_assistant_plan("c1", {"accepted": True}) - assert seen == {"method": "POST", "path": "/ai-assistant/c1/accept"} - - def test_decline_ai_assistant_plan(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _sync_client(handler) - client.decline_ai_assistant_plan("c1") - assert seen == {"method": "POST", "path": "/ai-assistant/c1/decline"} - - def test_accept_ai_memory_bank_suggestion(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"ok": True}) - - client = _sync_client(handler) - client.accept_ai_memory_bank_suggestion("c1", {"accepted": True}) - assert seen == {"method": "PATCH", "path": "/ai-assistant/memory-bank/c1"} - - -# --------------------------------------------------------------------------- -# Top-level AI Assistant (async) -# --------------------------------------------------------------------------- - - -class TestAsyncTopLevelAIAssistant: - @pytest.mark.asyncio - async def test_async_submit_ai_feedback(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"ok": True}) - - client = _async_client(handler) - await client.submit_ai_feedback({"rating": 5}) - assert seen == {"method": "POST", "path": "/ai-assistant/feedback"} - - @pytest.mark.asyncio - async def test_async_ai_assistant_knowledge_base(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - return _json_response({"plan": {}}) - - client = _async_client(handler) - await client.ai_assistant_knowledge_base({"user_input": "Create"}) - assert seen["path"] == "/ai-assistant/knowledge-base" - - @pytest.mark.asyncio - async def test_async_accept_ai_assistant_plan(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"result": "applied"}) - - client = _async_client(handler) - await client.accept_ai_assistant_plan("c1", {"accepted": True}) - assert seen == {"method": "POST", "path": "/ai-assistant/c1/accept"} - - @pytest.mark.asyncio - async def test_async_decline_ai_assistant_plan(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return httpx.Response(status_code=204) - - client = _async_client(handler) - await client.decline_ai_assistant_plan("c1") - assert seen == {"method": "POST", "path": "/ai-assistant/c1/decline"} - - -# --------------------------------------------------------------------------- -# Pagination helper -# --------------------------------------------------------------------------- - - -class TestPagination: - def test_paginate_single_page(self) -> None: - call_count = 0 - - def handler(req: httpx.Request) -> httpx.Response: - nonlocal call_count - call_count += 1 - # Return fewer items than limit → single page - return _json_response({"data": [{"id": "1"}, {"id": "2"}]}) - - client = _sync_client(handler) - items = list(client.paginate("GET", "/agents", limit=50)) - assert len(items) == 2 - assert items[0]["id"] == "1" - assert call_count == 1 - - def test_paginate_multiple_pages(self) -> None: - call_count = 0 - - def handler(req: httpx.Request) -> httpx.Response: - nonlocal call_count - call_count += 1 - page = int(req.url.params.get("page", "1")) - if page == 1: - return _json_response({"data": [{"id": "1"}, {"id": "2"}]}) - elif page == 2: - return _json_response({"data": [{"id": "3"}]}) - return _json_response({"data": []}) - - client = _sync_client(handler) - items = list(client.paginate("GET", "/agents", limit=2)) - assert len(items) == 3 - assert [i["id"] for i in items] == ["1", "2", "3"] - assert call_count == 2 - - def test_paginate_empty_first_page(self) -> None: - def handler(req: httpx.Request) -> httpx.Response: - return _json_response({"data": []}) - - client = _sync_client(handler) - items = list(client.paginate("GET", "/agents")) - assert items == [] - - def test_paginate_custom_items_key(self) -> None: - def handler(req: httpx.Request) -> httpx.Response: - return _json_response({"items": [{"id": "1"}]}) - - client = _sync_client(handler) - items = list(client.paginate("GET", "/alerts", items_key="items")) - assert len(items) == 1 - - @pytest.mark.asyncio - async def test_async_paginate_single_page(self) -> None: - async def handler(req: httpx.Request) -> httpx.Response: - return _json_response({"data": [{"id": "1"}, {"id": "2"}]}) - - client = _async_client(handler) - items = [item async for item in client.paginate("GET", "/agents", limit=50)] - assert len(items) == 2 - - @pytest.mark.asyncio - async def test_async_paginate_multiple_pages(self) -> None: - async def handler(req: httpx.Request) -> httpx.Response: - page = int(req.url.params.get("page", "1")) - if page == 1: - return _json_response({"data": [{"id": "1"}, {"id": "2"}]}) - return _json_response({"data": [{"id": "3"}]}) - - client = _async_client(handler) - items = [item async for item in client.paginate("GET", "/agents", limit=2)] - assert len(items) == 3 - - -# --------------------------------------------------------------------------- -# Error edge cases -# --------------------------------------------------------------------------- - - -class TestErrorEdgeCases: - def test_non_json_error_response(self) -> None: - """Non-JSON 500 response should still raise SeclaiAPIStatusError.""" - from seclai import SeclaiAPIStatusError - - def handler(req: httpx.Request) -> httpx.Response: - return httpx.Response(status_code=500, text="Internal Server Error") - - client = _sync_client(handler) - with pytest.raises(SeclaiAPIStatusError) as exc: - client.list_agents() - assert exc.value.status_code == 500 - - def test_empty_204_returns_none(self) -> None: - """A 204 No Content should return None from request().""" - - def handler(req: httpx.Request) -> httpx.Response: - return httpx.Response(status_code=204) - - client = _sync_client(handler) - result = client.request("DELETE", "/agents/a1") - assert result is None - - def test_text_response_returned_as_string(self) -> None: - """Non-JSON 200 should return text content.""" - - def handler(req: httpx.Request) -> httpx.Response: - return httpx.Response( - status_code=200, - headers={"content-type": "text/plain"}, - content=b"hello text", - ) - - client = _sync_client(handler) - result = client.request("GET", "/some/text") - assert result == "hello text" - - def test_strip_none_removes_none_values(self) -> None: - """_strip_none should remove None values but keep others.""" - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["params"] = dict(req.url.params) - return _json_response({"items": []}) - - # Uses `status`, which the endpoint declares. This previously asserted - # that `severity` reached the wire — a parameter GET /alerts has never - # accepted — so the test confirmed the defect instead of catching it. - client = _sync_client(handler) - client.list_alerts(status=None) - assert "status" not in seen["params"] - - client.list_alerts(status="triggered") - assert seen["params"]["status"] == "triggered" - - def test_request_passes_custom_headers(self) -> None: - """Per-request headers should be merged.""" - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["x-custom"] = req.headers.get("x-custom") - return _json_response({"ok": True}) - - client = _sync_client(handler) - client.request("GET", "/ping", headers={"x-custom": "val"}) - assert seen["x-custom"] == "val" - - @pytest.mark.asyncio - async def test_async_non_json_error(self) -> None: - from seclai import SeclaiAPIStatusError - - async def handler(req: httpx.Request) -> httpx.Response: - return httpx.Response(status_code=502, text="Bad Gateway") - - client = _async_client(handler) - with pytest.raises(SeclaiAPIStatusError) as exc: - await client.list_agents() - assert exc.value.status_code == 502 - - -# --------------------------------------------------------------------------- -# New in this sync: identity, agent pause, email governance, email domains, -# generation tiers, docs search -# --------------------------------------------------------------------------- - - -class TestIdentity: - """Identity.""" - - def test_get_me(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response( - {"account_id": "acct_1", "organizations": []}, status=200 - ) - - client = _sync_client(handler) - result = client.get_me() - assert seen["method"] == "GET" - assert seen["path"] == "/me" - assert result == {"account_id": "acct_1", "organizations": []} - - @pytest.mark.asyncio - async def test_async_get_me(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response( - {"account_id": "acct_1", "organizations": []}, status=200 - ) - - client = _async_client(handler) - result = await client.get_me() - assert seen["method"] == "GET" - assert seen["path"] == "/me" - assert result == {"account_id": "acct_1", "organizations": []} - - -class TestAgentEnableDisable: - """Agents — enable / disable.""" - - def test_disable_agent(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "a1", "disabled": True}, status=200) - - client = _sync_client(handler) - result = client.disable_agent("a1") - assert seen["method"] == "POST" - assert seen["path"] == "/agents/a1/disable" - assert result == {"id": "a1", "disabled": True} - - def test_enable_agent(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "a1", "disabled": False}, status=200) - - client = _sync_client(handler) - result = client.enable_agent("a1") - assert seen["method"] == "POST" - assert seen["path"] == "/agents/a1/enable" - assert result == {"id": "a1", "disabled": False} - - def test_get_agent_callers(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response( - [{"id": "a2", "name": "Caller", "disabled": False}], status=200 - ) - - client = _sync_client(handler) - result = client.get_agent_callers("a1") - assert seen["method"] == "GET" - assert seen["path"] == "/agents/a1/callers" - assert result == [{"id": "a2", "name": "Caller", "disabled": False}] - - @pytest.mark.asyncio - async def test_async_disable_agent(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "a1", "disabled": True}, status=200) - - client = _async_client(handler) - result = await client.disable_agent("a1") - assert seen["method"] == "POST" - assert seen["path"] == "/agents/a1/disable" - assert result == {"id": "a1", "disabled": True} - - @pytest.mark.asyncio - async def test_async_enable_agent(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "a1", "disabled": False}, status=200) - - client = _async_client(handler) - result = await client.enable_agent("a1") - assert seen["method"] == "POST" - assert seen["path"] == "/agents/a1/enable" - assert result == {"id": "a1", "disabled": False} - - @pytest.mark.asyncio - async def test_async_get_agent_callers(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response( - [{"id": "a2", "name": "Caller", "disabled": False}], status=200 - ) - - client = _async_client(handler) - result = await client.get_agent_callers("a1") - assert seen["method"] == "GET" - assert seen["path"] == "/agents/a1/callers" - assert result == [{"id": "a2", "name": "Caller", "disabled": False}] - - -class TestAgentEmailTriggers: - """Agent email triggers.""" - - def test_set_email_trigger_config(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response( - { - "trigger_id": "t1", - "agent_id": "a1", - "email_addresses": ["support.acct@agent.seclai.com"], - }, - status=200, - ) - - client = _sync_client(handler) - result = client.set_email_trigger_config("a1", "t1", {"alias": "support"}) - assert seen["method"] == "PUT" - assert seen["path"] == "/agents/a1/triggers/t1/email-config" - assert seen["body"] == {"alias": "support"} - assert result == { - "trigger_id": "t1", - "agent_id": "a1", - "email_addresses": ["support.acct@agent.seclai.com"], - } - - @pytest.mark.asyncio - async def test_async_set_email_trigger_config(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response( - { - "trigger_id": "t1", - "agent_id": "a1", - "email_addresses": ["support.acct@agent.seclai.com"], - }, - status=200, - ) - - client = _async_client(handler) - result = await client.set_email_trigger_config("a1", "t1", {"alias": "support"}) - assert seen["method"] == "PUT" - assert seen["path"] == "/agents/a1/triggers/t1/email-config" - assert seen["body"] == {"alias": "support"} - assert result == { - "trigger_id": "t1", - "agent_id": "a1", - "email_addresses": ["support.acct@agent.seclai.com"], - } - - -class TestAgentEmailGovernance: - """Agent email governance.""" - - def test_list_agent_email_optouts(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response({"items": [], "total": 0}, status=200) - - client = _sync_client(handler) - result = client.list_agent_email_optouts(agent_id="a1", limit=25, offset=50) - assert seen["method"] == "GET" - assert seen["path"] == "/agents/agent-email-optouts" - assert seen["params"] == {"agent_id": "a1", "limit": "25", "offset": "50"} - assert result == {"items": [], "total": 0} - - def test_list_agent_email_optouts_omits_unset(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response({"items": [], "total": 0}, status=200) - - client = _sync_client(handler) - result = client.list_agent_email_optouts() - assert seen["method"] == "GET" - assert seen["path"] == "/agents/agent-email-optouts" - assert seen["params"] == {} - assert result == {"items": [], "total": 0} - - def test_remove_agent_email_optout(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response(None, status=204) - - client = _sync_client(handler) - client.remove_agent_email_optout("oo1") - assert seen["method"] == "DELETE" - assert seen["path"] == "/agents/agent-email-optouts/oo1" - - def test_list_blocked_email_senders(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response( - {"items": [], "total": 0, "auto_block_mode": "disabled"}, status=200 - ) - - client = _sync_client(handler) - result = client.list_blocked_email_senders(limit=10) - assert seen["method"] == "GET" - assert seen["path"] == "/agents/blocked-email-senders" - assert seen["params"] == {"limit": "10"} - assert result == {"items": [], "total": 0, "auto_block_mode": "disabled"} - - def test_block_email_sender(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response( - { - "id": "b1", - "sender_email": "spam@example.com", - "match_type": "domain", - }, - status=201, - ) - - client = _sync_client(handler) - result = client.block_email_sender( - {"sender_email": "spam@example.com", "match_type": "domain"} - ) - assert seen["method"] == "POST" - assert seen["path"] == "/agents/blocked-email-senders" - assert seen["body"]["match_type"] == "domain" - assert result == { - "id": "b1", - "sender_email": "spam@example.com", - "match_type": "domain", - } - - def test_unblock_email_sender(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response(None, status=204) - - client = _sync_client(handler) - client.unblock_email_sender("b1") - assert seen["method"] == "DELETE" - assert seen["path"] == "/agents/blocked-email-senders/b1" - - def test_set_auto_block_mode(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response( - {"items": [], "total": 0, "auto_block_mode": "input_and_output"}, - status=200, - ) - - client = _sync_client(handler) - result = client.set_auto_block_mode({"mode": "input_and_output"}) - assert seen["method"] == "PUT" - assert seen["path"] == "/agents/blocked-email-senders/mode" - assert seen["body"] == {"mode": "input_and_output"} - assert result == { - "items": [], - "total": 0, - "auto_block_mode": "input_and_output", - } - - def test_list_inbound_email_rejections(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response( - [{"id": "r1", "reason": "unauthorized_sender"}], status=200 - ) - - client = _sync_client(handler) - result = client.list_inbound_email_rejections(agent_id="a1", limit=5) - assert seen["method"] == "GET" - assert seen["path"] == "/agents/inbound-email-rejections" - assert seen["params"] == {"agent_id": "a1", "limit": "5"} - assert result == [{"id": "r1", "reason": "unauthorized_sender"}] - - def test_get_inbound_email_status(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"paused": True, "queued_backlog": 42}, status=200) - - client = _sync_client(handler) - result = client.get_inbound_email_status() - assert seen["method"] == "GET" - assert seen["path"] == "/agents/inbound-email-status" - assert result == {"paused": True, "queued_backlog": 42} - - def test_cancel_queued_email_runs(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"cancelled": 7}, status=200) - - client = _sync_client(handler) - result = client.cancel_queued_email_runs() - assert seen["method"] == "POST" - assert seen["path"] == "/agents/inbound-email-status/cancel-queued" - assert result == {"cancelled": 7} - - def test_resume_inbound_email(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"resumed": True}, status=200) - - client = _sync_client(handler) - result = client.resume_inbound_email() - assert seen["method"] == "POST" - assert seen["path"] == "/agents/inbound-email-status/resume" - assert result == {"resumed": True} - - @pytest.mark.asyncio - async def test_async_list_agent_email_optouts(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response({"items": [], "total": 0}, status=200) - - client = _async_client(handler) - result = await client.list_agent_email_optouts( - agent_id="a1", limit=25, offset=50 - ) - assert seen["method"] == "GET" - assert seen["path"] == "/agents/agent-email-optouts" - assert seen["params"] == {"agent_id": "a1", "limit": "25", "offset": "50"} - assert result == {"items": [], "total": 0} - - @pytest.mark.asyncio - async def test_async_list_agent_email_optouts_omits_unset(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response({"items": [], "total": 0}, status=200) - - client = _async_client(handler) - result = await client.list_agent_email_optouts() - assert seen["method"] == "GET" - assert seen["path"] == "/agents/agent-email-optouts" - assert seen["params"] == {} - assert result == {"items": [], "total": 0} - - @pytest.mark.asyncio - async def test_async_remove_agent_email_optout(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response(None, status=204) - - client = _async_client(handler) - await client.remove_agent_email_optout("oo1") - assert seen["method"] == "DELETE" - assert seen["path"] == "/agents/agent-email-optouts/oo1" - - @pytest.mark.asyncio - async def test_async_list_blocked_email_senders(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response( - {"items": [], "total": 0, "auto_block_mode": "disabled"}, status=200 - ) - - client = _async_client(handler) - result = await client.list_blocked_email_senders(limit=10) - assert seen["method"] == "GET" - assert seen["path"] == "/agents/blocked-email-senders" - assert seen["params"] == {"limit": "10"} - assert result == {"items": [], "total": 0, "auto_block_mode": "disabled"} - - @pytest.mark.asyncio - async def test_async_block_email_sender(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response( - { - "id": "b1", - "sender_email": "spam@example.com", - "match_type": "domain", - }, - status=201, - ) - - client = _async_client(handler) - result = await client.block_email_sender( - {"sender_email": "spam@example.com", "match_type": "domain"} - ) - assert seen["method"] == "POST" - assert seen["path"] == "/agents/blocked-email-senders" - assert seen["body"]["match_type"] == "domain" - assert result == { - "id": "b1", - "sender_email": "spam@example.com", - "match_type": "domain", - } - - @pytest.mark.asyncio - async def test_async_unblock_email_sender(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response(None, status=204) - - client = _async_client(handler) - await client.unblock_email_sender("b1") - assert seen["method"] == "DELETE" - assert seen["path"] == "/agents/blocked-email-senders/b1" - - @pytest.mark.asyncio - async def test_async_set_auto_block_mode(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response( - {"items": [], "total": 0, "auto_block_mode": "input_and_output"}, - status=200, - ) - - client = _async_client(handler) - result = await client.set_auto_block_mode({"mode": "input_and_output"}) - assert seen["method"] == "PUT" - assert seen["path"] == "/agents/blocked-email-senders/mode" - assert seen["body"] == {"mode": "input_and_output"} - assert result == { - "items": [], - "total": 0, - "auto_block_mode": "input_and_output", - } - - @pytest.mark.asyncio - async def test_async_list_inbound_email_rejections(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response( - [{"id": "r1", "reason": "unauthorized_sender"}], status=200 - ) - - client = _async_client(handler) - result = await client.list_inbound_email_rejections(agent_id="a1", limit=5) - assert seen["method"] == "GET" - assert seen["path"] == "/agents/inbound-email-rejections" - assert seen["params"] == {"agent_id": "a1", "limit": "5"} - assert result == [{"id": "r1", "reason": "unauthorized_sender"}] - - @pytest.mark.asyncio - async def test_async_get_inbound_email_status(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"paused": True, "queued_backlog": 42}, status=200) - - client = _async_client(handler) - result = await client.get_inbound_email_status() - assert seen["method"] == "GET" - assert seen["path"] == "/agents/inbound-email-status" - assert result == {"paused": True, "queued_backlog": 42} - - @pytest.mark.asyncio - async def test_async_cancel_queued_email_runs(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"cancelled": 7}, status=200) - - client = _async_client(handler) - result = await client.cancel_queued_email_runs() - assert seen["method"] == "POST" - assert seen["path"] == "/agents/inbound-email-status/cancel-queued" - assert result == {"cancelled": 7} - - @pytest.mark.asyncio - async def test_async_resume_inbound_email(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"resumed": True}, status=200) - - client = _async_client(handler) - result = await client.resume_inbound_email() - assert seen["method"] == "POST" - assert seen["path"] == "/agents/inbound-email-status/resume" - assert result == {"resumed": True} - - -class TestEmailDomains: - """Email domains.""" - - def test_list_email_domains(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"domains": [], "can_add_vanity": True}, status=200) - - client = _sync_client(handler) - result = client.list_email_domains() - assert seen["method"] == "GET" - assert seen["path"] == "/email-domains" - assert result == {"domains": [], "can_add_vanity": True} - - def test_add_email_domain(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response( - {"id": "d1", "domain": "agent.example.com", "kind": "custom"}, - status=200, - ) - - client = _sync_client(handler) - result = client.add_email_domain( - {"kind": "custom", "value": "agent.example.com", "delegated": True} - ) - assert seen["method"] == "POST" - assert seen["path"] == "/email-domains" - assert seen["body"]["delegated"] is True - assert result == {"id": "d1", "domain": "agent.example.com", "kind": "custom"} - - def test_add_email_domain_vanity_without_delegated(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response( - {"id": "d2", "domain": "acme.seclai.com", "kind": "vanity"}, status=200 - ) - - client = _sync_client(handler) - result = client.add_email_domain({"kind": "vanity", "value": "acme"}) - assert seen["method"] == "POST" - assert seen["path"] == "/email-domains" - assert "delegated" not in seen["body"] - assert result == {"id": "d2", "domain": "acme.seclai.com", "kind": "vanity"} - - def test_remove_email_domain(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response( - {"removed": True, "cleanup_note": "Delete the NS record"}, status=200 - ) - - client = _sync_client(handler) - result = client.remove_email_domain("d1") - assert seen["method"] == "DELETE" - assert seen["path"] == "/email-domains/d1" - assert result == {"removed": True, "cleanup_note": "Delete the NS record"} - - def test_verify_email_domain(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response( - {"id": "d1", "status": "verified", "verified": True}, status=200 - ) - - client = _sync_client(handler) - result = client.verify_email_domain("d1") - assert seen["method"] == "POST" - assert seen["path"] == "/email-domains/d1/verify" - assert result == {"id": "d1", "status": "verified", "verified": True} - - def test_set_primary_email_domain(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "d1", "is_primary": True}, status=200) - - client = _sync_client(handler) - result = client.set_primary_email_domain("d1") - assert seen["method"] == "POST" - assert seen["path"] == "/email-domains/d1/primary" - assert result == {"id": "d1", "is_primary": True} - - def test_use_shared_email_domain(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response(None, status=204) - - client = _sync_client(handler) - client.use_shared_email_domain() - assert seen["method"] == "POST" - assert seen["path"] == "/email-domains/use-shared-domain" - - def test_send_email_domain_test_email(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"sent": True}, status=200) - - client = _sync_client(handler) - result = client.send_email_domain_test_email("d1") - assert seen["method"] == "POST" - assert seen["path"] == "/email-domains/d1/test-email" - assert result == {"sent": True} - - def test_get_dmarc_summary(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response( - {"window_days": 7, "report_count": 2, "total_messages": 100}, status=200 - ) - - client = _sync_client(handler) - result = client.get_dmarc_summary("d1", days=7, top_sources=3) - assert seen["method"] == "GET" - assert seen["path"] == "/email-domains/d1/dmarc" - assert seen["params"] == {"days": "7", "top_sources": "3"} - assert result == {"window_days": 7, "report_count": 2, "total_messages": 100} - - @pytest.mark.asyncio - async def test_async_list_email_domains(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"domains": [], "can_add_vanity": True}, status=200) - - client = _async_client(handler) - result = await client.list_email_domains() - assert seen["method"] == "GET" - assert seen["path"] == "/email-domains" - assert result == {"domains": [], "can_add_vanity": True} - - @pytest.mark.asyncio - async def test_async_add_email_domain(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response( - {"id": "d1", "domain": "agent.example.com", "kind": "custom"}, - status=200, - ) - - client = _async_client(handler) - result = await client.add_email_domain( - {"kind": "custom", "value": "agent.example.com", "delegated": True} - ) - assert seen["method"] == "POST" - assert seen["path"] == "/email-domains" - assert seen["body"]["delegated"] is True - assert result == {"id": "d1", "domain": "agent.example.com", "kind": "custom"} - - @pytest.mark.asyncio - async def test_async_add_email_domain_vanity_without_delegated(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response( - {"id": "d2", "domain": "acme.seclai.com", "kind": "vanity"}, status=200 - ) - - client = _async_client(handler) - result = await client.add_email_domain({"kind": "vanity", "value": "acme"}) - assert seen["method"] == "POST" - assert seen["path"] == "/email-domains" - assert "delegated" not in seen["body"] - assert result == {"id": "d2", "domain": "acme.seclai.com", "kind": "vanity"} - - @pytest.mark.asyncio - async def test_async_remove_email_domain(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response( - {"removed": True, "cleanup_note": "Delete the NS record"}, status=200 - ) - - client = _async_client(handler) - result = await client.remove_email_domain("d1") - assert seen["method"] == "DELETE" - assert seen["path"] == "/email-domains/d1" - assert result == {"removed": True, "cleanup_note": "Delete the NS record"} - - @pytest.mark.asyncio - async def test_async_verify_email_domain(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response( - {"id": "d1", "status": "verified", "verified": True}, status=200 - ) - - client = _async_client(handler) - result = await client.verify_email_domain("d1") - assert seen["method"] == "POST" - assert seen["path"] == "/email-domains/d1/verify" - assert result == {"id": "d1", "status": "verified", "verified": True} - - @pytest.mark.asyncio - async def test_async_set_primary_email_domain(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"id": "d1", "is_primary": True}, status=200) - - client = _async_client(handler) - result = await client.set_primary_email_domain("d1") - assert seen["method"] == "POST" - assert seen["path"] == "/email-domains/d1/primary" - assert result == {"id": "d1", "is_primary": True} - - @pytest.mark.asyncio - async def test_async_use_shared_email_domain(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response(None, status=204) - - client = _async_client(handler) - await client.use_shared_email_domain() - assert seen["method"] == "POST" - assert seen["path"] == "/email-domains/use-shared-domain" - - @pytest.mark.asyncio - async def test_async_send_email_domain_test_email(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"sent": True}, status=200) - - client = _async_client(handler) - result = await client.send_email_domain_test_email("d1") - assert seen["method"] == "POST" - assert seen["path"] == "/email-domains/d1/test-email" - assert result == {"sent": True} - - @pytest.mark.asyncio - async def test_async_get_dmarc_summary(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response( - {"window_days": 7, "report_count": 2, "total_messages": 100}, status=200 - ) - - client = _async_client(handler) - result = await client.get_dmarc_summary("d1", days=7, top_sources=3) - assert seen["method"] == "GET" - assert seen["path"] == "/email-domains/d1/dmarc" - assert seen["params"] == {"days": "7", "top_sources": "3"} - assert result == {"window_days": 7, "report_count": 2, "total_messages": 100} - - -class TestGenerationTiersAndDocsSearch: - """Generation tiers + docs search.""" - - def test_get_generation_tiers(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"image": {"fast": {"model": "m1"}}}, status=200) - - client = _sync_client(handler) - result = client.get_generation_tiers() - assert seen["method"] == "GET" - assert seen["path"] == "/models/generation-tiers" - assert result == {"image": {"fast": {"model": "m1"}}} - - def test_search_docs(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response({"results": []}, status=200) - - client = _sync_client(handler) - result = client.search_docs("email triggers", mode="semantic", limit=3) - assert seen["method"] == "GET" - assert seen["path"] == "/docs-search" - assert seen["params"] == { - "q": "email triggers", - "mode": "semantic", - "limit": "3", - } - assert result == {"results": []} - - def test_search_docs_omits_unset(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response({"results": []}, status=200) - - client = _sync_client(handler) - result = client.search_docs("webhooks") - assert seen["method"] == "GET" - assert seen["path"] == "/docs-search" - assert seen["params"] == {"q": "webhooks"} - assert result == {"results": []} - - @pytest.mark.asyncio - async def test_async_get_generation_tiers(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - return _json_response({"image": {"fast": {"model": "m1"}}}, status=200) - - client = _async_client(handler) - result = await client.get_generation_tiers() - assert seen["method"] == "GET" - assert seen["path"] == "/models/generation-tiers" - assert result == {"image": {"fast": {"model": "m1"}}} - - @pytest.mark.asyncio - async def test_async_search_docs(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response({"results": []}, status=200) - - client = _async_client(handler) - result = await client.search_docs("email triggers", mode="semantic", limit=3) - assert seen["method"] == "GET" - assert seen["path"] == "/docs-search" - assert seen["params"] == { - "q": "email triggers", - "mode": "semantic", - "limit": "3", - } - assert result == {"results": []} - - @pytest.mark.asyncio - async def test_async_search_docs_omits_unset(self) -> None: - seen: dict[str, Any] = {} - - async def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["params"] = dict(req.url.params) - return _json_response({"results": []}, status=200) - - client = _async_client(handler) - result = await client.search_docs("webhooks") - assert seen["method"] == "GET" - assert seen["path"] == "/docs-search" - assert seen["params"] == {"q": "webhooks"} - assert result == {"results": []} - - -class TestApiVersion: - def test_version_header_omitted_unless_opted_in(self) -> None: - # The point of the option: upgrading the SDK must not silently move an - # account onto a newer API version and change response shapes. - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["headers"] = dict(req.headers) - return _json_response({"data": []}) - - client = _sync_client(handler) - client.list_agents() - assert "seclai-version" not in seen["headers"] - - def test_version_header_sent_when_set(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["headers"] = dict(req.headers) - return _json_response({"data": []}) - - client = _sync_client(handler, api_version="2026-07-27") - client.list_agents() - assert seen["headers"]["seclai-version"] == "2026-07-27" - - def test_caller_supplied_version_header_overrides_rather_than_duplicates( - self, - ) -> None: - # httpx emits both keys if the cases differ, and the server then picks - # one arbitrarily. - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["values"] = req.headers.get_list("seclai-version") - return _json_response({"data": []}) - - client = _sync_client( - handler, - api_version="2026-07-01", - default_headers={"Seclai-Version": "2026-07-27"}, - ) - client.list_agents() - assert seen["values"] == ["2026-07-27"] - - def test_get_api_version(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["path"] = req.url.path - seen["method"] = req.method - # All five fields the spec marks required, using versions the server - # actually knows. The previous fixture omitted `default_version` and - # invented `2026-01-01`, modelling a state no server can produce. - return _json_response( - { - "pinned_version": None, - "effective_version": "2026-07-01", - "default_version": "2026-07-01", - "latest_version": "2026-07-27", - "known_versions": ["2026-07-01", "2026-07-27"], - } - ) - - client = _sync_client(handler) - result = client.get_api_version() - assert seen["method"] == "GET" - assert seen["path"] == "/version" - assert result["latest_version"] == "2026-07-27" - assert result["default_version"] == "2026-07-01" - - def test_update_api_version_sends_explicit_null_to_clear(self) -> None: - # null is the documented way to clear the pin, so it must reach the wire - # rather than being dropped as an unset value. - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["method"] = req.method - seen["path"] = req.url.path - seen["body"] = json.loads(req.content) - return _json_response({"pinned_version": None}) - - client = _sync_client(handler) - client.update_api_version(None) - assert seen["method"] == "PUT" - assert seen["path"] == "/version" - assert seen["body"] == {"version": None} - - -class TestVersionGatedListShapes: - """Endpoints whose response shape depends on the Seclai-Version header. - - The legacy shape is a bare, unpaginated array; opting in yields the canonical - {data, pagination} envelope. Both are live, so each accessor must read both. - """ - - def test_run_evaluation_results_accepts_a_bare_array(self) -> None: - def handler(req: httpx.Request) -> httpx.Response: - return _json_response([{"id": "er1"}]) - - client = _sync_client(handler) - assert client.list_run_evaluation_results("a1", "r1") == [{"id": "er1"}] - - def test_run_evaluation_results_unwraps_the_canonical_envelope(self) -> None: - def handler(req: httpx.Request) -> httpx.Response: - return _json_response( - { - "data": [{"id": "er1"}], - "pagination": { - "page": 1, - "limit": 50, - "total": 1, - "pages": 1, - "has_next": False, - "has_prev": False, - }, - } - ) - - client = _sync_client(handler) - assert client.list_run_evaluation_results("a1", "r1") == [{"id": "er1"}] - - def test_run_evaluation_results_page_exposes_pagination(self) -> None: - def handler(req: httpx.Request) -> httpx.Response: - return _json_response( - { - "data": [{"id": "er1"}], - "pagination": { - "page": 2, - "limit": 25, - "total": 7, - "pages": 1, - "has_next": False, - "has_prev": True, - }, - } - ) - - client = _sync_client(handler) - page = client.list_run_evaluation_results_page("a1", "r1", page=2, limit=25) - assert page["pagination"]["total"] == 7 - - def test_run_evaluation_results_page_omits_pagination_on_legacy(self) -> None: - def handler(req: httpx.Request) -> httpx.Response: - return _json_response([{"id": "er1"}]) - - client = _sync_client(handler) - page = client.list_run_evaluation_results_page("a1", "r1") - assert page == {"data": [{"id": "er1"}]} - assert "pagination" not in page - - -class TestUndeclaredQueryParams: - """Params the endpoint does not declare become 422s once a caller opts in.""" - - def test_list_alerts_does_not_send_severity(self) -> None: - # GET /alerts declares no severity filter. It never filtered anything, - # and sending it is a hard 422 under api_version 2026-07-27+. - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["query"] = dict(req.url.params) - return _json_response({"data": []}) - - client = _sync_client(handler) - client.list_alerts(severity="high") - assert "severity" not in seen["query"] - - def test_list_model_alerts_translates_page_to_offset(self) -> None: - # /models/alerts declares limit/offset, not page, so page 2 used to - # return page 1. - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["query"] = dict(req.url.params) - return _json_response({"data": []}) - - client = _sync_client(handler) - client.list_model_alerts(page=3, limit=25) - assert seen["query"] == {"offset": "50", "limit": "25"} - assert "page" not in seen["query"] - - -class TestApiVersionConstants: - def test_members_are_plain_strings(self) -> None: - # StrEnum members must be usable anywhere a str is, since api_version is - # typed `str | None` and lands straight in a header. Compared through a - # str-typed variable: mypy rejects a direct literal comparison as - # non-overlapping, which is a quirk of enum narrowing rather than a - # runtime difference. - member = seclai_versions.ApiVersion.V2026_07_27 - raw: str = "2026-07-27" - assert member == raw - assert member.value == raw - assert isinstance(member, str) - - def test_default_and_latest_track_the_spec(self) -> None: - spec = json.loads( - ( - pathlib.Path(__file__).parent.parent / "openapi" / "seclai.openapi.json" - ).read_text() - )["x-seclai-versions"] - assert seclai_versions.DEFAULT_API_VERSION == spec["default"] - assert seclai_versions.LATEST_API_VERSION == spec["latest"] - assert [v.value for v in seclai_versions.ApiVersion] == spec["known"] - - def test_an_unknown_version_is_rejected(self) -> None: - # A newer server version can reshape responses, and the client would - # mis-decode them silently rather than error. Fail closed at construction. - with pytest.raises(seclai.SeclaiConfigurationError) as exc: - Seclai(api_key="k", api_version="2099-01-01") - assert "2099-01-01" in str(exc.value) - assert "allow_unknown_api_version" in str(exc.value) - - def test_an_unknown_version_is_allowed_when_asked(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["headers"] = dict(req.headers) - return _json_response({"data": []}) - - client = _sync_client( - handler, api_version="2099-01-01", allow_unknown_api_version=True - ) - client.list_agents() - assert seen["headers"]["seclai-version"] == "2099-01-01" - - def test_a_known_version_needs_no_escape_hatch(self) -> None: - # Constructed through the helper: building a bare Seclai() here made a - # real httpx.Client against the live base URL, inert only because the - # test never issued a request. - client = _sync_client( - lambda req: _json_response({"data": []}), - api_version=seclai_versions.LATEST_API_VERSION, - ) - assert client._options.api_version == seclai_versions.LATEST_API_VERSION - - def test_update_api_version_rejects_an_unknown_pin(self) -> None: - # The account pin is sticky and applies to every header-less caller on - # the account, so it needs the guard at least as much as the header does. - client = _sync_client(lambda req: _json_response({"pinned_version": None})) - with pytest.raises(seclai.SeclaiConfigurationError) as exc: - client.update_api_version("2099-01-01") - assert "2099-01-01" in str(exc.value) - - def test_update_api_version_honours_the_escape_hatch(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["body"] = json.loads(req.content) - return _json_response({"pinned_version": "2099-01-01"}) - - client = _sync_client(handler, allow_unknown_api_version=True) - client.update_api_version("2099-01-01") - assert seen["body"] == {"version": "2099-01-01"} - - -class TestAsyncParityForNewBehaviour: - """AsyncSeclai hand-duplicates every method, so nothing in the sync tests - proves the async copy behaves the same. Each case here mirrors a sync test - of behaviour added or changed in this release; a typo in one async body - would otherwise ship green.""" - - @pytest.mark.asyncio - async def test_version_header_omitted_unless_opted_in(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["headers"] = dict(req.headers) - return _json_response({"data": []}) - - client = _async_client(handler) - await client.list_agents() - assert "seclai-version" not in seen["headers"] - - @pytest.mark.asyncio - async def test_version_header_sent_when_set(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["headers"] = dict(req.headers) - return _json_response({"data": []}) - - client = _async_client(handler, api_version="2026-07-27") - await client.list_agents() - assert seen["headers"]["seclai-version"] == "2026-07-27" - - @pytest.mark.asyncio - async def test_get_and_update_api_version(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen.setdefault("calls", []).append((req.method, req.url.path)) - if req.method == "PUT": - seen["body"] = json.loads(req.content) - return _json_response({"pinned_version": None}) - - client = _async_client(handler) - await client.get_api_version() - await client.update_api_version(None) - assert seen["calls"] == [("GET", "/version"), ("PUT", "/version")] - assert seen["body"] == {"version": None} - - @pytest.mark.asyncio - async def test_update_api_version_rejects_an_unknown_pin(self) -> None: - client = _async_client(lambda req: _json_response({"pinned_version": None})) - with pytest.raises(seclai.SeclaiConfigurationError): - await client.update_api_version("2099-01-01") - - @pytest.mark.asyncio - async def test_list_alerts_does_not_send_severity(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["query"] = dict(req.url.params) - return _json_response({"data": []}) - - client = _async_client(handler) - await client.list_alerts(severity="high") - assert "severity" not in seen["query"] - - @pytest.mark.asyncio - async def test_list_model_alerts_translates_page_to_offset(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["query"] = dict(req.url.params) - return _json_response({"alerts": []}) - - client = _async_client(handler) - await client.list_model_alerts(page=3, limit=25) - assert seen["query"] == {"offset": "50", "limit": "25"} - - @pytest.mark.asyncio - async def test_list_model_alerts_never_sends_a_negative_offset(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["query"] = dict(req.url.params) - return _json_response({"alerts": []}) - - client = _async_client(handler) - await client.list_model_alerts(page=0, limit=25) - assert seen["query"]["offset"] == "0" - - @pytest.mark.asyncio - async def test_evaluation_criteria_accepts_either_wire_shape(self) -> None: - legacy = _async_client(lambda req: _json_response([{"id": "ec1"}])) - assert await legacy.list_evaluation_criteria("a1") == [{"id": "ec1"}] - - canonical = _async_client( - lambda req: _json_response( - {"data": [{"id": "ec1"}], "pagination": {"total": 1}} - ) - ) - assert await canonical.list_evaluation_criteria("a1") == [{"id": "ec1"}] - page = await canonical.list_evaluation_criteria_page("a1") - assert page["pagination"]["total"] == 1 - - @pytest.mark.asyncio - async def test_run_evaluation_results_accepts_either_wire_shape(self) -> None: - legacy = _async_client(lambda req: _json_response([{"id": "er1"}])) - assert await legacy.list_run_evaluation_results("a1", "r1") == [{"id": "er1"}] - - canonical = _async_client(lambda req: _json_response({"data": [{"id": "er1"}]})) - assert await canonical.list_run_evaluation_results("a1", "r1") == [ - {"id": "er1"} - ] - - @pytest.mark.asyncio - async def test_conversation_history_requires_step_type(self) -> None: - client = _async_client(lambda req: _json_response({"conversations": []})) - with pytest.raises(ValueError, match="step_type is required"): - await client.get_agent_ai_conversation_history("a1") - - @pytest.mark.asyncio - async def test_conversation_history_sends_step_type(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["query"] = dict(req.url.params) - return _json_response({"conversations": []}) - - client = _async_client(handler) - await client.get_agent_ai_conversation_history("a1", step_type="llm") - assert seen["query"] == {"step_type": "llm"} - - -class TestVersionGuardCannotBeBypassed: - """`default_headers` is applied last so it wins, which means it can carry a - Seclai-Version. Validating only the argument left the guard one header away - from being bypassed.""" - - def test_unknown_version_in_default_headers_is_rejected(self) -> None: - with pytest.raises(seclai.SeclaiConfigurationError) as exc: - Seclai(api_key="k", default_headers={"Seclai-Version": "2099-01-01"}) - assert "2099-01-01" in str(exc.value) - assert "default_headers" in str(exc.value) - - def test_a_lowercase_header_key_is_caught_too(self) -> None: - with pytest.raises(seclai.SeclaiConfigurationError): - Seclai(api_key="k", default_headers={"seclai-version": "2099-01-01"}) - - def test_the_escape_hatch_still_covers_the_header_form(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["values"] = req.headers.get_list("seclai-version") - return _json_response({"data": []}) - - client = _sync_client( - handler, - default_headers={"Seclai-Version": "2099-01-01"}, - allow_unknown_api_version=True, - ) - client.list_agents() - assert seen["values"] == ["2099-01-01"] - - def test_a_known_version_in_default_headers_needs_no_escape_hatch(self) -> None: - client = _sync_client( - lambda req: _json_response({"data": []}), - default_headers={"Seclai-Version": seclai_versions.LATEST_API_VERSION}, - ) - assert client is not None - - -class TestDuplicateVersionHeaderSpellings: - """`default_headers` can carry two spellings of one header. The guard must - approve the value that survives the merge, and the merge must leave one.""" - - def test_a_second_spelling_cannot_slip_past_the_guard(self) -> None: - with pytest.raises(seclai.SeclaiConfigurationError) as exc: - Seclai( - api_key="k", - default_headers={ - "Seclai-Version": seclai_versions.LATEST_API_VERSION, - "seclai-version": "2099-01-01", - }, - ) - assert "2099-01-01" in str(exc.value) - - def test_only_one_value_reaches_the_wire(self) -> None: - seen: dict[str, Any] = {} - - def handler(req: httpx.Request) -> httpx.Response: - seen["values"] = req.headers.get_list("seclai-version") - return _json_response({"data": []}) - - client = _sync_client( - handler, - default_headers={ - "Seclai-Version": seclai_versions.DEFAULT_API_VERSION, - "seclai-version": seclai_versions.LATEST_API_VERSION, - }, - ) - client.list_agents() - assert seen["values"] == [seclai_versions.LATEST_API_VERSION] diff --git a/tests/test_status_errors.py b/tests/test_status_errors.py deleted file mode 100644 index 71730da..0000000 --- a/tests/test_status_errors.py +++ /dev/null @@ -1,21 +0,0 @@ -import httpx -import pytest - -from seclai import Seclai, SeclaiAPIStatusError - - -def test_non_2xx_raises_status_error(monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.setenv("SECLAI_API_KEY", "k") - - def handler(request: httpx.Request) -> httpx.Response: - return httpx.Response(401, json={"error": "unauthorized"}) - - transport = httpx.MockTransport(handler) - http_client = httpx.Client(transport=transport, base_url="https://example.invalid") - client = Seclai(http_client=http_client) - - with pytest.raises(SeclaiAPIStatusError) as exc: - _ = client.request("GET", "/private") - - assert exc.value.status_code == 401 - assert exc.value.method == "GET" diff --git a/tests/test_streaming_agent_runs.py b/tests/test_streaming_agent_runs.py deleted file mode 100644 index 6e0477e..0000000 --- a/tests/test_streaming_agent_runs.py +++ /dev/null @@ -1,134 +0,0 @@ -import json -import threading -import time -from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer -from typing import Any - -import httpx -import pytest - -from seclai import AgentRunStreamRequest, AsyncSeclai, Seclai, SeclaiError - - -def _agent_run_payload(status: str, *, output: str | None = None) -> dict[str, Any]: - payload: dict[str, Any] = { - "attempts": [], - "credits": None, - "error_count": 0, - "input": None, - "output": output, - "priority": False, - "run_id": "run_1", - "status": status, - } - return payload - - -def test_run_streaming_agent_and_wait_parses_done() -> None: - def handler(request: httpx.Request) -> httpx.Response: - assert request.method == "POST" - assert request.url.path == "/agents/agent_1/runs/stream" - assert "text/event-stream" in (request.headers.get("accept") or "") - - init_data = json.dumps(_agent_run_payload("processing")) - done_data = json.dumps(_agent_run_payload("completed", output="ok")) - - content = ( - b": keepalive\n\n" - + f"event: init\ndata: {init_data}\n\n".encode() - + f"event: done\ndata: {done_data}\n\n".encode() - ) - return httpx.Response( - status_code=200, - headers={"content-type": "text/event-stream"}, - content=content, - ) - - transport = httpx.MockTransport(handler) - http_client = httpx.Client(base_url="https://example.invalid", transport=transport) - - client = Seclai(api_key="test", http_client=http_client) - res = client.run_streaming_agent_and_wait( - "agent_1", body=AgentRunStreamRequest(input="hi", metadata={}) - ) - - assert res.run_id == "run_1" - assert res.output == "ok" - - -@pytest.mark.asyncio -async def test_async_run_streaming_agent_and_wait_parses_done() -> None: - async def handler(request: httpx.Request) -> httpx.Response: - assert request.method == "POST" - assert request.url.path == "/agents/agent_1/runs/stream" - assert "text/event-stream" in (request.headers.get("accept") or "") - - init_data = json.dumps(_agent_run_payload("processing")) - done_data = json.dumps(_agent_run_payload("completed", output="ok")) - - content = ( - b": keepalive\n\n" - + f"event: init\ndata: {init_data}\n\n".encode() - + f"event: done\ndata: {done_data}\n\n".encode() - ) - return httpx.Response( - status_code=200, - headers={"content-type": "text/event-stream"}, - content=content, - ) - - transport = httpx.MockTransport(handler) - http_client = httpx.AsyncClient( - base_url="https://example.invalid", transport=transport - ) - - async with AsyncSeclai(api_key="test", http_client=http_client) as client: - res = await client.run_streaming_agent_and_wait( - "agent_1", body=AgentRunStreamRequest(input="hi", metadata={}) - ) - - assert res.run_id == "run_1" - assert res.output == "ok" - - -def test_run_streaming_agent_and_wait_times_out() -> None: - class Handler(BaseHTTPRequestHandler): - protocol_version = "HTTP/1.1" - - def do_POST(self) -> None: # noqa: N802 - if self.path != "/agents/agent_1/runs/stream": - self.send_response(404) - self.end_headers() - return - - self.send_response(200) - self.send_header("Content-Type", "text/event-stream") - self.end_headers() - - self.wfile.write(b"event: init\n") - self.wfile.write(b"data: {}\n\n") - self.wfile.flush() - - # Keep the connection open longer than the client timeout. - time.sleep(1.0) - - def log_message(self, format: str, *args: object) -> None: # noqa: A003 - return - - server = ThreadingHTTPServer(("127.0.0.1", 0), Handler) - t = threading.Thread(target=server.serve_forever, daemon=True) - t.start() - try: - base_url = f"http://127.0.0.1:{server.server_address[1]}" - http_client = httpx.Client(base_url=base_url) - client = Seclai(api_key="test", http_client=http_client) - - with pytest.raises(SeclaiError): - client.run_streaming_agent_and_wait( - "agent_1", - body=AgentRunStreamRequest(input="hi", metadata={}), - timeout=0.05, - ) - finally: - server.shutdown() - server.server_close() From 798135b48fe8289fc223a96f1d51f30929bd7313 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Wed, 21 Oct 2026 09:29:35 -0700 Subject: [PATCH 2/8] Sync to the 2026-10-19 API spec #minor Add content-attachment, accepted-attachment and email-source rejection methods to Seclai and AsyncSeclai, regenerate the models, add the new ApiVersion members and move LATEST_API_VERSION to 2026-10-19. --- CHANGELOG.md | 20 + README.md | 54 +- openapi/seclai.openapi.json | 1769 +++++++++++++++-- ...ns_run_id_attachments_attachment_id_get.py | 24 +- ...ents_agent_id_attachment_references_get.py | 28 +- ...t_api_agents_agent_id_upload_input_post.py | 108 +- .../agents/create_agent_api_agents_post.py | 12 +- ...run_agent_api_agents_agent_id_runs_post.py | 8 +- ...nt_api_agents_agent_id_runs_stream_post.py | 12 + ...ers_trigger_id_accepted_attachments_put.py | 272 +++ ...id_triggers_trigger_id_email_config_put.py | 20 +- ...t_version_attachments_attachment_id_get.py | 330 +++ ...sion_attachments_attachment_id_file_get.py | 278 +++ ...ttachments_attachment_id_embeddings_get.py | 309 +++ ...nection_content_version_attachments_get.py | 312 +++ ..._connection_content_version_upload_post.py | 152 ++ ...d_experiments_experiment_id_cancel_post.py | 24 +- ...bedding_models_api_models_embedders_get.py | 16 +- .../sources/create_source_api_sources_post.py | 32 +- ...tion_id_contents_content_version_id_get.py | 16 + ...urce_connection_id_email_rejections_get.py | 304 +++ ...urces_source_connection_id_contents_get.py | 20 + ...ources_source_connection_id_upload_post.py | 160 ++ ...e_api_sources_source_connection_id_post.py | 8 + seclai/_generated/models/__init__.py | 30 + .../models/accepted_attachment_slot.py | 127 ++ .../models/accepted_attachments_response.py | 94 + .../agent_attachment_refs_api_response.py | 40 +- seclai/_generated/models/agent_run_request.py | 39 +- .../_generated/models/agent_run_response.py | 5 +- .../models/agent_run_step_response.py | 4 +- .../models/agent_run_stream_request.py | 20 +- .../models/agent_summary_response.py | 21 + .../content_attachment_detail_response.py | 216 ++ ...ent_attachment_detail_response_metadata.py | 52 + .../models/content_attachment_response.py | 161 ++ .../content_attachment_response_metadata.py | 52 + .../content_attachments_list_response.py | 86 + .../models/content_detail_response.py | 49 +- .../_generated/models/create_agent_request.py | 54 + .../_generated/models/create_source_body.py | 223 ++- .../email_source_rejection_list_response.py | 88 + .../models/email_source_rejection_response.py | 174 ++ ...source_rejection_response_auth_verdicts.py | 46 + .../models/email_trigger_config_response.py | 13 + .../models/generate_agent_steps_response.py | 5 +- .../set_accepted_attachments_request.py | 106 + .../set_email_trigger_config_request.py | 24 + .../models/skipped_attachment_reason.py | 11 + .../models/skipped_attachment_response.py | 100 + .../models/source_content_status_response.py | 32 +- seclai/_generated/models/source_response.py | 201 +- .../models/update_agent_definition_request.py | 57 +- .../_generated/models/update_source_body.py | 191 +- seclai/seclai.py | 467 ++++- seclai/versions.py | 7 +- tests/test_new_methods.py | 264 +++ 57 files changed, 7002 insertions(+), 345 deletions(-) create mode 100644 seclai/_generated/api/agents/set_accepted_attachments_api_api_agents_agent_id_triggers_trigger_id_accepted_attachments_put.py create mode 100644 seclai/_generated/api/contents/get_content_attachment_api_contents_source_connection_content_version_attachments_attachment_id_get.py create mode 100644 seclai/_generated/api/contents/get_content_attachment_file_api_contents_source_connection_content_version_attachments_attachment_id_file_get.py create mode 100644 seclai/_generated/api/contents/list_content_attachment_embeddings_api_contents_source_connection_content_version_attachments_attachment_id_embeddings_get.py create mode 100644 seclai/_generated/api/contents/list_content_attachments_api_contents_source_connection_content_version_attachments_get.py create mode 100644 seclai/_generated/api/sources/list_email_source_rejections_api_api_sources_source_connection_id_email_rejections_get.py create mode 100644 seclai/_generated/models/accepted_attachment_slot.py create mode 100644 seclai/_generated/models/accepted_attachments_response.py create mode 100644 seclai/_generated/models/content_attachment_detail_response.py create mode 100644 seclai/_generated/models/content_attachment_detail_response_metadata.py create mode 100644 seclai/_generated/models/content_attachment_response.py create mode 100644 seclai/_generated/models/content_attachment_response_metadata.py create mode 100644 seclai/_generated/models/content_attachments_list_response.py create mode 100644 seclai/_generated/models/email_source_rejection_list_response.py create mode 100644 seclai/_generated/models/email_source_rejection_response.py create mode 100644 seclai/_generated/models/email_source_rejection_response_auth_verdicts.py create mode 100644 seclai/_generated/models/set_accepted_attachments_request.py create mode 100644 seclai/_generated/models/skipped_attachment_reason.py create mode 100644 seclai/_generated/models/skipped_attachment_response.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c441d4..c16a976 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [1.8.0] - 2026-10-21 + +### Changed + +- Sync the bundled OpenAPI spec, adding 6 paths and 10 schemas. The typed models gain the new fields, including `accepted_attachments` on agent create and definition requests and on the attachment-reference contract, `trigger_id` on an agent, `include_reasoning` on a streaming run, `run_on_attachment_mismatch` on an email trigger, the `cloud_drive_*`, `document_images`, `email_allowed_senders`, `feed_attachments` and `email_address` source fields, `held_for_review` on a content status and `skipped_attachments` on a content item +- Move `LATEST_API_VERSION` to `2026-10-19` + +### Added + +- Add `list_content_attachments()`, `get_content_attachment()`, `list_content_attachment_embeddings()` and `download_content_attachment()` to read the files attached to a content item, with their indexing status. The download returns a streaming `httpx.Response` the caller closes +- Add `set_accepted_attachments()` to declare the input attachments an agent trigger accepts +- Add `list_email_source_rejections()` to list the mail an email content source refused, and why +- Add `include_reasoning`, `input_upload_id`, `input_upload_ids` and `replay_of_run_id` as optional keys of `AgentRunStreamRequest`. `include_reasoning` asks `run_streaming_agent()` for `stream_reasoning` events +- Add `ApiVersion` members for `2026-10-05`, `2026-10-13`, `2026-10-16`, `2026-10-18` and `2026-10-19`, so each can be selected without `allow_unknown_api_version` + +### Fixed + +- Correct the streaming-download examples of `download_agent_run_attachment()` and `download_source_export()`. They closed the response with `with response:`, which raises `TypeError` because an `httpx.Response` is not a context manager; they now close it in a `finally` block + ## [1.7.2] - 2026-10-05 ### Fixed @@ -217,6 +236,7 @@ _Stable release. Packaging, CI, and documentation deployment only; no API change _Initial release._ +[1.8.0]: https://github.com/seclai/seclai-python/releases/tag/1.8.0 [1.7.2]: https://github.com/seclai/seclai-python/releases/tag/1.7.2 [1.7.1]: https://github.com/seclai/seclai-python/releases/tag/1.7.1 [1.7.0]: https://github.com/seclai/seclai-python/releases/tag/1.7.0 diff --git a/README.md b/README.md index 1523412..c7a643b 100644 --- a/README.md +++ b/README.md @@ -238,6 +238,11 @@ client decodes: | `2026-09-28` | Agent-definition writes use the current file-list grammar: an omitted `attachments` keeps the stored list and `[]` means no files | | `2026-09-30` | A run's and a step's `output`, and a step's `input`, are the text rather than a JSON manifest; files are in `attachments` on every version | | `2026-10-03` | A new LLM step written without `attachments` takes its parent's files, and a new retrieval step's matched media are its files | +| `2026-10-05` | A content item held for review by an Enforce governance policy reports `completed` (with `held_for_review: true`) rather than `failed` | +| `2026-10-13` | A source's `media_types` refuses an unknown kind, or any kind on a source other than a website or RSS feed, with a 400 | +| `2026-10-16` | `upload_agent_input()` accepts a file of any type and it is `ready` at once; each upload reaches steps as a separate file and `input` carries only a heading for it | +| `2026-10-18` | A source's `document_images` defaults to true on a text-only embedder as well | +| `2026-10-19` | `polling_max_items` is refused with a 400 on any source other than an RSS feed | ## Resources @@ -339,6 +344,10 @@ for event_type, data in client.run_streaming_agent( print(event_type, data) ``` +Set `include_reasoning=True` in the request to also receive `stream_reasoning` +events with the model's reasoning, for a `streaming_result` step whose author +enabled `show_reasoning`. + Async: ```python @@ -369,7 +378,19 @@ result = client.run_agent_and_poll( # Discover which files (if any) the agent expects before staging uploads refs = client.get_agent_attachment_references("agent_id") # refs["requires_uploads"] -> bool; refs["agent"] lists the exact_names / -# indexes_max / patterns a run-time upload batch must satisfy. +# indexes_max / patterns a run-time upload batch must satisfy, and +# refs["accepted_attachments"] the attachments the trigger declares. + +# Declare the attachments a trigger accepts; steps reference each one as +# {{agent.attachments.}}. None accepts any files as one attachment, "files". +client.set_accepted_attachments( + "agent_id", + "trigger_id", + [ + {"name": "invoice", "content_types": ["application/pdf"], "min": 1, "max": 1}, + {"name": "photos", "content_types": ["image/*"], "name_pattern": "*.jpg"}, + ], +) upload = client.upload_agent_input("agent_id", file=b"data", file_name="input.pdf") status = client.get_agent_input_upload_status("agent_id", upload["upload_id"]) @@ -381,9 +402,11 @@ status = client.get_agent_input_upload_status("agent_id", upload["upload_id"]) # Download a file emitted by a step in an agent run. attachment_id is the # URL-safe-base64 storage_key surfaced in run output manifests / webhooks. response = client.download_agent_run_attachment("run_id", "attachment_id") # raw httpx.Response -with response: +try: for chunk in response.iter_bytes(): ... # write to disk +finally: + response.close() ``` ### Agent AI assistant @@ -485,6 +508,15 @@ batch = client.list_source_contents( one = client.get_source_content_status("source_id", "cv_1") ``` +Mail an email source refused, newest first — who sent it and why, never the +message itself. Requires an account owner or administrator: + +```python +refused = client.list_email_source_rejections("source_id", page=1, limit=20) +for r in refused["data"]: + print(r["from_address"], r["reason"], r["authenticated"]) +``` + ### Cloud drives ```python @@ -568,6 +600,23 @@ client.cancel_source_embedding_migration("source_id") detail = client.get_content_detail("source_connection_content_version") embeddings = client.list_content_embeddings("source_connection_content_version") client.delete_content("source_connection_content_version") + +# Files attached to a content item: email attachments, feed files, page media +# and the images inside documents, each with its indexing status +attachments = client.list_content_attachments("source_connection_content_version") +att_id = attachments["data"][0]["id"] +att = client.get_content_attachment("source_connection_content_version", att_id) +att_embeddings = client.list_content_attachment_embeddings( + "source_connection_content_version", att_id +) +response = client.download_content_attachment( + "source_connection_content_version", att_id +) # raw streaming httpx.Response +try: + for chunk in response.iter_bytes(): + ... # write to disk +finally: + response.close() ``` ### Solutions @@ -648,6 +697,7 @@ config = client.set_email_trigger_config( "ignore_auto_generated": True, # drop auto-replies to prevent loops "require_sender_auth": True, # require SPF or DMARC "queue_on_quota": False, # park over-rate mail instead of failing + "run_on_attachment_mismatch": False, # run even if attachments don't fit }, ) print(config["email_addresses"]) diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json index 058d09e..059fe2c 100644 --- a/openapi/seclai.openapi.json +++ b/openapi/seclai.openapi.json @@ -23,6 +23,99 @@ } }, "schemas": { + "AcceptedAttachmentSlot": { + "additionalProperties": false, + "properties": { + "content_types": { + "description": "Accepted types, e.g. ``application/pdf`` or ``image/*``; empty accepts any type.", + "items": { + "type": "string" + }, + "title": "Content Types", + "type": "array" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Shown to people.", + "title": "Label" + }, + "max": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Most files a run may include; empty is no limit.", + "title": "Max" + }, + "min": { + "default": 0, + "description": "Fewest files a run must include; fewer refuses the run, except on an email trigger set to run anyway, which lists the shortfall.", + "title": "Min", + "type": "integer" + }, + "name": { + "description": "Lowercase letters, digits and underscores, starting with a letter. Steps reference the files as ``{{agent.attachments.}}``.", + "title": "Name", + "type": "string" + }, + "name_pattern": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filename glob a file must also match, ignoring case.", + "title": "Name Pattern" + } + }, + "required": [ + "name" + ], + "title": "AcceptedAttachmentSlot", + "type": "object" + }, + "AcceptedAttachmentsResponse": { + "properties": { + "accepted_attachments": { + "items": { + "$ref": "#/components/schemas/AcceptedAttachmentSlot" + }, + "title": "Accepted Attachments", + "type": "array" + }, + "agent_id": { + "format": "uuid", + "title": "Agent Id", + "type": "string" + }, + "trigger_id": { + "format": "uuid", + "title": "Trigger Id", + "type": "string" + } + }, + "required": [ + "trigger_id", + "agent_id", + "accepted_attachments" + ], + "title": "AcceptedAttachmentsResponse", + "type": "object" + }, "AddConversationTurnRequest": { "properties": { "actions_taken": { @@ -89,14 +182,22 @@ "type": "object" }, "AgentAttachmentRefsApiResponse": { - "description": "Static attachment-reference contract for an agent.\n\nMirrors the MCP ``get_agent_attachment_references`` tool: returns\nwhat files (if any) an agent's templates expect on a run so API\nconsumers can stage uploads correctly before calling\n``POST /agents/{id}/runs``.", + "description": "The input attachments an agent's trigger declares.\n\nMirrors the MCP ``get_agent_attachment_references`` tool, so API\nconsumers can stage uploads that fit before calling\n``POST /agents/{id}/runs``.", "properties": { + "accepted_attachments": { + "description": "The attachments the agent's trigger declares. A run's files are each assigned to one; a file none accepts, or an attachment with fewer files than its ``min``, rejects the run with HTTP 400. Steps reference one as ``{{agent.attachments.}}``.", + "items": { + "$ref": "#/components/schemas/AcceptedAttachmentSlot" + }, + "title": "Accepted Attachments", + "type": "array" + }, "agent": { "$ref": "#/components/schemas/AttachmentRefsSourceApiSummary", - "description": "Aggregated selector summary across all consumer steps. ``exact_names`` entries must each appear in the upload batch; ``indexes_max+1`` is the minimum file count; every ``patterns`` glob must match at least one upload." + "description": "Aggregated summary of the agent-file references in the steps. Informational: which files a run accepts is ``accepted_attachments``." }, "requires_uploads": { - "description": "When ``false`` the agent's definition does NOT reference any uploaded attachments \u2014 ``POST /agents/{id}/upload-input`` will reject with HTTP 400. When ``true`` the ``agent`` block lists the specific selectors a run-time batch must satisfy.", + "description": "When ``false`` the agent takes no files through the API \u2014 it has no ``dynamic_input`` trigger, or that trigger declares no attachments \u2014 and ``POST /agents/{id}/upload-input`` will reject with HTTP 400. When ``true`` ``accepted_attachments`` lists what a run's files must fit.", "title": "Requires Uploads", "type": "boolean" } @@ -569,7 +670,7 @@ "type": "null" } ], - "description": "ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` \u2014 use that field to attach multiple files. May be combined with ``input``: the prompt text leads and the file's extracted text follows under a ``# {filename}`` heading.\n\n**Attachment visibility:** a step only sees the upload when its template references the input \u2014 via ``{{input}}`` / ``{{agent.input}}`` / ``{{step..input|output}}`` (implicit, all attachments) or the ``{{attachments[\u2026]}}`` family (explicit narrowing \u2014 e.g. ``{{attachments[0]}}``, ``{{attachments[*.pdf]}}``).\n\n**Per-batch validation:** every selector the agent's definition declares must be satisfied or the run is rejected with HTTP 400. Exact-name selectors require that filename to be present; indexed selectors require at least N+1 files; glob patterns require at least one matching filename.", + "description": "ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` \u2014 use that field to attach multiple files. May be combined with ``input``: the prompt text leads and the file follows under a ``# {filename}`` heading (before ``Seclai-Version: 2026-10-16``, followed by its extracted text).\n\n**Which steps receive it:** a step that sends or stores files takes the files its ``attachments`` field selects. An LLM step (``prompt_call``, ``extract_data``, ``evaluate_step``) takes the files its ``attachments`` field names, or else the files its plain-text templates reference: ``{{agent.attachments.}}`` for one attachment the trigger declares, or ``{{agent.input}}`` for every upload unless a template also names an agent attachment.\n\n**Per-batch validation:** the batch must fit the trigger's ``accepted_attachments`` \u2014 every file fits one declared attachment and each attachment gets at least its ``min`` files \u2014 or the run is rejected with HTTP 400.", "title": "Input Upload Id" }, "input_upload_ids": { @@ -586,7 +687,7 @@ "type": "null" } ], - "description": "IDs of multiple previously uploaded files. Each upload's extracted text is concatenated under a heading; each upload's binary is surfaced as a separate ``MediaAttachment`` so multi-modal prompt steps reason over all files at once. Steps narrow visibility via ``{{attachments[\u2026]}}`` selectors (by index, filename, or fnmatch glob). The batch must satisfy every selector the agent declares \u2014 exact names, indexed references (length must exceed the highest index), and glob patterns (each pattern needs at least one match). Mismatches return HTTP 400 with the unmet requirements listed. Mutually exclusive with ``input_upload_id`` (two spellings of the same batch), but may be combined with ``input`` \u2014 the prompt text leads and the per-file sections follow, so \"a photo plus a sentence about it\" needs no synthetic text upload. Max 20 uploads per run.", + "description": "IDs of multiple previously uploaded files. Each upload gets a heading in ``input`` (before ``Seclai-Version: 2026-10-16``, followed by its extracted text); each upload reaches steps as a separate file (before ``Seclai-Version: 2026-10-16``, a text upload in the open ``files`` attachment is written into ``input`` instead). Steps choose files as described under ``input_upload_id``. The batch must fit the trigger's ``accepted_attachments``; a mismatch returns HTTP 400 listing what does not fit. Mutually exclusive with ``input_upload_id`` (two spellings of the same batch), but may be combined with ``input`` \u2014 the prompt text leads and the per-file sections follow, so \"a photo plus a sentence about it\" needs no synthetic text upload. Max 20 uploads per run.", "title": "Input Upload Ids" }, "metadata": { @@ -620,7 +721,7 @@ "type": "null" } ], - "description": "Re-run this agent reusing a prior run's uploaded input files. The files are re-resolved server-side from the source run (which must belong to this account and agent) \u2014 you do not re-upload them. Combine with ``input`` to change the text while keeping the files. A fresh upload batch (``input_upload_id(s)``) takes precedence and disables replay. Binaries swept by retention fall back to their extracted text.", + "description": "Re-run this agent reusing a prior run's uploaded input files. The files are re-resolved server-side from the source run (which must belong to this account and agent) \u2014 you do not re-upload them. Combine with ``input`` to change the text while keeping the files. A fresh upload batch (``input_upload_id(s)``) takes precedence and disables replay. Binaries swept by retention fall back to their extracted text. Files the trigger's ``accepted_attachments`` no longer accepts are left out.", "title": "Replay Of Run Id" } }, @@ -747,7 +848,7 @@ "type": "null" } ], - "description": "The run's output text; its files are in `attachments`. Below `Seclai-Version: 2026-09-30` an output that has files is instead the manifest JSON `{schema, text, attachments: [{storage_key, mime, name, label, bytes}]}`; `bytes` is absent on runs made before that version shipped.", + "description": "The run's output text; its files are in `attachments`. Below `Seclai-Version: 2026-09-30` an output that has files is instead the manifest JSON `{schema, text, attachments: [{storage_key, mime, name, label, bytes}]}`; `bytes` can be `null` on runs made before that version shipped.", "title": "Output" }, "output_content_type": { @@ -813,7 +914,7 @@ "type": "null" } ], - "description": "When this run's trace content was deleted under the account's agent-trace retention window. Non-null means `input`, `output` and every step's and tool call's I/O are null **by design** and will never be available again \u2014 the run aged out, it did not fail. Branch on this rather than on a null `output`: a run that genuinely produced nothing looks identical. Status, timing and credits remain accurate.", + "description": "When this run's trace content was deleted under the account's agent-trace retention window. Non-null means `input`, `output` and every step's and tool call's I/O are null **by design** and will never be available again \u2014 the run aged out, it did not fail. A tool call's `error` may be null as well, so a failed tool call can report its status without a message. Branch on this rather than on a null `output`: a run that genuinely produced nothing looks identical. Status, timing and credits remain accurate.", "title": "Trace Purged At" }, "wait_ms": { @@ -963,7 +1064,7 @@ "type": "null" } ], - "description": "Authoring problems the step ran into, whether or not it then failed, such as a file name selector that matched none of its source's files.", + "description": "Problems the step ran into, whether or not it then failed, such as a file name selector that matched none of its source's files, or a model that returned no answer.", "title": "Warnings" } }, @@ -984,6 +1085,12 @@ }, "AgentRunStreamRequest": { "properties": { + "include_reasoning": { + "default": false, + "description": "Receive `stream_reasoning` events carrying the model's reasoning while it thinks. They are sent only for a `streaming_result` step whose author enabled `show_reasoning`, and never when a governance policy redacts that step.", + "title": "Include Reasoning", + "type": "boolean" + }, "input": { "anyOf": [ { @@ -1006,7 +1113,7 @@ "type": "null" } ], - "description": "ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` \u2014 use that field to attach multiple files. May be combined with ``input``. Subject to the same per-batch attachment-selector validation as the non-streaming endpoint.", + "description": "ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` \u2014 use that field to attach multiple files. May be combined with ``input``. Must fit the trigger's ``accepted_attachments``, as on the non-streaming endpoint.", "title": "Input Upload Id" }, "input_upload_ids": { @@ -1023,7 +1130,7 @@ "type": "null" } ], - "description": "IDs of multiple previously uploaded files. See the non-streaming endpoint for full semantics, including per-batch selector validation (exact names, indexed references, and glob patterns must all be satisfied or the run is rejected with HTTP 400) and combining the batch with ``input`` prompt text. Max 20.", + "description": "IDs of multiple previously uploaded files. See the non-streaming endpoint for full semantics, including fitting the trigger's ``accepted_attachments`` (else HTTP 400) and combining the batch with ``input`` prompt text. Max 20.", "title": "Input Upload Ids" }, "metadata": { @@ -1051,7 +1158,7 @@ "type": "null" } ], - "description": "Re-run reusing a prior run's uploaded input files (re-resolved server-side from the source run, which must belong to this account and agent). A fresh upload batch takes precedence.", + "description": "Re-run reusing a prior run's uploaded input files (re-resolved server-side from the source run, which must belong to this account and agent). A fresh upload batch takes precedence. Files the trigger's ``accepted_attachments`` no longer accepts are left out.", "title": "Replay Of Run Id" } }, @@ -1319,6 +1426,18 @@ "description": "Sampling configuration for sample_and_flag mode.", "title": "Sampling Config" }, + "trigger_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "ID of the agent's trigger, for the `/agents/{agent_id}/triggers/{trigger_id}/\u2026` endpoints such as `accepted-attachments` and `email-config`.", + "title": "Trigger Id" + }, "trigger_type": { "anyOf": [ { @@ -2910,6 +3029,90 @@ "title": "CompatibleRunResponse", "type": "object" }, + "ContentAttachmentResponse": { + "description": "A file attached to a content item.", + "properties": { + "content_type": { + "description": "MIME type of the attached file.", + "title": "Content Type", + "type": "string" + }, + "created_at": { + "description": "When the file was first attached.", + "title": "Created At", + "type": "string" + }, + "id": { + "description": "The attachment's id, which the single-attachment endpoints take.", + "title": "Id", + "type": "string" + }, + "indexed": { + "description": "Whether indexing the file for search was asked for.", + "title": "Indexed", + "type": "boolean" + }, + "indexing_error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Why the file was not indexed, when `indexing_status` is `failed`.", + "title": "Indexing Error" + }, + "indexing_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "`pending`, `completed` or `failed`; null when indexing was not asked for. Search finds the file only when `completed`.", + "title": "Indexing Status" + }, + "key": { + "description": "The attachment's key, unique within the item.", + "title": "Key", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "description": "What is known about the file beyond its bytes. An image extracted from a PDF carries its `page_number`, and `page_render: true` when it is a render of the whole page. An image or video from a web page carries `source_url` (the address it was fetched from), `position` (its place among the media the page listed, from 0) and, when the page gave one, `alt_text`. Empty for most files. A retrieval metadata filter matches these keys, except `alt_text`, which is indexed as the attachment's text.", + "title": "Metadata", + "type": "object" + }, + "size_bytes": { + "description": "Size of the attached file in bytes.", + "title": "Size Bytes", + "type": "integer" + }, + "updated_at": { + "description": "When the attachment last changed.", + "title": "Updated At", + "type": "string" + } + }, + "required": [ + "id", + "key", + "content_type", + "size_bytes", + "indexed", + "indexing_status", + "indexing_error", + "created_at", + "updated_at", + "metadata" + ], + "title": "ContentAttachmentResponse", + "type": "object" + }, "ContentEmbeddingResponse": { "description": "Response model for content embedding.", "properties": { @@ -3560,6 +3763,66 @@ "description": "Chunk size for content processing.", "title": "Chunk Size" }, + "cloud_drive_connection_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Required for a cloud_drive source, and ignored on any other: the id of a connected drive, from GET /cloud-drives.", + "title": "Cloud Drive Connection Id" + }, + "cloud_drive_content_types": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: comma-separated MIME types a file must have to be indexed. Omit for no filter.", + "title": "Cloud Drive Content Types" + }, + "cloud_drive_folder_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: the folder to index, as a path inside the drive. Omit to index the connected drive's own folder.", + "title": "Cloud Drive Folder Path" + }, + "cloud_drive_max_file_mb": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: files larger than this many megabytes are skipped. Omit for no limit of the source's own.", + "title": "Cloud Drive Max File Mb" + }, + "cloud_drive_path_pattern": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: a glob a file's path must match to be indexed, such as `**/*.pdf` or `/reports/*`. Omit for no filter.", + "title": "Cloud Drive Path Pattern" + }, "content_filter": { "anyOf": [ { @@ -3585,6 +3848,33 @@ "description": "Embedding dimensions override.", "title": "Dimensions" }, + "document_images": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether the images inside PDF, DOCX, PPTX and XLSX files are attached to the item and indexed; on a text-only embedder, by the text in each image. Applies to documents added after it changes. Defaults to true; below Seclai-Version 2026-10-18 it defaults to false on a text-only embedder. On a website or RSS source it is ignored: `media_types` decides.", + "title": "Document Images" + }, + "email_allowed_senders": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Required for an email source, and only valid there: the senders whose mail is stored. Each entry is a full address (news@example.com) or a bare domain (example.com), which also matches its sub-domains. Matched against the message's From address, which must pass DMARC.", + "title": "Email Allowed Senders" + }, "embedding_model": { "anyOf": [ { @@ -3597,6 +3887,21 @@ "description": "Embedding model override \u2014 a `model_type` from `GET /models/embedders`, which also reports each embedder's `supported_input_media`. Defaults to the platform embedder (`default_model_type` on that endpoint) when omitted. Indexing images or video requires an embedder that lists that modality.", "title": "Embedding Model" }, + "feed_attachments": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Kinds of file listed beside a feed item's content to attach to the item and index, on an RSS source. Subset of ['enclosures', 'item_image', 'media_rss']; any other value is refused. None are attached unless chosen.", + "title": "Feed Attachments" + }, "index_mode": { "anyOf": [ { @@ -3620,7 +3925,7 @@ "type": "null" } ], - "description": "Media kinds to extract from indexed content and embed as multi-modal KB chunks. Subset of ['images', 'video']. Only kinds the source's embedder can index are honored (see `supported_input_media` on GET /models/embedders); unsupported values are dropped. Omit / [] for text-only.", + "description": "Media kinds in a web page's main content to attach to the page's item and index, on a website or RSS source. Subset of ['images', 'video']. From `Seclai-Version: 2026-10-13` any other value, and any kind on another source type, is refused with a 400; older versions drop an unknown value and store the rest. A kind the source's embedder cannot index is stored and not indexed (see `supported_input_media` on GET /models/embedders). 'images' also covers the images inside PDF, DOCX, PPTX and XLSX files. Applies to pages and documents added after it is set.", "title": "Media Types" }, "name": { @@ -3664,7 +3969,7 @@ "type": "null" } ], - "description": "Max items per poll.", + "description": "The most new feed items a scheduled poll takes. Read for RSS feeds only: from Seclai-Version 2026-10-19 any other source type rejects it with 400. Earlier versions store it there. An email source rejects it at every version.", "title": "Polling Max Items" }, "retention": { @@ -3681,7 +3986,7 @@ "title": "Retention" }, "source_type": { - "description": "Source type: rss, website, or custom_index. The legacy value 'file_uploads' is accepted as an alias for custom_index.", + "description": "Source type: rss_feed, website, custom_index, cloud_drive or email. The legacy value 'file_uploads' is accepted as an alias for custom_index.", "title": "Source Type", "type": "string" }, @@ -4161,42 +4466,141 @@ "title": "EmailDomainsListResponse", "type": "object" }, - "EmailTriggerConfigResponse": { - "description": "An EMAIL_RECEIVED trigger's resolved address(es) and config.", + "EmailSourceRejectionListResponse": { + "description": "A page of mail an email content source refused.", "properties": { - "agent_id": { - "format": "uuid", - "title": "Agent Id", - "type": "string" - }, - "email_addresses": { + "data": { "items": { - "type": "string" + "$ref": "#/components/schemas/EmailSourceRejectionResponse" }, - "title": "Email Addresses", + "title": "Data", "type": "array" }, - "email_alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Email Alias" - }, - "email_allowed_senders": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" + "pagination": { + "$ref": "#/components/schemas/PaginationResponse" + } + }, + "required": [ + "data", + "pagination" + ], + "title": "EmailSourceRejectionListResponse", + "type": "object" + }, + "EmailSourceRejectionResponse": { + "description": "Mail an email content source refused: who sent it and why, never what\nit said.", + "properties": { + "auth_verdicts": { + "additionalProperties": { + "type": "string" + }, + "description": "The SPF, DKIM and DMARC verdicts reported for the message.", + "title": "Auth Verdicts", + "type": "object" + }, + "authenticated": { + "description": "Whether the message passed DMARC, which is what authenticates its From address. Adding an unauthenticated sender to the allowed senders does not let its mail in.", + "title": "Authenticated", + "type": "boolean" + }, + "created_at": { + "description": "When the mail was refused.", + "title": "Created At", + "type": "string" + }, + "from_address": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The address in the message's From line, which the source's allowed senders are matched against. Null when no single From address could be read from the message unambiguously.", + "title": "From Address" + }, + "id": { + "description": "Unique identifier of the refusal.", + "title": "Id", + "type": "string" + }, + "reason": { + "description": "Why it was refused: sender_not_allowed, unauthenticated_sender, unreadable_from, sender_blocked, spam, virus, unsafe_content, rate_limited, account_not_chargeable or empty_message; or, for a message the source received before, what became of the earlier one: repeat_stored, repeat_held, repeat_deleted or repeat_in_progress.", + "title": "Reason", + "type": "string" + }, + "recipient": { + "description": "The source address it was sent to.", + "title": "Recipient", + "type": "string" + }, + "sender": { + "description": "The envelope sender. For bulk mail this is the delivery provider's bounce address, not the From address.", + "title": "Sender", + "type": "string" + }, + "sender_ip": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "IP address the mail came from.", + "title": "Sender Ip" + } + }, + "required": [ + "id", + "created_at", + "recipient", + "sender", + "sender_ip", + "reason", + "authenticated" + ], + "title": "EmailSourceRejectionResponse", + "type": "object" + }, + "EmailTriggerConfigResponse": { + "description": "An EMAIL_RECEIVED trigger's resolved address(es) and config.", + "properties": { + "agent_id": { + "format": "uuid", + "title": "Agent Id", + "type": "string" + }, + "email_addresses": { + "items": { + "type": "string" + }, + "title": "Email Addresses", + "type": "array" + }, + "email_alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Email Alias" + }, + "email_allowed_senders": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" } ], "title": "Email Allowed Senders" @@ -4216,6 +4620,11 @@ "title": "Email Require Sender Auth", "type": "boolean" }, + "email_run_on_attachment_mismatch": { + "default": false, + "title": "Email Run On Attachment Mismatch", + "type": "boolean" + }, "trigger_id": { "format": "uuid", "title": "Trigger Id", @@ -5491,7 +5900,7 @@ "type": "null" } ], - "description": "Suggested agent-level configuration, if any.", + "description": "Suggested agent-level configuration, if any. For an email_received agent it may carry `email_run_on_attachment_mismatch`, which the caller applies through the trigger's email-config endpoint. For a dynamic_input or email_received agent it may carry `accepted_attachments`, which the caller passes with the steps to `PUT /agents/{agent_id}/definition` so both save together.", "title": "Agent Config" }, "conversation_id": { @@ -7405,6 +7814,30 @@ "title": "ServiceUnavailableError", "type": "object" }, + "SetAcceptedAttachmentsRequest": { + "properties": { + "accepted_attachments": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/AcceptedAttachmentSlot" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "The input attachments the trigger accepts; ``null`` accepts any files (one attachment named ``files``). Only ``dynamic_input`` and ``email_received`` triggers take files.", + "title": "Accepted Attachments" + } + }, + "required": [ + "accepted_attachments" + ], + "title": "SetAcceptedAttachmentsRequest", + "type": "object" + }, "SetAutoBlockModeRequest": { "description": "Set the account's governance auto-block mode (shared REST request).", "properties": { @@ -7419,6 +7852,62 @@ "title": "SetAutoBlockModeRequest", "type": "object" }, + "SkippedAttachmentReason": { + "enum": [ + "displayed_in_body", + "over_cap", + "no_filename", + "undecodable" + ], + "title": "SkippedAttachmentReason", + "type": "string" + }, + "SkippedAttachmentResponse": { + "description": "A part of an email that was not stored as an attachment.", + "properties": { + "content_type": { + "description": "The part's declared media type.", + "title": "Content Type", + "type": "string" + }, + "filename": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The file name the part is listed under; null when it had none.", + "title": "Filename" + }, + "reason": { + "$ref": "#/components/schemas/SkippedAttachmentReason", + "description": "Why the part was not stored." + }, + "size_bytes": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Decoded size in bytes.", + "title": "Size Bytes" + } + }, + "required": [ + "filename", + "content_type", + "size_bytes", + "reason" + ], + "title": "SkippedAttachmentResponse", + "type": "object" + }, "SolutionSourceConnectionResponse": { "properties": { "id": { @@ -7642,7 +8131,7 @@ }, "extracted_media_capped": { "default": false, - "description": "True when extraction stopped with media still unread, so the item references more media than was indexed and media search will not match anything past the cut. Two causes: a web page that ran out of the budget for fetching remote assets, or a container that could not be read to the end (a truncated or hostile archive). An uploaded document that reads cleanly is never capped, however much media it holds \u2014 there is no limit on that.", + "description": "True when extraction stopped with media still unread, so the item references more media than was attached and media search will not match anything past the cut. The cause is a web page that ran out of the budget for fetching remote assets or listed more media than is recorded, or a web page or document that could not be read to the end.", "title": "Extracted Media Capped", "type": "boolean" }, @@ -7655,7 +8144,7 @@ "type": "null" } ], - "description": "Number of embedded images / videos extracted from inside this item and indexed as their own chunks. There is no limit on this \u2014 a document contributes as many as it holds. Null when there is no media record for the item: the extraction pass has not run, does not apply to this container, or found nothing. Treat null as 'unknown', never as zero.", + "description": "Number of images / videos in this web page's main content, or of images inside this PDF or Office document, that were attached to the item on this source; a file over the per-file size limit, listed as a failed attachment, is not counted. Null when there is no media record for the item: the extraction pass has not run, does not apply to this container or this source's settings, or found nothing. Treat null as 'unknown', never as zero.", "title": "Extracted Media Count" }, "extracted_media_limit": { @@ -7667,9 +8156,15 @@ "type": "null" } ], - "description": "The bound that was reached, when extracted_media_capped is true and the stop was a bound \u2014 a number of fetch attempts, or a number of seconds. Null when extraction was not capped, or when it stopped because the container could not be read rather than because a bound fired.", + "description": "The bound that was reached, when extracted_media_capped is true and the stop was a bound \u2014 a number of fetch attempts, of seconds, of bytes, or of media listed. Null when extraction was not capped, or when it stopped because the container could not be read rather than because a bound fired.", "title": "Extracted Media Limit" }, + "held_for_review": { + "default": false, + "description": "An ENFORCE governance policy blocked this item at import. It is held for review and is not retrievable: resolving its blocking evaluations releases it into the source, and it is purged when the hold window ends.", + "title": "Held For Review", + "type": "boolean" + }, "indexed_at": { "anyOf": [ { @@ -8002,6 +8497,66 @@ "description": "Chunk size for content processing.", "title": "Chunk Size" }, + "cloud_drive_connection_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: the id of the connected drive it indexes. Null for every other source type.", + "title": "Cloud Drive Connection Id" + }, + "cloud_drive_content_types": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: the comma-separated MIME types a file must have to be indexed. Null when there is no filter.", + "title": "Cloud Drive Content Types" + }, + "cloud_drive_folder_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: the folder it indexes. Null when it indexes the connected drive's own folder.", + "title": "Cloud Drive Folder Path" + }, + "cloud_drive_max_file_mb": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: the size in megabytes above which a file is skipped. Null when the source sets no limit of its own.", + "title": "Cloud Drive Max File Mb" + }, + "cloud_drive_path_pattern": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: the glob a file's path must match to be indexed. Null when there is none.", + "title": "Cloud Drive Path Pattern" + }, "content_count": { "default": 0, "description": "Number of content items associated with the source connection.", @@ -8030,6 +8585,39 @@ "description": "Dimensions of the embedding model.", "title": "Dimensions" }, + "document_images": { + "default": true, + "description": "Whether the images inside PDF, DOCX, PPTX and XLSX files are attached to the item and indexed; on a source that follows no web pages and has a text-only embedder, by the text in each image. Applies to documents added after it changes. On a website or RSS source it reports whether `media_types` holds 'images', and the images are attached only when the source's embedder indexes images.", + "title": "Document Images", + "type": "boolean" + }, + "email_address": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For an email source: the address to send mail to. Null for every other source type.", + "title": "Email Address" + }, + "email_allowed_senders": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "For an email source: the addresses and domains whose mail is stored. Null for every other source type.", + "title": "Email Allowed Senders" + }, "embedding_model": { "anyOf": [ { @@ -8054,6 +8642,14 @@ "description": "Type of the embedding model.", "title": "Embedding Model Type" }, + "feed_attachments": { + "description": "Kinds of file listed beside a feed item's content that an RSS source attaches to the item and indexes (subset of ['enclosures', 'item_image', 'media_rss']).", + "items": { + "type": "string" + }, + "title": "Feed Attachments", + "type": "array" + }, "free_retention_days": { "anyOf": [ { @@ -8089,7 +8685,7 @@ "description": "Index mode for custom_index sources: fast_and_cheap, balanced, slow_and_thorough, or custom." }, "media_types": { - "description": "Media kinds extracted from indexed content and embedded as multi-modal KB chunks (subset of ['images', 'video']). Empty = text-only.", + "description": "Media kinds in a web page's main content that are attached to the page's item and indexed (subset of ['images', 'video']). On a website or RSS source 'images' also covers the images inside PDF, DOCX, PPTX and XLSX files.", "items": { "type": "string" }, @@ -8146,7 +8742,7 @@ "type": "null" } ], - "description": "Maximum items to poll for the source connection.", + "description": "The most new feed items a scheduled poll takes. Read for RSS feeds only.", "title": "Polling Max Items" }, "pulled_at": { @@ -8593,6 +9189,21 @@ }, "UpdateAgentDefinitionRequest": { "properties": { + "accepted_attachments": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/AcceptedAttachmentSlot" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "When given, declared on the main branch's file-taking triggers in the same save, so the steps may read its slots as `{{agent.attachments.}}`; omitted, the triggers keep theirs.", + "title": "Accepted Attachments" + }, "definition": { "additionalProperties": true, "description": "The full agent definition (name, description, tags, steps). Steps form a tree workflow. Each step has a `step_type`, `id`, `name`, and type-specific config. Content enrichment steps (write_metadata, write_content_attachment, load_content_attachment, load_content) require content-triggered agents.", @@ -9033,11 +9644,101 @@ "UpdateSourceBody": { "description": "Request body for updating a content source.", "properties": { - "media_types": { + "cloud_drive_content_types": { "anyOf": [ { - "items": { - "type": "string" + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: comma-separated MIME types a file must have to be indexed. Send an empty string to clear it; omit to leave it unchanged.", + "title": "Cloud Drive Content Types" + }, + "cloud_drive_folder_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: the folder to index, as a path inside the drive. Send an empty string to index the connected drive's own folder; omit to leave it unchanged.", + "title": "Cloud Drive Folder Path" + }, + "cloud_drive_max_file_mb": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: files larger than this many megabytes are skipped. Send 0 to clear the source's own limit; omit to leave it unchanged.", + "title": "Cloud Drive Max File Mb" + }, + "cloud_drive_path_pattern": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For a cloud_drive source: a glob a file's path must match to be indexed, such as `**/*.pdf` or `/reports/*`. Send an empty string to clear it; omit to leave it unchanged.", + "title": "Cloud Drive Path Pattern" + }, + "document_images": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether the images inside PDF, DOCX, PPTX and XLSX files are attached to the item and indexed; on a text-only embedder, by the text in each image. Applies to documents added after it changes. Omit the field to leave it unchanged. On a website or RSS source it is ignored: `media_types` decides.", + "title": "Document Images" + }, + "email_allowed_senders": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "For an email source: replaces the allowed senders. Each entry is a full address or a bare domain. The list cannot be emptied. Omit to leave it unchanged.", + "title": "Email Allowed Senders" + }, + "feed_attachments": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Kinds of file listed beside a feed item's content to attach to the item and index, on an RSS source. Subset of ['enclosures', 'item_image', 'media_rss']; any other value is refused. [] attaches none. Applies to items added after it changes. Omit the field to leave it unchanged.", + "title": "Feed Attachments" + }, + "media_types": { + "anyOf": [ + { + "items": { + "type": "string" }, "type": "array" }, @@ -9045,7 +9746,7 @@ "type": "null" } ], - "description": "Media kinds to extract from indexed content and embed as multi-modal KB chunks. Subset of ['images', 'video']. Only kinds the source's embedder can index are honored (see `supported_input_media` on GET /models/embedders); unsupported values are dropped. [] disables media extraction (text-only).", + "description": "Media kinds in a web page's main content to attach to the page's item and index, on a website or RSS source. Subset of ['images', 'video']. From `Seclai-Version: 2026-10-13` any other value, and any kind on another source type, is refused with a 400; older versions drop an unknown value and store the rest. A kind the source's embedder cannot index is stored and not indexed (see `supported_input_media` on GET /models/embedders). [] attaches no media from web pages. 'images' also covers the images inside PDF, DOCX, PPTX and XLSX files. Applies to pages and documents added after it changes.", "title": "Media Types" }, "name": { @@ -9582,6 +10283,21 @@ }, "routers__api__agents__CreateAgentRequest": { "properties": { + "accepted_attachments": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/AcceptedAttachmentSlot" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "The input attachments the trigger accepts. Omitted, the ``agent_definition`` trigger's declaration is kept when the export carries one and both trigger types take files; otherwise a dynamic_input or email_received trigger accepts any files (one attachment named ``files``), and any other trigger none.", + "title": "Accepted Attachments" + }, "agent_definition": { "anyOf": [ { @@ -9745,6 +10461,18 @@ ], "description": "When true (default for new triggers), the envelope sender must pass SPF or DMARC even on an open inbox (no allowlist); unauthenticated, spoofable mail is rejected. Set false to accept fully unauthenticated mail on an open inbox.", "title": "Require Sender Auth" + }, + "run_on_attachment_mismatch": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "When true (default false), an email whose attachments don't fit what the agent expects still runs: files the agent can't take are left out and the problems are listed in the `email_attachment_issues` run metadata. When false, the run fails.", + "title": "Run On Attachment Mismatch" } }, "title": "SetEmailTriggerConfigRequest", @@ -10384,6 +11112,152 @@ "title": "UpdateOrganizationAlertPreferenceRequest", "type": "object" }, + "routers__api__contents__ContentAttachmentDetailResponse": { + "description": "One attached file, with the text indexed from it.", + "properties": { + "content_type": { + "description": "MIME type of the attached file.", + "title": "Content Type", + "type": "string" + }, + "created_at": { + "description": "When the file was first attached.", + "title": "Created At", + "type": "string" + }, + "file_withheld": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Why the file's bytes are not served, or null when they are: `blocked_by_governance_policy`, `redacted_by_governance_policy` (any text below is the redacted text), or `pending_screening`.", + "title": "File Withheld" + }, + "id": { + "description": "The attachment's id, which the single-attachment endpoints take.", + "title": "Id", + "type": "string" + }, + "indexed": { + "description": "Whether indexing the file for search was asked for.", + "title": "Indexed", + "type": "boolean" + }, + "indexing_error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Why the file was not indexed, when `indexing_status` is `failed`.", + "title": "Indexing Error" + }, + "indexing_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "`pending`, `completed` or `failed`; null when indexing was not asked for. Search finds the file only when `completed`.", + "title": "Indexing Status" + }, + "key": { + "description": "The attachment's key, unique within the item.", + "title": "Key", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "description": "What is known about the file beyond its bytes. An image extracted from a PDF carries its `page_number`, and `page_render: true` when it is a render of the whole page. An image or video from a web page carries `source_url` (the address it was fetched from), `position` (its place among the media the page listed, from 0) and, when the page gave one, `alt_text`. Empty for most files. A retrieval metadata filter matches these keys, except `alt_text`, which is indexed as the attachment's text.", + "title": "Metadata", + "type": "object" + }, + "size_bytes": { + "description": "Size of the attached file in bytes.", + "title": "Size Bytes", + "type": "integer" + }, + "text_content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The requested range of the text the file is indexed by; null when the file has no completed index or was indexed without text.", + "title": "Text Content" + }, + "text_content_end": { + "title": "Text Content End", + "type": "integer" + }, + "text_content_start": { + "title": "Text Content Start", + "type": "integer" + }, + "text_content_total_length": { + "title": "Text Content Total Length", + "type": "integer" + }, + "updated_at": { + "description": "When the attachment last changed.", + "title": "Updated At", + "type": "string" + } + }, + "required": [ + "id", + "key", + "content_type", + "size_bytes", + "indexed", + "indexing_status", + "indexing_error", + "created_at", + "updated_at", + "metadata", + "file_withheld", + "text_content", + "text_content_start", + "text_content_end", + "text_content_total_length" + ], + "title": "ContentAttachmentDetailResponse", + "type": "object" + }, + "routers__api__contents__ContentAttachmentsListResponse": { + "description": "Response model for a content item's attachments.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ContentAttachmentResponse" + }, + "title": "Data", + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponse" + } + }, + "required": [ + "data", + "pagination" + ], + "title": "ContentAttachmentsListResponse", + "type": "object" + }, "routers__api__contents__ContentDetailResponse": { "description": "Response model for content detail.", "properties": { @@ -10469,7 +11343,7 @@ }, "extracted_media_capped": { "default": false, - "description": "True when extraction stopped with media still unread, so the item references more media than was indexed and media search will not match anything past the cut. Two causes: a web page that ran out of the budget for fetching remote assets, or a container that could not be read to the end (a truncated or hostile archive). An uploaded document that reads cleanly is never capped, however much media it holds \u2014 there is no limit on that.", + "description": "True when extraction stopped with media still unread, so the item references more media than was attached and media search will not match anything past the cut. The cause is a web page that ran out of the budget for fetching remote assets or listed more media than is recorded, or a web page or document that could not be read to the end.", "title": "Extracted Media Capped", "type": "boolean" }, @@ -10482,7 +11356,7 @@ "type": "null" } ], - "description": "Number of embedded images / videos extracted from inside this item and indexed as their own chunks. There is no limit on this \u2014 a document contributes as many as it holds. Null when there is no media record for the item: the extraction pass has not run, does not apply to this container, or found nothing. Treat null as 'unknown', never as zero.", + "description": "Number of images / videos in this web page's main content, or of images inside this PDF or Office document, that were attached to the item on this source; a file over the per-file size limit, listed as a failed attachment, is not counted. Null when there is no media record for the item: the extraction pass has not run, does not apply to this container or this source's settings, or found nothing. Treat null as 'unknown', never as zero.", "title": "Extracted Media Count" }, "extracted_media_limit": { @@ -10494,7 +11368,7 @@ "type": "null" } ], - "description": "The bound that was reached, when extracted_media_capped is true and the stop was a bound \u2014 a number of fetch attempts, or a number of seconds. Null when extraction was not capped, or when it stopped because the container could not be read rather than because a bound fired.", + "description": "The bound that was reached, when extracted_media_capped is true and the stop was a bound \u2014 a number of fetch attempts, of seconds, of bytes, or of media listed. Null when extraction was not capped, or when it stopped because the container could not be read rather than because a bound fired.", "title": "Extracted Media Limit" }, "id": { @@ -10537,6 +11411,14 @@ "title": "Pulled At", "type": "string" }, + "skipped_attachments": { + "description": "Parts of an email delivered to an email content source that were not stored as attachments of this item, each with the reason: displayed_in_body (an image the message body shows, such as a signature logo), over_cap (beyond the per-message attachment limit), no_filename, or undecodable. size_bytes is null for a part that was never decoded. Empty for every other item.", + "items": { + "$ref": "#/components/schemas/SkippedAttachmentResponse" + }, + "title": "Skipped Attachments", + "type": "array" + }, "source_connection_content_version_id": { "description": "ID of the source connection content version.", "title": "Source Connection Content Version Id", @@ -12024,7 +12906,7 @@ "type": "null" } ], - "description": "Set when the file is non-text but the source's embedder is text-only \u2014 indexing will rely on OCR / transcription and may produce a FAILED row if no text can be extracted.", + "description": "Set when a file that is not text is indexed from its extracted text alone rather than embedded whole: the item is FAILED if no text can be extracted. Says so when the images inside a document are attached to the item and indexed as well.", "title": "Embedder Warning" }, "filename": { @@ -12764,7 +13646,7 @@ ] }, "post": { - "description": "Create a new agent.\n\nTrigger types:\n- `dynamic_input`: triggered via API with user-provided input\n- `template_input`: triggered via API with a predefined template\n- `schedule`: triggered on a schedule\n- `new_content`: triggered when new content arrives\n- `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`.\n\nTemplates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline`\n\nImporting an existing agent:\n- Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; items that don't resolve in this account are reported in the response's `import_warnings` array.\n- Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: target_uuid}` on this call to substitute them before save.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account.", + "description": "Create a new agent.\n\nTrigger types:\n- `dynamic_input`: triggered via API with user-provided input\n- `template_input`: triggered via API with a predefined template\n- `schedule`: triggered on a schedule\n- `new_content`: triggered when new content arrives\n- `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`, using the `trigger_id` this response returns.\n\nTemplates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline`\n\nImporting an existing agent:\n- Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; items that don't resolve in this account are reported in the response's `import_warnings` array.\n- Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: target_uuid}` on this call to substitute them before save.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account.", "operationId": "create_agent_api_agents_post", "parameters": [ { @@ -15065,7 +15947,7 @@ }, "/agents/{agent_id}/attachment-references": { "get": { - "description": "Return the static attachment-reference contract for an agent \u2014 what files the agent's definition expects on a run.\n\nCall this BEFORE staging uploads so you know whether the agent accepts files at all (``requires_uploads``), and which specific filenames/indexes/patterns the templates reference. Mismatched batches are rejected at run time with HTTP 400.", + "description": "Return the input attachments the agent's dynamic_input trigger declares \u2014 the files a run may carry.\n\nCall this BEFORE staging uploads so you know whether the agent accepts files at all (``requires_uploads``), and which attachments its trigger declares (``accepted_attachments``). Batches that do not fit them are rejected at run time with HTTP 400.", "operationId": "api_get_agent_attachment_references_api_agents__agent_id__attachment_references_get", "parameters": [ { @@ -16308,7 +17190,7 @@ ] }, "post": { - "description": "Start an agent run.\n\nAn *agent* is an automated workflow that can monitor content from your sources, process it with AI, and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve status and output.\n\nWhen to use:\n- Use this endpoint for request/response style integrations where polling is acceptable.\n- Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE.\n\nKey fields:\n- `input`: text input for agents with a `dynamic_input` trigger.\n- `input_upload_id` / `input_upload_ids`: reference one or more files previously uploaded via `POST /agents/{agent_id}/upload-input`. Send them **with** `input` to pair prompt text with the files (the text leads, each file's extracted text follows); only the two upload fields are mutually exclusive with each other.\n- `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but without live token streaming.\n- `metadata`: a JSON object that becomes available to agent steps for string substitution.\n\nAfter starting:\n- Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`.\n- Use `include_step_outputs=true` to include per-step outputs, timing, and credits.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", + "description": "Start an agent run.\n\nAn *agent* is an automated workflow that can monitor content from your sources, process it with AI, and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve status and output.\n\nWhen to use:\n- Use this endpoint for request/response style integrations where polling is acceptable.\n- Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE.\n\nKey fields:\n- `input`: text input for agents with a `dynamic_input` trigger.\n- `input_upload_id` / `input_upload_ids`: reference one or more files previously uploaded via `POST /agents/{agent_id}/upload-input`. Send them **with** `input` to pair prompt text with the files (the text leads, each file follows under its heading); only the two upload fields are mutually exclusive with each other.\n- `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but without live token streaming.\n- `metadata`: a JSON object that becomes available to agent steps for string substitution.\n\nAfter starting:\n- Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`.\n- Use `include_step_outputs=true` to include per-step outputs, timing, and credits.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", "operationId": "run_agent_api_agents__agent_id__runs_post", "parameters": [ { @@ -16395,7 +17277,7 @@ }, "/agents/{agent_id}/runs/stream": { "post": { - "description": "Start a **priority** agent run and stream run events using Server-Sent Events (SSE).\n\nThis is the best option for interactive UIs where you want progress updates as the run executes.\n\nHow it works:\n- The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`.\n- Subsequent events are forwarded from the run event stream (status changes, step events, etc).\n- If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion.\n- The final `done` event contains the terminal snapshot (including `output` and `credits` when available).\n\nInput options (for `dynamic_input` triggers):\n- `input`: text input passed directly.\n- `input_upload_id` / `input_upload_ids`: reference one or more files uploaded via `POST /agents/{agent_id}/upload-input`. Combine either with `input` to send prompt text alongside the files; only the two upload fields are mutually exclusive with each other.\n\nClient guidance:\n- Keep the connection open and handle keepalive comments.\n- On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET /agents/runs/{run_id}`.\n- `stream_token` events carry the model's raw output. When the agent pairs `streaming_result` with a sibling `extract_content`/`display_result` branch, that branch's `display_result` takes precedence over the stream, so the `done` snapshot's `output` is the validated payload and the tokens are a progress channel \u2014 render tokens live, but read the result from `done`. Check `done.status` first: the streamed text is already the run's output when the stream ends, so a run that FAILED its validation step still carries that raw text in `output`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", + "description": "Start a **priority** agent run and stream run events using Server-Sent Events (SSE).\n\nThis is the best option for interactive UIs where you want progress updates as the run executes.\n\nHow it works:\n- The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`.\n- Subsequent events are forwarded from the run event stream (status changes, step events, etc).\n- If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion.\n- With `include_reasoning=true`, `stream_reasoning` events (with a `text` field) carry the model's reasoning while it thinks, when the `streaming_result` step's author enabled `show_reasoning`. Reasoning is never part of `output`.\n- The final `done` event contains the terminal snapshot (including `output` and `credits` when available).\n\nInput options (for `dynamic_input` triggers):\n- `input`: text input passed directly.\n- `input_upload_id` / `input_upload_ids`: reference one or more files uploaded via `POST /agents/{agent_id}/upload-input`. Combine either with `input` to send prompt text alongside the files; only the two upload fields are mutually exclusive with each other.\n\nClient guidance:\n- Keep the connection open and handle keepalive comments.\n- On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET /agents/runs/{run_id}`.\n- `stream_token` events carry the model's raw output. When the agent pairs `streaming_result` with a sibling `extract_content`/`display_result` branch, that branch's `display_result` takes precedence over the stream, so the `done` snapshot's `output` is the validated payload and the tokens are a progress channel \u2014 render tokens live, but read the result from `done`. Check `done.status` first: the streamed text is already the run's output when the stream ends, so a run that FAILED its validation step still carries that raw text in `output`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", "operationId": "run_streaming_agent_api_agents__agent_id__runs_stream_post", "parameters": [ { @@ -16587,10 +17469,10 @@ ] } }, - "/agents/{agent_id}/triggers/{trigger_id}/email-config": { + "/agents/{agent_id}/triggers/{trigger_id}/accepted-attachments": { "put": { - "description": "Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, `require_sender_auth`, `queue_on_quota`) on an agent's EMAIL_RECEIVED trigger, and return its computed email address(es). Omitted fields are left unchanged.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account.", - "operationId": "set_email_trigger_config_api_api_agents__agent_id__triggers__trigger_id__email_config_put", + "description": "Replace the input attachments a trigger accepts. A run's files are each assigned to one declared attachment before any step runs; steps reference one as ``{{agent.attachments.}}``. Rejected with HTTP 400 when the agent references an attachment the new declaration leaves out. `trigger_id` is the one `GET /agents/{agent_id}` returns.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account.", + "operationId": "set_accepted_attachments_api_api_agents__agent_id__triggers__trigger_id__accepted_attachments_put", "parameters": [ { "in": "path", @@ -16621,7 +17503,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__agents__SetEmailTriggerConfigRequest" + "$ref": "#/components/schemas/SetAcceptedAttachmentsRequest" } } }, @@ -16632,7 +17514,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmailTriggerConfigResponse" + "$ref": "#/components/schemas/AcceptedAttachmentsResponse" } } }, @@ -16667,16 +17549,16 @@ } } }, - "summary": "Configure an EMAIL_RECEIVED trigger", + "summary": "Declare the input attachments a trigger accepts", "tags": [ "agents" ] } }, - "/agents/{agent_id}/upload-input": { - "post": { - "description": "Upload a file to use as input for a `dynamic_input` agent run.\n\nSupports the same file types as content source uploads: text, PDF, DOCX, audio, video, images, etc. Text and document files are processed synchronously; audio/video are submitted for asynchronous transcription.\n\n**Size limit:** 200 MB per file.\n\n**Supported extensions:** txt, html, md, csv, xml, json, pdf, msg, docx, doc, pptx, ppt, xlsx, xls, zip, epub, png, jpg, gif, bmp, tiff, webp, mp3, wav, m4a, flac, ogg, mp4, mov, avi.\n\nAfter uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, then pass `input_upload_id` to `POST /agents/{agent_id}/runs`.\n\n**Multi-modal routing:** non-text uploads (image, audio, video, PDF) are surfaced natively to multi-modal-capable prompt steps; text-only models fall back to the OCR / transcript text counterpart. Audio originals are preserved past transcription so audio-capable models (Gemini 2.5/3, GPT-5 audio) read them directly; the agent-input-binary janitor sweeps originals once they pass your account's agent-trace retention (the agent-traces source's retention period; free default 7 days).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "api_upload_agent_input_api_agents__agent_id__upload_input_post", + "/agents/{agent_id}/triggers/{trigger_id}/email-config": { + "put": { + "description": "Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, `require_sender_auth`, `queue_on_quota`, `run_on_attachment_mismatch`) on an agent's EMAIL_RECEIVED trigger, and return its computed email address(es). `trigger_id` is the one `GET /agents/{agent_id}` returns. Omitted fields are left unchanged.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account.", + "operationId": "set_email_trigger_config_api_api_agents__agent_id__triggers__trigger_id__email_config_put", "parameters": [ { "in": "path", @@ -16687,6 +17569,15 @@ "type": "string" } }, + { + "in": "path", + "name": "trigger_id", + "required": true, + "schema": { + "title": "Trigger Id", + "type": "string" + } + }, { "$ref": "#/components/parameters/X-Account-Id" }, @@ -16694,12 +17585,22 @@ "$ref": "#/components/parameters/Seclai-Version" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/routers__api__agents__SetEmailTriggerConfigRequest" + } + } + }, + "required": true + }, "responses": { - "202": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UploadAgentInputApiResponse" + "$ref": "#/components/schemas/EmailTriggerConfigResponse" } } }, @@ -16734,25 +17635,92 @@ } } }, - "summary": "Upload file input", + "summary": "Configure an EMAIL_RECEIVED trigger", "tags": [ "agents" ] } }, - "/ai-assistant/feedback": { + "/agents/{agent_id}/upload-input": { "post": { - "description": "Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is analyzed for concerning issues.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_feedback_api_ai_assistant_feedback_post", + "description": "Upload a file to use as input for a `dynamic_input` agent run. Any other agent rejects the upload with HTTP 400.\n\n**Size limit:** 200 MB per file.\n\nFrom `Seclai-Version: 2026-10-16` a file of any type is accepted and is `ready` at once: pass `input_upload_id` to `POST /agents/{agent_id}/runs`. Each step receives the file itself when its model reads that type, and otherwise its text (OCR, extraction or transcript), made once for the steps that need it; a type nothing reads or converts is passed on as a file only. `input` carries a `# filename` heading per file.\n\nEarlier versions accept only these extensions: avi, bmp, csv, docx, epub, flac, gif, html, jpg, json, m4a, markdown, md, mov, mp3, mp4, msg, ogg, pdf, png, ppt, pptx, svg, tiff, txt, wav, webp, xls, xlsx, xml, zip. They write each file's text into `input`, so poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready` before running.\n\nThe agent-input-binary janitor sweeps originals once they pass your account's agent-trace retention (the agent-traces source's retention period; free default 7 days).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", + "operationId": "api_upload_agent_input_api_agents__agent_id__upload_input_post", "parameters": [ { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "title": "Agent Id", + "type": "string" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + }, + { + "$ref": "#/components/parameters/Seclai-Version" + } + ], + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UploadAgentInputApiResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + }, + "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", + "schema": { + "type": "integer" + } + } + } + } + }, + "summary": "Upload file input", + "tags": [ + "agents" + ] + } + }, + "/ai-assistant/feedback": { + "post": { + "description": "Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is analyzed for concerning issues.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", + "operationId": "api_ai_feedback_api_ai_assistant_feedback_post", + "parameters": [ + { + "$ref": "#/components/parameters/X-Account-Id" + }, + { + "$ref": "#/components/parameters/Seclai-Version" + } + ], + "requestBody": { "content": { "application/json": { "schema": { @@ -18969,9 +19937,326 @@ "name": "limit", "required": false, "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, + "default": 50, + "maximum": 200, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + }, + { + "$ref": "#/components/parameters/Seclai-Version" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/CloudDriveRejectionResponseModel" + }, + "title": "Response List Cloud Drive Rejections Api Api Cloud Drives Connection Id Rejections Get", + "type": "array" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + }, + "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", + "schema": { + "type": "integer" + } + } + } + } + }, + "summary": "List files this connection did not process", + "tags": [ + "cloud_drives" + ] + } + }, + "/contents/{source_connection_content_version}": { + "delete": { + "description": "Delete a content item (a `SourceConnectionContentVersion`).\n\nUse this to remove an uploaded or indexed item from your account. Deleting content can affect agents and knowledge base workflows that reference this item.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your account.\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.", + "operationId": "delete_content_api_contents__source_connection_content_version__delete", + "parameters": [ + { + "in": "path", + "name": "source_connection_content_version", + "required": true, + "schema": { + "title": "Source Connection Content Version", + "type": "string" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + }, + { + "$ref": "#/components/parameters/Seclai-Version" + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "403": { + "description": "The key's user is a member of the account but not an owner or administrator (`error.code` is `permission_denied`)." + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + }, + "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", + "schema": { + "type": "integer" + } + } + } + } + }, + "summary": "Delete content", + "tags": [ + "contents" + ] + }, + "get": { + "description": "Get detailed information about a specific content item (a `SourceConnectionContentVersion`).\n\nThis is useful when you want to:\n- Inspect the extracted text for debugging or review.\n- Display content details in a UI.\n\nText range:\n- `start` and `end` control the character range returned in `text_content` so clients can page through large documents.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account.", + "operationId": "get_content_detail_api_contents__source_connection_content_version__get", + "parameters": [ + { + "in": "path", + "name": "source_connection_content_version", + "required": true, + "schema": { + "title": "Source Connection Content Version", + "type": "string" + } + }, + { + "in": "query", + "name": "start", + "required": false, + "schema": { + "default": 0, + "title": "Start", + "type": "integer" + } + }, + { + "in": "query", + "name": "end", + "required": false, + "schema": { + "default": 5000, + "title": "End", + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + }, + { + "$ref": "#/components/parameters/Seclai-Version" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/routers__api__contents__ContentDetailResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + }, + "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", + "schema": { + "type": "integer" + } + } + } + } + }, + "summary": "Get content details", + "tags": [ + "contents" + ] + }, + "put": { + "description": "Replace a content version using a small inline text payload.\n\n**Maximum payload size:** 8192 bytes (UTF-8).\n\n**Supported content types:**\n- `application/json`\n- `application/xml`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- Use this endpoint for small text payloads; larger files should use `/upload`.\n- `title` is merged into `metadata.title` when not already present.\n- The replacement is indexed in the background. This `SourceConnectionContentVersion` ID keeps working, and reads return the previous content until indexing finishes; poll `list_source_content_status` to follow it. The returned `content_version_id` is the new version.", + "operationId": "replace_content_with_inline_text_api_contents__source_connection_content_version__put", + "parameters": [ + { + "in": "path", + "name": "source_connection_content_version", + "required": true, + "schema": { + "title": "Source Connection Content Version", + "type": "string" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + }, + { + "$ref": "#/components/parameters/Seclai-Version" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InlineTextReplaceRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/routers__api__contents__FileUploadResponse" + } + } + }, + "description": "Successful Response" + }, + "403": { + "description": "The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`)." + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + }, + "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", + "schema": { + "type": "integer" + } + } + } + } + }, + "summary": "Replace a content version with inline text", + "tags": [ + "contents" + ] + } + }, + "/contents/{source_connection_content_version}/attachments": { + "get": { + "description": "List the files attached to a content item, with pagination.\n\nAn agent's `write_content_attachment` step attaches a file, and an email content source attaches the files sent with a message. An RSS source attaches the kinds of feed file chosen in its `feed_attachments`. The images and video in a web page's main content are attached on a source with media indexing on. The images inside a PDF, DOCX, PPTX or XLSX item or attachment are attached too, on a source that indexes document images. Each entry says whether the file is indexed for search and, when indexing failed, why.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content belonging to your account.", + "operationId": "list_content_attachments_api_contents__source_connection_content_version__attachments_get", + "parameters": [ + { + "in": "path", + "name": "source_connection_content_version", + "required": true, + "schema": { + "title": "Source Connection Content Version", + "type": "string" + } + }, + { + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "title": "Page", + "type": "integer" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 20, "title": "Limit", "type": "integer" } @@ -18988,11 +20273,7 @@ "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/CloudDriveRejectionResponseModel" - }, - "title": "Response List Cloud Drive Rejections Api Api Cloud Drives Connection Id Rejections Get", - "type": "array" + "$ref": "#/components/schemas/routers__api__contents__ContentAttachmentsListResponse" } } }, @@ -19027,26 +20308,59 @@ } } }, - "summary": "List files this connection did not process", + "summary": "List content attachments", "tags": [ - "cloud_drives" + "contents" ] } }, - "/contents/{source_connection_content_version}": { - "delete": { - "description": "Delete a content item (a `SourceConnectionContentVersion`).\n\nUse this to remove an uploaded or indexed item from your account. Deleting content can affect agents and knowledge base workflows that reference this item.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your account.\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.", - "operationId": "delete_content_api_contents__source_connection_content_version__delete", + "/contents/{source_connection_content_version}/attachments/{attachment_id}": { + "get": { + "description": "Get one file attached to a content item: its indexing status and reason, its metadata, and the text it is indexed by.\n\n`attachment_id` is the `id` of an entry in the item's attachment list. Use `start` and `end` to page through long text. A file that was not indexed has no text.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content belonging to your account.", + "operationId": "get_content_attachment_api_contents__source_connection_content_version__attachments__attachment_id__get", "parameters": [ { "in": "path", "name": "source_connection_content_version", "required": true, "schema": { + "format": "uuid", "title": "Source Connection Content Version", "type": "string" } }, + { + "in": "path", + "name": "attachment_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Attachment Id", + "type": "string" + } + }, + { + "in": "query", + "name": "start", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Start", + "type": "integer" + } + }, + { + "in": "query", + "name": "end", + "required": false, + "schema": { + "default": 5000, + "minimum": 0, + "title": "End", + "type": "integer" + } + }, { "$ref": "#/components/parameters/X-Account-Id" }, @@ -19055,11 +20369,18 @@ } ], "responses": { - "204": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/routers__api__contents__ContentAttachmentDetailResponse" + } + } + }, "description": "Successful Response" }, - "403": { - "description": "The key's user is a member of the account but not an owner or administrator (`error.code` is `permission_denied`)." + "402": { + "description": "The account has no credits left (`error.code` is `insufficient_credits`)." }, "422": { "content": { @@ -19090,41 +20411,57 @@ } } }, - "summary": "Delete content", + "summary": "Get a content attachment", "tags": [ "contents" ] - }, + } + }, + "/contents/{source_connection_content_version}/attachments/{attachment_id}/embeddings": { "get": { - "description": "Get detailed information about a specific content item (a `SourceConnectionContentVersion`).\n\nThis is useful when you want to:\n- Inspect the extracted text for debugging or review.\n- Display content details in a UI.\n\nText range:\n- `start` and `end` control the character range returned in `text_content` so clients can page through large documents.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account.", - "operationId": "get_content_detail_api_contents__source_connection_content_version__get", + "description": "List the embeddings (chunk vectors) an attached file is indexed by, with pagination. The list is empty for a file that has no completed index.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content belonging to your account.", + "operationId": "list_content_attachment_embeddings_api_contents__source_connection_content_version__attachments__attachment_id__embeddings_get", "parameters": [ { "in": "path", "name": "source_connection_content_version", "required": true, "schema": { + "format": "uuid", "title": "Source Connection Content Version", "type": "string" } }, + { + "in": "path", + "name": "attachment_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Attachment Id", + "type": "string" + } + }, { "in": "query", - "name": "start", + "name": "page", "required": false, "schema": { - "default": 0, - "title": "Start", + "default": 1, + "minimum": 1, + "title": "Page", "type": "integer" } }, { "in": "query", - "name": "end", + "name": "limit", "required": false, "schema": { - "default": 5000, - "title": "End", + "default": 20, + "maximum": 100, + "minimum": 1, + "title": "Limit", "type": "integer" } }, @@ -19140,12 +20477,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/routers__api__contents__ContentDetailResponse" + "$ref": "#/components/schemas/routers__api__contents__ContentEmbeddingsListResponse" } } }, "description": "Successful Response" }, + "402": { + "description": "The account has no credits left (`error.code` is `insufficient_credits`)." + }, "422": { "content": { "application/json": { @@ -19175,24 +20515,37 @@ } } }, - "summary": "Get content details", + "summary": "List a content attachment's embeddings", "tags": [ "contents" ] - }, - "put": { - "description": "Replace a content version using a small inline text payload.\n\n**Maximum payload size:** 8192 bytes (UTF-8).\n\n**Supported content types:**\n- `application/json`\n- `application/xml`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- Use this endpoint for small text payloads; larger files should use `/upload`.\n- `title` is merged into `metadata.title` when not already present.\n- The replacement is indexed in the background. This `SourceConnectionContentVersion` ID keeps working, and reads return the previous content until indexing finishes; poll `list_source_content_status` to follow it. The returned `content_version_id` is the new version.", - "operationId": "replace_content_with_inline_text_api_contents__source_connection_content_version__put", + } + }, + "/contents/{source_connection_content_version}/attachments/{attachment_id}/file": { + "get": { + "description": "Download an attached file's bytes.\n\nImages, audio, video, PDF and plain text are served with their own type; an SVG that cannot be sanitized, and anything else, is served as `application/octet-stream`.\n\nAnswers 403 when the file is withheld: a governance policy blocked or redacted it, or it arrived from outside and is still being indexed. The attachment's `file_withheld` field says which before you ask.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content belonging to your account.", + "operationId": "get_content_attachment_file_api_contents__source_connection_content_version__attachments__attachment_id__file_get", "parameters": [ { "in": "path", "name": "source_connection_content_version", "required": true, "schema": { + "format": "uuid", "title": "Source Connection Content Version", "type": "string" } }, + { + "in": "path", + "name": "attachment_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Attachment Id", + "type": "string" + } + }, { "$ref": "#/components/parameters/X-Account-Id" }, @@ -19200,29 +20553,53 @@ "$ref": "#/components/parameters/Seclai-Version" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InlineTextReplaceRequest" - } - } - }, - "required": true - }, "responses": { "200": { "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/routers__api__contents__FileUploadResponse" + "format": "binary", + "type": "string" + } + }, + "application/pdf": { + "schema": { + "format": "binary", + "type": "string" + } + }, + "audio/*": { + "schema": { + "format": "binary", + "type": "string" + } + }, + "image/*": { + "schema": { + "format": "binary", + "type": "string" + } + }, + "text/plain": { + "schema": { + "format": "binary", + "type": "string" + } + }, + "video/*": { + "schema": { + "format": "binary", + "type": "string" } } }, - "description": "Successful Response" + "description": "The file's bytes." + }, + "402": { + "description": "The account has no credits left (`error.code` is `insufficient_credits`)." }, "403": { - "description": "The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`)." + "description": "The file is withheld; `error.code` says why." }, "422": { "content": { @@ -19253,7 +20630,7 @@ } } }, - "summary": "Replace a content version with inline text", + "summary": "Download a content attachment", "tags": [ "contents" ] @@ -19348,7 +20725,7 @@ }, "/contents/{source_connection_content_version}/upload": { "post": { - "description": "Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`.\n\nThis behaves like a source file upload, but it targets an existing content version ID. This is useful when you want to correct or update an uploaded document while keeping references stable.\n\n**Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized before it is stored).\n\n**Supported MIME types:**\n- `application/epub+zip`\n- `application/json`\n- `application/pdf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/xml`\n- `application/zip`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/wav`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/svg+xml`\n- `image/tiff`\n- `image/webp`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n- `video/mp4`\n- `video/quicktime`\n- `video/x-msvideo`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- The replacement is indexed in the background. This `SourceConnectionContentVersion` ID keeps working, and reads return the previous content until indexing finishes; poll `list_source_content_status` to follow it. The returned `content_version_id` is the new version.\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your account.", + "description": "Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`.\n\nThis behaves like a source file upload, but it targets an existing content version ID. This is useful when you want to correct or update an uploaded document while keeping references stable.\n\n**Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized before it is stored).\n\n**Supported MIME types:**\n- `application/atom+xml`\n- `application/epub+zip`\n- `application/json`\n- `application/pdf`\n- `application/rss+xml`\n- `application/rtf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/x-ipynb+json`\n- `application/xhtml+xml`\n- `application/xml`\n- `application/zip`\n- `audio/aac`\n- `audio/amr`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/opus`\n- `audio/wav`\n- `audio/webm`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/svg+xml`\n- `image/tiff`\n- `image/webp`\n- `message/rfc822`\n- `text/calendar`\n- `text/csv`\n- `text/html`\n- `text/javascript`\n- `text/markdown`\n- `text/plain`\n- `text/tab-separated-values`\n- `text/vcard`\n- `text/vtt`\n- `text/x-c`\n- `text/x-c++`\n- `text/x-csharp`\n- `text/x-go`\n- `text/x-ini`\n- `text/x-java`\n- `text/x-log`\n- `text/x-markdown`\n- `text/x-php`\n- `text/x-python`\n- `text/x-ruby`\n- `text/x-rust`\n- `text/x-shellscript`\n- `text/x-sql`\n- `text/x-subrip`\n- `text/x-tex`\n- `text/x-toml`\n- `text/x-typescript`\n- `text/xml`\n- `text/yaml`\n- `video/3gpp`\n- `video/mp2t`\n- `video/mp4`\n- `video/mpeg`\n- `video/quicktime`\n- `video/webm`\n- `video/x-matroska`\n- `video/x-msvideo`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- The replacement is indexed in the background. This `SourceConnectionContentVersion` ID keeps working, and reads return the previous content until indexing finishes; poll `list_source_content_status` to follow it. The returned `content_version_id` is the new version.\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your account.", "operationId": "upload_file_to_content_api_contents__source_connection_content_version__upload_post", "parameters": [ { @@ -22312,7 +23689,7 @@ }, "/models/embedders": { "get": { - "description": "List the embedding models a source can be created with.\n\nEach entry carries the `model_type` to pass as `embedding_model` when creating a source, the `dimensions` it supports, and \u2014 most importantly for multi-modal indexing \u2014 `supported_input_media`: the modalities that embedder can actually index. A source only honours a `media_types` entry its embedder lists here; unsupported kinds are dropped at save time with an `embedder_warning`, so check this before choosing an embedder for a knowledge base of images or video.\n\nText-only embedders report `supported_input_media` as null. Pricing is reported as `credits` (per ~1,000 English words of text) plus `per_modality_rates` for the non-text modalities a multi-modal embedder bills differently.\n\nAn embedder whose credit rate has not been published yet is omitted, so you are never offered one that cannot be billed.\n\nOptional query parameters:\n- `supports_input_media`: keep only embedders that can index this modality (`text`/`image`/`video`/`audio` or a full MIME)\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical for every account.", + "description": "List the embedding models a source can be created with.\n\nEach entry carries the `model_type` to pass as `embedding_model` when creating a source, the `dimensions` it supports, and \u2014 most importantly for multi-modal indexing \u2014 `supported_input_media`: the modalities that embedder can actually index. A source only honours a `media_types` entry its embedder lists here; a kind it does not list is stored and not indexed, so check this before choosing an embedder for a knowledge base of images or video.\n\nText-only embedders report `supported_input_media` as null. Pricing is reported as `credits` (per ~1,000 English words of text) plus `per_modality_rates` for the non-text modalities a multi-modal embedder bills differently.\n\nAn embedder whose credit rate has not been published yet is omitted, so you are never offered one that cannot be billed.\n\nOptional query parameters:\n- `supports_input_media`: keep only embedders that can index this modality (`text`/`image`/`video`/`audio` or a full MIME)\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical for every account.", "operationId": "list_embedding_models_api_models_embedders_get", "parameters": [ { @@ -22766,7 +24143,7 @@ }, "/models/playground/experiments/{experiment_id}/cancel": { "post": { - "description": "Cancel a running or pending model playground experiment.\n\nSignals running model calls to abort and marks the experiment as canceled.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404.", + "description": "Cancel a running or pending model playground experiment.\n\nMarks the experiment as canceled. An experiment that has not started never runs. One that is running starts no further model calls, and records each model it did not call with the error `Canceled`. A model call or evaluation already in progress is not interrupted by the cancel: it continues and is billed, and its result is recorded on the canceled experiment. Canceling may therefore not shorten the run or reduce its cost.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404.", "operationId": "cancel_experiment_endpoint_api_models_playground_experiments__experiment_id__cancel_post", "parameters": [ { @@ -24818,7 +26195,7 @@ ] }, "post": { - "description": "Create a new content source.\n\nSource types: `rss`, `website`, `custom_index`.\n\nFor RSS and website sources, provide the URL. For custom index sources, the URL is created automatically.\n\nFor custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`.", + "description": "Create a new content source.\n\nSource types: `rss_feed`, `website`, `custom_index`, `cloud_drive`, `email`.\n\nFor RSS and website sources, provide the URL. For custom index sources, the URL is created automatically.\n\nAn `email` source takes no URL and requires `email_allowed_senders`; the response's `email_address` is where to send mail.\n\nA `cloud_drive` source takes no URL and requires `cloud_drive_connection_id`, the id of a drive connected in the app (`GET /cloud-drives` lists them).\n\nFor custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`.", "operationId": "create_source_api_sources_post", "parameters": [ { @@ -25014,7 +26391,7 @@ ] }, "post": { - "description": "Upload a small text payload to a content source (no multipart/form-data required).\n\n**Maximum payload size:** 8192 bytes (UTF-8).\n\n**Supported content types:**\n- `application/json`\n- `application/xml`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- Use this endpoint for small text payloads; larger files should use `/upload`.\n- `title` is merged into `metadata.title` when not already present.\n\nTracking indexing progress:\n- **Which id you get back depends on `status`, and they are not interchangeable:**\n - `uploaded` \u2014 a new item. `content_version_id` is set and `source_connection_content_version_id` is `null`. Indexing continues in the background after this call returns.\n - `duplicate` \u2014 this exact file is already on the source, so nothing was created and nothing is being indexed. `content_version_id` is `null` and `source_connection_content_version_id` is the existing, already-indexed item: pass it straight to `GET /contents/{id}`. There is nothing to poll.\n- For an `uploaded` item, poll `GET /sources/{id}/contents/{content_version_id}` with the returned `content_version_id`, or `GET /sources/{id}/contents?content_version_id=\u2026&content_version_id=\u2026` for a whole batch, to follow each item through to `completed` or `failed`.\n- On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes.", + "description": "Upload a small text payload to a content source (no multipart/form-data required).\n\n**Maximum payload size:** 8192 bytes (UTF-8).\n\n**Supported content types:**\n- `application/json`\n- `application/xml`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- Use this endpoint for small text payloads; larger files should use `/upload`.\n- `title` is merged into `metadata.title` when not already present.\n\nTracking indexing progress:\n- **Which id you get back depends on `status`, and they are not interchangeable:**\n - `uploaded` \u2014 a new item. `content_version_id` is set and `source_connection_content_version_id` is `null`. Indexing continues in the background after this call returns.\n - `duplicate` \u2014 this exact file is already on the source, so nothing was created and nothing is being indexed. `content_version_id` is `null` and `source_connection_content_version_id` is the existing, already-indexed item: pass it straight to `GET /contents/{id}`. There is nothing to poll.\n- For an `uploaded` item, poll `GET /sources/{id}/contents/{content_version_id}` with the returned `content_version_id`, or `GET /sources/{id}/contents?content_version_id=\u2026&content_version_id=\u2026` for a whole batch, to follow each item through to `completed` or `failed`.\n- On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes.\n- An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is not in the source and its id stays `null` unless a reviewer releases it, so stop polling.", "operationId": "upload_inline_text_to_source_api_sources__source_connection_id__post", "parameters": [ { @@ -25171,7 +26548,7 @@ }, "/sources/{source_connection_id}/contents": { "get": { - "description": "List every content item this source has attempted to index, with the status of each.\n\nUnlike the source's `content_count`, which only counts finished items, this listing includes items that are still processing and items that failed \u2014 so a bulk upload can report per-item progress and point at the specific items that did not make it.\n\nCorrelating with an upload:\n- Each item is keyed by `content_version_id`, which is what the upload endpoints return. Pass those ids as repeated `content_version_id` query parameters to poll exactly the items you uploaded.\n- `source_connection_content_version_id` is `null` until an item finishes indexing; once set, it is the id `GET /contents/{id}` takes.\n- `content_status` reaches `completed` on success and `failed` on error, with the reason in `error`. The intermediate values are `pending`, `fetching`, `transcribing`, `scanning`, and `indexing`.\n\nParameters:\n- Pagination: `page` and `limit`.\n- Sorting: `sort` (created_at/title/status) and `order` (asc/desc). `created_at` sorts on when the item was uploaded or pulled.\n- Filtering: `status` and repeatable `content_version_id`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only list content for sources belonging to your account.", + "description": "List every content item this source has attempted to index, with the status of each.\n\nUnlike the source's `content_count`, which only counts finished items, this listing includes items that are still processing and items that failed \u2014 so a bulk upload can report per-item progress and point at the specific items that did not make it.\n\nCorrelating with an upload:\n- Each item is keyed by `content_version_id`, which is what the upload endpoints return. Pass those ids as repeated `content_version_id` query parameters to poll exactly the items you uploaded.\n- `source_connection_content_version_id` is `null` until an item finishes indexing; once set, it is the id `GET /contents/{id}` takes.\n- `content_status` reaches `completed` on success and `failed` on error, with the reason in `error`. The intermediate values are `pending`, `fetching`, `transcribing`, `scanning`, and `indexing`.\n- An item an Enforce governance policy blocked at import is held for review: `held_for_review` is `true` and `source_connection_content_version_id` stays `null` until a reviewer releases it. With `Seclai-Version: 2026-10-05` or later it reports `completed`; earlier versions report it as `failed` with the hold as the `error`. The `status` filter matches the item under `completed` on every version.\n\nParameters:\n- Pagination: `page` and `limit`.\n- Sorting: `sort` (created_at/title/status) and `order` (asc/desc). `created_at` sorts on when the item was uploaded or pulled.\n- Filtering: `status` and repeatable `content_version_id`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only list content for sources belonging to your account.", "operationId": "list_source_contents_api_sources__source_connection_id__contents_get", "parameters": [ { @@ -25331,7 +26708,7 @@ }, "/sources/{source_connection_id}/contents/{content_version_id}": { "get": { - "description": "Get the indexing status of a single content item, addressed by the `content_version_id` the upload endpoints return.\n\nUse this to follow one uploaded file through indexing. To follow many at once, use `GET /sources/{id}/contents` with repeated `content_version_id` parameters instead of polling this endpoint per item.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account.", + "description": "Get the indexing status of a single content item, addressed by the `content_version_id` the upload endpoints return.\n\nUse this to follow one uploaded file through indexing. To follow many at once, use `GET /sources/{id}/contents` with repeated `content_version_id` parameters instead of polling this endpoint per item.\n\nAn item held for review by an Enforce governance policy reports `held_for_review: true`. With `Seclai-Version: 2026-10-05` or later its `content_status` is `completed`; earlier versions report `failed` with the hold as the `error`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account.", "operationId": "get_source_content_status_endpoint_api_sources__source_connection_id__contents__content_version_id__get", "parameters": [ { @@ -25407,6 +26784,101 @@ ] } }, + "/sources/{source_connection_id}/email-rejections": { + "get": { + "description": "List mail that an email content source refused, newest first. Each entry says who sent the message and why it was refused, never its subject or body. A message refused as `unsafe_content` also has a prompt-scan record, which keeps the scanned text.\n\nTo accept a refused sender, add its `from_address` or that address's domain to the source's `email_allowed_senders`. That only helps when `authenticated` is true. A `repeat_*` reason marks a message the source received before; allowing its sender does not store it.\n\nRequires an account owner or administrator: a key or token bound to another member gets 403. Returns 404 for a source that is not an email source.", + "operationId": "list_email_source_rejections_api_api_sources__source_connection_id__email_rejections_get", + "parameters": [ + { + "in": "path", + "name": "source_connection_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Source Connection Id", + "type": "string" + } + }, + { + "description": "Page number.", + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "description": "Page number.", + "minimum": 1, + "title": "Page", + "type": "integer" + } + }, + { + "description": "Items per page.", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 20, + "description": "Items per page.", + "maximum": 100, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + }, + { + "$ref": "#/components/parameters/Seclai-Version" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailSourceRejectionListResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + }, + "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", + "schema": { + "type": "integer" + } + } + } + } + }, + "summary": "List mail an email source refused", + "tags": [ + "sources" + ] + } + }, "/sources/{source_connection_id}/embedding-migration": { "get": { "description": "Get the latest embedding migration status for a custom-index source.\n\nReturns `null` when no migration has ever been started for this source.", @@ -26187,7 +27659,7 @@ }, "/sources/{source_connection_id}/upload": { "post": { - "description": "Upload a file to a content source.\n\n**Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized before it is stored).\n\n**Supported MIME types:**\n- `application/epub+zip`\n- `application/json`\n- `application/pdf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/xml`\n- `application/zip`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/wav`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/svg+xml`\n- `image/tiff`\n- `image/webp`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n- `video/mp4`\n- `video/quicktime`\n- `video/x-msvideo`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"author\":\"Ada\",\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nResponse:\n- `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source.\n\nTracking indexing progress:\n- **Which id you get back depends on `status`, and they are not interchangeable:**\n - `uploaded` \u2014 a new item. `content_version_id` is set and `source_connection_content_version_id` is `null`. Indexing continues in the background after this call returns.\n - `duplicate` \u2014 this exact file is already on the source, so nothing was created and nothing is being indexed. `content_version_id` is `null` and `source_connection_content_version_id` is the existing, already-indexed item: pass it straight to `GET /contents/{id}`. There is nothing to poll.\n- For an `uploaded` item, poll `GET /sources/{id}/contents/{content_version_id}` with the returned `content_version_id`, or `GET /sources/{id}/contents?content_version_id=\u2026&content_version_id=\u2026` for a whole batch, to follow each item through to `completed` or `failed`.\n- On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes.", + "description": "Upload a file to a content source.\n\n**Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized before it is stored).\n\n**Supported MIME types:**\n- `application/atom+xml`\n- `application/epub+zip`\n- `application/json`\n- `application/pdf`\n- `application/rss+xml`\n- `application/rtf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/x-ipynb+json`\n- `application/xhtml+xml`\n- `application/xml`\n- `application/zip`\n- `audio/aac`\n- `audio/amr`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/opus`\n- `audio/wav`\n- `audio/webm`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/svg+xml`\n- `image/tiff`\n- `image/webp`\n- `message/rfc822`\n- `text/calendar`\n- `text/csv`\n- `text/html`\n- `text/javascript`\n- `text/markdown`\n- `text/plain`\n- `text/tab-separated-values`\n- `text/vcard`\n- `text/vtt`\n- `text/x-c`\n- `text/x-c++`\n- `text/x-csharp`\n- `text/x-go`\n- `text/x-ini`\n- `text/x-java`\n- `text/x-log`\n- `text/x-markdown`\n- `text/x-php`\n- `text/x-python`\n- `text/x-ruby`\n- `text/x-rust`\n- `text/x-shellscript`\n- `text/x-sql`\n- `text/x-subrip`\n- `text/x-tex`\n- `text/x-toml`\n- `text/x-typescript`\n- `text/xml`\n- `text/yaml`\n- `video/3gpp`\n- `video/mp2t`\n- `video/mp4`\n- `video/mpeg`\n- `video/quicktime`\n- `video/webm`\n- `video/x-matroska`\n- `video/x-msvideo`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"author\":\"Ada\",\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nResponse:\n- `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source.\n\nTracking indexing progress:\n- **Which id you get back depends on `status`, and they are not interchangeable:**\n - `uploaded` \u2014 a new item. `content_version_id` is set and `source_connection_content_version_id` is `null`. Indexing continues in the background after this call returns.\n - `duplicate` \u2014 this exact file is already on the source, so nothing was created and nothing is being indexed. `content_version_id` is `null` and `source_connection_content_version_id` is the existing, already-indexed item: pass it straight to `GET /contents/{id}`. There is nothing to poll.\n- For an `uploaded` item, poll `GET /sources/{id}/contents/{content_version_id}` with the returned `content_version_id`, or `GET /sources/{id}/contents?content_version_id=\u2026&content_version_id=\u2026` for a whole batch, to follow each item through to `completed` or `failed`.\n- On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes.\n- An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is not in the source and its id stays `null` unless a reviewer releases it, so stop polling.", "operationId": "upload_file_to_source_api_sources__source_connection_id__upload_post", "parameters": [ { @@ -26267,7 +27739,7 @@ }, "/v2/agent-runs/{run_id}/attachments/{attachment_id}": { "get": { - "description": "Streams the bytes of an attachment emitted by a step in the given agent run. ``attachment_id`` is the ``id`` of an entry in the run's or a step's ``attachments``, or the URL-safe-base64-encoded storage key, which webhook and email links carry.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- The calling account must own ``run_id``; lookup failures (missing run, cross-account run, soft-deleted agent, a run whose trace was purged, a file not in the run) all collapse to a single 404 to prevent cross-tenant existence enumeration.\n\nMIME handling:\n- Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, application/vnd.seclai.manifest+json) are served with their declared type.\n- Everything else is served as ``application/octet-stream`` with an attachment disposition to prevent stored-XSS.", + "description": "Streams the bytes of a file of the given agent run: one a step emitted, or one the run started with. ``attachment_id`` is the ``id`` of an entry in the run's or a step's ``attachments``, or the URL-safe-base64-encoded storage key, which webhook and email links carry.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- The calling account must own ``run_id``; lookup failures (missing run, cross-account run, soft-deleted agent, a run whose trace was purged, a file not in the run) all collapse to a single 404 to prevent cross-tenant existence enumeration.\n\nMIME handling:\n- Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, application/vnd.seclai.manifest+json) are served with their declared type.\n- Everything else is served as ``application/octet-stream`` with an attachment disposition to prevent stored-XSS.", "operationId": "serve_agent_run_attachment_api_v2_agent_runs__run_id__attachments__attachment_id__get", "parameters": [ { @@ -26528,8 +28000,13 @@ "2026-08-21", "2026-09-28", "2026-09-30", - "2026-10-03" + "2026-10-03", + "2026-10-05", + "2026-10-13", + "2026-10-16", + "2026-10-18", + "2026-10-19" ], - "latest": "2026-10-03" + "latest": "2026-10-19" } } diff --git a/seclai/_generated/api/agent_run_attachments/serve_agent_run_attachment_api_v2_agent_runs_run_id_attachments_attachment_id_get.py b/seclai/_generated/api/agent_run_attachments/serve_agent_run_attachment_api_v2_agent_runs_run_id_attachments_attachment_id_get.py index b6b0f94..76fef0a 100644 --- a/seclai/_generated/api/agent_run_attachments/serve_agent_run_attachment_api_v2_agent_runs_run_id_attachments_attachment_id_get.py +++ b/seclai/_generated/api/agent_run_attachments/serve_agent_run_attachment_api_v2_agent_runs_run_id_attachments_attachment_id_get.py @@ -98,9 +98,9 @@ def sync_detailed( ) -> Response[File | HTTPValidationError | ServiceUnavailableError]: """Download an agent-run attachment - Streams the bytes of an attachment emitted by a step in the given agent run. ``attachment_id`` is - the ``id`` of an entry in the run's or a step's ``attachments``, or the URL-safe-base64-encoded - storage key, which webhook and email links carry. + Streams the bytes of a file of the given agent run: one a step emitted, or one the run started with. + ``attachment_id`` is the ``id`` of an entry in the run's or a step's ``attachments``, or the URL- + safe-base64-encoded storage key, which webhook and email links carry. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. @@ -155,9 +155,9 @@ def sync( ) -> File | HTTPValidationError | ServiceUnavailableError | None: """Download an agent-run attachment - Streams the bytes of an attachment emitted by a step in the given agent run. ``attachment_id`` is - the ``id`` of an entry in the run's or a step's ``attachments``, or the URL-safe-base64-encoded - storage key, which webhook and email links carry. + Streams the bytes of a file of the given agent run: one a step emitted, or one the run started with. + ``attachment_id`` is the ``id`` of an entry in the run's or a step's ``attachments``, or the URL- + safe-base64-encoded storage key, which webhook and email links carry. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. @@ -207,9 +207,9 @@ async def asyncio_detailed( ) -> Response[File | HTTPValidationError | ServiceUnavailableError]: """Download an agent-run attachment - Streams the bytes of an attachment emitted by a step in the given agent run. ``attachment_id`` is - the ``id`` of an entry in the run's or a step's ``attachments``, or the URL-safe-base64-encoded - storage key, which webhook and email links carry. + Streams the bytes of a file of the given agent run: one a step emitted, or one the run started with. + ``attachment_id`` is the ``id`` of an entry in the run's or a step's ``attachments``, or the URL- + safe-base64-encoded storage key, which webhook and email links carry. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. @@ -262,9 +262,9 @@ async def asyncio( ) -> File | HTTPValidationError | ServiceUnavailableError | None: """Download an agent-run attachment - Streams the bytes of an attachment emitted by a step in the given agent run. ``attachment_id`` is - the ``id`` of an entry in the run's or a step's ``attachments``, or the URL-safe-base64-encoded - storage key, which webhook and email links carry. + Streams the bytes of a file of the given agent run: one a step emitted, or one the run started with. + ``attachment_id`` is the ``id`` of an entry in the run's or a step's ``attachments``, or the URL- + safe-base64-encoded storage key, which webhook and email links carry. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. diff --git a/seclai/_generated/api/agents/api_get_agent_attachment_references_api_agents_agent_id_attachment_references_get.py b/seclai/_generated/api/agents/api_get_agent_attachment_references_api_agents_agent_id_attachment_references_get.py index 8a21071..1c24f4e 100644 --- a/seclai/_generated/api/agents/api_get_agent_attachment_references_api_agents_agent_id_attachment_references_get.py +++ b/seclai/_generated/api/agents/api_get_agent_attachment_references_api_agents_agent_id_attachment_references_get.py @@ -90,12 +90,11 @@ def sync_detailed( ]: """Get agent attachment-reference contract - Return the static attachment-reference contract for an agent — what files the agent's definition - expects on a run. + Return the input attachments the agent's dynamic_input trigger declares — the files a run may carry. Call this BEFORE staging uploads so you know whether the agent accepts files at all - (``requires_uploads``), and which specific filenames/indexes/patterns the templates reference. - Mismatched batches are rejected at run time with HTTP 400. + (``requires_uploads``), and which attachments its trigger declares (``accepted_attachments``). + Batches that do not fit them are rejected at run time with HTTP 400. Args: agent_id (str): @@ -137,12 +136,11 @@ def sync( ): """Get agent attachment-reference contract - Return the static attachment-reference contract for an agent — what files the agent's definition - expects on a run. + Return the input attachments the agent's dynamic_input trigger declares — the files a run may carry. Call this BEFORE staging uploads so you know whether the agent accepts files at all - (``requires_uploads``), and which specific filenames/indexes/patterns the templates reference. - Mismatched batches are rejected at run time with HTTP 400. + (``requires_uploads``), and which attachments its trigger declares (``accepted_attachments``). + Batches that do not fit them are rejected at run time with HTTP 400. Args: agent_id (str): @@ -176,12 +174,11 @@ async def asyncio_detailed( ]: """Get agent attachment-reference contract - Return the static attachment-reference contract for an agent — what files the agent's definition - expects on a run. + Return the input attachments the agent's dynamic_input trigger declares — the files a run may carry. Call this BEFORE staging uploads so you know whether the agent accepts files at all - (``requires_uploads``), and which specific filenames/indexes/patterns the templates reference. - Mismatched batches are rejected at run time with HTTP 400. + (``requires_uploads``), and which attachments its trigger declares (``accepted_attachments``). + Batches that do not fit them are rejected at run time with HTTP 400. Args: agent_id (str): @@ -221,12 +218,11 @@ async def asyncio( ): """Get agent attachment-reference contract - Return the static attachment-reference contract for an agent — what files the agent's definition - expects on a run. + Return the input attachments the agent's dynamic_input trigger declares — the files a run may carry. Call this BEFORE staging uploads so you know whether the agent accepts files at all - (``requires_uploads``), and which specific filenames/indexes/patterns the templates reference. - Mismatched batches are rejected at run time with HTTP 400. + (``requires_uploads``), and which attachments its trigger declares (``accepted_attachments``). + Batches that do not fit them are rejected at run time with HTTP 400. Args: agent_id (str): diff --git a/seclai/_generated/api/agents/api_upload_agent_input_api_agents_agent_id_upload_input_post.py b/seclai/_generated/api/agents/api_upload_agent_input_api_agents_agent_id_upload_input_post.py index a37b599..5c3c7e3 100644 --- a/seclai/_generated/api/agents/api_upload_agent_input_api_agents_agent_id_upload_input_post.py +++ b/seclai/_generated/api/agents/api_upload_agent_input_api_agents_agent_id_upload_input_post.py @@ -85,25 +85,24 @@ def sync_detailed( ]: """Upload file input - Upload a file to use as input for a `dynamic_input` agent run. - - Supports the same file types as content source uploads: text, PDF, DOCX, audio, video, images, etc. - Text and document files are processed synchronously; audio/video are submitted for asynchronous - transcription. + Upload a file to use as input for a `dynamic_input` agent run. Any other agent rejects the upload + with HTTP 400. **Size limit:** 200 MB per file. - **Supported extensions:** txt, html, md, csv, xml, json, pdf, msg, docx, doc, pptx, ppt, xlsx, xls, - zip, epub, png, jpg, gif, bmp, tiff, webp, mp3, wav, m4a, flac, ogg, mp4, mov, avi. + From `Seclai-Version: 2026-10-16` a file of any type is accepted and is `ready` at once: pass + `input_upload_id` to `POST /agents/{agent_id}/runs`. Each step receives the file itself when its + model reads that type, and otherwise its text (OCR, extraction or transcript), made once for the + steps that need it; a type nothing reads or converts is passed on as a file only. `input` carries a + `# filename` heading per file. - After uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, - then pass `input_upload_id` to `POST /agents/{agent_id}/runs`. + Earlier versions accept only these extensions: avi, bmp, csv, docx, epub, flac, gif, html, jpg, + json, m4a, markdown, md, mov, mp3, mp4, msg, ogg, pdf, png, ppt, pptx, svg, tiff, txt, wav, webp, + xls, xlsx, xml, zip. They write each file's text into `input`, so poll `GET + /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready` before running. - **Multi-modal routing:** non-text uploads (image, audio, video, PDF) are surfaced natively to multi- - modal-capable prompt steps; text-only models fall back to the OCR / transcript text counterpart. - Audio originals are preserved past transcription so audio-capable models (Gemini 2.5/3, GPT-5 audio) - read them directly; the agent-input-binary janitor sweeps originals once they pass your account's - agent-trace retention (the agent-traces source's retention period; free default 7 days). + The agent-input-binary janitor sweeps originals once they pass your account's agent-trace retention + (the agent-traces source's retention period; free default 7 days). Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's @@ -144,25 +143,24 @@ def sync( ) -> HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse | None: """Upload file input - Upload a file to use as input for a `dynamic_input` agent run. - - Supports the same file types as content source uploads: text, PDF, DOCX, audio, video, images, etc. - Text and document files are processed synchronously; audio/video are submitted for asynchronous - transcription. + Upload a file to use as input for a `dynamic_input` agent run. Any other agent rejects the upload + with HTTP 400. **Size limit:** 200 MB per file. - **Supported extensions:** txt, html, md, csv, xml, json, pdf, msg, docx, doc, pptx, ppt, xlsx, xls, - zip, epub, png, jpg, gif, bmp, tiff, webp, mp3, wav, m4a, flac, ogg, mp4, mov, avi. + From `Seclai-Version: 2026-10-16` a file of any type is accepted and is `ready` at once: pass + `input_upload_id` to `POST /agents/{agent_id}/runs`. Each step receives the file itself when its + model reads that type, and otherwise its text (OCR, extraction or transcript), made once for the + steps that need it; a type nothing reads or converts is passed on as a file only. `input` carries a + `# filename` heading per file. - After uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, - then pass `input_upload_id` to `POST /agents/{agent_id}/runs`. + Earlier versions accept only these extensions: avi, bmp, csv, docx, epub, flac, gif, html, jpg, + json, m4a, markdown, md, mov, mp3, mp4, msg, ogg, pdf, png, ppt, pptx, svg, tiff, txt, wav, webp, + xls, xlsx, xml, zip. They write each file's text into `input`, so poll `GET + /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready` before running. - **Multi-modal routing:** non-text uploads (image, audio, video, PDF) are surfaced natively to multi- - modal-capable prompt steps; text-only models fall back to the OCR / transcript text counterpart. - Audio originals are preserved past transcription so audio-capable models (Gemini 2.5/3, GPT-5 audio) - read them directly; the agent-input-binary janitor sweeps originals once they pass your account's - agent-trace retention (the agent-traces source's retention period; free default 7 days). + The agent-input-binary janitor sweeps originals once they pass your account's agent-trace retention + (the agent-traces source's retention period; free default 7 days). Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's @@ -200,25 +198,24 @@ async def asyncio_detailed( ]: """Upload file input - Upload a file to use as input for a `dynamic_input` agent run. - - Supports the same file types as content source uploads: text, PDF, DOCX, audio, video, images, etc. - Text and document files are processed synchronously; audio/video are submitted for asynchronous - transcription. + Upload a file to use as input for a `dynamic_input` agent run. Any other agent rejects the upload + with HTTP 400. **Size limit:** 200 MB per file. - **Supported extensions:** txt, html, md, csv, xml, json, pdf, msg, docx, doc, pptx, ppt, xlsx, xls, - zip, epub, png, jpg, gif, bmp, tiff, webp, mp3, wav, m4a, flac, ogg, mp4, mov, avi. + From `Seclai-Version: 2026-10-16` a file of any type is accepted and is `ready` at once: pass + `input_upload_id` to `POST /agents/{agent_id}/runs`. Each step receives the file itself when its + model reads that type, and otherwise its text (OCR, extraction or transcript), made once for the + steps that need it; a type nothing reads or converts is passed on as a file only. `input` carries a + `# filename` heading per file. - After uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, - then pass `input_upload_id` to `POST /agents/{agent_id}/runs`. + Earlier versions accept only these extensions: avi, bmp, csv, docx, epub, flac, gif, html, jpg, + json, m4a, markdown, md, mov, mp3, mp4, msg, ogg, pdf, png, ppt, pptx, svg, tiff, txt, wav, webp, + xls, xlsx, xml, zip. They write each file's text into `input`, so poll `GET + /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready` before running. - **Multi-modal routing:** non-text uploads (image, audio, video, PDF) are surfaced natively to multi- - modal-capable prompt steps; text-only models fall back to the OCR / transcript text counterpart. - Audio originals are preserved past transcription so audio-capable models (Gemini 2.5/3, GPT-5 audio) - read them directly; the agent-input-binary janitor sweeps originals once they pass your account's - agent-trace retention (the agent-traces source's retention period; free default 7 days). + The agent-input-binary janitor sweeps originals once they pass your account's agent-trace retention + (the agent-traces source's retention period; free default 7 days). Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's @@ -257,25 +254,24 @@ async def asyncio( ) -> HTTPValidationError | ServiceUnavailableError | UploadAgentInputApiResponse | None: """Upload file input - Upload a file to use as input for a `dynamic_input` agent run. - - Supports the same file types as content source uploads: text, PDF, DOCX, audio, video, images, etc. - Text and document files are processed synchronously; audio/video are submitted for asynchronous - transcription. + Upload a file to use as input for a `dynamic_input` agent run. Any other agent rejects the upload + with HTTP 400. **Size limit:** 200 MB per file. - **Supported extensions:** txt, html, md, csv, xml, json, pdf, msg, docx, doc, pptx, ppt, xlsx, xls, - zip, epub, png, jpg, gif, bmp, tiff, webp, mp3, wav, m4a, flac, ogg, mp4, mov, avi. + From `Seclai-Version: 2026-10-16` a file of any type is accepted and is `ready` at once: pass + `input_upload_id` to `POST /agents/{agent_id}/runs`. Each step receives the file itself when its + model reads that type, and otherwise its text (OCR, extraction or transcript), made once for the + steps that need it; a type nothing reads or converts is passed on as a file only. `input` carries a + `# filename` heading per file. - After uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, - then pass `input_upload_id` to `POST /agents/{agent_id}/runs`. + Earlier versions accept only these extensions: avi, bmp, csv, docx, epub, flac, gif, html, jpg, + json, m4a, markdown, md, mov, mp3, mp4, msg, ogg, pdf, png, ppt, pptx, svg, tiff, txt, wav, webp, + xls, xlsx, xml, zip. They write each file's text into `input`, so poll `GET + /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready` before running. - **Multi-modal routing:** non-text uploads (image, audio, video, PDF) are surfaced natively to multi- - modal-capable prompt steps; text-only models fall back to the OCR / transcript text counterpart. - Audio originals are preserved past transcription so audio-capable models (Gemini 2.5/3, GPT-5 audio) - read them directly; the agent-input-binary janitor sweeps originals once they pass your account's - agent-trace retention (the agent-traces source's retention period; free default 7 days). + The agent-input-binary janitor sweeps originals once they pass your account's agent-trace retention + (the agent-traces source's retention period; free default 7 days). Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's diff --git a/seclai/_generated/api/agents/create_agent_api_agents_post.py b/seclai/_generated/api/agents/create_agent_api_agents_post.py index 88f706c..1cd3705 100644 --- a/seclai/_generated/api/agents/create_agent_api_agents_post.py +++ b/seclai/_generated/api/agents/create_agent_api_agents_post.py @@ -113,7 +113,8 @@ def sync_detailed( - `schedule`: triggered on a schedule - `new_content`: triggered when new content arrives - `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure - the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`. + the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`, using the + `trigger_id` this response returns. Templates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline` @@ -178,7 +179,8 @@ def sync( - `schedule`: triggered on a schedule - `new_content`: triggered when new content arrives - `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure - the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`. + the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`, using the + `trigger_id` this response returns. Templates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline` @@ -237,7 +239,8 @@ async def asyncio_detailed( - `schedule`: triggered on a schedule - `new_content`: triggered when new content arrives - `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure - the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`. + the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`, using the + `trigger_id` this response returns. Templates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline` @@ -300,7 +303,8 @@ async def asyncio( - `schedule`: triggered on a schedule - `new_content`: triggered when new content arrives - `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure - the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`. + the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`, using the + `trigger_id` this response returns. Templates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline` diff --git a/seclai/_generated/api/agents/run_agent_api_agents_agent_id_runs_post.py b/seclai/_generated/api/agents/run_agent_api_agents_agent_id_runs_post.py index f01bd90..035caac 100644 --- a/seclai/_generated/api/agents/run_agent_api_agents_agent_id_runs_post.py +++ b/seclai/_generated/api/agents/run_agent_api_agents_agent_id_runs_post.py @@ -124,7 +124,7 @@ def sync_detailed( - `input`: text input for agents with a `dynamic_input` trigger. - `input_upload_id` / `input_upload_ids`: reference one or more files previously uploaded via `POST /agents/{agent_id}/upload-input`. Send them **with** `input` to pair prompt text with the files (the - text leads, each file's extracted text follows); only the two upload fields are mutually exclusive + text leads, each file follows under its heading); only the two upload fields are mutually exclusive with each other. - `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but @@ -197,7 +197,7 @@ def sync( - `input`: text input for agents with a `dynamic_input` trigger. - `input_upload_id` / `input_upload_ids`: reference one or more files previously uploaded via `POST /agents/{agent_id}/upload-input`. Send them **with** `input` to pair prompt text with the files (the - text leads, each file's extracted text follows); only the two upload fields are mutually exclusive + text leads, each file follows under its heading); only the two upload fields are mutually exclusive with each other. - `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but @@ -264,7 +264,7 @@ async def asyncio_detailed( - `input`: text input for agents with a `dynamic_input` trigger. - `input_upload_id` / `input_upload_ids`: reference one or more files previously uploaded via `POST /agents/{agent_id}/upload-input`. Send them **with** `input` to pair prompt text with the files (the - text leads, each file's extracted text follows); only the two upload fields are mutually exclusive + text leads, each file follows under its heading); only the two upload fields are mutually exclusive with each other. - `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but @@ -335,7 +335,7 @@ async def asyncio( - `input`: text input for agents with a `dynamic_input` trigger. - `input_upload_id` / `input_upload_ids`: reference one or more files previously uploaded via `POST /agents/{agent_id}/upload-input`. Send them **with** `input` to pair prompt text with the files (the - text leads, each file's extracted text follows); only the two upload fields are mutually exclusive + text leads, each file follows under its heading); only the two upload fields are mutually exclusive with each other. - `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but diff --git a/seclai/_generated/api/agents/run_streaming_agent_api_agents_agent_id_runs_stream_post.py b/seclai/_generated/api/agents/run_streaming_agent_api_agents_agent_id_runs_stream_post.py index c9582ba..4935f05 100644 --- a/seclai/_generated/api/agents/run_streaming_agent_api_agents_agent_id_runs_stream_post.py +++ b/seclai/_generated/api/agents/run_streaming_agent_api_agents_agent_id_runs_stream_post.py @@ -111,6 +111,9 @@ def sync_detailed( - Subsequent events are forwarded from the run event stream (status changes, step events, etc). - If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion. + - With `include_reasoning=true`, `stream_reasoning` events (with a `text` field) carry the model's + reasoning while it thinks, when the `streaming_result` step's author enabled `show_reasoning`. + Reasoning is never part of `output`. - The final `done` event contains the terminal snapshot (including `output` and `credits` when available). @@ -188,6 +191,9 @@ def sync( - Subsequent events are forwarded from the run event stream (status changes, step events, etc). - If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion. + - With `include_reasoning=true`, `stream_reasoning` events (with a `text` field) carry the model's + reasoning while it thinks, when the `streaming_result` step's author enabled `show_reasoning`. + Reasoning is never part of `output`. - The final `done` event contains the terminal snapshot (including `output` and `credits` when available). @@ -256,6 +262,9 @@ async def asyncio_detailed( - Subsequent events are forwarded from the run event stream (status changes, step events, etc). - If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion. + - With `include_reasoning=true`, `stream_reasoning` events (with a `text` field) carry the model's + reasoning while it thinks, when the `streaming_result` step's author enabled `show_reasoning`. + Reasoning is never part of `output`. - The final `done` event contains the terminal snapshot (including `output` and `credits` when available). @@ -331,6 +340,9 @@ async def asyncio( - Subsequent events are forwarded from the run event stream (status changes, step events, etc). - If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion. + - With `include_reasoning=true`, `stream_reasoning` events (with a `text` field) carry the model's + reasoning while it thinks, when the `streaming_result` step's author enabled `show_reasoning`. + Reasoning is never part of `output`. - The final `done` event contains the terminal snapshot (including `output` and `credits` when available). diff --git a/seclai/_generated/api/agents/set_accepted_attachments_api_api_agents_agent_id_triggers_trigger_id_accepted_attachments_put.py b/seclai/_generated/api/agents/set_accepted_attachments_api_api_agents_agent_id_triggers_trigger_id_accepted_attachments_put.py new file mode 100644 index 0000000..2ff1eba --- /dev/null +++ b/seclai/_generated/api/agents/set_accepted_attachments_api_api_agents_agent_id_triggers_trigger_id_accepted_attachments_put.py @@ -0,0 +1,272 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.accepted_attachments_response import AcceptedAttachmentsResponse +from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError +from ...models.set_accepted_attachments_request import SetAcceptedAttachmentsRequest +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + agent_id: str, + trigger_id: str, + *, + body: SetAcceptedAttachmentsRequest, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(x_account_id, Unset): + headers["X-Account-Id"] = x_account_id + + if not isinstance(seclai_version, Unset): + headers["Seclai-Version"] = seclai_version + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/agents/{agent_id}/triggers/{trigger_id}/accepted-attachments".format( + agent_id=quote(str(agent_id), safe=""), + trigger_id=quote(str(trigger_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AcceptedAttachmentsResponse | HTTPValidationError | ServiceUnavailableError | None: + if response.status_code == 200: + response_200 = AcceptedAttachmentsResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if response.status_code == 503: + response_503 = ServiceUnavailableError.from_dict(response.json()) + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + AcceptedAttachmentsResponse | HTTPValidationError | ServiceUnavailableError +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + agent_id: str, + trigger_id: str, + *, + client: AuthenticatedClient | Client, + body: SetAcceptedAttachmentsRequest, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + AcceptedAttachmentsResponse | HTTPValidationError | ServiceUnavailableError +]: + """Declare the input attachments a trigger accepts + + Replace the input attachments a trigger accepts. A run's files are each assigned to one declared + attachment before any step runs; steps reference one as ``{{agent.attachments.}}``. Rejected + with HTTP 400 when the agent references an attachment the new declaration leaves out. `trigger_id` + is the one `GET /agents/{agent_id}` returns. + + Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an + agent in the key's account. + + Args: + agent_id (str): + trigger_id (str): + x_account_id (UUID | Unset): + seclai_version (str | Unset): + body (SetAcceptedAttachmentsRequest): + + 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[AcceptedAttachmentsResponse | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + agent_id=agent_id, + trigger_id=trigger_id, + body=body, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + agent_id: str, + trigger_id: str, + *, + client: AuthenticatedClient | Client, + body: SetAcceptedAttachmentsRequest, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> AcceptedAttachmentsResponse | HTTPValidationError | ServiceUnavailableError | None: + """Declare the input attachments a trigger accepts + + Replace the input attachments a trigger accepts. A run's files are each assigned to one declared + attachment before any step runs; steps reference one as ``{{agent.attachments.}}``. Rejected + with HTTP 400 when the agent references an attachment the new declaration leaves out. `trigger_id` + is the one `GET /agents/{agent_id}` returns. + + Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an + agent in the key's account. + + Args: + agent_id (str): + trigger_id (str): + x_account_id (UUID | Unset): + seclai_version (str | Unset): + body (SetAcceptedAttachmentsRequest): + + 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: + AcceptedAttachmentsResponse | HTTPValidationError | ServiceUnavailableError + """ + + return sync_detailed( + agent_id=agent_id, + trigger_id=trigger_id, + client=client, + body=body, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + agent_id: str, + trigger_id: str, + *, + client: AuthenticatedClient | Client, + body: SetAcceptedAttachmentsRequest, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + AcceptedAttachmentsResponse | HTTPValidationError | ServiceUnavailableError +]: + """Declare the input attachments a trigger accepts + + Replace the input attachments a trigger accepts. A run's files are each assigned to one declared + attachment before any step runs; steps reference one as ``{{agent.attachments.}}``. Rejected + with HTTP 400 when the agent references an attachment the new declaration leaves out. `trigger_id` + is the one `GET /agents/{agent_id}` returns. + + Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an + agent in the key's account. + + Args: + agent_id (str): + trigger_id (str): + x_account_id (UUID | Unset): + seclai_version (str | Unset): + body (SetAcceptedAttachmentsRequest): + + 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[AcceptedAttachmentsResponse | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + agent_id=agent_id, + trigger_id=trigger_id, + body=body, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + agent_id: str, + trigger_id: str, + *, + client: AuthenticatedClient | Client, + body: SetAcceptedAttachmentsRequest, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> AcceptedAttachmentsResponse | HTTPValidationError | ServiceUnavailableError | None: + """Declare the input attachments a trigger accepts + + Replace the input attachments a trigger accepts. A run's files are each assigned to one declared + attachment before any step runs; steps reference one as ``{{agent.attachments.}}``. Rejected + with HTTP 400 when the agent references an attachment the new declaration leaves out. `trigger_id` + is the one `GET /agents/{agent_id}` returns. + + Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an + agent in the key's account. + + Args: + agent_id (str): + trigger_id (str): + x_account_id (UUID | Unset): + seclai_version (str | Unset): + body (SetAcceptedAttachmentsRequest): + + 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: + AcceptedAttachmentsResponse | HTTPValidationError | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + agent_id=agent_id, + trigger_id=trigger_id, + client=client, + body=body, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/agents/set_email_trigger_config_api_api_agents_agent_id_triggers_trigger_id_email_config_put.py b/seclai/_generated/api/agents/set_email_trigger_config_api_api_agents_agent_id_triggers_trigger_id_email_config_put.py index 5ec9910..0d88642 100644 --- a/seclai/_generated/api/agents/set_email_trigger_config_api_api_agents_agent_id_triggers_trigger_id_email_config_put.py +++ b/seclai/_generated/api/agents/set_email_trigger_config_api_api_agents_agent_id_triggers_trigger_id_email_config_put.py @@ -96,8 +96,9 @@ def sync_detailed( """Configure an EMAIL_RECEIVED trigger Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, - `require_sender_auth`, `queue_on_quota`) on an agent's EMAIL_RECEIVED trigger, and return its - computed email address(es). Omitted fields are left unchanged. + `require_sender_auth`, `queue_on_quota`, `run_on_attachment_mismatch`) on an agent's EMAIL_RECEIVED + trigger, and return its computed email address(es). `trigger_id` is the one `GET /agents/{agent_id}` + returns. Omitted fields are left unchanged. Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account. @@ -148,8 +149,9 @@ def sync( """Configure an EMAIL_RECEIVED trigger Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, - `require_sender_auth`, `queue_on_quota`) on an agent's EMAIL_RECEIVED trigger, and return its - computed email address(es). Omitted fields are left unchanged. + `require_sender_auth`, `queue_on_quota`, `run_on_attachment_mismatch`) on an agent's EMAIL_RECEIVED + trigger, and return its computed email address(es). `trigger_id` is the one `GET /agents/{agent_id}` + returns. Omitted fields are left unchanged. Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account. @@ -197,8 +199,9 @@ async def asyncio_detailed( """Configure an EMAIL_RECEIVED trigger Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, - `require_sender_auth`, `queue_on_quota`) on an agent's EMAIL_RECEIVED trigger, and return its - computed email address(es). Omitted fields are left unchanged. + `require_sender_auth`, `queue_on_quota`, `run_on_attachment_mismatch`) on an agent's EMAIL_RECEIVED + trigger, and return its computed email address(es). `trigger_id` is the one `GET /agents/{agent_id}` + returns. Omitted fields are left unchanged. Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account. @@ -247,8 +250,9 @@ async def asyncio( """Configure an EMAIL_RECEIVED trigger Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, - `require_sender_auth`, `queue_on_quota`) on an agent's EMAIL_RECEIVED trigger, and return its - computed email address(es). Omitted fields are left unchanged. + `require_sender_auth`, `queue_on_quota`, `run_on_attachment_mismatch`) on an agent's EMAIL_RECEIVED + trigger, and return its computed email address(es). `trigger_id` is the one `GET /agents/{agent_id}` + returns. Omitted fields are left unchanged. Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account. diff --git a/seclai/_generated/api/contents/get_content_attachment_api_contents_source_connection_content_version_attachments_attachment_id_get.py b/seclai/_generated/api/contents/get_content_attachment_api_contents_source_connection_content_version_attachments_attachment_id_get.py new file mode 100644 index 0000000..a3f8787 --- /dev/null +++ b/seclai/_generated/api/contents/get_content_attachment_api_contents_source_connection_content_version_attachments_attachment_id_get.py @@ -0,0 +1,330 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.content_attachment_detail_response import ContentAttachmentDetailResponse +from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + start: int | Unset = 0, + end: int | Unset = 5000, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(x_account_id, Unset): + headers["X-Account-Id"] = x_account_id + + if not isinstance(seclai_version, Unset): + headers["Seclai-Version"] = seclai_version + + params: dict[str, Any] = {} + + params["start"] = start + + params["end"] = end + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/contents/{source_connection_content_version}/attachments/{attachment_id}".format( + source_connection_content_version=quote( + str(source_connection_content_version), safe="" + ), + attachment_id=quote(str(attachment_id), safe=""), + ), + "params": params, + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + Any + | ContentAttachmentDetailResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): + if response.status_code == 200: + response_200 = ContentAttachmentDetailResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 402: + response_402 = cast(Any, None) + return response_402 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if response.status_code == 503: + response_503 = ServiceUnavailableError.from_dict(response.json()) + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + Any + | ContentAttachmentDetailResponse + | HTTPValidationError + | ServiceUnavailableError +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + client: AuthenticatedClient | Client, + start: int | Unset = 0, + end: int | Unset = 5000, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + Any + | ContentAttachmentDetailResponse + | HTTPValidationError + | ServiceUnavailableError +]: + """Get a content attachment + + Get one file attached to a content item: its indexing status and reason, its metadata, and the text + it is indexed by. + + `attachment_id` is the `id` of an entry in the item's attachment list. Use `start` and `end` to page + through long text. A file that was not indexed has no text. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (UUID): + attachment_id (UUID): + start (int | Unset): Default: 0. + end (int | Unset): Default: 5000. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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 | ContentAttachmentDetailResponse | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + source_connection_content_version=source_connection_content_version, + attachment_id=attachment_id, + start=start, + end=end, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + client: AuthenticatedClient | Client, + start: int | Unset = 0, + end: int | Unset = 5000, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + Any + | ContentAttachmentDetailResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): + """Get a content attachment + + Get one file attached to a content item: its indexing status and reason, its metadata, and the text + it is indexed by. + + `attachment_id` is the `id` of an entry in the item's attachment list. Use `start` and `end` to page + through long text. A file that was not indexed has no text. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (UUID): + attachment_id (UUID): + start (int | Unset): Default: 0. + end (int | Unset): Default: 5000. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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 | ContentAttachmentDetailResponse | HTTPValidationError | ServiceUnavailableError + """ + + return sync_detailed( + source_connection_content_version=source_connection_content_version, + attachment_id=attachment_id, + client=client, + start=start, + end=end, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + client: AuthenticatedClient | Client, + start: int | Unset = 0, + end: int | Unset = 5000, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + Any + | ContentAttachmentDetailResponse + | HTTPValidationError + | ServiceUnavailableError +]: + """Get a content attachment + + Get one file attached to a content item: its indexing status and reason, its metadata, and the text + it is indexed by. + + `attachment_id` is the `id` of an entry in the item's attachment list. Use `start` and `end` to page + through long text. A file that was not indexed has no text. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (UUID): + attachment_id (UUID): + start (int | Unset): Default: 0. + end (int | Unset): Default: 5000. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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 | ContentAttachmentDetailResponse | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + source_connection_content_version=source_connection_content_version, + attachment_id=attachment_id, + start=start, + end=end, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + client: AuthenticatedClient | Client, + start: int | Unset = 0, + end: int | Unset = 5000, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + Any + | ContentAttachmentDetailResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): + """Get a content attachment + + Get one file attached to a content item: its indexing status and reason, its metadata, and the text + it is indexed by. + + `attachment_id` is the `id` of an entry in the item's attachment list. Use `start` and `end` to page + through long text. A file that was not indexed has no text. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (UUID): + attachment_id (UUID): + start (int | Unset): Default: 0. + end (int | Unset): Default: 5000. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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 | ContentAttachmentDetailResponse | HTTPValidationError | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + source_connection_content_version=source_connection_content_version, + attachment_id=attachment_id, + client=client, + start=start, + end=end, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/contents/get_content_attachment_file_api_contents_source_connection_content_version_attachments_attachment_id_file_get.py b/seclai/_generated/api/contents/get_content_attachment_file_api_contents_source_connection_content_version_attachments_attachment_id_file_get.py new file mode 100644 index 0000000..6c1016b --- /dev/null +++ b/seclai/_generated/api/contents/get_content_attachment_file_api_contents_source_connection_content_version_attachments_attachment_id_file_get.py @@ -0,0 +1,278 @@ +from http import HTTPStatus +from io import BytesIO +from typing import Any, cast +from urllib.parse import quote +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError +from ...types import UNSET, File, Response, Unset + + +def _get_kwargs( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(x_account_id, Unset): + headers["X-Account-Id"] = x_account_id + + if not isinstance(seclai_version, Unset): + headers["Seclai-Version"] = seclai_version + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/contents/{source_connection_content_version}/attachments/{attachment_id}/file".format( + source_connection_content_version=quote( + str(source_connection_content_version), safe="" + ), + attachment_id=quote(str(attachment_id), safe=""), + ), + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | File | HTTPValidationError | ServiceUnavailableError | None: + if response.status_code == 200: + response_200 = File(payload=BytesIO(response.content)) + + return response_200 + + if response.status_code == 402: + response_402 = cast(Any, None) + return response_402 + + if response.status_code == 403: + response_403 = cast(Any, None) + return response_403 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if response.status_code == 503: + response_503 = ServiceUnavailableError.from_dict(response.json()) + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | File | HTTPValidationError | ServiceUnavailableError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[Any | File | HTTPValidationError | ServiceUnavailableError]: + """Download a content attachment + + Download an attached file's bytes. + + Images, audio, video, PDF and plain text are served with their own type; an SVG that cannot be + sanitized, and anything else, is served as `application/octet-stream`. + + Answers 403 when the file is withheld: a governance policy blocked or redacted it, or it arrived + from outside and is still being indexed. The attachment's `file_withheld` field says which before + you ask. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (UUID): + attachment_id (UUID): + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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 | File | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + source_connection_content_version=source_connection_content_version, + attachment_id=attachment_id, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Any | File | HTTPValidationError | ServiceUnavailableError | None: + """Download a content attachment + + Download an attached file's bytes. + + Images, audio, video, PDF and plain text are served with their own type; an SVG that cannot be + sanitized, and anything else, is served as `application/octet-stream`. + + Answers 403 when the file is withheld: a governance policy blocked or redacted it, or it arrived + from outside and is still being indexed. The attachment's `file_withheld` field says which before + you ask. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (UUID): + attachment_id (UUID): + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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 | File | HTTPValidationError | ServiceUnavailableError + """ + + return sync_detailed( + source_connection_content_version=source_connection_content_version, + attachment_id=attachment_id, + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[Any | File | HTTPValidationError | ServiceUnavailableError]: + """Download a content attachment + + Download an attached file's bytes. + + Images, audio, video, PDF and plain text are served with their own type; an SVG that cannot be + sanitized, and anything else, is served as `application/octet-stream`. + + Answers 403 when the file is withheld: a governance policy blocked or redacted it, or it arrived + from outside and is still being indexed. The attachment's `file_withheld` field says which before + you ask. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (UUID): + attachment_id (UUID): + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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 | File | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + source_connection_content_version=source_connection_content_version, + attachment_id=attachment_id, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + client: AuthenticatedClient | Client, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Any | File | HTTPValidationError | ServiceUnavailableError | None: + """Download a content attachment + + Download an attached file's bytes. + + Images, audio, video, PDF and plain text are served with their own type; an SVG that cannot be + sanitized, and anything else, is served as `application/octet-stream`. + + Answers 403 when the file is withheld: a governance policy blocked or redacted it, or it arrived + from outside and is still being indexed. The attachment's `file_withheld` field says which before + you ask. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (UUID): + attachment_id (UUID): + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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 | File | HTTPValidationError | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + source_connection_content_version=source_connection_content_version, + attachment_id=attachment_id, + client=client, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/contents/list_content_attachment_embeddings_api_contents_source_connection_content_version_attachments_attachment_id_embeddings_get.py b/seclai/_generated/api/contents/list_content_attachment_embeddings_api_contents_source_connection_content_version_attachments_attachment_id_embeddings_get.py new file mode 100644 index 0000000..9ff7a4f --- /dev/null +++ b/seclai/_generated/api/contents/list_content_attachment_embeddings_api_contents_source_connection_content_version_attachments_attachment_id_embeddings_get.py @@ -0,0 +1,309 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.content_embeddings_list_response import ContentEmbeddingsListResponse +from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(x_account_id, Unset): + headers["X-Account-Id"] = x_account_id + + if not isinstance(seclai_version, Unset): + headers["Seclai-Version"] = seclai_version + + params: dict[str, Any] = {} + + params["page"] = page + + params["limit"] = limit + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/contents/{source_connection_content_version}/attachments/{attachment_id}/embeddings".format( + source_connection_content_version=quote( + str(source_connection_content_version), safe="" + ), + attachment_id=quote(str(attachment_id), safe=""), + ), + "params": params, + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + Any + | ContentEmbeddingsListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): + if response.status_code == 200: + response_200 = ContentEmbeddingsListResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 402: + response_402 = cast(Any, None) + return response_402 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if response.status_code == 503: + response_503 = ServiceUnavailableError.from_dict(response.json()) + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + Any | ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + client: AuthenticatedClient | Client, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + Any | ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError +]: + """List a content attachment's embeddings + + List the embeddings (chunk vectors) an attached file is indexed by, with pagination. The list is + empty for a file that has no completed index. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (UUID): + attachment_id (UUID): + page (int | Unset): Default: 1. + limit (int | Unset): Default: 20. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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 | ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + source_connection_content_version=source_connection_content_version, + attachment_id=attachment_id, + page=page, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + client: AuthenticatedClient | Client, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + Any + | ContentEmbeddingsListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): + """List a content attachment's embeddings + + List the embeddings (chunk vectors) an attached file is indexed by, with pagination. The list is + empty for a file that has no completed index. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (UUID): + attachment_id (UUID): + page (int | Unset): Default: 1. + limit (int | Unset): Default: 20. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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 | ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError + """ + + return sync_detailed( + source_connection_content_version=source_connection_content_version, + attachment_id=attachment_id, + client=client, + page=page, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + client: AuthenticatedClient | Client, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + Any | ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError +]: + """List a content attachment's embeddings + + List the embeddings (chunk vectors) an attached file is indexed by, with pagination. The list is + empty for a file that has no completed index. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (UUID): + attachment_id (UUID): + page (int | Unset): Default: 1. + limit (int | Unset): Default: 20. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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 | ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + source_connection_content_version=source_connection_content_version, + attachment_id=attachment_id, + page=page, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + source_connection_content_version: UUID, + attachment_id: UUID, + *, + client: AuthenticatedClient | Client, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + Any + | ContentEmbeddingsListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): + """List a content attachment's embeddings + + List the embeddings (chunk vectors) an attached file is indexed by, with pagination. The list is + empty for a file that has no completed index. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (UUID): + attachment_id (UUID): + page (int | Unset): Default: 1. + limit (int | Unset): Default: 20. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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 | ContentEmbeddingsListResponse | HTTPValidationError | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + source_connection_content_version=source_connection_content_version, + attachment_id=attachment_id, + client=client, + page=page, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/contents/list_content_attachments_api_contents_source_connection_content_version_attachments_get.py b/seclai/_generated/api/contents/list_content_attachments_api_contents_source_connection_content_version_attachments_get.py new file mode 100644 index 0000000..db2ff6e --- /dev/null +++ b/seclai/_generated/api/contents/list_content_attachments_api_contents_source_connection_content_version_attachments_get.py @@ -0,0 +1,312 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.content_attachments_list_response import ContentAttachmentsListResponse +from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + source_connection_content_version: str, + *, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(x_account_id, Unset): + headers["X-Account-Id"] = x_account_id + + if not isinstance(seclai_version, Unset): + headers["Seclai-Version"] = seclai_version + + params: dict[str, Any] = {} + + params["page"] = page + + params["limit"] = limit + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/contents/{source_connection_content_version}/attachments".format( + source_connection_content_version=quote( + str(source_connection_content_version), safe="" + ), + ), + "params": params, + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + ContentAttachmentsListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): + if response.status_code == 200: + response_200 = ContentAttachmentsListResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if response.status_code == 503: + response_503 = ServiceUnavailableError.from_dict(response.json()) + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + ContentAttachmentsListResponse | HTTPValidationError | ServiceUnavailableError +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + source_connection_content_version: str, + *, + client: AuthenticatedClient | Client, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + ContentAttachmentsListResponse | HTTPValidationError | ServiceUnavailableError +]: + """List content attachments + + List the files attached to a content item, with pagination. + + An agent's `write_content_attachment` step attaches a file, and an email content source attaches the + files sent with a message. An RSS source attaches the kinds of feed file chosen in its + `feed_attachments`. The images and video in a web page's main content are attached on a source with + media indexing on. The images inside a PDF, DOCX, PPTX or XLSX item or attachment are attached too, + on a source that indexes document images. Each entry says whether the file is indexed for search + and, when indexing failed, why. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (str): + page (int | Unset): Default: 1. + limit (int | Unset): Default: 20. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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[ContentAttachmentsListResponse | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + source_connection_content_version=source_connection_content_version, + page=page, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + source_connection_content_version: str, + *, + client: AuthenticatedClient | Client, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + ContentAttachmentsListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): + """List content attachments + + List the files attached to a content item, with pagination. + + An agent's `write_content_attachment` step attaches a file, and an email content source attaches the + files sent with a message. An RSS source attaches the kinds of feed file chosen in its + `feed_attachments`. The images and video in a web page's main content are attached on a source with + media indexing on. The images inside a PDF, DOCX, PPTX or XLSX item or attachment are attached too, + on a source that indexes document images. Each entry says whether the file is indexed for search + and, when indexing failed, why. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (str): + page (int | Unset): Default: 1. + limit (int | Unset): Default: 20. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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: + ContentAttachmentsListResponse | HTTPValidationError | ServiceUnavailableError + """ + + return sync_detailed( + source_connection_content_version=source_connection_content_version, + client=client, + page=page, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + source_connection_content_version: str, + *, + client: AuthenticatedClient | Client, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + ContentAttachmentsListResponse | HTTPValidationError | ServiceUnavailableError +]: + """List content attachments + + List the files attached to a content item, with pagination. + + An agent's `write_content_attachment` step attaches a file, and an email content source attaches the + files sent with a message. An RSS source attaches the kinds of feed file chosen in its + `feed_attachments`. The images and video in a web page's main content are attached on a source with + media indexing on. The images inside a PDF, DOCX, PPTX or XLSX item or attachment are attached too, + on a source that indexes document images. Each entry says whether the file is indexed for search + and, when indexing failed, why. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (str): + page (int | Unset): Default: 1. + limit (int | Unset): Default: 20. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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[ContentAttachmentsListResponse | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + source_connection_content_version=source_connection_content_version, + page=page, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + source_connection_content_version: str, + *, + client: AuthenticatedClient | Client, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + ContentAttachmentsListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): + """List content attachments + + List the files attached to a content item, with pagination. + + An agent's `write_content_attachment` step attaches a file, and an email content source attaches the + files sent with a message. An RSS source attaches the kinds of feed file chosen in its + `feed_attachments`. The images and video in a web page's main content are attached on a source with + media indexing on. The images inside a PDF, DOCX, PPTX or XLSX item or attachment are attached too, + on a source that indexes document images. Each entry says whether the file is indexed for search + and, when indexing failed, why. + + Auth & scoping: + - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content + belonging to your account. + + Args: + source_connection_content_version (str): + page (int | Unset): Default: 1. + limit (int | Unset): Default: 20. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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: + ContentAttachmentsListResponse | HTTPValidationError | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + source_connection_content_version=source_connection_content_version, + client=client, + page=page, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/contents/upload_file_to_content_api_contents_source_connection_content_version_upload_post.py b/seclai/_generated/api/contents/upload_file_to_content_api_contents_source_connection_content_version_upload_post.py index cd8a7ef..4228709 100644 --- a/seclai/_generated/api/contents/upload_file_to_content_api_contents_source_connection_content_version_upload_post.py +++ b/seclai/_generated/api/contents/upload_file_to_content_api_contents_source_connection_content_version_upload_post.py @@ -103,22 +103,31 @@ def sync_detailed( before it is stored). **Supported MIME types:** + - `application/atom+xml` - `application/epub+zip` - `application/json` - `application/pdf` + - `application/rss+xml` + - `application/rtf` - `application/vnd.ms-excel` - `application/vnd.ms-outlook` - `application/vnd.ms-powerpoint` - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + - `application/x-ipynb+json` + - `application/xhtml+xml` - `application/xml` - `application/zip` + - `audio/aac` + - `audio/amr` - `audio/flac` - `audio/mp4` - `audio/mpeg` - `audio/ogg` + - `audio/opus` - `audio/wav` + - `audio/webm` - `image/bmp` - `image/gif` - `image/jpeg` @@ -126,14 +135,43 @@ def sync_detailed( - `image/svg+xml` - `image/tiff` - `image/webp` + - `message/rfc822` + - `text/calendar` - `text/csv` - `text/html` + - `text/javascript` - `text/markdown` - `text/plain` + - `text/tab-separated-values` + - `text/vcard` + - `text/vtt` + - `text/x-c` + - `text/x-c++` + - `text/x-csharp` + - `text/x-go` + - `text/x-ini` + - `text/x-java` + - `text/x-log` - `text/x-markdown` + - `text/x-php` + - `text/x-python` + - `text/x-ruby` + - `text/x-rust` + - `text/x-shellscript` + - `text/x-sql` + - `text/x-subrip` + - `text/x-tex` + - `text/x-toml` + - `text/x-typescript` - `text/xml` + - `text/yaml` + - `video/3gpp` + - `video/mp2t` - `video/mp4` + - `video/mpeg` - `video/quicktime` + - `video/webm` + - `video/x-matroska` - `video/x-msvideo` Notes: @@ -202,22 +240,31 @@ def sync( before it is stored). **Supported MIME types:** + - `application/atom+xml` - `application/epub+zip` - `application/json` - `application/pdf` + - `application/rss+xml` + - `application/rtf` - `application/vnd.ms-excel` - `application/vnd.ms-outlook` - `application/vnd.ms-powerpoint` - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + - `application/x-ipynb+json` + - `application/xhtml+xml` - `application/xml` - `application/zip` + - `audio/aac` + - `audio/amr` - `audio/flac` - `audio/mp4` - `audio/mpeg` - `audio/ogg` + - `audio/opus` - `audio/wav` + - `audio/webm` - `image/bmp` - `image/gif` - `image/jpeg` @@ -225,14 +272,43 @@ def sync( - `image/svg+xml` - `image/tiff` - `image/webp` + - `message/rfc822` + - `text/calendar` - `text/csv` - `text/html` + - `text/javascript` - `text/markdown` - `text/plain` + - `text/tab-separated-values` + - `text/vcard` + - `text/vtt` + - `text/x-c` + - `text/x-c++` + - `text/x-csharp` + - `text/x-go` + - `text/x-ini` + - `text/x-java` + - `text/x-log` - `text/x-markdown` + - `text/x-php` + - `text/x-python` + - `text/x-ruby` + - `text/x-rust` + - `text/x-shellscript` + - `text/x-sql` + - `text/x-subrip` + - `text/x-tex` + - `text/x-toml` + - `text/x-typescript` - `text/xml` + - `text/yaml` + - `video/3gpp` + - `video/mp2t` - `video/mp4` + - `video/mpeg` - `video/quicktime` + - `video/webm` + - `video/x-matroska` - `video/x-msvideo` Notes: @@ -296,22 +372,31 @@ async def asyncio_detailed( before it is stored). **Supported MIME types:** + - `application/atom+xml` - `application/epub+zip` - `application/json` - `application/pdf` + - `application/rss+xml` + - `application/rtf` - `application/vnd.ms-excel` - `application/vnd.ms-outlook` - `application/vnd.ms-powerpoint` - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + - `application/x-ipynb+json` + - `application/xhtml+xml` - `application/xml` - `application/zip` + - `audio/aac` + - `audio/amr` - `audio/flac` - `audio/mp4` - `audio/mpeg` - `audio/ogg` + - `audio/opus` - `audio/wav` + - `audio/webm` - `image/bmp` - `image/gif` - `image/jpeg` @@ -319,14 +404,43 @@ async def asyncio_detailed( - `image/svg+xml` - `image/tiff` - `image/webp` + - `message/rfc822` + - `text/calendar` - `text/csv` - `text/html` + - `text/javascript` - `text/markdown` - `text/plain` + - `text/tab-separated-values` + - `text/vcard` + - `text/vtt` + - `text/x-c` + - `text/x-c++` + - `text/x-csharp` + - `text/x-go` + - `text/x-ini` + - `text/x-java` + - `text/x-log` - `text/x-markdown` + - `text/x-php` + - `text/x-python` + - `text/x-ruby` + - `text/x-rust` + - `text/x-shellscript` + - `text/x-sql` + - `text/x-subrip` + - `text/x-tex` + - `text/x-toml` + - `text/x-typescript` - `text/xml` + - `text/yaml` + - `video/3gpp` + - `video/mp2t` - `video/mp4` + - `video/mpeg` - `video/quicktime` + - `video/webm` + - `video/x-matroska` - `video/x-msvideo` Notes: @@ -393,22 +507,31 @@ async def asyncio( before it is stored). **Supported MIME types:** + - `application/atom+xml` - `application/epub+zip` - `application/json` - `application/pdf` + - `application/rss+xml` + - `application/rtf` - `application/vnd.ms-excel` - `application/vnd.ms-outlook` - `application/vnd.ms-powerpoint` - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + - `application/x-ipynb+json` + - `application/xhtml+xml` - `application/xml` - `application/zip` + - `audio/aac` + - `audio/amr` - `audio/flac` - `audio/mp4` - `audio/mpeg` - `audio/ogg` + - `audio/opus` - `audio/wav` + - `audio/webm` - `image/bmp` - `image/gif` - `image/jpeg` @@ -416,14 +539,43 @@ async def asyncio( - `image/svg+xml` - `image/tiff` - `image/webp` + - `message/rfc822` + - `text/calendar` - `text/csv` - `text/html` + - `text/javascript` - `text/markdown` - `text/plain` + - `text/tab-separated-values` + - `text/vcard` + - `text/vtt` + - `text/x-c` + - `text/x-c++` + - `text/x-csharp` + - `text/x-go` + - `text/x-ini` + - `text/x-java` + - `text/x-log` - `text/x-markdown` + - `text/x-php` + - `text/x-python` + - `text/x-ruby` + - `text/x-rust` + - `text/x-shellscript` + - `text/x-sql` + - `text/x-subrip` + - `text/x-tex` + - `text/x-toml` + - `text/x-typescript` - `text/xml` + - `text/yaml` + - `video/3gpp` + - `video/mp2t` - `video/mp4` + - `video/mpeg` - `video/quicktime` + - `video/webm` + - `video/x-matroska` - `video/x-msvideo` Notes: diff --git a/seclai/_generated/api/models/cancel_experiment_endpoint_api_models_playground_experiments_experiment_id_cancel_post.py b/seclai/_generated/api/models/cancel_experiment_endpoint_api_models_playground_experiments_experiment_id_cancel_post.py index fc7efb5..1bee2e0 100644 --- a/seclai/_generated/api/models/cancel_experiment_endpoint_api_models_playground_experiments_experiment_id_cancel_post.py +++ b/seclai/_generated/api/models/cancel_experiment_endpoint_api_models_playground_experiments_experiment_id_cancel_post.py @@ -83,7 +83,11 @@ def sync_detailed( Cancel a running or pending model playground experiment. - Signals running model calls to abort and marks the experiment as canceled. + Marks the experiment as canceled. An experiment that has not started never runs. One that is running + starts no further model calls, and records each model it did not call with the error `Canceled`. A + model call or evaluation already in progress is not interrupted by the cancel: it continues and is + billed, and its result is recorded on the canceled experiment. Canceling may therefore not shorten + the run or reduce its cost. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's @@ -126,7 +130,11 @@ def sync( Cancel a running or pending model playground experiment. - Signals running model calls to abort and marks the experiment as canceled. + Marks the experiment as canceled. An experiment that has not started never runs. One that is running + starts no further model calls, and records each model it did not call with the error `Canceled`. A + model call or evaluation already in progress is not interrupted by the cancel: it continues and is + billed, and its result is recorded on the canceled experiment. Canceling may therefore not shorten + the run or reduce its cost. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's @@ -164,7 +172,11 @@ async def asyncio_detailed( Cancel a running or pending model playground experiment. - Signals running model calls to abort and marks the experiment as canceled. + Marks the experiment as canceled. An experiment that has not started never runs. One that is running + starts no further model calls, and records each model it did not call with the error `Canceled`. A + model call or evaluation already in progress is not interrupted by the cancel: it continues and is + billed, and its result is recorded on the canceled experiment. Canceling may therefore not shorten + the run or reduce its cost. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's @@ -205,7 +217,11 @@ async def asyncio( Cancel a running or pending model playground experiment. - Signals running model calls to abort and marks the experiment as canceled. + Marks the experiment as canceled. An experiment that has not started never runs. One that is running + starts no further model calls, and records each model it did not call with the error `Canceled`. A + model call or evaluation already in progress is not interrupted by the cancel: it continues and is + billed, and its result is recorded on the canceled experiment. Canceling may therefore not shorten + the run or reduce its cost. Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's diff --git a/seclai/_generated/api/models/list_embedding_models_api_models_embedders_get.py b/seclai/_generated/api/models/list_embedding_models_api_models_embedders_get.py index 11694f3..31bcae9 100644 --- a/seclai/_generated/api/models/list_embedding_models_api_models_embedders_get.py +++ b/seclai/_generated/api/models/list_embedding_models_api_models_embedders_get.py @@ -99,8 +99,8 @@ def sync_detailed( Each entry carries the `model_type` to pass as `embedding_model` when creating a source, the `dimensions` it supports, and — most importantly for multi-modal indexing — `supported_input_media`: the modalities that embedder can actually index. A source only honours a `media_types` entry its - embedder lists here; unsupported kinds are dropped at save time with an `embedder_warning`, so check - this before choosing an embedder for a knowledge base of images or video. + embedder lists here; a kind it does not list is stored and not indexed, so check this before + choosing an embedder for a knowledge base of images or video. Text-only embedders report `supported_input_media` as null. Pricing is reported as `credits` (per ~1,000 English words of text) plus `per_modality_rates` for the non-text modalities a multi-modal @@ -158,8 +158,8 @@ def sync( Each entry carries the `model_type` to pass as `embedding_model` when creating a source, the `dimensions` it supports, and — most importantly for multi-modal indexing — `supported_input_media`: the modalities that embedder can actually index. A source only honours a `media_types` entry its - embedder lists here; unsupported kinds are dropped at save time with an `embedder_warning`, so check - this before choosing an embedder for a knowledge base of images or video. + embedder lists here; a kind it does not list is stored and not indexed, so check this before + choosing an embedder for a knowledge base of images or video. Text-only embedders report `supported_input_media` as null. Pricing is reported as `credits` (per ~1,000 English words of text) plus `per_modality_rates` for the non-text modalities a multi-modal @@ -214,8 +214,8 @@ async def asyncio_detailed( Each entry carries the `model_type` to pass as `embedding_model` when creating a source, the `dimensions` it supports, and — most importantly for multi-modal indexing — `supported_input_media`: the modalities that embedder can actually index. A source only honours a `media_types` entry its - embedder lists here; unsupported kinds are dropped at save time with an `embedder_warning`, so check - this before choosing an embedder for a knowledge base of images or video. + embedder lists here; a kind it does not list is stored and not indexed, so check this before + choosing an embedder for a knowledge base of images or video. Text-only embedders report `supported_input_media` as null. Pricing is reported as `credits` (per ~1,000 English words of text) plus `per_modality_rates` for the non-text modalities a multi-modal @@ -271,8 +271,8 @@ async def asyncio( Each entry carries the `model_type` to pass as `embedding_model` when creating a source, the `dimensions` it supports, and — most importantly for multi-modal indexing — `supported_input_media`: the modalities that embedder can actually index. A source only honours a `media_types` entry its - embedder lists here; unsupported kinds are dropped at save time with an `embedder_warning`, so check - this before choosing an embedder for a knowledge base of images or video. + embedder lists here; a kind it does not list is stored and not indexed, so check this before + choosing an embedder for a knowledge base of images or video. Text-only embedders report `supported_input_media` as null. Pricing is reported as `credits` (per ~1,000 English words of text) plus `per_modality_rates` for the non-text modalities a multi-modal diff --git a/seclai/_generated/api/sources/create_source_api_sources_post.py b/seclai/_generated/api/sources/create_source_api_sources_post.py index 79a6cd6..6ca0fa0 100644 --- a/seclai/_generated/api/sources/create_source_api_sources_post.py +++ b/seclai/_generated/api/sources/create_source_api_sources_post.py @@ -89,11 +89,17 @@ def sync_detailed( Create a new content source. - Source types: `rss`, `website`, `custom_index`. + Source types: `rss_feed`, `website`, `custom_index`, `cloud_drive`, `email`. For RSS and website sources, provide the URL. For custom index sources, the URL is created automatically. + An `email` source takes no URL and requires `email_allowed_senders`; the response's `email_address` + is where to send mail. + + A `cloud_drive` source takes no URL and requires `cloud_drive_connection_id`, the id of a drive + connected in the app (`GET /cloud-drives` lists them). + For custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`. @@ -135,11 +141,17 @@ def sync( Create a new content source. - Source types: `rss`, `website`, `custom_index`. + Source types: `rss_feed`, `website`, `custom_index`, `cloud_drive`, `email`. For RSS and website sources, provide the URL. For custom index sources, the URL is created automatically. + An `email` source takes no URL and requires `email_allowed_senders`; the response's `email_address` + is where to send mail. + + A `cloud_drive` source takes no URL and requires `cloud_drive_connection_id`, the id of a drive + connected in the app (`GET /cloud-drives` lists them). + For custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`. @@ -176,11 +188,17 @@ async def asyncio_detailed( Create a new content source. - Source types: `rss`, `website`, `custom_index`. + Source types: `rss_feed`, `website`, `custom_index`, `cloud_drive`, `email`. For RSS and website sources, provide the URL. For custom index sources, the URL is created automatically. + An `email` source takes no URL and requires `email_allowed_senders`; the response's `email_address` + is where to send mail. + + A `cloud_drive` source takes no URL and requires `cloud_drive_connection_id`, the id of a drive + connected in the app (`GET /cloud-drives` lists them). + For custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`. @@ -220,11 +238,17 @@ async def asyncio( Create a new content source. - Source types: `rss`, `website`, `custom_index`. + Source types: `rss_feed`, `website`, `custom_index`, `cloud_drive`, `email`. For RSS and website sources, provide the URL. For custom index sources, the URL is created automatically. + An `email` source takes no URL and requires `email_allowed_senders`; the response's `email_address` + is where to send mail. + + A `cloud_drive` source takes no URL and requires `cloud_drive_connection_id`, the id of a drive + connected in the app (`GET /cloud-drives` lists them). + For custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`. diff --git a/seclai/_generated/api/sources/get_source_content_status_endpoint_api_sources_source_connection_id_contents_content_version_id_get.py b/seclai/_generated/api/sources/get_source_content_status_endpoint_api_sources_source_connection_id_contents_content_version_id_get.py index 6748cc4..6c14568 100644 --- a/seclai/_generated/api/sources/get_source_content_status_endpoint_api_sources_source_connection_id_contents_content_version_id_get.py +++ b/seclai/_generated/api/sources/get_source_content_status_endpoint_api_sources_source_connection_id_contents_content_version_id_get.py @@ -95,6 +95,10 @@ def sync_detailed( /sources/{id}/contents` with repeated `content_version_id` parameters instead of polling this endpoint per item. + An item held for review by an Enforce governance policy reports `held_for_review: true`. With + `Seclai-Version: 2026-10-05` or later its `content_status` is `completed`; earlier versions report + `failed` with the hold as the `error`. + Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account. @@ -144,6 +148,10 @@ def sync( /sources/{id}/contents` with repeated `content_version_id` parameters instead of polling this endpoint per item. + An item held for review by an Enforce governance policy reports `held_for_review: true`. With + `Seclai-Version: 2026-10-05` or later its `content_status` is `completed`; earlier versions report + `failed` with the hold as the `error`. + Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account. @@ -190,6 +198,10 @@ async def asyncio_detailed( /sources/{id}/contents` with repeated `content_version_id` parameters instead of polling this endpoint per item. + An item held for review by an Enforce governance policy reports `held_for_review: true`. With + `Seclai-Version: 2026-10-05` or later its `content_status` is `completed`; earlier versions report + `failed` with the hold as the `error`. + Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account. @@ -237,6 +249,10 @@ async def asyncio( /sources/{id}/contents` with repeated `content_version_id` parameters instead of polling this endpoint per item. + An item held for review by an Enforce governance policy reports `held_for_review: true`. With + `Seclai-Version: 2026-10-05` or later its `content_status` is `completed`; earlier versions report + `failed` with the hold as the `error`. + Auth & scoping: - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account. diff --git a/seclai/_generated/api/sources/list_email_source_rejections_api_api_sources_source_connection_id_email_rejections_get.py b/seclai/_generated/api/sources/list_email_source_rejections_api_api_sources_source_connection_id_email_rejections_get.py new file mode 100644 index 0000000..6409c88 --- /dev/null +++ b/seclai/_generated/api/sources/list_email_source_rejections_api_api_sources_source_connection_id_email_rejections_get.py @@ -0,0 +1,304 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.email_source_rejection_list_response import ( + EmailSourceRejectionListResponse, +) +from ...models.http_validation_error import HTTPValidationError +from ...models.service_unavailable_error import ServiceUnavailableError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + source_connection_id: UUID, + *, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(x_account_id, Unset): + headers["X-Account-Id"] = x_account_id + + if not isinstance(seclai_version, Unset): + headers["Seclai-Version"] = seclai_version + + params: dict[str, Any] = {} + + params["page"] = page + + params["limit"] = limit + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/sources/{source_connection_id}/email-rejections".format( + source_connection_id=quote(str(source_connection_id), safe=""), + ), + "params": params, + } + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + EmailSourceRejectionListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): + if response.status_code == 200: + response_200 = EmailSourceRejectionListResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if response.status_code == 503: + response_503 = ServiceUnavailableError.from_dict(response.json()) + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + EmailSourceRejectionListResponse | HTTPValidationError | ServiceUnavailableError +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + source_connection_id: UUID, + *, + client: AuthenticatedClient | Client, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + EmailSourceRejectionListResponse | HTTPValidationError | ServiceUnavailableError +]: + """List mail an email source refused + + List mail that an email content source refused, newest first. Each entry says who sent the message + and why it was refused, never its subject or body. A message refused as `unsafe_content` also has a + prompt-scan record, which keeps the scanned text. + + To accept a refused sender, add its `from_address` or that address's domain to the source's + `email_allowed_senders`. That only helps when `authenticated` is true. A `repeat_*` reason marks a + message the source received before; allowing its sender does not store it. + + Requires an account owner or administrator: a key or token bound to another member gets 403. Returns + 404 for a source that is not an email source. + + Args: + source_connection_id (UUID): + page (int | Unset): Page number. Default: 1. + limit (int | Unset): Items per page. Default: 20. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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[EmailSourceRejectionListResponse | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + source_connection_id=source_connection_id, + page=page, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + source_connection_id: UUID, + *, + client: AuthenticatedClient | Client, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + EmailSourceRejectionListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): + """List mail an email source refused + + List mail that an email content source refused, newest first. Each entry says who sent the message + and why it was refused, never its subject or body. A message refused as `unsafe_content` also has a + prompt-scan record, which keeps the scanned text. + + To accept a refused sender, add its `from_address` or that address's domain to the source's + `email_allowed_senders`. That only helps when `authenticated` is true. A `repeat_*` reason marks a + message the source received before; allowing its sender does not store it. + + Requires an account owner or administrator: a key or token bound to another member gets 403. Returns + 404 for a source that is not an email source. + + Args: + source_connection_id (UUID): + page (int | Unset): Page number. Default: 1. + limit (int | Unset): Items per page. Default: 20. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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: + EmailSourceRejectionListResponse | HTTPValidationError | ServiceUnavailableError + """ + + return sync_detailed( + source_connection_id=source_connection_id, + client=client, + page=page, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ).parsed + + +async def asyncio_detailed( + source_connection_id: UUID, + *, + client: AuthenticatedClient | Client, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> Response[ + EmailSourceRejectionListResponse | HTTPValidationError | ServiceUnavailableError +]: + """List mail an email source refused + + List mail that an email content source refused, newest first. Each entry says who sent the message + and why it was refused, never its subject or body. A message refused as `unsafe_content` also has a + prompt-scan record, which keeps the scanned text. + + To accept a refused sender, add its `from_address` or that address's domain to the source's + `email_allowed_senders`. That only helps when `authenticated` is true. A `repeat_*` reason marks a + message the source received before; allowing its sender does not store it. + + Requires an account owner or administrator: a key or token bound to another member gets 403. Returns + 404 for a source that is not an email source. + + Args: + source_connection_id (UUID): + page (int | Unset): Page number. Default: 1. + limit (int | Unset): Items per page. Default: 20. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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[EmailSourceRejectionListResponse | HTTPValidationError | ServiceUnavailableError] + """ + + kwargs = _get_kwargs( + source_connection_id=source_connection_id, + page=page, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + source_connection_id: UUID, + *, + client: AuthenticatedClient | Client, + page: int | Unset = 1, + limit: int | Unset = 20, + x_account_id: UUID | Unset = UNSET, + seclai_version: str | Unset = UNSET, +) -> ( + EmailSourceRejectionListResponse + | HTTPValidationError + | ServiceUnavailableError + | None +): + """List mail an email source refused + + List mail that an email content source refused, newest first. Each entry says who sent the message + and why it was refused, never its subject or body. A message refused as `unsafe_content` also has a + prompt-scan record, which keeps the scanned text. + + To accept a refused sender, add its `from_address` or that address's domain to the source's + `email_allowed_senders`. That only helps when `authenticated` is true. A `repeat_*` reason marks a + message the source received before; allowing its sender does not store it. + + Requires an account owner or administrator: a key or token bound to another member gets 403. Returns + 404 for a source that is not an email source. + + Args: + source_connection_id (UUID): + page (int | Unset): Page number. Default: 1. + limit (int | Unset): Items per page. Default: 20. + x_account_id (UUID | Unset): + seclai_version (str | Unset): + + 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: + EmailSourceRejectionListResponse | HTTPValidationError | ServiceUnavailableError + """ + + return ( + await asyncio_detailed( + source_connection_id=source_connection_id, + client=client, + page=page, + limit=limit, + x_account_id=x_account_id, + seclai_version=seclai_version, + ) + ).parsed diff --git a/seclai/_generated/api/sources/list_source_contents_api_sources_source_connection_id_contents_get.py b/seclai/_generated/api/sources/list_source_contents_api_sources_source_connection_id_contents_get.py index e5ad496..1d20696 100644 --- a/seclai/_generated/api/sources/list_source_contents_api_sources_source_connection_id_contents_get.py +++ b/seclai/_generated/api/sources/list_source_contents_api_sources_source_connection_id_contents_get.py @@ -150,6 +150,11 @@ def sync_detailed( the id `GET /contents/{id}` takes. - `content_status` reaches `completed` on success and `failed` on error, with the reason in `error`. The intermediate values are `pending`, `fetching`, `transcribing`, `scanning`, and `indexing`. + - An item an Enforce governance policy blocked at import is held for review: `held_for_review` is + `true` and `source_connection_content_version_id` stays `null` until a reviewer releases it. With + `Seclai-Version: 2026-10-05` or later it reports `completed`; earlier versions report it as `failed` + with the hold as the `error`. The `status` filter matches the item under `completed` on every + version. Parameters: - Pagination: `page` and `limit`. @@ -239,6 +244,11 @@ def sync( the id `GET /contents/{id}` takes. - `content_status` reaches `completed` on success and `failed` on error, with the reason in `error`. The intermediate values are `pending`, `fetching`, `transcribing`, `scanning`, and `indexing`. + - An item an Enforce governance policy blocked at import is held for review: `held_for_review` is + `true` and `source_connection_content_version_id` stays `null` until a reviewer releases it. With + `Seclai-Version: 2026-10-05` or later it reports `completed`; earlier versions report it as `failed` + with the hold as the `error`. The `status` filter matches the item under `completed` on every + version. Parameters: - Pagination: `page` and `limit`. @@ -320,6 +330,11 @@ async def asyncio_detailed( the id `GET /contents/{id}` takes. - `content_status` reaches `completed` on success and `failed` on error, with the reason in `error`. The intermediate values are `pending`, `fetching`, `transcribing`, `scanning`, and `indexing`. + - An item an Enforce governance policy blocked at import is held for review: `held_for_review` is + `true` and `source_connection_content_version_id` stays `null` until a reviewer releases it. With + `Seclai-Version: 2026-10-05` or later it reports `completed`; earlier versions report it as `failed` + with the hold as the `error`. The `status` filter matches the item under `completed` on every + version. Parameters: - Pagination: `page` and `limit`. @@ -407,6 +422,11 @@ async def asyncio( the id `GET /contents/{id}` takes. - `content_status` reaches `completed` on success and `failed` on error, with the reason in `error`. The intermediate values are `pending`, `fetching`, `transcribing`, `scanning`, and `indexing`. + - An item an Enforce governance policy blocked at import is held for review: `held_for_review` is + `true` and `source_connection_content_version_id` stays `null` until a reviewer releases it. With + `Seclai-Version: 2026-10-05` or later it reports `completed`; earlier versions report it as `failed` + with the hold as the `error`. The `status` filter matches the item under `completed` on every + version. Parameters: - Pagination: `page` and `limit`. diff --git a/seclai/_generated/api/sources/upload_file_to_source_api_sources_source_connection_id_upload_post.py b/seclai/_generated/api/sources/upload_file_to_source_api_sources_source_connection_id_upload_post.py index e818d9b..9fad008 100644 --- a/seclai/_generated/api/sources/upload_file_to_source_api_sources_source_connection_id_upload_post.py +++ b/seclai/_generated/api/sources/upload_file_to_source_api_sources_source_connection_id_upload_post.py @@ -92,22 +92,31 @@ def sync_detailed( before it is stored). **Supported MIME types:** + - `application/atom+xml` - `application/epub+zip` - `application/json` - `application/pdf` + - `application/rss+xml` + - `application/rtf` - `application/vnd.ms-excel` - `application/vnd.ms-outlook` - `application/vnd.ms-powerpoint` - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + - `application/x-ipynb+json` + - `application/xhtml+xml` - `application/xml` - `application/zip` + - `audio/aac` + - `audio/amr` - `audio/flac` - `audio/mp4` - `audio/mpeg` - `audio/ogg` + - `audio/opus` - `audio/wav` + - `audio/webm` - `image/bmp` - `image/gif` - `image/jpeg` @@ -115,14 +124,43 @@ def sync_detailed( - `image/svg+xml` - `image/tiff` - `image/webp` + - `message/rfc822` + - `text/calendar` - `text/csv` - `text/html` + - `text/javascript` - `text/markdown` - `text/plain` + - `text/tab-separated-values` + - `text/vcard` + - `text/vtt` + - `text/x-c` + - `text/x-c++` + - `text/x-csharp` + - `text/x-go` + - `text/x-ini` + - `text/x-java` + - `text/x-log` - `text/x-markdown` + - `text/x-php` + - `text/x-python` + - `text/x-ruby` + - `text/x-rust` + - `text/x-shellscript` + - `text/x-sql` + - `text/x-subrip` + - `text/x-tex` + - `text/x-toml` + - `text/x-typescript` - `text/xml` + - `text/yaml` + - `video/3gpp` + - `video/mp2t` - `video/mp4` + - `video/mpeg` - `video/quicktime` + - `video/webm` + - `video/x-matroska` - `video/x-msvideo` Notes: @@ -153,6 +191,8 @@ def sync_detailed( a whole batch, to follow each item through to `completed` or `failed`. - On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes. + - An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is + not in the source and its id stays `null` unless a reviewer releases it, so stop polling. Args: source_connection_id (str): @@ -198,22 +238,31 @@ def sync( before it is stored). **Supported MIME types:** + - `application/atom+xml` - `application/epub+zip` - `application/json` - `application/pdf` + - `application/rss+xml` + - `application/rtf` - `application/vnd.ms-excel` - `application/vnd.ms-outlook` - `application/vnd.ms-powerpoint` - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + - `application/x-ipynb+json` + - `application/xhtml+xml` - `application/xml` - `application/zip` + - `audio/aac` + - `audio/amr` - `audio/flac` - `audio/mp4` - `audio/mpeg` - `audio/ogg` + - `audio/opus` - `audio/wav` + - `audio/webm` - `image/bmp` - `image/gif` - `image/jpeg` @@ -221,14 +270,43 @@ def sync( - `image/svg+xml` - `image/tiff` - `image/webp` + - `message/rfc822` + - `text/calendar` - `text/csv` - `text/html` + - `text/javascript` - `text/markdown` - `text/plain` + - `text/tab-separated-values` + - `text/vcard` + - `text/vtt` + - `text/x-c` + - `text/x-c++` + - `text/x-csharp` + - `text/x-go` + - `text/x-ini` + - `text/x-java` + - `text/x-log` - `text/x-markdown` + - `text/x-php` + - `text/x-python` + - `text/x-ruby` + - `text/x-rust` + - `text/x-shellscript` + - `text/x-sql` + - `text/x-subrip` + - `text/x-tex` + - `text/x-toml` + - `text/x-typescript` - `text/xml` + - `text/yaml` + - `video/3gpp` + - `video/mp2t` - `video/mp4` + - `video/mpeg` - `video/quicktime` + - `video/webm` + - `video/x-matroska` - `video/x-msvideo` Notes: @@ -259,6 +337,8 @@ def sync( a whole batch, to follow each item through to `completed` or `failed`. - On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes. + - An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is + not in the source and its id stays `null` unless a reviewer releases it, so stop polling. Args: source_connection_id (str): @@ -299,22 +379,31 @@ async def asyncio_detailed( before it is stored). **Supported MIME types:** + - `application/atom+xml` - `application/epub+zip` - `application/json` - `application/pdf` + - `application/rss+xml` + - `application/rtf` - `application/vnd.ms-excel` - `application/vnd.ms-outlook` - `application/vnd.ms-powerpoint` - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + - `application/x-ipynb+json` + - `application/xhtml+xml` - `application/xml` - `application/zip` + - `audio/aac` + - `audio/amr` - `audio/flac` - `audio/mp4` - `audio/mpeg` - `audio/ogg` + - `audio/opus` - `audio/wav` + - `audio/webm` - `image/bmp` - `image/gif` - `image/jpeg` @@ -322,14 +411,43 @@ async def asyncio_detailed( - `image/svg+xml` - `image/tiff` - `image/webp` + - `message/rfc822` + - `text/calendar` - `text/csv` - `text/html` + - `text/javascript` - `text/markdown` - `text/plain` + - `text/tab-separated-values` + - `text/vcard` + - `text/vtt` + - `text/x-c` + - `text/x-c++` + - `text/x-csharp` + - `text/x-go` + - `text/x-ini` + - `text/x-java` + - `text/x-log` - `text/x-markdown` + - `text/x-php` + - `text/x-python` + - `text/x-ruby` + - `text/x-rust` + - `text/x-shellscript` + - `text/x-sql` + - `text/x-subrip` + - `text/x-tex` + - `text/x-toml` + - `text/x-typescript` - `text/xml` + - `text/yaml` + - `video/3gpp` + - `video/mp2t` - `video/mp4` + - `video/mpeg` - `video/quicktime` + - `video/webm` + - `video/x-matroska` - `video/x-msvideo` Notes: @@ -360,6 +478,8 @@ async def asyncio_detailed( a whole batch, to follow each item through to `completed` or `failed`. - On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes. + - An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is + not in the source and its id stays `null` unless a reviewer releases it, so stop polling. Args: source_connection_id (str): @@ -403,22 +523,31 @@ async def asyncio( before it is stored). **Supported MIME types:** + - `application/atom+xml` - `application/epub+zip` - `application/json` - `application/pdf` + - `application/rss+xml` + - `application/rtf` - `application/vnd.ms-excel` - `application/vnd.ms-outlook` - `application/vnd.ms-powerpoint` - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + - `application/x-ipynb+json` + - `application/xhtml+xml` - `application/xml` - `application/zip` + - `audio/aac` + - `audio/amr` - `audio/flac` - `audio/mp4` - `audio/mpeg` - `audio/ogg` + - `audio/opus` - `audio/wav` + - `audio/webm` - `image/bmp` - `image/gif` - `image/jpeg` @@ -426,14 +555,43 @@ async def asyncio( - `image/svg+xml` - `image/tiff` - `image/webp` + - `message/rfc822` + - `text/calendar` - `text/csv` - `text/html` + - `text/javascript` - `text/markdown` - `text/plain` + - `text/tab-separated-values` + - `text/vcard` + - `text/vtt` + - `text/x-c` + - `text/x-c++` + - `text/x-csharp` + - `text/x-go` + - `text/x-ini` + - `text/x-java` + - `text/x-log` - `text/x-markdown` + - `text/x-php` + - `text/x-python` + - `text/x-ruby` + - `text/x-rust` + - `text/x-shellscript` + - `text/x-sql` + - `text/x-subrip` + - `text/x-tex` + - `text/x-toml` + - `text/x-typescript` - `text/xml` + - `text/yaml` + - `video/3gpp` + - `video/mp2t` - `video/mp4` + - `video/mpeg` - `video/quicktime` + - `video/webm` + - `video/x-matroska` - `video/x-msvideo` Notes: @@ -464,6 +622,8 @@ async def asyncio( a whole batch, to follow each item through to `completed` or `failed`. - On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes. + - An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is + not in the source and its id stays `null` unless a reviewer releases it, so stop polling. Args: source_connection_id (str): diff --git a/seclai/_generated/api/sources/upload_inline_text_to_source_api_sources_source_connection_id_post.py b/seclai/_generated/api/sources/upload_inline_text_to_source_api_sources_source_connection_id_post.py index 67220e5..4bbf625 100644 --- a/seclai/_generated/api/sources/upload_inline_text_to_source_api_sources_source_connection_id_post.py +++ b/seclai/_generated/api/sources/upload_inline_text_to_source_api_sources_source_connection_id_post.py @@ -118,6 +118,8 @@ def sync_detailed( a whole batch, to follow each item through to `completed` or `failed`. - On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes. + - An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is + not in the source and its id stays `null` unless a reviewer releases it, so stop polling. Args: source_connection_id (UUID): @@ -189,6 +191,8 @@ def sync( a whole batch, to follow each item through to `completed` or `failed`. - On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes. + - An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is + not in the source and its id stays `null` unless a reviewer releases it, so stop polling. Args: source_connection_id (UUID): @@ -255,6 +259,8 @@ async def asyncio_detailed( a whole batch, to follow each item through to `completed` or `failed`. - On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes. + - An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is + not in the source and its id stays `null` unless a reviewer releases it, so stop polling. Args: source_connection_id (UUID): @@ -324,6 +330,8 @@ async def asyncio( a whole batch, to follow each item through to `completed` or `failed`. - On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes. + - An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is + not in the source and its id stays `null` unless a reviewer releases it, so stop polling. Args: source_connection_id (UUID): diff --git a/seclai/_generated/models/__init__.py b/seclai/_generated/models/__init__.py index 055d8a9..64fbf20 100644 --- a/seclai/_generated/models/__init__.py +++ b/seclai/_generated/models/__init__.py @@ -1,5 +1,7 @@ """Contains all the data models used in inputs/outputs""" +from .accepted_attachment_slot import AcceptedAttachmentSlot +from .accepted_attachments_response import AcceptedAttachmentsResponse from .add_comment_request import AddCommentRequest from .add_conversation_turn_request import AddConversationTurnRequest from .add_conversation_turn_request_actions_taken_type_0 import ( @@ -108,6 +110,13 @@ from .compaction_test_response_model import CompactionTestResponseModel from .compatible_run_list_response import CompatibleRunListResponse from .compatible_run_response import CompatibleRunResponse +from .content_attachment_detail_response import ContentAttachmentDetailResponse +from .content_attachment_detail_response_metadata import ( + ContentAttachmentDetailResponseMetadata, +) +from .content_attachment_response import ContentAttachmentResponse +from .content_attachment_response_metadata import ContentAttachmentResponseMetadata +from .content_attachments_list_response import ContentAttachmentsListResponse from .content_detail_response import ContentDetailResponse from .content_detail_response_metadata_type_0_item import ( ContentDetailResponseMetadataType0Item, @@ -151,6 +160,11 @@ from .effort_options_response import EffortOptionsResponse from .email_domain_response import EmailDomainResponse from .email_domains_list_response import EmailDomainsListResponse +from .email_source_rejection_list_response import EmailSourceRejectionListResponse +from .email_source_rejection_response import EmailSourceRejectionResponse +from .email_source_rejection_response_auth_verdicts import ( + EmailSourceRejectionResponseAuthVerdicts, +) from .email_trigger_config_response import EmailTriggerConfigResponse from .embedding_modality_rate_response import EmbeddingModalityRateResponse from .embedding_model_list_response import EmbeddingModelListResponse @@ -327,8 +341,11 @@ from .service_unavailable_error import ServiceUnavailableError from .service_unavailable_error_error import ServiceUnavailableErrorError from .service_unavailable_error_error_code import ServiceUnavailableErrorErrorCode +from .set_accepted_attachments_request import SetAcceptedAttachmentsRequest from .set_auto_block_mode_request import SetAutoBlockModeRequest from .set_email_trigger_config_request import SetEmailTriggerConfigRequest +from .skipped_attachment_reason import SkippedAttachmentReason +from .skipped_attachment_response import SkippedAttachmentResponse from .solution_agent_response import SolutionAgentResponse from .solution_conversation_response import SolutionConversationResponse from .solution_conversation_response_actions_taken_type_0 import ( @@ -392,6 +409,8 @@ from .variant_option_response import VariantOptionResponse __all__ = ( + "AcceptedAttachmentSlot", + "AcceptedAttachmentsResponse", "AddCommentRequest", "AddConversationTurnRequest", "AddConversationTurnRequestActionsTakenType0", @@ -474,6 +493,11 @@ "CompactionTestResponseModel", "CompatibleRunListResponse", "CompatibleRunResponse", + "ContentAttachmentDetailResponse", + "ContentAttachmentDetailResponseMetadata", + "ContentAttachmentResponse", + "ContentAttachmentResponseMetadata", + "ContentAttachmentsListResponse", "ContentDetailResponse", "ContentDetailResponseMetadataType0Item", "ContentEmbeddingResponse", @@ -505,6 +529,9 @@ "EffortOptionsResponse", "EmailDomainResponse", "EmailDomainsListResponse", + "EmailSourceRejectionListResponse", + "EmailSourceRejectionResponse", + "EmailSourceRejectionResponseAuthVerdicts", "EmailTriggerConfigResponse", "EmbeddingModalityRateResponse", "EmbeddingModelListResponse", @@ -625,8 +652,11 @@ "ServiceUnavailableError", "ServiceUnavailableErrorError", "ServiceUnavailableErrorErrorCode", + "SetAcceptedAttachmentsRequest", "SetAutoBlockModeRequest", "SetEmailTriggerConfigRequest", + "SkippedAttachmentReason", + "SkippedAttachmentResponse", "SolutionAgentResponse", "SolutionConversationResponse", "SolutionConversationResponseActionsTakenType0", diff --git a/seclai/_generated/models/accepted_attachment_slot.py b/seclai/_generated/models/accepted_attachment_slot.py new file mode 100644 index 0000000..61757ef --- /dev/null +++ b/seclai/_generated/models/accepted_attachment_slot.py @@ -0,0 +1,127 @@ +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="AcceptedAttachmentSlot") + + +@_attrs_define +class AcceptedAttachmentSlot: + """ + Attributes: + name (str): Lowercase letters, digits and underscores, starting with a letter. Steps reference the files as + ``{{agent.attachments.}}``. + content_types (list[str] | Unset): Accepted types, e.g. ``application/pdf`` or ``image/*``; empty accepts any + type. + label (None | str | Unset): Shown to people. + max_ (int | None | Unset): Most files a run may include; empty is no limit. + min_ (int | Unset): Fewest files a run must include; fewer refuses the run, except on an email trigger set to + run anyway, which lists the shortfall. Default: 0. + name_pattern (None | str | Unset): Filename glob a file must also match, ignoring case. + """ + + name: str + content_types: list[str] | Unset = UNSET + label: None | str | Unset = UNSET + max_: int | None | Unset = UNSET + min_: int | Unset = 0 + name_pattern: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + content_types: list[str] | Unset = UNSET + if not isinstance(self.content_types, Unset): + content_types = self.content_types + + label: None | str | Unset + if isinstance(self.label, Unset): + label = UNSET + else: + label = self.label + + max_: int | None | Unset + if isinstance(self.max_, Unset): + max_ = UNSET + else: + max_ = self.max_ + + min_ = self.min_ + + name_pattern: None | str | Unset + if isinstance(self.name_pattern, Unset): + name_pattern = UNSET + else: + name_pattern = self.name_pattern + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if content_types is not UNSET: + field_dict["content_types"] = content_types + if label is not UNSET: + field_dict["label"] = label + if max_ is not UNSET: + field_dict["max"] = max_ + if min_ is not UNSET: + field_dict["min"] = min_ + if name_pattern is not UNSET: + field_dict["name_pattern"] = name_pattern + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + content_types = cast(list[str], d.pop("content_types", UNSET)) + + def _parse_label(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + label = _parse_label(d.pop("label", UNSET)) + + def _parse_max_(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + max_ = _parse_max_(d.pop("max", UNSET)) + + min_ = d.pop("min", UNSET) + + def _parse_name_pattern(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + name_pattern = _parse_name_pattern(d.pop("name_pattern", UNSET)) + + accepted_attachment_slot = cls( + name=name, + content_types=content_types, + label=label, + max_=max_, + min_=min_, + name_pattern=name_pattern, + ) + + return accepted_attachment_slot diff --git a/seclai/_generated/models/accepted_attachments_response.py b/seclai/_generated/models/accepted_attachments_response.py new file mode 100644 index 0000000..cff7076 --- /dev/null +++ b/seclai/_generated/models/accepted_attachments_response.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.accepted_attachment_slot import AcceptedAttachmentSlot + + +T = TypeVar("T", bound="AcceptedAttachmentsResponse") + + +@_attrs_define +class AcceptedAttachmentsResponse: + """ + Attributes: + accepted_attachments (list[AcceptedAttachmentSlot]): + agent_id (UUID): + trigger_id (UUID): + """ + + accepted_attachments: list[AcceptedAttachmentSlot] + agent_id: UUID + trigger_id: UUID + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + accepted_attachments = [] + for accepted_attachments_item_data in self.accepted_attachments: + accepted_attachments_item = accepted_attachments_item_data.to_dict() + accepted_attachments.append(accepted_attachments_item) + + agent_id = str(self.agent_id) + + trigger_id = str(self.trigger_id) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "accepted_attachments": accepted_attachments, + "agent_id": agent_id, + "trigger_id": trigger_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.accepted_attachment_slot import AcceptedAttachmentSlot + + d = dict(src_dict) + accepted_attachments = [] + _accepted_attachments = d.pop("accepted_attachments") + for accepted_attachments_item_data in _accepted_attachments: + accepted_attachments_item = AcceptedAttachmentSlot.from_dict( + accepted_attachments_item_data + ) + + accepted_attachments.append(accepted_attachments_item) + + agent_id = UUID(d.pop("agent_id")) + + trigger_id = UUID(d.pop("trigger_id")) + + accepted_attachments_response = cls( + accepted_attachments=accepted_attachments, + agent_id=agent_id, + trigger_id=trigger_id, + ) + + accepted_attachments_response.additional_properties = d + return accepted_attachments_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/seclai/_generated/models/agent_attachment_refs_api_response.py b/seclai/_generated/models/agent_attachment_refs_api_response.py index 5df7f52..f7a9cf0 100644 --- a/seclai/_generated/models/agent_attachment_refs_api_response.py +++ b/seclai/_generated/models/agent_attachment_refs_api_response.py @@ -9,6 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.accepted_attachment_slot import AcceptedAttachmentSlot from ..models.attachment_refs_source_api_summary import ( AttachmentRefsSourceApiSummary, ) @@ -19,27 +20,37 @@ @_attrs_define class AgentAttachmentRefsApiResponse: - """Static attachment-reference contract for an agent. + """The input attachments an agent's trigger declares. - Mirrors the MCP ``get_agent_attachment_references`` tool: returns - what files (if any) an agent's templates expect on a run so API - consumers can stage uploads correctly before calling + Mirrors the MCP ``get_agent_attachment_references`` tool, so API + consumers can stage uploads that fit before calling ``POST /agents/{id}/runs``. Attributes: - requires_uploads (bool): When ``false`` the agent's definition does NOT reference any uploaded attachments — - ``POST /agents/{id}/upload-input`` will reject with HTTP 400. When ``true`` the ``agent`` block lists the - specific selectors a run-time batch must satisfy. + requires_uploads (bool): When ``false`` the agent takes no files through the API — it has no ``dynamic_input`` + trigger, or that trigger declares no attachments — and ``POST /agents/{id}/upload-input`` will reject with HTTP + 400. When ``true`` ``accepted_attachments`` lists what a run's files must fit. + accepted_attachments (list[AcceptedAttachmentSlot] | Unset): The attachments the agent's trigger declares. A + run's files are each assigned to one; a file none accepts, or an attachment with fewer files than its ``min``, + rejects the run with HTTP 400. Steps reference one as ``{{agent.attachments.}}``. agent (AttachmentRefsSourceApiSummary | Unset): Per-source attachment-reference summary. """ requires_uploads: bool + accepted_attachments: list[AcceptedAttachmentSlot] | Unset = UNSET agent: AttachmentRefsSourceApiSummary | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: requires_uploads = self.requires_uploads + accepted_attachments: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.accepted_attachments, Unset): + accepted_attachments = [] + for accepted_attachments_item_data in self.accepted_attachments: + accepted_attachments_item = accepted_attachments_item_data.to_dict() + accepted_attachments.append(accepted_attachments_item) + agent: dict[str, Any] | Unset = UNSET if not isinstance(self.agent, Unset): agent = self.agent.to_dict() @@ -51,6 +62,8 @@ def to_dict(self) -> dict[str, Any]: "requires_uploads": requires_uploads, } ) + if accepted_attachments is not UNSET: + field_dict["accepted_attachments"] = accepted_attachments if agent is not UNSET: field_dict["agent"] = agent @@ -58,6 +71,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.accepted_attachment_slot import AcceptedAttachmentSlot from ..models.attachment_refs_source_api_summary import ( AttachmentRefsSourceApiSummary, ) @@ -65,6 +79,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) requires_uploads = d.pop("requires_uploads") + _accepted_attachments = d.pop("accepted_attachments", UNSET) + accepted_attachments: list[AcceptedAttachmentSlot] | Unset = UNSET + if _accepted_attachments is not UNSET: + accepted_attachments = [] + for accepted_attachments_item_data in _accepted_attachments: + accepted_attachments_item = AcceptedAttachmentSlot.from_dict( + accepted_attachments_item_data + ) + + accepted_attachments.append(accepted_attachments_item) + _agent = d.pop("agent", UNSET) agent: AttachmentRefsSourceApiSummary | Unset if isinstance(_agent, Unset): @@ -74,6 +99,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: agent_attachment_refs_api_response = cls( requires_uploads=requires_uploads, + accepted_attachments=accepted_attachments, agent=agent, ) diff --git a/seclai/_generated/models/agent_run_request.py b/seclai/_generated/models/agent_run_request.py index 7c11e7b..8ca3910 100644 --- a/seclai/_generated/models/agent_run_request.py +++ b/seclai/_generated/models/agent_run_request.py @@ -23,25 +23,24 @@ class AgentRunRequest: input_ (None | str | Unset): Input to provide to the agent upon running for agents with dynamic triggers. input_upload_id (None | Unset | UUID): ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` — use that field - to attach multiple files. May be combined with ``input``: the prompt text leads and the file's extracted text - follows under a ``# {filename}`` heading. - - **Attachment visibility:** a step only sees the upload when its template references the input — via - ``{{input}}`` / ``{{agent.input}}`` / ``{{step..input|output}}`` (implicit, all attachments) or the - ``{{attachments[…]}}`` family (explicit narrowing — e.g. ``{{attachments[0]}}``, ``{{attachments[*.pdf]}}``). - - **Per-batch validation:** every selector the agent's definition declares must be satisfied or the run is - rejected with HTTP 400. Exact-name selectors require that filename to be present; indexed selectors require at - least N+1 files; glob patterns require at least one matching filename. - input_upload_ids (list[UUID] | None | Unset): IDs of multiple previously uploaded files. Each upload's extracted - text is concatenated under a heading; each upload's binary is surfaced as a separate ``MediaAttachment`` so - multi-modal prompt steps reason over all files at once. Steps narrow visibility via ``{{attachments[…]}}`` - selectors (by index, filename, or fnmatch glob). The batch must satisfy every selector the agent declares — - exact names, indexed references (length must exceed the highest index), and glob patterns (each pattern needs at - least one match). Mismatches return HTTP 400 with the unmet requirements listed. Mutually exclusive with - ``input_upload_id`` (two spellings of the same batch), but may be combined with ``input`` — the prompt text - leads and the per-file sections follow, so "a photo plus a sentence about it" needs no synthetic text upload. - Max 20 uploads per run. + to attach multiple files. May be combined with ``input``: the prompt text leads and the file follows under a ``# + {filename}`` heading (before ``Seclai-Version: 2026-10-16``, followed by its extracted text). + + **Which steps receive it:** a step that sends or stores files takes the files its ``attachments`` field selects. + An LLM step (``prompt_call``, ``extract_data``, ``evaluate_step``) takes the files its ``attachments`` field + names, or else the files its plain-text templates reference: ``{{agent.attachments.}}`` for one attachment + the trigger declares, or ``{{agent.input}}`` for every upload unless a template also names an agent attachment. + + **Per-batch validation:** the batch must fit the trigger's ``accepted_attachments`` — every file fits one + declared attachment and each attachment gets at least its ``min`` files — or the run is rejected with HTTP 400. + input_upload_ids (list[UUID] | None | Unset): IDs of multiple previously uploaded files. Each upload gets a + heading in ``input`` (before ``Seclai-Version: 2026-10-16``, followed by its extracted text); each upload + reaches steps as a separate file (before ``Seclai-Version: 2026-10-16``, a text upload in the open ``files`` + attachment is written into ``input`` instead). Steps choose files as described under ``input_upload_id``. The + batch must fit the trigger's ``accepted_attachments``; a mismatch returns HTTP 400 listing what does not fit. + Mutually exclusive with ``input_upload_id`` (two spellings of the same batch), but may be combined with + ``input`` — the prompt text leads and the per-file sections follow, so "a photo plus a sentence about it" needs + no synthetic text upload. Max 20 uploads per run. metadata (AgentRunRequestMetadataType0 | None | Unset): Metadata to make available for string substitution expressions in agent tasks. priority (bool | Unset): If true, the agent run will be treated as priority execution. Default: False. @@ -49,7 +48,7 @@ class AgentRunRequest: are re-resolved server-side from the source run (which must belong to this account and agent) — you do not re- upload them. Combine with ``input`` to change the text while keeping the files. A fresh upload batch (``input_upload_id(s)``) takes precedence and disables replay. Binaries swept by retention fall back to their - extracted text. + extracted text. Files the trigger's ``accepted_attachments`` no longer accepts are left out. """ input_: None | str | Unset = UNSET diff --git a/seclai/_generated/models/agent_run_response.py b/seclai/_generated/models/agent_run_response.py index 10f95ba..7842585 100644 --- a/seclai/_generated/models/agent_run_response.py +++ b/seclai/_generated/models/agent_run_response.py @@ -34,7 +34,7 @@ class AgentRunResponse: input_ (None | str): Input provided to the agent for this run. output (None | str): The run's output text; its files are in `attachments`. Below `Seclai-Version: 2026-09-30` an output that has files is instead the manifest JSON `{schema, text, attachments: [{storage_key, mime, name, - label, bytes}]}`; `bytes` is absent on runs made before that version shipped. + label, bytes}]}`; `bytes` can be `null` on runs made before that version shipped. priority (bool): Indicates if the run was treated as a priority execution. run_id (str): Unique identifier for the agent run. status (PendingProcessingCompletedFailedStatus): @@ -61,7 +61,8 @@ class AgentRunResponse: requested. trace_purged_at (datetime.datetime | None | Unset): When this run's trace content was deleted under the account's agent-trace retention window. Non-null means `input`, `output` and every step's and tool call's I/O - are null **by design** and will never be available again — the run aged out, it did not fail. Branch on this + are null **by design** and will never be available again — the run aged out, it did not fail. A tool call's + `error` may be null as well, so a failed tool call can report its status without a message. Branch on this rather than on a null `output`: a run that genuinely produced nothing looks identical. Status, timing and credits remain accurate. wait_ms (int | None | Unset): Cumulative milliseconds the run was parked on standard-mode wait steps. diff --git a/seclai/_generated/models/agent_run_step_response.py b/seclai/_generated/models/agent_run_step_response.py index 74a7327..0617c86 100644 --- a/seclai/_generated/models/agent_run_step_response.py +++ b/seclai/_generated/models/agent_run_step_response.py @@ -41,8 +41,8 @@ class AgentRunStepResponse: produced none, for steps run before files were listed here, and once the run's trace is purged. tool_calls (list[AgentRunToolCallResponse] | Unset): LLM tool calls made during this step (prompt_call steps only), ordered by execution. Empty for steps that invoked no tools. - warnings (list[str] | None | Unset): Authoring problems the step ran into, whether or not it then failed, such - as a file name selector that matched none of its source's files. + warnings (list[str] | None | Unset): Problems the step ran into, whether or not it then failed, such as a file + name selector that matched none of its source's files, or a model that returned no answer. """ agent_step_id: str diff --git a/seclai/_generated/models/agent_run_stream_request.py b/seclai/_generated/models/agent_run_stream_request.py index 003fb80..2178bec 100644 --- a/seclai/_generated/models/agent_run_stream_request.py +++ b/seclai/_generated/models/agent_run_stream_request.py @@ -22,21 +22,25 @@ class AgentRunStreamRequest: """ Attributes: + include_reasoning (bool | Unset): Receive `stream_reasoning` events carrying the model's reasoning while it + thinks. They are sent only for a `streaming_result` step whose author enabled `show_reasoning`, and never when a + governance policy redacts that step. Default: False. input_ (None | str | Unset): Input to provide to the agent upon running for agents with dynamic triggers. input_upload_id (None | Unset | UUID): ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` — use that field - to attach multiple files. May be combined with ``input``. Subject to the same per-batch attachment-selector - validation as the non-streaming endpoint. + to attach multiple files. May be combined with ``input``. Must fit the trigger's ``accepted_attachments``, as on + the non-streaming endpoint. input_upload_ids (list[UUID] | None | Unset): IDs of multiple previously uploaded files. See the non-streaming - endpoint for full semantics, including per-batch selector validation (exact names, indexed references, and glob - patterns must all be satisfied or the run is rejected with HTTP 400) and combining the batch with ``input`` - prompt text. Max 20. + endpoint for full semantics, including fitting the trigger's ``accepted_attachments`` (else HTTP 400) and + combining the batch with ``input`` prompt text. Max 20. metadata (AgentRunStreamRequestMetadataType0 | None | Unset): Metadata to make available for string substitution expressions in agent tasks. replay_of_run_id (None | Unset | UUID): Re-run reusing a prior run's uploaded input files (re-resolved server- side from the source run, which must belong to this account and agent). A fresh upload batch takes precedence. + Files the trigger's ``accepted_attachments`` no longer accepts are left out. """ + include_reasoning: bool | Unset = False input_: None | str | Unset = UNSET input_upload_id: None | Unset | UUID = UNSET input_upload_ids: list[UUID] | None | Unset = UNSET @@ -49,6 +53,8 @@ def to_dict(self) -> dict[str, Any]: AgentRunStreamRequestMetadataType0, ) + include_reasoning = self.include_reasoning + input_: None | str | Unset if isinstance(self.input_, Unset): input_ = UNSET @@ -94,6 +100,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if include_reasoning is not UNSET: + field_dict["include_reasoning"] = include_reasoning if input_ is not UNSET: field_dict["input"] = input_ if input_upload_id is not UNSET: @@ -114,6 +122,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) + include_reasoning = d.pop("include_reasoning", UNSET) def _parse_input_(data: object) -> None | str | Unset: if data is None: @@ -202,6 +211,7 @@ def _parse_replay_of_run_id(data: object) -> None | Unset | UUID: replay_of_run_id = _parse_replay_of_run_id(d.pop("replay_of_run_id", UNSET)) agent_run_stream_request = cls( + include_reasoning=include_reasoning, input_=input_, input_upload_id=input_upload_id, input_upload_ids=input_upload_ids, diff --git a/seclai/_generated/models/agent_summary_response.py b/seclai/_generated/models/agent_summary_response.py index ed8789b..52a6f0a 100644 --- a/seclai/_generated/models/agent_summary_response.py +++ b/seclai/_generated/models/agent_summary_response.py @@ -46,6 +46,8 @@ class AgentSummaryResponse: retry_on_failure (bool | Unset): Whether to retry on evaluation failure. Default: True. sampling_config (AgentSummaryResponseSamplingConfigType0 | None | Unset): Sampling configuration for sample_and_flag mode. + trigger_id (None | str | Unset): ID of the agent's trigger, for the `/agents/{agent_id}/triggers/{trigger_id}/…` + endpoints such as `accepted-attachments` and `email-config`. trigger_type (None | str | Unset): Trigger type for the agent. """ @@ -66,6 +68,7 @@ class AgentSummaryResponse: prompt_model_auto_upgrade_strategy: str | Unset = "none" retry_on_failure: bool | Unset = True sampling_config: AgentSummaryResponseSamplingConfigType0 | None | Unset = UNSET + trigger_id: None | str | Unset = UNSET trigger_type: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -148,6 +151,12 @@ def to_dict(self) -> dict[str, Any]: else: sampling_config = self.sampling_config + trigger_id: None | str | Unset + if isinstance(self.trigger_id, Unset): + trigger_id = UNSET + else: + trigger_id = self.trigger_id + trigger_type: None | str | Unset if isinstance(self.trigger_type, Unset): trigger_type = UNSET @@ -195,6 +204,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["retry_on_failure"] = retry_on_failure if sampling_config is not UNSET: field_dict["sampling_config"] = sampling_config + if trigger_id is not UNSET: + field_dict["trigger_id"] = trigger_id if trigger_type is not UNSET: field_dict["trigger_type"] = trigger_type @@ -338,6 +349,15 @@ def _parse_sampling_config( sampling_config = _parse_sampling_config(d.pop("sampling_config", UNSET)) + def _parse_trigger_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + trigger_id = _parse_trigger_id(d.pop("trigger_id", UNSET)) + def _parse_trigger_type(data: object) -> None | str | Unset: if data is None: return data @@ -365,6 +385,7 @@ def _parse_trigger_type(data: object) -> None | str | Unset: prompt_model_auto_upgrade_strategy=prompt_model_auto_upgrade_strategy, retry_on_failure=retry_on_failure, sampling_config=sampling_config, + trigger_id=trigger_id, trigger_type=trigger_type, ) diff --git a/seclai/_generated/models/content_attachment_detail_response.py b/seclai/_generated/models/content_attachment_detail_response.py new file mode 100644 index 0000000..2d95ff0 --- /dev/null +++ b/seclai/_generated/models/content_attachment_detail_response.py @@ -0,0 +1,216 @@ +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.content_attachment_detail_response_metadata import ( + ContentAttachmentDetailResponseMetadata, + ) + + +T = TypeVar("T", bound="ContentAttachmentDetailResponse") + + +@_attrs_define +class ContentAttachmentDetailResponse: + """One attached file, with the text indexed from it. + + Attributes: + content_type (str): MIME type of the attached file. + created_at (str): When the file was first attached. + file_withheld (None | str): Why the file's bytes are not served, or null when they are: + `blocked_by_governance_policy`, `redacted_by_governance_policy` (any text below is the redacted text), or + `pending_screening`. + id (str): The attachment's id, which the single-attachment endpoints take. + indexed (bool): Whether indexing the file for search was asked for. + indexing_error (None | str): Why the file was not indexed, when `indexing_status` is `failed`. + indexing_status (None | str): `pending`, `completed` or `failed`; null when indexing was not asked for. Search + finds the file only when `completed`. + key (str): The attachment's key, unique within the item. + metadata (ContentAttachmentDetailResponseMetadata): What is known about the file beyond its bytes. An image + extracted from a PDF carries its `page_number`, and `page_render: true` when it is a render of the whole page. + An image or video from a web page carries `source_url` (the address it was fetched from), `position` (its place + among the media the page listed, from 0) and, when the page gave one, `alt_text`. Empty for most files. A + retrieval metadata filter matches these keys, except `alt_text`, which is indexed as the attachment's text. + size_bytes (int): Size of the attached file in bytes. + text_content (None | str): The requested range of the text the file is indexed by; null when the file has no + completed index or was indexed without text. + text_content_end (int): + text_content_start (int): + text_content_total_length (int): + updated_at (str): When the attachment last changed. + """ + + content_type: str + created_at: str + file_withheld: None | str + id: str + indexed: bool + indexing_error: None | str + indexing_status: None | str + key: str + metadata: ContentAttachmentDetailResponseMetadata + size_bytes: int + text_content: None | str + text_content_end: int + text_content_start: int + text_content_total_length: int + updated_at: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + content_type = self.content_type + + created_at = self.created_at + + file_withheld: None | str + file_withheld = self.file_withheld + + id = self.id + + indexed = self.indexed + + indexing_error: None | str + indexing_error = self.indexing_error + + indexing_status: None | str + indexing_status = self.indexing_status + + key = self.key + + metadata = self.metadata.to_dict() + + size_bytes = self.size_bytes + + text_content: None | str + text_content = self.text_content + + text_content_end = self.text_content_end + + text_content_start = self.text_content_start + + text_content_total_length = self.text_content_total_length + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "content_type": content_type, + "created_at": created_at, + "file_withheld": file_withheld, + "id": id, + "indexed": indexed, + "indexing_error": indexing_error, + "indexing_status": indexing_status, + "key": key, + "metadata": metadata, + "size_bytes": size_bytes, + "text_content": text_content, + "text_content_end": text_content_end, + "text_content_start": text_content_start, + "text_content_total_length": text_content_total_length, + "updated_at": updated_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.content_attachment_detail_response_metadata import ( + ContentAttachmentDetailResponseMetadata, + ) + + d = dict(src_dict) + content_type = d.pop("content_type") + + created_at = d.pop("created_at") + + def _parse_file_withheld(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + file_withheld = _parse_file_withheld(d.pop("file_withheld")) + + id = d.pop("id") + + indexed = d.pop("indexed") + + def _parse_indexing_error(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + indexing_error = _parse_indexing_error(d.pop("indexing_error")) + + def _parse_indexing_status(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + indexing_status = _parse_indexing_status(d.pop("indexing_status")) + + key = d.pop("key") + + metadata = ContentAttachmentDetailResponseMetadata.from_dict(d.pop("metadata")) + + size_bytes = d.pop("size_bytes") + + def _parse_text_content(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + text_content = _parse_text_content(d.pop("text_content")) + + text_content_end = d.pop("text_content_end") + + text_content_start = d.pop("text_content_start") + + text_content_total_length = d.pop("text_content_total_length") + + updated_at = d.pop("updated_at") + + content_attachment_detail_response = cls( + content_type=content_type, + created_at=created_at, + file_withheld=file_withheld, + id=id, + indexed=indexed, + indexing_error=indexing_error, + indexing_status=indexing_status, + key=key, + metadata=metadata, + size_bytes=size_bytes, + text_content=text_content, + text_content_end=text_content_end, + text_content_start=text_content_start, + text_content_total_length=text_content_total_length, + updated_at=updated_at, + ) + + content_attachment_detail_response.additional_properties = d + return content_attachment_detail_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/seclai/_generated/models/content_attachment_detail_response_metadata.py b/seclai/_generated/models/content_attachment_detail_response_metadata.py new file mode 100644 index 0000000..a741bc3 --- /dev/null +++ b/seclai/_generated/models/content_attachment_detail_response_metadata.py @@ -0,0 +1,52 @@ +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="ContentAttachmentDetailResponseMetadata") + + +@_attrs_define +class ContentAttachmentDetailResponseMetadata: + """What is known about the file beyond its bytes. An image extracted from a PDF carries its `page_number`, and + `page_render: true` when it is a render of the whole page. An image or video from a web page carries `source_url` + (the address it was fetched from), `position` (its place among the media the page listed, from 0) and, when the page + gave one, `alt_text`. Empty for most files. A retrieval metadata filter matches these keys, except `alt_text`, which + is indexed as the attachment's text. + + """ + + additional_properties: dict[str, Any] = _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) + content_attachment_detail_response_metadata = cls() + + content_attachment_detail_response_metadata.additional_properties = d + return content_attachment_detail_response_metadata + + @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/seclai/_generated/models/content_attachment_response.py b/seclai/_generated/models/content_attachment_response.py new file mode 100644 index 0000000..3353681 --- /dev/null +++ b/seclai/_generated/models/content_attachment_response.py @@ -0,0 +1,161 @@ +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.content_attachment_response_metadata import ( + ContentAttachmentResponseMetadata, + ) + + +T = TypeVar("T", bound="ContentAttachmentResponse") + + +@_attrs_define +class ContentAttachmentResponse: + """A file attached to a content item. + + Attributes: + content_type (str): MIME type of the attached file. + created_at (str): When the file was first attached. + id (str): The attachment's id, which the single-attachment endpoints take. + indexed (bool): Whether indexing the file for search was asked for. + indexing_error (None | str): Why the file was not indexed, when `indexing_status` is `failed`. + indexing_status (None | str): `pending`, `completed` or `failed`; null when indexing was not asked for. Search + finds the file only when `completed`. + key (str): The attachment's key, unique within the item. + metadata (ContentAttachmentResponseMetadata): What is known about the file beyond its bytes. An image extracted + from a PDF carries its `page_number`, and `page_render: true` when it is a render of the whole page. An image or + video from a web page carries `source_url` (the address it was fetched from), `position` (its place among the + media the page listed, from 0) and, when the page gave one, `alt_text`. Empty for most files. A retrieval + metadata filter matches these keys, except `alt_text`, which is indexed as the attachment's text. + size_bytes (int): Size of the attached file in bytes. + updated_at (str): When the attachment last changed. + """ + + content_type: str + created_at: str + id: str + indexed: bool + indexing_error: None | str + indexing_status: None | str + key: str + metadata: ContentAttachmentResponseMetadata + size_bytes: int + updated_at: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + content_type = self.content_type + + created_at = self.created_at + + id = self.id + + indexed = self.indexed + + indexing_error: None | str + indexing_error = self.indexing_error + + indexing_status: None | str + indexing_status = self.indexing_status + + key = self.key + + metadata = self.metadata.to_dict() + + size_bytes = self.size_bytes + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "content_type": content_type, + "created_at": created_at, + "id": id, + "indexed": indexed, + "indexing_error": indexing_error, + "indexing_status": indexing_status, + "key": key, + "metadata": metadata, + "size_bytes": size_bytes, + "updated_at": updated_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.content_attachment_response_metadata import ( + ContentAttachmentResponseMetadata, + ) + + d = dict(src_dict) + content_type = d.pop("content_type") + + created_at = d.pop("created_at") + + id = d.pop("id") + + indexed = d.pop("indexed") + + def _parse_indexing_error(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + indexing_error = _parse_indexing_error(d.pop("indexing_error")) + + def _parse_indexing_status(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + indexing_status = _parse_indexing_status(d.pop("indexing_status")) + + key = d.pop("key") + + metadata = ContentAttachmentResponseMetadata.from_dict(d.pop("metadata")) + + size_bytes = d.pop("size_bytes") + + updated_at = d.pop("updated_at") + + content_attachment_response = cls( + content_type=content_type, + created_at=created_at, + id=id, + indexed=indexed, + indexing_error=indexing_error, + indexing_status=indexing_status, + key=key, + metadata=metadata, + size_bytes=size_bytes, + updated_at=updated_at, + ) + + content_attachment_response.additional_properties = d + return content_attachment_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/seclai/_generated/models/content_attachment_response_metadata.py b/seclai/_generated/models/content_attachment_response_metadata.py new file mode 100644 index 0000000..dcbf0b5 --- /dev/null +++ b/seclai/_generated/models/content_attachment_response_metadata.py @@ -0,0 +1,52 @@ +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="ContentAttachmentResponseMetadata") + + +@_attrs_define +class ContentAttachmentResponseMetadata: + """What is known about the file beyond its bytes. An image extracted from a PDF carries its `page_number`, and + `page_render: true` when it is a render of the whole page. An image or video from a web page carries `source_url` + (the address it was fetched from), `position` (its place among the media the page listed, from 0) and, when the page + gave one, `alt_text`. Empty for most files. A retrieval metadata filter matches these keys, except `alt_text`, which + is indexed as the attachment's text. + + """ + + additional_properties: dict[str, Any] = _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) + content_attachment_response_metadata = cls() + + content_attachment_response_metadata.additional_properties = d + return content_attachment_response_metadata + + @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/seclai/_generated/models/content_attachments_list_response.py b/seclai/_generated/models/content_attachments_list_response.py new file mode 100644 index 0000000..51ea952 --- /dev/null +++ b/seclai/_generated/models/content_attachments_list_response.py @@ -0,0 +1,86 @@ +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.content_attachment_response import ContentAttachmentResponse + from ..models.pagination_response import PaginationResponse + + +T = TypeVar("T", bound="ContentAttachmentsListResponse") + + +@_attrs_define +class ContentAttachmentsListResponse: + """Response model for a content item's attachments. + + Attributes: + data (list[ContentAttachmentResponse]): + pagination (PaginationResponse): Pagination information. + """ + + data: list[ContentAttachmentResponse] + pagination: PaginationResponse + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + pagination = self.pagination.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "pagination": pagination, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.content_attachment_response import ContentAttachmentResponse + from ..models.pagination_response import PaginationResponse + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ContentAttachmentResponse.from_dict(data_item_data) + + data.append(data_item) + + pagination = PaginationResponse.from_dict(d.pop("pagination")) + + content_attachments_list_response = cls( + data=data, + pagination=pagination, + ) + + content_attachments_list_response.additional_properties = d + return content_attachments_list_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/seclai/_generated/models/content_detail_response.py b/seclai/_generated/models/content_detail_response.py index ea34be0..82afb98 100644 --- a/seclai/_generated/models/content_detail_response.py +++ b/seclai/_generated/models/content_detail_response.py @@ -12,6 +12,7 @@ from ..models.content_detail_response_metadata_type_0_item import ( ContentDetailResponseMetadataType0Item, ) + from ..models.skipped_attachment_response import SkippedAttachmentResponse T = TypeVar("T", bound="ContentDetailResponse") @@ -45,17 +46,22 @@ class ContentDetailResponse: text_content_total_length (int): Total length of the text content. title (None | str): Title of the content. extracted_media_capped (bool | Unset): True when extraction stopped with media still unread, so the item - references more media than was indexed and media search will not match anything past the cut. Two causes: a web - page that ran out of the budget for fetching remote assets, or a container that could not be read to the end (a - truncated or hostile archive). An uploaded document that reads cleanly is never capped, however much media it - holds — there is no limit on that. Default: False. - extracted_media_count (int | None | Unset): Number of embedded images / videos extracted from inside this item - and indexed as their own chunks. There is no limit on this — a document contributes as many as it holds. Null - when there is no media record for the item: the extraction pass has not run, does not apply to this container, - or found nothing. Treat null as 'unknown', never as zero. + references more media than was attached and media search will not match anything past the cut. The cause is a + web page that ran out of the budget for fetching remote assets or listed more media than is recorded, or a web + page or document that could not be read to the end. Default: False. + extracted_media_count (int | None | Unset): Number of images / videos in this web page's main content, or of + images inside this PDF or Office document, that were attached to the item on this source; a file over the per- + file size limit, listed as a failed attachment, is not counted. Null when there is no media record for the item: + the extraction pass has not run, does not apply to this container or this source's settings, or found nothing. + Treat null as 'unknown', never as zero. extracted_media_limit (int | None | Unset): The bound that was reached, when extracted_media_capped is true and - the stop was a bound — a number of fetch attempts, or a number of seconds. Null when extraction was not capped, - or when it stopped because the container could not be read rather than because a bound fired. + the stop was a bound — a number of fetch attempts, of seconds, of bytes, or of media listed. Null when + extraction was not capped, or when it stopped because the container could not be read rather than because a + bound fired. + skipped_attachments (list[SkippedAttachmentResponse] | Unset): Parts of an email delivered to an email content + source that were not stored as attachments of this item, each with the reason: displayed_in_body (an image the + message body shows, such as a signature logo), over_cap (beyond the per-message attachment limit), no_filename, + or undecodable. size_bytes is null for a part that was never decoded. Empty for every other item. """ content_duration: int | None @@ -83,6 +89,7 @@ class ContentDetailResponse: extracted_media_capped: bool | Unset = False extracted_media_count: int | None | Unset = UNSET extracted_media_limit: int | None | Unset = UNSET + skipped_attachments: list[SkippedAttachmentResponse] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -160,6 +167,13 @@ def to_dict(self) -> dict[str, Any]: else: extracted_media_limit = self.extracted_media_limit + skipped_attachments: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.skipped_attachments, Unset): + skipped_attachments = [] + for skipped_attachments_item_data in self.skipped_attachments: + skipped_attachments_item = skipped_attachments_item_data.to_dict() + skipped_attachments.append(skipped_attachments_item) + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -194,6 +208,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["extracted_media_count"] = extracted_media_count if extracted_media_limit is not UNSET: field_dict["extracted_media_limit"] = extracted_media_limit + if skipped_attachments is not UNSET: + field_dict["skipped_attachments"] = skipped_attachments return field_dict @@ -202,6 +218,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.content_detail_response_metadata_type_0_item import ( ContentDetailResponseMetadataType0Item, ) + from ..models.skipped_attachment_response import SkippedAttachmentResponse d = dict(src_dict) @@ -341,6 +358,17 @@ def _parse_extracted_media_limit(data: object) -> int | None | Unset: d.pop("extracted_media_limit", UNSET) ) + _skipped_attachments = d.pop("skipped_attachments", UNSET) + skipped_attachments: list[SkippedAttachmentResponse] | Unset = UNSET + if _skipped_attachments is not UNSET: + skipped_attachments = [] + for skipped_attachments_item_data in _skipped_attachments: + skipped_attachments_item = SkippedAttachmentResponse.from_dict( + skipped_attachments_item_data + ) + + skipped_attachments.append(skipped_attachments_item) + content_detail_response = cls( content_duration=content_duration, content_duration_display=content_duration_display, @@ -367,6 +395,7 @@ def _parse_extracted_media_limit(data: object) -> int | None | Unset: extracted_media_capped=extracted_media_capped, extracted_media_count=extracted_media_count, extracted_media_limit=extracted_media_limit, + skipped_attachments=skipped_attachments, ) content_detail_response.additional_properties = d diff --git a/seclai/_generated/models/create_agent_request.py b/seclai/_generated/models/create_agent_request.py index 53a08c1..a7635bb 100644 --- a/seclai/_generated/models/create_agent_request.py +++ b/seclai/_generated/models/create_agent_request.py @@ -9,6 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.accepted_attachment_slot import AcceptedAttachmentSlot from ..models.create_agent_request_agent_definition_type_0 import ( CreateAgentRequestAgentDefinitionType0, ) @@ -25,6 +26,10 @@ class CreateAgentRequest: """ Attributes: name (str): Name for the new agent. + accepted_attachments (list[AcceptedAttachmentSlot] | None | Unset): The input attachments the trigger accepts. + Omitted, the ``agent_definition`` trigger's declaration is kept when the export carries one and both trigger + types take files; otherwise a dynamic_input or email_received trigger accepts any files (one attachment named + ``files``), and any other trigger none. agent_definition (CreateAgentRequestAgentDefinitionType0 | None | Unset): Optional payload in the same format produced by GET /agents/{id}/export. When provided, replaces any template-derived workflow and pre-fills metadata/trigger fields the request does not specify explicitly. Validation errors include line/column @@ -41,6 +46,7 @@ class CreateAgentRequest: """ name: str + accepted_attachments: list[AcceptedAttachmentSlot] | None | Unset = UNSET agent_definition: CreateAgentRequestAgentDefinitionType0 | None | Unset = UNSET agent_template: None | str | Unset = UNSET description: None | str | Unset = UNSET @@ -58,6 +64,20 @@ def to_dict(self) -> dict[str, Any]: name = self.name + accepted_attachments: list[dict[str, Any]] | None | Unset + if isinstance(self.accepted_attachments, Unset): + accepted_attachments = UNSET + elif isinstance(self.accepted_attachments, list): + accepted_attachments = [] + for accepted_attachments_type_0_item_data in self.accepted_attachments: + accepted_attachments_type_0_item = ( + accepted_attachments_type_0_item_data.to_dict() + ) + accepted_attachments.append(accepted_attachments_type_0_item) + + else: + accepted_attachments = self.accepted_attachments + agent_definition: dict[str, Any] | None | Unset if isinstance(self.agent_definition, Unset): agent_definition = UNSET @@ -95,6 +115,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, } ) + if accepted_attachments is not UNSET: + field_dict["accepted_attachments"] = accepted_attachments if agent_definition is not UNSET: field_dict["agent_definition"] = agent_definition if agent_template is not UNSET: @@ -110,6 +132,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.accepted_attachment_slot import AcceptedAttachmentSlot from ..models.create_agent_request_agent_definition_type_0 import ( CreateAgentRequestAgentDefinitionType0, ) @@ -120,6 +143,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") + def _parse_accepted_attachments( + data: object, + ) -> list[AcceptedAttachmentSlot] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + accepted_attachments_type_0 = [] + _accepted_attachments_type_0 = data + for ( + accepted_attachments_type_0_item_data + ) in _accepted_attachments_type_0: + accepted_attachments_type_0_item = AcceptedAttachmentSlot.from_dict( + accepted_attachments_type_0_item_data + ) + + accepted_attachments_type_0.append(accepted_attachments_type_0_item) + + return accepted_attachments_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[AcceptedAttachmentSlot] | None | Unset, data) + + accepted_attachments = _parse_accepted_attachments( + d.pop("accepted_attachments", UNSET) + ) + def _parse_agent_definition( data: object, ) -> CreateAgentRequestAgentDefinitionType0 | None | Unset: @@ -182,6 +235,7 @@ def _parse_entity_remap( create_agent_request = cls( name=name, + accepted_attachments=accepted_attachments, agent_definition=agent_definition, agent_template=agent_template, description=description, diff --git a/seclai/_generated/models/create_source_body.py b/seclai/_generated/models/create_source_body.py index 1c14469..31a8cc3 100644 --- a/seclai/_generated/models/create_source_body.py +++ b/seclai/_generated/models/create_source_body.py @@ -18,24 +18,49 @@ class CreateSourceBody: Attributes: name (str): Source name. - source_type (str): Source type: rss, website, or custom_index. The legacy value 'file_uploads' is accepted as an - alias for custom_index. + source_type (str): Source type: rss_feed, website, custom_index, cloud_drive or email. The legacy value + 'file_uploads' is accepted as an alias for custom_index. chunk_overlap (int | None | Unset): Chunk overlap for content processing. chunk_size (int | None | Unset): Chunk size for content processing. + cloud_drive_connection_id (None | str | Unset): Required for a cloud_drive source, and ignored on any other: the + id of a connected drive, from GET /cloud-drives. + cloud_drive_content_types (None | str | Unset): For a cloud_drive source: comma-separated MIME types a file must + have to be indexed. Omit for no filter. + cloud_drive_folder_path (None | str | Unset): For a cloud_drive source: the folder to index, as a path inside + the drive. Omit to index the connected drive's own folder. + cloud_drive_max_file_mb (int | None | Unset): For a cloud_drive source: files larger than this many megabytes + are skipped. Omit for no limit of the source's own. + cloud_drive_path_pattern (None | str | Unset): For a cloud_drive source: a glob a file's path must match to be + indexed, such as `**/*.pdf` or `/reports/*`. Omit for no filter. content_filter (None | str | Unset): Content filter type. dimensions (int | None | Unset): Embedding dimensions override. + document_images (bool | None | Unset): Whether the images inside PDF, DOCX, PPTX and XLSX files are attached to + the item and indexed; on a text-only embedder, by the text in each image. Applies to documents added after it + changes. Defaults to true; below Seclai-Version 2026-10-18 it defaults to false on a text-only embedder. On a + website or RSS source it is ignored: `media_types` decides. + email_allowed_senders (list[str] | None | Unset): Required for an email source, and only valid there: the + senders whose mail is stored. Each entry is a full address (news@example.com) or a bare domain (example.com), + which also matches its sub-domains. Matched against the message's From address, which must pass DMARC. embedding_model (None | str | Unset): Embedding model override — a `model_type` from `GET /models/embedders`, which also reports each embedder's `supported_input_media`. Defaults to the platform embedder (`default_model_type` on that endpoint) when omitted. Indexing images or video requires an embedder that lists that modality. + feed_attachments (list[str] | None | Unset): Kinds of file listed beside a feed item's content to attach to the + item and index, on an RSS source. Subset of ['enclosures', 'item_image', 'media_rss']; any other value is + refused. None are attached unless chosen. index_mode (None | SourceIndexMode | Unset): Index mode for custom_index sources: fast_and_cheap (default), balanced, slow_and_thorough, or custom. - media_types (list[str] | None | Unset): Media kinds to extract from indexed content and embed as multi-modal KB - chunks. Subset of ['images', 'video']. Only kinds the source's embedder can index are honored (see - `supported_input_media` on GET /models/embedders); unsupported values are dropped. Omit / [] for text-only. + media_types (list[str] | None | Unset): Media kinds in a web page's main content to attach to the page's item + and index, on a website or RSS source. Subset of ['images', 'video']. From `Seclai-Version: 2026-10-13` any + other value, and any kind on another source type, is refused with a 400; older versions drop an unknown value + and store the rest. A kind the source's embedder cannot index is stored and not indexed (see + `supported_input_media` on GET /models/embedders). 'images' also covers the images inside PDF, DOCX, PPTX and + XLSX files. Applies to pages and documents added after it is set. polling (None | str | Unset): Polling interval (e.g. hourly, daily). polling_action (None | str | Unset): Polling action. - polling_max_items (int | None | Unset): Max items per poll. + polling_max_items (int | None | Unset): The most new feed items a scheduled poll takes. Read for RSS feeds only: + from Seclai-Version 2026-10-19 any other source type rejects it with 400. Earlier versions store it there. An + email source rejects it at every version. retention (int | None | Unset): Retention period in days. url_id (None | str | Unset): URL record ID (required for rss/website sources). """ @@ -44,9 +69,17 @@ class CreateSourceBody: source_type: str chunk_overlap: int | None | Unset = UNSET chunk_size: int | None | Unset = UNSET + cloud_drive_connection_id: None | str | Unset = UNSET + cloud_drive_content_types: None | str | Unset = UNSET + cloud_drive_folder_path: None | str | Unset = UNSET + cloud_drive_max_file_mb: int | None | Unset = UNSET + cloud_drive_path_pattern: None | str | Unset = UNSET content_filter: None | str | Unset = UNSET dimensions: int | None | Unset = UNSET + document_images: bool | None | Unset = UNSET + email_allowed_senders: list[str] | None | Unset = UNSET embedding_model: None | str | Unset = UNSET + feed_attachments: list[str] | None | Unset = UNSET index_mode: None | SourceIndexMode | Unset = UNSET media_types: list[str] | None | Unset = UNSET polling: None | str | Unset = UNSET @@ -73,6 +106,36 @@ def to_dict(self) -> dict[str, Any]: else: chunk_size = self.chunk_size + cloud_drive_connection_id: None | str | Unset + if isinstance(self.cloud_drive_connection_id, Unset): + cloud_drive_connection_id = UNSET + else: + cloud_drive_connection_id = self.cloud_drive_connection_id + + cloud_drive_content_types: None | str | Unset + if isinstance(self.cloud_drive_content_types, Unset): + cloud_drive_content_types = UNSET + else: + cloud_drive_content_types = self.cloud_drive_content_types + + cloud_drive_folder_path: None | str | Unset + if isinstance(self.cloud_drive_folder_path, Unset): + cloud_drive_folder_path = UNSET + else: + cloud_drive_folder_path = self.cloud_drive_folder_path + + cloud_drive_max_file_mb: int | None | Unset + if isinstance(self.cloud_drive_max_file_mb, Unset): + cloud_drive_max_file_mb = UNSET + else: + cloud_drive_max_file_mb = self.cloud_drive_max_file_mb + + cloud_drive_path_pattern: None | str | Unset + if isinstance(self.cloud_drive_path_pattern, Unset): + cloud_drive_path_pattern = UNSET + else: + cloud_drive_path_pattern = self.cloud_drive_path_pattern + content_filter: None | str | Unset if isinstance(self.content_filter, Unset): content_filter = UNSET @@ -85,12 +148,36 @@ def to_dict(self) -> dict[str, Any]: else: dimensions = self.dimensions + document_images: bool | None | Unset + if isinstance(self.document_images, Unset): + document_images = UNSET + else: + document_images = self.document_images + + email_allowed_senders: list[str] | None | Unset + if isinstance(self.email_allowed_senders, Unset): + email_allowed_senders = UNSET + elif isinstance(self.email_allowed_senders, list): + email_allowed_senders = self.email_allowed_senders + + else: + email_allowed_senders = self.email_allowed_senders + embedding_model: None | str | Unset if isinstance(self.embedding_model, Unset): embedding_model = UNSET else: embedding_model = self.embedding_model + feed_attachments: list[str] | None | Unset + if isinstance(self.feed_attachments, Unset): + feed_attachments = UNSET + elif isinstance(self.feed_attachments, list): + feed_attachments = self.feed_attachments + + else: + feed_attachments = self.feed_attachments + index_mode: None | str | Unset if isinstance(self.index_mode, Unset): index_mode = UNSET @@ -150,12 +237,28 @@ def to_dict(self) -> dict[str, Any]: field_dict["chunk_overlap"] = chunk_overlap if chunk_size is not UNSET: field_dict["chunk_size"] = chunk_size + if cloud_drive_connection_id is not UNSET: + field_dict["cloud_drive_connection_id"] = cloud_drive_connection_id + if cloud_drive_content_types is not UNSET: + field_dict["cloud_drive_content_types"] = cloud_drive_content_types + if cloud_drive_folder_path is not UNSET: + field_dict["cloud_drive_folder_path"] = cloud_drive_folder_path + if cloud_drive_max_file_mb is not UNSET: + field_dict["cloud_drive_max_file_mb"] = cloud_drive_max_file_mb + if cloud_drive_path_pattern is not UNSET: + field_dict["cloud_drive_path_pattern"] = cloud_drive_path_pattern if content_filter is not UNSET: field_dict["content_filter"] = content_filter if dimensions is not UNSET: field_dict["dimensions"] = dimensions + if document_images is not UNSET: + field_dict["document_images"] = document_images + if email_allowed_senders is not UNSET: + field_dict["email_allowed_senders"] = email_allowed_senders if embedding_model is not UNSET: field_dict["embedding_model"] = embedding_model + if feed_attachments is not UNSET: + field_dict["feed_attachments"] = feed_attachments if index_mode is not UNSET: field_dict["index_mode"] = index_mode if media_types is not UNSET: @@ -198,6 +301,61 @@ def _parse_chunk_size(data: object) -> int | None | Unset: chunk_size = _parse_chunk_size(d.pop("chunk_size", UNSET)) + def _parse_cloud_drive_connection_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cloud_drive_connection_id = _parse_cloud_drive_connection_id( + d.pop("cloud_drive_connection_id", UNSET) + ) + + def _parse_cloud_drive_content_types(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cloud_drive_content_types = _parse_cloud_drive_content_types( + d.pop("cloud_drive_content_types", UNSET) + ) + + def _parse_cloud_drive_folder_path(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cloud_drive_folder_path = _parse_cloud_drive_folder_path( + d.pop("cloud_drive_folder_path", UNSET) + ) + + def _parse_cloud_drive_max_file_mb(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + cloud_drive_max_file_mb = _parse_cloud_drive_max_file_mb( + d.pop("cloud_drive_max_file_mb", UNSET) + ) + + def _parse_cloud_drive_path_pattern(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cloud_drive_path_pattern = _parse_cloud_drive_path_pattern( + d.pop("cloud_drive_path_pattern", UNSET) + ) + def _parse_content_filter(data: object) -> None | str | Unset: if data is None: return data @@ -216,6 +374,34 @@ def _parse_dimensions(data: object) -> int | None | Unset: dimensions = _parse_dimensions(d.pop("dimensions", UNSET)) + def _parse_document_images(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + document_images = _parse_document_images(d.pop("document_images", UNSET)) + + def _parse_email_allowed_senders(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() + email_allowed_senders_type_0 = cast(list[str], data) + + return email_allowed_senders_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + email_allowed_senders = _parse_email_allowed_senders( + d.pop("email_allowed_senders", UNSET) + ) + def _parse_embedding_model(data: object) -> None | str | Unset: if data is None: return data @@ -225,6 +411,23 @@ def _parse_embedding_model(data: object) -> None | str | Unset: embedding_model = _parse_embedding_model(d.pop("embedding_model", UNSET)) + def _parse_feed_attachments(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() + feed_attachments_type_0 = cast(list[str], data) + + return feed_attachments_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + feed_attachments = _parse_feed_attachments(d.pop("feed_attachments", UNSET)) + def _parse_index_mode(data: object) -> None | SourceIndexMode | Unset: if data is None: return data @@ -309,9 +512,17 @@ def _parse_url_id(data: object) -> None | str | Unset: source_type=source_type, chunk_overlap=chunk_overlap, chunk_size=chunk_size, + cloud_drive_connection_id=cloud_drive_connection_id, + cloud_drive_content_types=cloud_drive_content_types, + cloud_drive_folder_path=cloud_drive_folder_path, + cloud_drive_max_file_mb=cloud_drive_max_file_mb, + cloud_drive_path_pattern=cloud_drive_path_pattern, content_filter=content_filter, dimensions=dimensions, + document_images=document_images, + email_allowed_senders=email_allowed_senders, embedding_model=embedding_model, + feed_attachments=feed_attachments, index_mode=index_mode, media_types=media_types, polling=polling, diff --git a/seclai/_generated/models/email_source_rejection_list_response.py b/seclai/_generated/models/email_source_rejection_list_response.py new file mode 100644 index 0000000..360c864 --- /dev/null +++ b/seclai/_generated/models/email_source_rejection_list_response.py @@ -0,0 +1,88 @@ +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.email_source_rejection_response import EmailSourceRejectionResponse + from ..models.pagination_response import PaginationResponse + + +T = TypeVar("T", bound="EmailSourceRejectionListResponse") + + +@_attrs_define +class EmailSourceRejectionListResponse: + """A page of mail an email content source refused. + + Attributes: + data (list[EmailSourceRejectionResponse]): + pagination (PaginationResponse): Pagination information. + """ + + data: list[EmailSourceRejectionResponse] + pagination: PaginationResponse + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + pagination = self.pagination.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "pagination": pagination, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.email_source_rejection_response import ( + EmailSourceRejectionResponse, + ) + from ..models.pagination_response import PaginationResponse + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = EmailSourceRejectionResponse.from_dict(data_item_data) + + data.append(data_item) + + pagination = PaginationResponse.from_dict(d.pop("pagination")) + + email_source_rejection_list_response = cls( + data=data, + pagination=pagination, + ) + + email_source_rejection_list_response.additional_properties = d + return email_source_rejection_list_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/seclai/_generated/models/email_source_rejection_response.py b/seclai/_generated/models/email_source_rejection_response.py new file mode 100644 index 0000000..b786c14 --- /dev/null +++ b/seclai/_generated/models/email_source_rejection_response.py @@ -0,0 +1,174 @@ +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.email_source_rejection_response_auth_verdicts import ( + EmailSourceRejectionResponseAuthVerdicts, + ) + + +T = TypeVar("T", bound="EmailSourceRejectionResponse") + + +@_attrs_define +class EmailSourceRejectionResponse: + """Mail an email content source refused: who sent it and why, never what + it said. + + Attributes: + authenticated (bool): Whether the message passed DMARC, which is what authenticates its From address. Adding an + unauthenticated sender to the allowed senders does not let its mail in. + created_at (str): When the mail was refused. + id (str): Unique identifier of the refusal. + reason (str): Why it was refused: sender_not_allowed, unauthenticated_sender, unreadable_from, sender_blocked, + spam, virus, unsafe_content, rate_limited, account_not_chargeable or empty_message; or, for a message the source + received before, what became of the earlier one: repeat_stored, repeat_held, repeat_deleted or + repeat_in_progress. + recipient (str): The source address it was sent to. + sender (str): The envelope sender. For bulk mail this is the delivery provider's bounce address, not the From + address. + sender_ip (None | str): IP address the mail came from. + auth_verdicts (EmailSourceRejectionResponseAuthVerdicts | Unset): The SPF, DKIM and DMARC verdicts reported for + the message. + from_address (None | str | Unset): The address in the message's From line, which the source's allowed senders + are matched against. Null when no single From address could be read from the message unambiguously. + """ + + authenticated: bool + created_at: str + id: str + reason: str + recipient: str + sender: str + sender_ip: None | str + auth_verdicts: EmailSourceRejectionResponseAuthVerdicts | Unset = UNSET + from_address: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + authenticated = self.authenticated + + created_at = self.created_at + + id = self.id + + reason = self.reason + + recipient = self.recipient + + sender = self.sender + + sender_ip: None | str + sender_ip = self.sender_ip + + auth_verdicts: dict[str, Any] | Unset = UNSET + if not isinstance(self.auth_verdicts, Unset): + auth_verdicts = self.auth_verdicts.to_dict() + + from_address: None | str | Unset + if isinstance(self.from_address, Unset): + from_address = UNSET + else: + from_address = self.from_address + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "authenticated": authenticated, + "created_at": created_at, + "id": id, + "reason": reason, + "recipient": recipient, + "sender": sender, + "sender_ip": sender_ip, + } + ) + if auth_verdicts is not UNSET: + field_dict["auth_verdicts"] = auth_verdicts + if from_address is not UNSET: + field_dict["from_address"] = from_address + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.email_source_rejection_response_auth_verdicts import ( + EmailSourceRejectionResponseAuthVerdicts, + ) + + d = dict(src_dict) + authenticated = d.pop("authenticated") + + created_at = d.pop("created_at") + + id = d.pop("id") + + reason = d.pop("reason") + + recipient = d.pop("recipient") + + sender = d.pop("sender") + + def _parse_sender_ip(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + sender_ip = _parse_sender_ip(d.pop("sender_ip")) + + _auth_verdicts = d.pop("auth_verdicts", UNSET) + auth_verdicts: EmailSourceRejectionResponseAuthVerdicts | Unset + if isinstance(_auth_verdicts, Unset): + auth_verdicts = UNSET + else: + auth_verdicts = EmailSourceRejectionResponseAuthVerdicts.from_dict( + _auth_verdicts + ) + + def _parse_from_address(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + from_address = _parse_from_address(d.pop("from_address", UNSET)) + + email_source_rejection_response = cls( + authenticated=authenticated, + created_at=created_at, + id=id, + reason=reason, + recipient=recipient, + sender=sender, + sender_ip=sender_ip, + auth_verdicts=auth_verdicts, + from_address=from_address, + ) + + email_source_rejection_response.additional_properties = d + return email_source_rejection_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/seclai/_generated/models/email_source_rejection_response_auth_verdicts.py b/seclai/_generated/models/email_source_rejection_response_auth_verdicts.py new file mode 100644 index 0000000..ce8665d --- /dev/null +++ b/seclai/_generated/models/email_source_rejection_response_auth_verdicts.py @@ -0,0 +1,46 @@ +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="EmailSourceRejectionResponseAuthVerdicts") + + +@_attrs_define +class EmailSourceRejectionResponseAuthVerdicts: + """The SPF, DKIM and DMARC verdicts reported for the message.""" + + 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) + email_source_rejection_response_auth_verdicts = cls() + + email_source_rejection_response_auth_verdicts.additional_properties = d + return email_source_rejection_response_auth_verdicts + + @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/seclai/_generated/models/email_trigger_config_response.py b/seclai/_generated/models/email_trigger_config_response.py index b2996e6..68b63bf 100644 --- a/seclai/_generated/models/email_trigger_config_response.py +++ b/seclai/_generated/models/email_trigger_config_response.py @@ -26,6 +26,7 @@ class EmailTriggerConfigResponse: email_ignore_auto_generated (bool | Unset): Default: True. email_queue_on_quota (bool | Unset): Default: False. email_require_sender_auth (bool | Unset): Default: True. + email_run_on_attachment_mismatch (bool | Unset): Default: False. """ agent_id: UUID @@ -37,6 +38,7 @@ class EmailTriggerConfigResponse: email_ignore_auto_generated: bool | Unset = True email_queue_on_quota: bool | Unset = False email_require_sender_auth: bool | Unset = True + email_run_on_attachment_mismatch: bool | Unset = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -71,6 +73,8 @@ def to_dict(self) -> dict[str, Any]: email_require_sender_auth = self.email_require_sender_auth + email_run_on_attachment_mismatch = self.email_run_on_attachment_mismatch + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -92,6 +96,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["email_queue_on_quota"] = email_queue_on_quota if email_require_sender_auth is not UNSET: field_dict["email_require_sender_auth"] = email_require_sender_auth + if email_run_on_attachment_mismatch is not UNSET: + field_dict["email_run_on_attachment_mismatch"] = ( + email_run_on_attachment_mismatch + ) return field_dict @@ -140,6 +148,10 @@ def _parse_email_allowed_senders(data: object) -> list[str] | None | Unset: email_require_sender_auth = d.pop("email_require_sender_auth", UNSET) + email_run_on_attachment_mismatch = d.pop( + "email_run_on_attachment_mismatch", UNSET + ) + email_trigger_config_response = cls( agent_id=agent_id, trigger_id=trigger_id, @@ -150,6 +162,7 @@ def _parse_email_allowed_senders(data: object) -> list[str] | None | Unset: email_ignore_auto_generated=email_ignore_auto_generated, email_queue_on_quota=email_queue_on_quota, email_require_sender_auth=email_require_sender_auth, + email_run_on_attachment_mismatch=email_run_on_attachment_mismatch, ) email_trigger_config_response.additional_properties = d diff --git a/seclai/_generated/models/generate_agent_steps_response.py b/seclai/_generated/models/generate_agent_steps_response.py index 3989e73..b05da5f 100644 --- a/seclai/_generated/models/generate_agent_steps_response.py +++ b/seclai/_generated/models/generate_agent_steps_response.py @@ -30,7 +30,10 @@ class GenerateAgentStepsResponse: steps (list[GenerateAgentStepsResponseStepsItem]): Generated agent steps. success (bool): Whether steps were successfully generated. agent_config (GenerateAgentStepsResponseAgentConfigType0 | None | Unset): Suggested agent-level configuration, - if any. + if any. For an email_received agent it may carry `email_run_on_attachment_mismatch`, which the caller applies + through the trigger's email-config endpoint. For a dynamic_input or email_received agent it may carry + `accepted_attachments`, which the caller passes with the steps to `PUT /agents/{agent_id}/definition` so both + save together. example_prompts (list[ExamplePrompt] | Unset): Example natural-language prompts that demonstrate the capabilities of this AI assistant for the given mode. intent_assessment (None | str | Unset): How the assistant interpreted the request: 'clear' when steps were diff --git a/seclai/_generated/models/set_accepted_attachments_request.py b/seclai/_generated/models/set_accepted_attachments_request.py new file mode 100644 index 0000000..f968db2 --- /dev/null +++ b/seclai/_generated/models/set_accepted_attachments_request.py @@ -0,0 +1,106 @@ +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.accepted_attachment_slot import AcceptedAttachmentSlot + + +T = TypeVar("T", bound="SetAcceptedAttachmentsRequest") + + +@_attrs_define +class SetAcceptedAttachmentsRequest: + """ + Attributes: + accepted_attachments (list[AcceptedAttachmentSlot] | None): The input attachments the trigger accepts; ``null`` + accepts any files (one attachment named ``files``). Only ``dynamic_input`` and ``email_received`` triggers take + files. + """ + + accepted_attachments: list[AcceptedAttachmentSlot] | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + accepted_attachments: list[dict[str, Any]] | None + if isinstance(self.accepted_attachments, list): + accepted_attachments = [] + for accepted_attachments_type_0_item_data in self.accepted_attachments: + accepted_attachments_type_0_item = ( + accepted_attachments_type_0_item_data.to_dict() + ) + accepted_attachments.append(accepted_attachments_type_0_item) + + else: + accepted_attachments = self.accepted_attachments + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "accepted_attachments": accepted_attachments, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.accepted_attachment_slot import AcceptedAttachmentSlot + + d = dict(src_dict) + + def _parse_accepted_attachments( + data: object, + ) -> list[AcceptedAttachmentSlot] | None: + if data is None: + return data + try: + if not isinstance(data, list): + raise TypeError() + accepted_attachments_type_0 = [] + _accepted_attachments_type_0 = data + for ( + accepted_attachments_type_0_item_data + ) in _accepted_attachments_type_0: + accepted_attachments_type_0_item = AcceptedAttachmentSlot.from_dict( + accepted_attachments_type_0_item_data + ) + + accepted_attachments_type_0.append(accepted_attachments_type_0_item) + + return accepted_attachments_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[AcceptedAttachmentSlot] | None, data) + + accepted_attachments = _parse_accepted_attachments( + d.pop("accepted_attachments") + ) + + set_accepted_attachments_request = cls( + accepted_attachments=accepted_attachments, + ) + + set_accepted_attachments_request.additional_properties = d + return set_accepted_attachments_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/seclai/_generated/models/set_email_trigger_config_request.py b/seclai/_generated/models/set_email_trigger_config_request.py index 056b04c..d0ea593 100644 --- a/seclai/_generated/models/set_email_trigger_config_request.py +++ b/seclai/_generated/models/set_email_trigger_config_request.py @@ -34,6 +34,9 @@ class SetEmailTriggerConfigRequest: require_sender_auth (bool | None | Unset): When true (default for new triggers), the envelope sender must pass SPF or DMARC even on an open inbox (no allowlist); unauthenticated, spoofable mail is rejected. Set false to accept fully unauthenticated mail on an open inbox. + run_on_attachment_mismatch (bool | None | Unset): When true (default false), an email whose attachments don't + fit what the agent expects still runs: files the agent can't take are left out and the problems are listed in + the `email_attachment_issues` run metadata. When false, the run fails. """ alias: None | str | Unset = UNSET @@ -41,6 +44,7 @@ class SetEmailTriggerConfigRequest: ignore_auto_generated: bool | None | Unset = UNSET queue_on_quota: bool | None | Unset = UNSET require_sender_auth: bool | None | Unset = UNSET + run_on_attachment_mismatch: bool | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -77,6 +81,12 @@ def to_dict(self) -> dict[str, Any]: else: require_sender_auth = self.require_sender_auth + run_on_attachment_mismatch: bool | None | Unset + if isinstance(self.run_on_attachment_mismatch, Unset): + run_on_attachment_mismatch = UNSET + else: + run_on_attachment_mismatch = self.run_on_attachment_mismatch + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -90,6 +100,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["queue_on_quota"] = queue_on_quota if require_sender_auth is not UNSET: field_dict["require_sender_auth"] = require_sender_auth + if run_on_attachment_mismatch is not UNSET: + field_dict["run_on_attachment_mismatch"] = run_on_attachment_mismatch return field_dict @@ -154,12 +166,24 @@ def _parse_require_sender_auth(data: object) -> bool | None | Unset: d.pop("require_sender_auth", UNSET) ) + def _parse_run_on_attachment_mismatch(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + run_on_attachment_mismatch = _parse_run_on_attachment_mismatch( + d.pop("run_on_attachment_mismatch", UNSET) + ) + set_email_trigger_config_request = cls( alias=alias, allowed_senders=allowed_senders, ignore_auto_generated=ignore_auto_generated, queue_on_quota=queue_on_quota, require_sender_auth=require_sender_auth, + run_on_attachment_mismatch=run_on_attachment_mismatch, ) set_email_trigger_config_request.additional_properties = d diff --git a/seclai/_generated/models/skipped_attachment_reason.py b/seclai/_generated/models/skipped_attachment_reason.py new file mode 100644 index 0000000..bc0c2d6 --- /dev/null +++ b/seclai/_generated/models/skipped_attachment_reason.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class SkippedAttachmentReason(str, Enum): + DISPLAYED_IN_BODY = "displayed_in_body" + NO_FILENAME = "no_filename" + OVER_CAP = "over_cap" + UNDECODABLE = "undecodable" + + def __str__(self) -> str: + return str(self.value) diff --git a/seclai/_generated/models/skipped_attachment_response.py b/seclai/_generated/models/skipped_attachment_response.py new file mode 100644 index 0000000..691c7cf --- /dev/null +++ b/seclai/_generated/models/skipped_attachment_response.py @@ -0,0 +1,100 @@ +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 ..models.skipped_attachment_reason import SkippedAttachmentReason + +T = TypeVar("T", bound="SkippedAttachmentResponse") + + +@_attrs_define +class SkippedAttachmentResponse: + """A part of an email that was not stored as an attachment. + + Attributes: + content_type (str): The part's declared media type. + filename (None | str): The file name the part is listed under; null when it had none. + reason (SkippedAttachmentReason): + size_bytes (int | None): Decoded size in bytes. + """ + + content_type: str + filename: None | str + reason: SkippedAttachmentReason + size_bytes: int | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + content_type = self.content_type + + filename: None | str + filename = self.filename + + reason = self.reason.value + + size_bytes: int | None + size_bytes = self.size_bytes + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "content_type": content_type, + "filename": filename, + "reason": reason, + "size_bytes": size_bytes, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + content_type = d.pop("content_type") + + def _parse_filename(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + filename = _parse_filename(d.pop("filename")) + + reason = SkippedAttachmentReason(d.pop("reason")) + + def _parse_size_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + size_bytes = _parse_size_bytes(d.pop("size_bytes")) + + skipped_attachment_response = cls( + content_type=content_type, + filename=filename, + reason=reason, + size_bytes=size_bytes, + ) + + skipped_attachment_response.additional_properties = d + return skipped_attachment_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/seclai/_generated/models/source_content_status_response.py b/seclai/_generated/models/source_content_status_response.py index 3e8033d..891a3f8 100644 --- a/seclai/_generated/models/source_content_status_response.py +++ b/seclai/_generated/models/source_content_status_response.py @@ -43,17 +43,21 @@ class SourceContentStatusResponse: sweep to drain. The re-embedding is not charged to your account: nothing you did caused it, so Seclai absorbs the cost. Never true for an item that is simply still indexing; content_status covers that. Default: False. extracted_media_capped (bool | Unset): True when extraction stopped with media still unread, so the item - references more media than was indexed and media search will not match anything past the cut. Two causes: a web - page that ran out of the budget for fetching remote assets, or a container that could not be read to the end (a - truncated or hostile archive). An uploaded document that reads cleanly is never capped, however much media it - holds — there is no limit on that. Default: False. - extracted_media_count (int | None | Unset): Number of embedded images / videos extracted from inside this item - and indexed as their own chunks. There is no limit on this — a document contributes as many as it holds. Null - when there is no media record for the item: the extraction pass has not run, does not apply to this container, - or found nothing. Treat null as 'unknown', never as zero. + references more media than was attached and media search will not match anything past the cut. The cause is a + web page that ran out of the budget for fetching remote assets or listed more media than is recorded, or a web + page or document that could not be read to the end. Default: False. + extracted_media_count (int | None | Unset): Number of images / videos in this web page's main content, or of + images inside this PDF or Office document, that were attached to the item on this source; a file over the per- + file size limit, listed as a failed attachment, is not counted. Null when there is no media record for the item: + the extraction pass has not run, does not apply to this container or this source's settings, or found nothing. + Treat null as 'unknown', never as zero. extracted_media_limit (int | None | Unset): The bound that was reached, when extracted_media_capped is true and - the stop was a bound — a number of fetch attempts, or a number of seconds. Null when extraction was not capped, - or when it stopped because the container could not be read rather than because a bound fired. + the stop was a bound — a number of fetch attempts, of seconds, of bytes, or of media listed. Null when + extraction was not capped, or when it stopped because the container could not be read rather than because a + bound fired. + held_for_review (bool | Unset): An ENFORCE governance policy blocked this item at import. It is held for review + and is not retrievable: resolving its blocking evaluations releases it into the source, and it is purged when + the hold window ends. Default: False. """ content_status: str @@ -73,6 +77,7 @@ class SourceContentStatusResponse: extracted_media_capped: bool | Unset = False extracted_media_count: int | None | Unset = UNSET extracted_media_limit: int | None | Unset = UNSET + held_for_review: bool | Unset = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -127,6 +132,8 @@ def to_dict(self) -> dict[str, Any]: else: extracted_media_limit = self.extracted_media_limit + held_for_review = self.held_for_review + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -154,6 +161,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["extracted_media_count"] = extracted_media_count if extracted_media_limit is not UNSET: field_dict["extracted_media_limit"] = extracted_media_limit + if held_for_review is not UNSET: + field_dict["held_for_review"] = held_for_review return field_dict @@ -261,6 +270,8 @@ def _parse_extracted_media_limit(data: object) -> int | None | Unset: d.pop("extracted_media_limit", UNSET) ) + held_for_review = d.pop("held_for_review", UNSET) + source_content_status_response = cls( content_status=content_status, content_token_count=content_token_count, @@ -279,6 +290,7 @@ def _parse_extracted_media_limit(data: object) -> int | None | Unset: extracted_media_capped=extracted_media_capped, extracted_media_count=extracted_media_count, extracted_media_limit=extracted_media_limit, + held_for_review=held_for_review, ) source_content_status_response.additional_properties = d diff --git a/seclai/_generated/models/source_response.py b/seclai/_generated/models/source_response.py index 41dd46f..adb4146 100644 --- a/seclai/_generated/models/source_response.py +++ b/seclai/_generated/models/source_response.py @@ -26,7 +26,7 @@ class SourceResponse: next_poll_at (None | str): Timestamp for the next scheduled poll. polling (None | str): Polling configuration for the source connection. polling_action (None | str): Polling action for the source connection. - polling_max_items (int | None): Maximum items to poll for the source connection. + polling_max_items (int | None): The most new feed items a scheduled poll takes. Read for RSS feeds only. pulled_at (None | str): Timestamp when content was last pulled. retention (int | None): Retention period for the source connection. source_type (str): Type of the source connection. @@ -39,16 +39,37 @@ class SourceResponse: chunk_regex_separators (bool | None | Unset): Indicates if chunk separators are regex patterns. chunk_separators (None | str | Unset): Chunk separators used for content processing. chunk_size (int | None | Unset): Chunk size for content processing. + cloud_drive_connection_id (None | str | Unset): For a cloud_drive source: the id of the connected drive it + indexes. Null for every other source type. + cloud_drive_content_types (None | str | Unset): For a cloud_drive source: the comma-separated MIME types a file + must have to be indexed. Null when there is no filter. + cloud_drive_folder_path (None | str | Unset): For a cloud_drive source: the folder it indexes. Null when it + indexes the connected drive's own folder. + cloud_drive_max_file_mb (int | None | Unset): For a cloud_drive source: the size in megabytes above which a file + is skipped. Null when the source sets no limit of its own. + cloud_drive_path_pattern (None | str | Unset): For a cloud_drive source: the glob a file's path must match to be + indexed. Null when there is none. content_count (int | Unset): Number of content items associated with the source connection. Default: 0. dimensions (int | None | Unset): Dimensions of the embedding model. + document_images (bool | Unset): Whether the images inside PDF, DOCX, PPTX and XLSX files are attached to the + item and indexed; on a source that follows no web pages and has a text-only embedder, by the text in each image. + Applies to documents added after it changes. On a website or RSS source it reports whether `media_types` holds + 'images', and the images are attached only when the source's embedder indexes images. Default: True. + email_address (None | str | Unset): For an email source: the address to send mail to. Null for every other + source type. + email_allowed_senders (list[str] | None | Unset): For an email source: the addresses and domains whose mail is + stored. Null for every other source type. embedding_model (None | str | Unset): Embedding model used for the source connection. embedding_model_type (None | str | Unset): Type of the embedding model. + feed_attachments (list[str] | Unset): Kinds of file listed beside a feed item's content that an RSS source + attaches to the item and indexes (subset of ['enclosures', 'item_image', 'media_rss']). free_retention_days (int | None | Unset): Number of days content is stored for free before billing applies. has_historical_data (bool | Unset): Indicates if the source connection has historical data. Default: False. index_mode (None | SourceIndexMode | Unset): Index mode for custom_index sources: fast_and_cheap, balanced, slow_and_thorough, or custom. - media_types (list[str] | Unset): Media kinds extracted from indexed content and embedded as multi-modal KB - chunks (subset of ['images', 'video']). Empty = text-only. + media_types (list[str] | Unset): Media kinds in a web page's main content that are attached to the page's item + and indexed (subset of ['images', 'video']). On a website or RSS source 'images' also covers the images inside + PDF, DOCX, PPTX and XLSX files. readonly (bool | Unset): Indicates if the source connection is read-only. Default: False. system_managed (bool | Unset): Indicates if this source is automatically managed by the system (e.g., agent traces). Default: False. @@ -75,10 +96,19 @@ class SourceResponse: chunk_regex_separators: bool | None | Unset = UNSET chunk_separators: None | str | Unset = UNSET chunk_size: int | None | Unset = UNSET + cloud_drive_connection_id: None | str | Unset = UNSET + cloud_drive_content_types: None | str | Unset = UNSET + cloud_drive_folder_path: None | str | Unset = UNSET + cloud_drive_max_file_mb: int | None | Unset = UNSET + cloud_drive_path_pattern: None | str | Unset = UNSET content_count: int | Unset = 0 dimensions: int | None | Unset = UNSET + document_images: bool | Unset = True + email_address: None | str | Unset = UNSET + email_allowed_senders: list[str] | None | Unset = UNSET embedding_model: None | str | Unset = UNSET embedding_model_type: None | str | Unset = UNSET + feed_attachments: list[str] | Unset = UNSET free_retention_days: int | None | Unset = UNSET has_historical_data: bool | Unset = False index_mode: None | SourceIndexMode | Unset = UNSET @@ -165,6 +195,36 @@ def to_dict(self) -> dict[str, Any]: else: chunk_size = self.chunk_size + cloud_drive_connection_id: None | str | Unset + if isinstance(self.cloud_drive_connection_id, Unset): + cloud_drive_connection_id = UNSET + else: + cloud_drive_connection_id = self.cloud_drive_connection_id + + cloud_drive_content_types: None | str | Unset + if isinstance(self.cloud_drive_content_types, Unset): + cloud_drive_content_types = UNSET + else: + cloud_drive_content_types = self.cloud_drive_content_types + + cloud_drive_folder_path: None | str | Unset + if isinstance(self.cloud_drive_folder_path, Unset): + cloud_drive_folder_path = UNSET + else: + cloud_drive_folder_path = self.cloud_drive_folder_path + + cloud_drive_max_file_mb: int | None | Unset + if isinstance(self.cloud_drive_max_file_mb, Unset): + cloud_drive_max_file_mb = UNSET + else: + cloud_drive_max_file_mb = self.cloud_drive_max_file_mb + + cloud_drive_path_pattern: None | str | Unset + if isinstance(self.cloud_drive_path_pattern, Unset): + cloud_drive_path_pattern = UNSET + else: + cloud_drive_path_pattern = self.cloud_drive_path_pattern + content_count = self.content_count dimensions: int | None | Unset @@ -173,6 +233,23 @@ def to_dict(self) -> dict[str, Any]: else: dimensions = self.dimensions + document_images = self.document_images + + email_address: None | str | Unset + if isinstance(self.email_address, Unset): + email_address = UNSET + else: + email_address = self.email_address + + email_allowed_senders: list[str] | None | Unset + if isinstance(self.email_allowed_senders, Unset): + email_allowed_senders = UNSET + elif isinstance(self.email_allowed_senders, list): + email_allowed_senders = self.email_allowed_senders + + else: + email_allowed_senders = self.email_allowed_senders + embedding_model: None | str | Unset if isinstance(self.embedding_model, Unset): embedding_model = UNSET @@ -185,6 +262,10 @@ def to_dict(self) -> dict[str, Any]: else: embedding_model_type = self.embedding_model_type + feed_attachments: list[str] | Unset = UNSET + if not isinstance(self.feed_attachments, Unset): + feed_attachments = self.feed_attachments + free_retention_days: int | None | Unset if isinstance(self.free_retention_days, Unset): free_retention_days = UNSET @@ -243,14 +324,32 @@ def to_dict(self) -> dict[str, Any]: field_dict["chunk_separators"] = chunk_separators if chunk_size is not UNSET: field_dict["chunk_size"] = chunk_size + if cloud_drive_connection_id is not UNSET: + field_dict["cloud_drive_connection_id"] = cloud_drive_connection_id + if cloud_drive_content_types is not UNSET: + field_dict["cloud_drive_content_types"] = cloud_drive_content_types + if cloud_drive_folder_path is not UNSET: + field_dict["cloud_drive_folder_path"] = cloud_drive_folder_path + if cloud_drive_max_file_mb is not UNSET: + field_dict["cloud_drive_max_file_mb"] = cloud_drive_max_file_mb + if cloud_drive_path_pattern is not UNSET: + field_dict["cloud_drive_path_pattern"] = cloud_drive_path_pattern if content_count is not UNSET: field_dict["content_count"] = content_count if dimensions is not UNSET: field_dict["dimensions"] = dimensions + if document_images is not UNSET: + field_dict["document_images"] = document_images + if email_address is not UNSET: + field_dict["email_address"] = email_address + if email_allowed_senders is not UNSET: + field_dict["email_allowed_senders"] = email_allowed_senders if embedding_model is not UNSET: field_dict["embedding_model"] = embedding_model if embedding_model_type is not UNSET: field_dict["embedding_model_type"] = embedding_model_type + if feed_attachments is not UNSET: + field_dict["feed_attachments"] = feed_attachments if free_retention_days is not UNSET: field_dict["free_retention_days"] = free_retention_days if has_historical_data is not UNSET: @@ -401,6 +500,61 @@ def _parse_chunk_size(data: object) -> int | None | Unset: chunk_size = _parse_chunk_size(d.pop("chunk_size", UNSET)) + def _parse_cloud_drive_connection_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cloud_drive_connection_id = _parse_cloud_drive_connection_id( + d.pop("cloud_drive_connection_id", UNSET) + ) + + def _parse_cloud_drive_content_types(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cloud_drive_content_types = _parse_cloud_drive_content_types( + d.pop("cloud_drive_content_types", UNSET) + ) + + def _parse_cloud_drive_folder_path(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cloud_drive_folder_path = _parse_cloud_drive_folder_path( + d.pop("cloud_drive_folder_path", UNSET) + ) + + def _parse_cloud_drive_max_file_mb(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + cloud_drive_max_file_mb = _parse_cloud_drive_max_file_mb( + d.pop("cloud_drive_max_file_mb", UNSET) + ) + + def _parse_cloud_drive_path_pattern(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cloud_drive_path_pattern = _parse_cloud_drive_path_pattern( + d.pop("cloud_drive_path_pattern", UNSET) + ) + content_count = d.pop("content_count", UNSET) def _parse_dimensions(data: object) -> int | None | Unset: @@ -412,6 +566,36 @@ def _parse_dimensions(data: object) -> int | None | Unset: dimensions = _parse_dimensions(d.pop("dimensions", UNSET)) + document_images = d.pop("document_images", UNSET) + + def _parse_email_address(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + email_address = _parse_email_address(d.pop("email_address", UNSET)) + + def _parse_email_allowed_senders(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() + email_allowed_senders_type_0 = cast(list[str], data) + + return email_allowed_senders_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + email_allowed_senders = _parse_email_allowed_senders( + d.pop("email_allowed_senders", UNSET) + ) + def _parse_embedding_model(data: object) -> None | str | Unset: if data is None: return data @@ -432,6 +616,8 @@ def _parse_embedding_model_type(data: object) -> None | str | Unset: d.pop("embedding_model_type", UNSET) ) + feed_attachments = cast(list[str], d.pop("feed_attachments", UNSET)) + def _parse_free_retention_days(data: object) -> int | None | Unset: if data is None: return data @@ -490,10 +676,19 @@ def _parse_index_mode(data: object) -> None | SourceIndexMode | Unset: chunk_regex_separators=chunk_regex_separators, chunk_separators=chunk_separators, chunk_size=chunk_size, + cloud_drive_connection_id=cloud_drive_connection_id, + cloud_drive_content_types=cloud_drive_content_types, + cloud_drive_folder_path=cloud_drive_folder_path, + cloud_drive_max_file_mb=cloud_drive_max_file_mb, + cloud_drive_path_pattern=cloud_drive_path_pattern, content_count=content_count, dimensions=dimensions, + document_images=document_images, + email_address=email_address, + email_allowed_senders=email_allowed_senders, embedding_model=embedding_model, embedding_model_type=embedding_model_type, + feed_attachments=feed_attachments, free_retention_days=free_retention_days, has_historical_data=has_historical_data, index_mode=index_mode, diff --git a/seclai/_generated/models/update_agent_definition_request.py b/seclai/_generated/models/update_agent_definition_request.py index b259795..5f83001 100644 --- a/seclai/_generated/models/update_agent_definition_request.py +++ b/seclai/_generated/models/update_agent_definition_request.py @@ -1,12 +1,15 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +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.accepted_attachment_slot import AcceptedAttachmentSlot from ..models.update_agent_definition_request_definition import ( UpdateAgentDefinitionRequestDefinition, ) @@ -24,10 +27,14 @@ class UpdateAgentDefinitionRequest: enrichment steps (write_metadata, write_content_attachment, load_content_attachment, load_content) require content-triggered agents. expected_change_id (str): The change_id from the last GET, for optimistic locking. + accepted_attachments (list[AcceptedAttachmentSlot] | None | Unset): When given, declared on the main branch's + file-taking triggers in the same save, so the steps may read its slots as `{{agent.attachments.}}`; + omitted, the triggers keep theirs. """ definition: UpdateAgentDefinitionRequestDefinition expected_change_id: str + accepted_attachments: list[AcceptedAttachmentSlot] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -35,6 +42,20 @@ def to_dict(self) -> dict[str, Any]: expected_change_id = self.expected_change_id + accepted_attachments: list[dict[str, Any]] | None | Unset + if isinstance(self.accepted_attachments, Unset): + accepted_attachments = UNSET + elif isinstance(self.accepted_attachments, list): + accepted_attachments = [] + for accepted_attachments_type_0_item_data in self.accepted_attachments: + accepted_attachments_type_0_item = ( + accepted_attachments_type_0_item_data.to_dict() + ) + accepted_attachments.append(accepted_attachments_type_0_item) + + else: + accepted_attachments = self.accepted_attachments + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -43,11 +64,14 @@ def to_dict(self) -> dict[str, Any]: "expected_change_id": expected_change_id, } ) + if accepted_attachments is not UNSET: + field_dict["accepted_attachments"] = accepted_attachments return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.accepted_attachment_slot import AcceptedAttachmentSlot from ..models.update_agent_definition_request_definition import ( UpdateAgentDefinitionRequestDefinition, ) @@ -59,9 +83,40 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: expected_change_id = d.pop("expected_change_id") + def _parse_accepted_attachments( + data: object, + ) -> list[AcceptedAttachmentSlot] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + accepted_attachments_type_0 = [] + _accepted_attachments_type_0 = data + for ( + accepted_attachments_type_0_item_data + ) in _accepted_attachments_type_0: + accepted_attachments_type_0_item = AcceptedAttachmentSlot.from_dict( + accepted_attachments_type_0_item_data + ) + + accepted_attachments_type_0.append(accepted_attachments_type_0_item) + + return accepted_attachments_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[AcceptedAttachmentSlot] | None | Unset, data) + + accepted_attachments = _parse_accepted_attachments( + d.pop("accepted_attachments", UNSET) + ) + update_agent_definition_request = cls( definition=definition, expected_change_id=expected_change_id, + accepted_attachments=accepted_attachments, ) update_agent_definition_request.additional_properties = d diff --git a/seclai/_generated/models/update_source_body.py b/seclai/_generated/models/update_source_body.py index f946686..844e072 100644 --- a/seclai/_generated/models/update_source_body.py +++ b/seclai/_generated/models/update_source_body.py @@ -16,10 +16,28 @@ class UpdateSourceBody: """Request body for updating a content source. Attributes: - media_types (list[str] | None | Unset): Media kinds to extract from indexed content and embed as multi-modal KB - chunks. Subset of ['images', 'video']. Only kinds the source's embedder can index are honored (see - `supported_input_media` on GET /models/embedders); unsupported values are dropped. [] disables media extraction - (text-only). + cloud_drive_content_types (None | str | Unset): For a cloud_drive source: comma-separated MIME types a file must + have to be indexed. Send an empty string to clear it; omit to leave it unchanged. + cloud_drive_folder_path (None | str | Unset): For a cloud_drive source: the folder to index, as a path inside + the drive. Send an empty string to index the connected drive's own folder; omit to leave it unchanged. + cloud_drive_max_file_mb (int | None | Unset): For a cloud_drive source: files larger than this many megabytes + are skipped. Send 0 to clear the source's own limit; omit to leave it unchanged. + cloud_drive_path_pattern (None | str | Unset): For a cloud_drive source: a glob a file's path must match to be + indexed, such as `**/*.pdf` or `/reports/*`. Send an empty string to clear it; omit to leave it unchanged. + document_images (bool | None | Unset): Whether the images inside PDF, DOCX, PPTX and XLSX files are attached to + the item and indexed; on a text-only embedder, by the text in each image. Applies to documents added after it + changes. Omit the field to leave it unchanged. On a website or RSS source it is ignored: `media_types` decides. + email_allowed_senders (list[str] | None | Unset): For an email source: replaces the allowed senders. Each entry + is a full address or a bare domain. The list cannot be emptied. Omit to leave it unchanged. + feed_attachments (list[str] | None | Unset): Kinds of file listed beside a feed item's content to attach to the + item and index, on an RSS source. Subset of ['enclosures', 'item_image', 'media_rss']; any other value is + refused. [] attaches none. Applies to items added after it changes. Omit the field to leave it unchanged. + media_types (list[str] | None | Unset): Media kinds in a web page's main content to attach to the page's item + and index, on a website or RSS source. Subset of ['images', 'video']. From `Seclai-Version: 2026-10-13` any + other value, and any kind on another source type, is refused with a 400; older versions drop an unknown value + and store the rest. A kind the source's embedder cannot index is stored and not indexed (see + `supported_input_media` on GET /models/embedders). [] attaches no media from web pages. 'images' also covers the + images inside PDF, DOCX, PPTX and XLSX files. Applies to pages and documents added after it changes. name (None | str | Unset): New name. polling (None | str | Unset): New polling interval. retention_days (int | None | Unset): New retention period in days — content older than this is deleted @@ -27,6 +45,13 @@ class UpdateSourceBody: unchanged. """ + cloud_drive_content_types: None | str | Unset = UNSET + cloud_drive_folder_path: None | str | Unset = UNSET + cloud_drive_max_file_mb: int | None | Unset = UNSET + cloud_drive_path_pattern: None | str | Unset = UNSET + document_images: bool | None | Unset = UNSET + email_allowed_senders: list[str] | None | Unset = UNSET + feed_attachments: list[str] | None | Unset = UNSET media_types: list[str] | None | Unset = UNSET name: None | str | Unset = UNSET polling: None | str | Unset = UNSET @@ -34,6 +59,54 @@ class UpdateSourceBody: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + cloud_drive_content_types: None | str | Unset + if isinstance(self.cloud_drive_content_types, Unset): + cloud_drive_content_types = UNSET + else: + cloud_drive_content_types = self.cloud_drive_content_types + + cloud_drive_folder_path: None | str | Unset + if isinstance(self.cloud_drive_folder_path, Unset): + cloud_drive_folder_path = UNSET + else: + cloud_drive_folder_path = self.cloud_drive_folder_path + + cloud_drive_max_file_mb: int | None | Unset + if isinstance(self.cloud_drive_max_file_mb, Unset): + cloud_drive_max_file_mb = UNSET + else: + cloud_drive_max_file_mb = self.cloud_drive_max_file_mb + + cloud_drive_path_pattern: None | str | Unset + if isinstance(self.cloud_drive_path_pattern, Unset): + cloud_drive_path_pattern = UNSET + else: + cloud_drive_path_pattern = self.cloud_drive_path_pattern + + document_images: bool | None | Unset + if isinstance(self.document_images, Unset): + document_images = UNSET + else: + document_images = self.document_images + + email_allowed_senders: list[str] | None | Unset + if isinstance(self.email_allowed_senders, Unset): + email_allowed_senders = UNSET + elif isinstance(self.email_allowed_senders, list): + email_allowed_senders = self.email_allowed_senders + + else: + email_allowed_senders = self.email_allowed_senders + + feed_attachments: list[str] | None | Unset + if isinstance(self.feed_attachments, Unset): + feed_attachments = UNSET + elif isinstance(self.feed_attachments, list): + feed_attachments = self.feed_attachments + + else: + feed_attachments = self.feed_attachments + media_types: list[str] | None | Unset if isinstance(self.media_types, Unset): media_types = UNSET @@ -64,6 +137,20 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if cloud_drive_content_types is not UNSET: + field_dict["cloud_drive_content_types"] = cloud_drive_content_types + if cloud_drive_folder_path is not UNSET: + field_dict["cloud_drive_folder_path"] = cloud_drive_folder_path + if cloud_drive_max_file_mb is not UNSET: + field_dict["cloud_drive_max_file_mb"] = cloud_drive_max_file_mb + if cloud_drive_path_pattern is not UNSET: + field_dict["cloud_drive_path_pattern"] = cloud_drive_path_pattern + if document_images is not UNSET: + field_dict["document_images"] = document_images + if email_allowed_senders is not UNSET: + field_dict["email_allowed_senders"] = email_allowed_senders + if feed_attachments is not UNSET: + field_dict["feed_attachments"] = feed_attachments if media_types is not UNSET: field_dict["media_types"] = media_types if name is not UNSET: @@ -79,6 +166,95 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + def _parse_cloud_drive_content_types(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cloud_drive_content_types = _parse_cloud_drive_content_types( + d.pop("cloud_drive_content_types", UNSET) + ) + + def _parse_cloud_drive_folder_path(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cloud_drive_folder_path = _parse_cloud_drive_folder_path( + d.pop("cloud_drive_folder_path", UNSET) + ) + + def _parse_cloud_drive_max_file_mb(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + cloud_drive_max_file_mb = _parse_cloud_drive_max_file_mb( + d.pop("cloud_drive_max_file_mb", UNSET) + ) + + def _parse_cloud_drive_path_pattern(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cloud_drive_path_pattern = _parse_cloud_drive_path_pattern( + d.pop("cloud_drive_path_pattern", UNSET) + ) + + def _parse_document_images(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + document_images = _parse_document_images(d.pop("document_images", UNSET)) + + def _parse_email_allowed_senders(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() + email_allowed_senders_type_0 = cast(list[str], data) + + return email_allowed_senders_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + email_allowed_senders = _parse_email_allowed_senders( + d.pop("email_allowed_senders", UNSET) + ) + + def _parse_feed_attachments(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() + feed_attachments_type_0 = cast(list[str], data) + + return feed_attachments_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + feed_attachments = _parse_feed_attachments(d.pop("feed_attachments", UNSET)) + def _parse_media_types(data: object) -> list[str] | None | Unset: if data is None: return data @@ -124,6 +300,13 @@ def _parse_retention_days(data: object) -> int | None | Unset: retention_days = _parse_retention_days(d.pop("retention_days", UNSET)) update_source_body = cls( + cloud_drive_content_types=cloud_drive_content_types, + cloud_drive_folder_path=cloud_drive_folder_path, + cloud_drive_max_file_mb=cloud_drive_max_file_mb, + cloud_drive_path_pattern=cloud_drive_path_pattern, + document_images=document_images, + email_allowed_senders=email_allowed_senders, + feed_attachments=feed_attachments, media_types=media_types, name=name, polling=polling, diff --git a/seclai/seclai.py b/seclai/seclai.py index 3c2b425..4451c27 100644 --- a/seclai/seclai.py +++ b/seclai/seclai.py @@ -47,7 +47,17 @@ from http import HTTPStatus from io import BytesIO from pathlib import Path -from typing import Any, BinaryIO, Literal, Self, TypedDict, TypeVar, cast, overload +from typing import ( + Any, + BinaryIO, + Literal, + NotRequired, + Self, + TypedDict, + TypeVar, + cast, + overload, +) import httpx @@ -88,6 +98,12 @@ class AgentRunStreamRequest(TypedDict): input: str | None metadata: dict[str, JSONValue] + #: Receive ``stream_reasoning`` events carrying the model's reasoning, for a + #: ``streaming_result`` step whose author enabled ``show_reasoning``. + include_reasoning: NotRequired[bool] + input_upload_id: NotRequired[str | None] + input_upload_ids: NotRequired[list[str] | None] + replay_of_run_id: NotRequired[str | None] #: Default API base URL. Override via the ``SECLAI_API_URL`` environment variable. @@ -1527,6 +1543,147 @@ def list_content_embeddings( ) return _expect_model(parsed, ContentEmbeddingsListResponse) + def list_content_attachments( + self, + source_connection_content_version: str, + *, + page: int | None = None, + limit: int | None = None, + ) -> dict[str, Any]: + """List the files attached to a content item. + + An agent's ``write_content_attachment`` step attaches a file, an email + source attaches the files sent with a message, an RSS source the feed + files chosen in its ``feed_attachments``, and a source that indexes + media or document images attaches those images and videos. + + Args: + source_connection_content_version: Content version identifier. + page: Page number (1-indexed, default 1). + limit: Items per page (default 20). + + Returns: + The attachments under ``data``, each with its indexing status, and + ``pagination``. + """ + return cast( + dict[str, Any], + self.request( + "GET", + f"/contents/{source_connection_content_version}/attachments", + params=_strip_none({"page": page, "limit": limit}), + ), + ) + + def get_content_attachment( + self, + source_connection_content_version: str, + attachment_id: str, + *, + start: int | None = None, + end: int | None = None, + ) -> dict[str, Any]: + """Get one file attached to a content item. + + Args: + source_connection_content_version: Content version identifier. + attachment_id: The ``id`` of an entry in + :meth:`list_content_attachments`. + start: Start offset of the returned text (default 0). + end: End offset of the returned text (default 5000). + + Returns: + The attachment's indexing status and reason, its metadata, and the + text it is indexed by. A file that was not indexed has no text. + """ + return cast( + dict[str, Any], + self.request( + "GET", + f"/contents/{source_connection_content_version}/attachments/{attachment_id}", + params=_strip_none({"start": start, "end": end}), + ), + ) + + def list_content_attachment_embeddings( + self, + source_connection_content_version: str, + attachment_id: str, + *, + page: int | None = None, + limit: int | None = None, + ) -> dict[str, Any]: + """List the embeddings an attached file is indexed by. + + Args: + source_connection_content_version: Content version identifier. + attachment_id: Attachment identifier. + page: Page number (1-indexed, default 1). + limit: Items per page (1-100, default 20). + + Returns: + A page of embeddings; empty for a file with no completed index. + """ + return cast( + dict[str, Any], + self.request( + "GET", + f"/contents/{source_connection_content_version}/attachments/{attachment_id}/embeddings", + params=_strip_none({"page": page, "limit": limit}), + ), + ) + + def download_content_attachment( + self, + source_connection_content_version: str, + attachment_id: str, + ) -> httpx.Response: + """Download the bytes of a file attached to a content item. + + Returns a **streaming** response. The caller is responsible for + consuming and closing the response:: + + response = client.download_content_attachment("content", "att") + try: + for chunk in response.iter_bytes(): + f.write(chunk) + finally: + response.close() + + Images, audio, video, PDF and plain text are served with their own + content type; anything else as ``application/octet-stream``. A file + withheld by a governance policy, or still being indexed after arriving + from outside, answers 403 — the attachment's ``file_withheld`` field + says which beforehand. + + Args: + source_connection_content_version: Content version identifier. + attachment_id: Attachment identifier. + + Returns: + A streaming ``httpx.Response``. Must be closed by the caller. + + Raises: + SeclaiAPIStatusError: If the API returns a non-success status code. + """ + request = self._client.build_request( + "GET", + f"/contents/{source_connection_content_version}/attachments/{attachment_id}/file", + headers=_merge_request_headers( + options=self._options, + client_headers=self._client.headers, + request_headers=None, + ), + ) + response = self._client.send(request, stream=True) + if response.is_error: + # Read the body for a useful error message, then release the + # connection before raising. + response.read() + response.close() + _raise_for_status(response) + return response + def list_sources( self, *, @@ -2241,7 +2398,8 @@ def get_agent_attachment_references(self, agent_id: str) -> dict[str, Any]: agent_id: Agent identifier. Returns: - The agent's attachment-reference contract. + The agent's attachment-reference contract, including the + ``accepted_attachments`` its trigger declares. """ return cast( dict[str, Any], @@ -2264,9 +2422,11 @@ def download_agent_run_attachment( consuming and closing the response:: response = client.download_agent_run_attachment("run", "att") - with response: + try: for chunk in response.iter_bytes(): f.write(chunk) + finally: + response.close() Args: run_id: Run identifier. @@ -2944,7 +3104,8 @@ def set_email_trigger_config( agent_id: Agent identifier. trigger_id: Trigger identifier. body: Fields to set (alias, allowed_senders, ignore_auto_generated, - require_sender_auth, queue_on_quota). Omitted fields are unchanged. + require_sender_auth, queue_on_quota, run_on_attachment_mismatch). + Omitted fields are unchanged. Returns: The trigger's resolved email address(es) and config. @@ -2959,6 +3120,42 @@ def set_email_trigger_config( ), ) + def set_accepted_attachments( + self, + agent_id: str, + trigger_id: str, + accepted_attachments: list[dict[str, Any]] | None, + ) -> dict[str, Any]: + """Declare the input attachments a trigger accepts. + + Replaces the trigger's declaration. A run's files are each assigned to + one declared attachment before any step runs, and steps reference one as + ``{{agent.attachments.}}``. Only ``dynamic_input`` and + ``email_received`` triggers take files. The API answers 400 when the + agent references an attachment the new declaration leaves out. + + Args: + agent_id: Agent identifier. + trigger_id: Trigger identifier, as :meth:`get_agent` returns it. + accepted_attachments: The attachments, each with a ``name`` and + optional ``label``, ``content_types``, ``name_pattern``, ``min`` + and ``max``. ``None`` accepts any files, as one attachment named + ``files``. Sent as given, so ``None`` is sent as ``null``. + + Returns: + The trigger's ``accepted_attachments`` with its ``agent_id`` and + ``trigger_id``. + """ + body: dict[str, Any] = {"accepted_attachments": accepted_attachments} + return cast( + dict[str, Any], + self.request( + "PUT", + f"/agents/{agent_id}/triggers/{trigger_id}/accepted-attachments", + json=body, + ), + ) + # ── Knowledge Bases ─────────────────────────────────────────────────────── def list_knowledge_bases( @@ -3328,6 +3525,39 @@ def update_source(self, source_id: str, body: dict[str, Any]) -> dict[str, Any]: ), ) + def list_email_source_rejections( + self, + source_id: str, + *, + page: int | None = None, + limit: int | None = None, + ) -> dict[str, Any]: + """List mail an email content source refused, newest first. + + Each entry says who sent the message and why it was refused, never its + subject or body. To accept a refused sender, add its ``from_address`` or + that address's domain to the source's ``email_allowed_senders`` — which + only helps when ``authenticated`` is true. Requires an account owner or + administrator; the API answers 404 for a source that is not an email + source. + + Args: + source_id: Source identifier. + page: Page number (1-indexed, default 1). + limit: Items per page (1-100, default 20). + + Returns: + The refusals under ``data``, and ``pagination``. + """ + return cast( + dict[str, Any], + self.request( + "GET", + f"/sources/{source_id}/email-rejections", + params=_strip_none({"page": page, "limit": limit}), + ), + ) + def delete_source(self, source_id: str) -> None: """Delete a source. @@ -3524,9 +3754,11 @@ def download_source_export(self, source_id: str, export_id: str) -> httpx.Respon consuming and closing the response:: response = client.download_source_export("src", "exp") - with response: + try: for chunk in response.iter_bytes(): f.write(chunk) + finally: + response.close() Args: source_id: Source identifier. @@ -5824,6 +6056,148 @@ async def list_content_embeddings( ) return _expect_model(parsed, ContentEmbeddingsListResponse) + async def list_content_attachments( + self, + source_connection_content_version: str, + *, + page: int | None = None, + limit: int | None = None, + ) -> dict[str, Any]: + """List the files attached to a content item. + + An agent's ``write_content_attachment`` step attaches a file, an email + source attaches the files sent with a message, an RSS source the feed + files chosen in its ``feed_attachments``, and a source that indexes + media or document images attaches those images and videos. + + Args: + source_connection_content_version: Content version identifier. + page: Page number (1-indexed, default 1). + limit: Items per page (default 20). + + Returns: + The attachments under ``data``, each with its indexing status, and + ``pagination``. + """ + return cast( + dict[str, Any], + await self.request( + "GET", + f"/contents/{source_connection_content_version}/attachments", + params=_strip_none({"page": page, "limit": limit}), + ), + ) + + async def get_content_attachment( + self, + source_connection_content_version: str, + attachment_id: str, + *, + start: int | None = None, + end: int | None = None, + ) -> dict[str, Any]: + """Get one file attached to a content item. + + Args: + source_connection_content_version: Content version identifier. + attachment_id: The ``id`` of an entry in + :meth:`list_content_attachments`. + start: Start offset of the returned text (default 0). + end: End offset of the returned text (default 5000). + + Returns: + The attachment's indexing status and reason, its metadata, and the + text it is indexed by. A file that was not indexed has no text. + """ + return cast( + dict[str, Any], + await self.request( + "GET", + f"/contents/{source_connection_content_version}/attachments/{attachment_id}", + params=_strip_none({"start": start, "end": end}), + ), + ) + + async def list_content_attachment_embeddings( + self, + source_connection_content_version: str, + attachment_id: str, + *, + page: int | None = None, + limit: int | None = None, + ) -> dict[str, Any]: + """List the embeddings an attached file is indexed by. + + Args: + source_connection_content_version: Content version identifier. + attachment_id: Attachment identifier. + page: Page number (1-indexed, default 1). + limit: Items per page (1-100, default 20). + + Returns: + A page of embeddings; empty for a file with no completed index. + """ + return cast( + dict[str, Any], + await self.request( + "GET", + f"/contents/{source_connection_content_version}/attachments/{attachment_id}/embeddings", + params=_strip_none({"page": page, "limit": limit}), + ), + ) + + async def download_content_attachment( + self, + source_connection_content_version: str, + attachment_id: str, + ) -> httpx.Response: + """Download the bytes of a file attached to a content item. + + Returns a **streaming** response. The caller is responsible for + consuming and closing the response:: + + response = await client.download_content_attachment("content", "att") + try: + async for chunk in response.aiter_bytes(): + f.write(chunk) + finally: + await response.aclose() + + Images, audio, video, PDF and plain text are served with their own + content type; anything else as ``application/octet-stream``. A file + withheld by a governance policy, or still being indexed after arriving + from outside, answers 403 — the attachment's ``file_withheld`` field + says which beforehand. + + Args: + source_connection_content_version: Content version identifier. + attachment_id: Attachment identifier. + + Returns: + A streaming ``httpx.Response``. Must be closed by the caller. + + Raises: + SeclaiAPIStatusError: If the API returns a non-success status code. + """ + headers = await _merge_request_headers_async( + options=self._options, + client_headers=self._client.headers, + request_headers=None, + ) + request = self._client.build_request( + "GET", + f"/contents/{source_connection_content_version}/attachments/{attachment_id}/file", + headers=headers, + ) + response = await self._client.send(request, stream=True) + if response.is_error: + # Read the body for a useful error message, then release the + # connection before raising. + await response.aread() + await response.aclose() + _raise_for_status(response) + return response + async def list_sources( self, *, @@ -6550,7 +6924,8 @@ async def get_agent_attachment_references(self, agent_id: str) -> dict[str, Any] agent_id: Agent identifier. Returns: - The agent's attachment-reference contract. + The agent's attachment-reference contract, including the + ``accepted_attachments`` its trigger declares. """ return cast( dict[str, Any], @@ -6573,9 +6948,11 @@ async def download_agent_run_attachment( consuming and closing the response:: response = await client.download_agent_run_attachment("run", "att") - async with response: + try: async for chunk in response.aiter_bytes(): f.write(chunk) + finally: + await response.aclose() Args: run_id: Run identifier. @@ -7257,7 +7634,8 @@ async def set_email_trigger_config( agent_id: Agent identifier. trigger_id: Trigger identifier. body: Fields to set (alias, allowed_senders, ignore_auto_generated, - require_sender_auth, queue_on_quota). Omitted fields are unchanged. + require_sender_auth, queue_on_quota, run_on_attachment_mismatch). + Omitted fields are unchanged. Returns: The trigger's resolved email address(es) and config. @@ -7272,6 +7650,42 @@ async def set_email_trigger_config( ), ) + async def set_accepted_attachments( + self, + agent_id: str, + trigger_id: str, + accepted_attachments: list[dict[str, Any]] | None, + ) -> dict[str, Any]: + """Declare the input attachments a trigger accepts. + + Replaces the trigger's declaration. A run's files are each assigned to + one declared attachment before any step runs, and steps reference one as + ``{{agent.attachments.}}``. Only ``dynamic_input`` and + ``email_received`` triggers take files. The API answers 400 when the + agent references an attachment the new declaration leaves out. + + Args: + agent_id: Agent identifier. + trigger_id: Trigger identifier, as :meth:`get_agent` returns it. + accepted_attachments: The attachments, each with a ``name`` and + optional ``label``, ``content_types``, ``name_pattern``, ``min`` + and ``max``. ``None`` accepts any files, as one attachment named + ``files``. Sent as given, so ``None`` is sent as ``null``. + + Returns: + The trigger's ``accepted_attachments`` with its ``agent_id`` and + ``trigger_id``. + """ + body: dict[str, Any] = {"accepted_attachments": accepted_attachments} + return cast( + dict[str, Any], + await self.request( + "PUT", + f"/agents/{agent_id}/triggers/{trigger_id}/accepted-attachments", + json=body, + ), + ) + # ── Knowledge Bases ─────────────────────────────────────────────────────── async def list_knowledge_bases( @@ -7652,6 +8066,39 @@ async def update_source( ), ) + async def list_email_source_rejections( + self, + source_id: str, + *, + page: int | None = None, + limit: int | None = None, + ) -> dict[str, Any]: + """List mail an email content source refused, newest first. + + Each entry says who sent the message and why it was refused, never its + subject or body. To accept a refused sender, add its ``from_address`` or + that address's domain to the source's ``email_allowed_senders`` — which + only helps when ``authenticated`` is true. Requires an account owner or + administrator; the API answers 404 for a source that is not an email + source. + + Args: + source_id: Source identifier. + page: Page number (1-indexed, default 1). + limit: Items per page (1-100, default 20). + + Returns: + The refusals under ``data``, and ``pagination``. + """ + return cast( + dict[str, Any], + await self.request( + "GET", + f"/sources/{source_id}/email-rejections", + params=_strip_none({"page": page, "limit": limit}), + ), + ) + async def delete_source(self, source_id: str) -> None: """Delete a source. @@ -7854,9 +8301,11 @@ async def download_source_export( consuming and closing the response:: response = await client.download_source_export("src", "exp") - async with response: + try: async for chunk in response.aiter_bytes(): f.write(chunk) + finally: + await response.aclose() Args: source_id: Source identifier. diff --git a/seclai/versions.py b/seclai/versions.py index 7ebfb70..aaf4ddd 100644 --- a/seclai/versions.py +++ b/seclai/versions.py @@ -25,13 +25,18 @@ class ApiVersion(StrEnum): V2026_09_28 = "2026-09-28" V2026_09_30 = "2026-09-30" V2026_10_03 = "2026-10-03" + V2026_10_05 = "2026-10-05" + V2026_10_13 = "2026-10-13" + V2026_10_16 = "2026-10-16" + V2026_10_18 = "2026-10-18" + V2026_10_19 = "2026-10-19" #: Baseline applied to an unpinned, header-less caller. DEFAULT_API_VERSION = ApiVersion.V2026_07_01 #: Newest version known to this SDK release. May lag the server. -LATEST_API_VERSION = ApiVersion.V2026_10_03 +LATEST_API_VERSION = ApiVersion.V2026_10_19 def validate_api_version(version: str | None, *, allow_unknown: bool) -> str | None: diff --git a/tests/test_new_methods.py b/tests/test_new_methods.py index da39c5a..41a6ffa 100644 --- a/tests/test_new_methods.py +++ b/tests/test_new_methods.py @@ -4197,3 +4197,267 @@ async def test_async_parity(self) -> None: async for item in client.paginate("GET", "/agents/a1/evaluation-criteria") ] assert items == [{"id": "ec1"}] + + +# --------------------------------------------------------------------------- +# 2026-10-19: content attachments, accepted attachments, email-source refusals +# --------------------------------------------------------------------------- + +_SLOTS = [ + {"name": "invoice", "content_types": ["application/pdf"], "min": 1, "max": 1}, + {"name": "photos", "content_types": ["image/*"], "name_pattern": "*.jpg"}, +] + +# (method, args, kwargs, verb, path, query, body). One table drives the sync and +# async tests, so the two classes cannot be asserted against different +# expectations. +_SYNC_2026_10_19_CALLS: list[ + tuple[str, tuple[Any, ...], dict[str, Any], str, str, list[tuple[str, str]], Any] +] = [ + ( + "list_content_attachments", + ("cv1",), + {"page": 2, "limit": 5}, + "GET", + "/contents/cv1/attachments", + [("page", "2"), ("limit", "5")], + None, + ), + ( + "list_content_attachments", + ("cv1",), + {}, + "GET", + "/contents/cv1/attachments", + [], + None, + ), + ( + "get_content_attachment", + ("cv1", "att1"), + {"start": 100, "end": 200}, + "GET", + "/contents/cv1/attachments/att1", + [("start", "100"), ("end", "200")], + None, + ), + ( + "get_content_attachment", + ("cv1", "att1"), + {}, + "GET", + "/contents/cv1/attachments/att1", + [], + None, + ), + ( + "list_content_attachment_embeddings", + ("cv1", "att1"), + {"page": 3, "limit": 50}, + "GET", + "/contents/cv1/attachments/att1/embeddings", + [("page", "3"), ("limit", "50")], + None, + ), + ( + "list_content_attachment_embeddings", + ("cv1", "att1"), + {}, + "GET", + "/contents/cv1/attachments/att1/embeddings", + [], + None, + ), + ( + "set_accepted_attachments", + ("a1", "t1", _SLOTS), + {}, + "PUT", + "/agents/a1/triggers/t1/accepted-attachments", + [], + {"accepted_attachments": _SLOTS}, + ), + ( + # None means "accept any files" and must reach the API as an explicit null. + "set_accepted_attachments", + ("a1", "t1", None), + {}, + "PUT", + "/agents/a1/triggers/t1/accepted-attachments", + [], + {"accepted_attachments": None}, + ), + ( + "list_email_source_rejections", + ("s1",), + {"page": 2, "limit": 100}, + "GET", + "/sources/s1/email-rejections", + [("page", "2"), ("limit", "100")], + None, + ), + ( + "list_email_source_rejections", + ("s1",), + {}, + "GET", + "/sources/s1/email-rejections", + [], + None, + ), +] + +_ENVELOPE_BODY = {"data": [{"id": "x1"}], "pagination": _ENVELOPE_PAGINATION} + + +class TestAttachmentsAndEmailSourceRejections: + @pytest.mark.parametrize( + ("name", "args", "kwargs", "verb", "path", "query", "body"), + _SYNC_2026_10_19_CALLS, + ) + def test_request( + self, + name: str, + args: tuple[Any, ...], + kwargs: dict[str, Any], + verb: str, + path: str, + query: list[tuple[str, str]], + body: Any, + ) -> None: + seen: dict[str, Any] = {} + client = _sync_client(_recording_handler(seen, _ENVELOPE_BODY)) + result = getattr(client, name)(*args, **kwargs) + assert seen == {"method": verb, "path": path, "query": query, "body": body} + assert result == _ENVELOPE_BODY + + @pytest.mark.asyncio + @pytest.mark.parametrize( + ("name", "args", "kwargs", "verb", "path", "query", "body"), + _SYNC_2026_10_19_CALLS, + ) + async def test_request_async( + self, + name: str, + args: tuple[Any, ...], + kwargs: dict[str, Any], + verb: str, + path: str, + query: list[tuple[str, str]], + body: Any, + ) -> None: + seen: dict[str, Any] = {} + client = _async_client(_recording_handler(seen, _ENVELOPE_BODY)) + result = await getattr(client, name)(*args, **kwargs) + assert seen == {"method": verb, "path": path, "query": query, "body": body} + assert result == _ENVELOPE_BODY + + def test_download_content_attachment(self) -> None: + seen: dict[str, Any] = {} + + def handler(req: httpx.Request) -> httpx.Response: + seen["method"] = req.method + seen["path"] = req.url.path + seen["query"] = list(req.url.params.multi_items()) + return httpx.Response( + status_code=200, + content=b"%PDF-bytes", + headers={"content-type": "application/pdf"}, + ) + + client = _sync_client(handler) + resp = client.download_content_attachment("cv1", "att1") + assert seen == { + "method": "GET", + "path": "/contents/cv1/attachments/att1/file", + "query": [], + } + try: + assert resp.read() == b"%PDF-bytes" + finally: + resp.close() + assert resp.headers["content-type"] == "application/pdf" + + def test_download_content_attachment_withheld_closes_stream(self) -> None: + from seclai import SeclaiAPIStatusError + + captured: dict[str, httpx.Response] = {} + + def handler(req: httpx.Request) -> httpx.Response: + resp = httpx.Response(status_code=403, json={"detail": "withheld"}) + captured["resp"] = resp + return resp + + client = _sync_client(handler) + with pytest.raises(SeclaiAPIStatusError) as exc: + client.download_content_attachment("cv1", "att1") + assert exc.value.status_code == 403 + assert "withheld" in (exc.value.response_text or "") + assert captured["resp"].is_closed + + @pytest.mark.asyncio + async def test_async_download_content_attachment(self) -> None: + seen: dict[str, Any] = {} + + async def handler(req: httpx.Request) -> httpx.Response: + seen["method"] = req.method + seen["path"] = req.url.path + return httpx.Response(status_code=200, content=b"img") + + client = _async_client(handler) + resp = await client.download_content_attachment("cv1", "att1") + assert seen == { + "method": "GET", + "path": "/contents/cv1/attachments/att1/file", + } + await resp.aread() + assert resp.content == b"img" + await resp.aclose() + + @pytest.mark.asyncio + async def test_async_download_content_attachment_error_closes_stream( + self, + ) -> None: + from seclai import SeclaiAPIStatusError + + captured: dict[str, httpx.Response] = {} + + async def handler(req: httpx.Request) -> httpx.Response: + resp = httpx.Response(status_code=404, content=b"not found") + captured["resp"] = resp + return resp + + client = _async_client(handler) + with pytest.raises(SeclaiAPIStatusError) as exc: + await client.download_content_attachment("cv1", "missing") + assert exc.value.status_code == 404 + assert captured["resp"].is_closed + + def test_stream_request_sends_include_reasoning(self) -> None: + seen: dict[str, Any] = {} + + def handler(req: httpx.Request) -> httpx.Response: + seen["body"] = json.loads(req.content) + return httpx.Response( + status_code=200, + content=b'event: stream_reasoning\ndata: {"text": "hmm"}\n\n' + b'event: done\ndata: {"run_id": "r1"}\n\n', + headers={"content-type": "text/event-stream"}, + ) + + client = _sync_client(handler) + events = list( + client.run_streaming_agent( + "a1", + AgentRunStreamRequest(input="hi", metadata={}, include_reasoning=True), + ) + ) + assert seen["body"] == { + "input": "hi", + "metadata": {}, + "include_reasoning": True, + } + assert events == [ + ("stream_reasoning", {"text": "hmm"}), + ("done", {"run_id": "r1"}), + ] From c97b03a2bbadcf78c6b44984b04d70de76ffe97b Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Wed, 21 Oct 2026 10:13:14 -0700 Subject: [PATCH 3/8] Addressed review comments #minor --- CHANGELOG.md | 12 +- README.md | 56 +++-- seclai/seclai.py | 486 ++++++++++++++++++++++---------------- tests/test_new_methods.py | 262 +++++++++++++++++++- 4 files changed, 594 insertions(+), 222 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c16a976..f3a58e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,18 +5,20 @@ ### Changed - Sync the bundled OpenAPI spec, adding 6 paths and 10 schemas. The typed models gain the new fields, including `accepted_attachments` on agent create and definition requests and on the attachment-reference contract, `trigger_id` on an agent, `include_reasoning` on a streaming run, `run_on_attachment_mismatch` on an email trigger, the `cloud_drive_*`, `document_images`, `email_allowed_senders`, `feed_attachments` and `email_address` source fields, `held_for_review` on a content status and `skipped_attachments` on a content item -- Move `LATEST_API_VERSION` to `2026-10-19` +- Move `LATEST_API_VERSION` to `2026-10-19`. A client built with `api_version=LATEST_API_VERSION` also opts into `2026-10-05` to `2026-10-19`: a content item held for review reports `content_status` `completed` rather than `failed` (read `held_for_review` instead), `create_source()` and `update_source()` refuse an unknown `media_types` kind, or any on a source other than a website or RSS feed, with a 400, `create_source()` refuses `polling_max_items` on a source other than an RSS feed with a 400, and `upload_agent_input()` accepts any file type, `ready` at once +- Make `input` and `metadata` optional keys of `AgentRunStreamRequest`, and let `metadata` be `None`, as the API schema does. A run on an uploaded file no longer needs `"input": None, "metadata": {}` as filler to satisfy a type checker ### Added -- Add `list_content_attachments()`, `get_content_attachment()`, `list_content_attachment_embeddings()` and `download_content_attachment()` to read the files attached to a content item, with their indexing status. The download returns a streaming `httpx.Response` the caller closes -- Add `set_accepted_attachments()` to declare the input attachments an agent trigger accepts -- Add `list_email_source_rejections()` to list the mail an email content source refused, and why -- Add `include_reasoning`, `input_upload_id`, `input_upload_ids` and `replay_of_run_id` as optional keys of `AgentRunStreamRequest`. `include_reasoning` asks `run_streaming_agent()` for `stream_reasoning` events +- Add `list_content_attachments()`, `get_content_attachment()`, `list_content_attachment_embeddings()` and `download_content_attachment()` to read the files attached to a content item, with their indexing status. The first three return the generated `ContentAttachmentsListResponse`, `ContentAttachmentDetailResponse` and `ContentEmbeddingsListResponse` models; the download returns a streaming `httpx.Response` the caller closes. `get_content_attachment()` sends `start` and `end` only when given, including `end=0` +- Add `set_accepted_attachments()` to declare the input attachments an agent trigger accepts, returning `AcceptedAttachmentsResponse` +- Add `list_email_source_rejections()` to list the mail an email content source refused, and why, returning `EmailSourceRejectionListResponse` +- Add `include_reasoning`, `input_upload_id`, `input_upload_ids` and `replay_of_run_id` as optional keys of `AgentRunStreamRequest`. `include_reasoning` asks `run_streaming_agent()` for `stream_reasoning` events; `run_streaming_agent_and_wait()` discards them - Add `ApiVersion` members for `2026-10-05`, `2026-10-13`, `2026-10-16`, `2026-10-18` and `2026-10-19`, so each can be selected without `allow_unknown_api_version` ### Fixed +- Release the connection and raise `SeclaiAPIStatusError` from `download_agent_run_attachment()` and `download_source_export()` when reading an error response's body fails. The connection leaked, and the caller got the transport error instead of the status - Correct the streaming-download examples of `download_agent_run_attachment()` and `download_source_export()`. They closed the response with `with response:`, which raises `TypeError` because an `httpx.Response` is not a context manager; they now close it in a `finally` block ## [1.7.2] - 2026-10-05 diff --git a/README.md b/README.md index c7a643b..1c0a0d9 100644 --- a/README.md +++ b/README.md @@ -239,10 +239,20 @@ client decodes: | `2026-09-30` | A run's and a step's `output`, and a step's `input`, are the text rather than a JSON manifest; files are in `attachments` on every version | | `2026-10-03` | A new LLM step written without `attachments` takes its parent's files, and a new retrieval step's matched media are its files | | `2026-10-05` | A content item held for review by an Enforce governance policy reports `completed` (with `held_for_review: true`) rather than `failed` | -| `2026-10-13` | A source's `media_types` refuses an unknown kind, or any kind on a source other than a website or RSS feed, with a 400 | +| `2026-10-13` | `create_source()` and `update_source()` refuse a `media_types` with an unknown kind, or any kind on a source other than a website or RSS feed, with a 400 | | `2026-10-16` | `upload_agent_input()` accepts a file of any type and it is `ready` at once; each upload reaches steps as a separate file and `input` carries only a heading for it | | `2026-10-18` | A source's `document_images` defaults to true on a text-only embedder as well | -| `2026-10-19` | `polling_max_items` is refused with a 400 on any source other than an RSS feed | +| `2026-10-19` | `create_source()` refuses `polling_max_items` with a 400 on any source other than an RSS feed | + +Moving to a later version can still change a value your code branches on, or +reject a request that used to work. From `2026-10-05`, a content item held for +review reports `content_status` `completed` rather than `failed`, so code that +reads `failed` from `get_source_content_status()` or `list_source_contents()` to +find held items stops seeing them: check `held_for_review` instead. (The +`status` filter already matched held items under `completed` on every version.) +`2026-10-13` and `2026-10-19` turn source bodies that were accepted before into +400s. Passing +`api_version=LATEST_API_VERSION` opts into all of these at once. ## Resources @@ -346,7 +356,11 @@ for event_type, data in client.run_streaming_agent( Set `include_reasoning=True` in the request to also receive `stream_reasoning` events with the model's reasoning, for a `streaming_result` step whose author -enabled `show_reasoning`. +enabled `show_reasoning`. `run_streaming_agent_and_wait()` keeps only the +`init` and `done` events, so there the flag only adds traffic. + +Every key of `AgentRunStreamRequest` is optional, so a run on an uploaded file +can send just `AgentRunStreamRequest(input_upload_id=upload["upload_id"])`. Async: @@ -392,7 +406,10 @@ client.set_accepted_attachments( ], ) +# Only a dynamic_input agent takes uploads; any other agent answers 400. upload = client.upload_agent_input("agent_id", file=b"data", file_name="input.pdf") +# From api_version 2026-10-16 an upload of any type is ready at once. Before +# that, only listed types are accepted: poll until status is "ready". status = client.get_agent_input_upload_status("agent_id", upload["upload_id"]) ``` @@ -513,8 +530,8 @@ message itself. Requires an account owner or administrator: ```python refused = client.list_email_source_rejections("source_id", page=1, limit=20) -for r in refused["data"]: - print(r["from_address"], r["reason"], r["authenticated"]) +for r in refused.data: # EmailSourceRejectionListResponse + print(r.from_address, r.reason, r.authenticated) ``` ### Cloud drives @@ -597,24 +614,35 @@ client.cancel_source_embedding_migration("source_id") ### Content ```python +import os + detail = client.get_content_detail("source_connection_content_version") embeddings = client.list_content_embeddings("source_connection_content_version") client.delete_content("source_connection_content_version") # Files attached to a content item: email attachments, feed files, page media -# and the images inside documents, each with its indexing status +# and the images inside documents, each with its indexing status. These return +# the generated models (ContentAttachmentsListResponse and so on). attachments = client.list_content_attachments("source_connection_content_version") -att_id = attachments["data"][0]["id"] -att = client.get_content_attachment("source_connection_content_version", att_id) +for item in attachments.data: + print(item.key, item.content_type, item.indexing_status) +att = attachments.data[0] +att_detail = client.get_content_attachment( + "source_connection_content_version", att.id +) +print(att_detail.text_content) # None for a file that was not indexed att_embeddings = client.list_content_attachment_embeddings( - "source_connection_content_version", att_id + "source_connection_content_version", att.id ) response = client.download_content_attachment( - "source_connection_content_version", att_id -) # raw streaming httpx.Response + "source_connection_content_version", att.id +) # raw streaming httpx.Response; 403 if withheld, 402 with no credits left try: - for chunk in response.iter_bytes(): - ... # write to disk + # The key comes from a third party (an email or feed file name), so never + # use it as a path as is: keep only its final component. + with open(os.path.basename(att.key) or att.id, "wb") as f: + for chunk in response.iter_bytes(): + f.write(chunk) finally: response.close() ``` @@ -697,7 +725,7 @@ config = client.set_email_trigger_config( "ignore_auto_generated": True, # drop auto-replies to prevent loops "require_sender_auth": True, # require SPF or DMARC "queue_on_quota": False, # park over-rate mail instead of failing - "run_on_attachment_mismatch": False, # run even if attachments don't fit + "run_on_attachment_mismatch": False, # True runs even if attachments don't fit }, ) print(config["email_addresses"]) diff --git a/seclai/seclai.py b/seclai/seclai.py index 4451c27..18e2826 100644 --- a/seclai/seclai.py +++ b/seclai/seclai.py @@ -62,13 +62,25 @@ import httpx from seclai._generated.client import Client as GeneratedClient +from seclai._generated.models.accepted_attachments_response import ( + AcceptedAttachmentsResponse, +) from seclai._generated.models.agent_run_list_response import AgentRunListResponse from seclai._generated.models.agent_run_request import AgentRunRequest from seclai._generated.models.agent_run_response import AgentRunResponse +from seclai._generated.models.content_attachment_detail_response import ( + ContentAttachmentDetailResponse, +) +from seclai._generated.models.content_attachments_list_response import ( + ContentAttachmentsListResponse, +) from seclai._generated.models.content_detail_response import ContentDetailResponse from seclai._generated.models.content_embeddings_list_response import ( ContentEmbeddingsListResponse, ) +from seclai._generated.models.email_source_rejection_list_response import ( + EmailSourceRejectionListResponse, +) from seclai._generated.models.file_upload_response import FileUploadResponse from seclai._generated.models.http_validation_error import HTTPValidationError from seclai._generated.models.source_list_response import SourceListResponse @@ -93,13 +105,18 @@ class AgentRunStreamRequest(TypedDict): """Request body for streaming agent runs. - This matches the API schema for POST /agents/{agent_id}/runs/stream. + This matches the API schema for POST /agents/{agent_id}/runs/stream. Every + key is optional, as in the schema: a run on an uploaded file can send only + ``input_upload_id``. """ - input: str | None - metadata: dict[str, JSONValue] + input: NotRequired[str | None] + metadata: NotRequired[dict[str, JSONValue] | None] #: Receive ``stream_reasoning`` events carrying the model's reasoning, for a - #: ``streaming_result`` step whose author enabled ``show_reasoning``. + #: ``streaming_result`` step whose author enabled ``show_reasoning``. Only + #: :meth:`Seclai.run_streaming_agent` yields them; + #: :meth:`Seclai.run_streaming_agent_and_wait` discards every event but + #: ``init`` and ``done``, so there it only adds traffic. include_reasoning: NotRequired[bool] input_upload_id: NotRequired[str | None] input_upload_ids: NotRequired[list[str] | None] @@ -309,6 +326,24 @@ def _expect_model(parsed: object, model: type[_ModelT]) -> _ModelT: return parsed +def _parse_model(payload: object, model: type[_ModelT]) -> _ModelT: + """Decode a JSON response body returned by ``request`` into ``model``. + + A body that is not a JSON object, or does not fit the model, raises + `SeclaiError` rather than the ``KeyError``/``TypeError`` the generated + ``from_dict`` would, so ``except SeclaiError`` handlers still catch it. + """ + if not isinstance(payload, dict): + raise SeclaiError( + f"Expected a JSON object for {model.__name__}, got {type(payload).__name__}." + ) + try: + # Every generated model has a ``from_dict`` classmethod. + return cast(_ModelT, cast(Any, model).from_dict(payload)) + except (KeyError, TypeError, ValueError, AttributeError) as e: + raise SeclaiError(f"Could not decode {model.__name__}: {e!r}") from e + + class SeclaiError(Exception): """Base error for the Seclai SDK.""" @@ -1037,6 +1072,37 @@ def request( return cast(JSONValue, response.json()) return response.text + def _stream_get( + self, path: str, *, params: Mapping[str, Any] | None = None + ) -> httpx.Response: + """Send a GET and return the response unread, for the caller to stream. + + On an error status the body is read for the error message and the + connection released before raising. A transport error while reading + that body still closes the response and raises the status error, with + no response text, rather than the transport error. + """ + request = self._client.build_request( + "GET", + path, + params=params, + headers=_merge_request_headers( + options=self._options, + client_headers=self._client.headers, + request_headers=None, + ), + ) + response = self._client.send(request, stream=True) + if response.is_error: + try: + response.read() + except httpx.HTTPError: + pass + finally: + response.close() + _raise_for_status(response) + return response + def run_agent(self, agent_id: str, body: AgentRunRequest) -> AgentRunResponse: """Run an agent. @@ -1099,7 +1165,10 @@ def run_streaming_agent_and_wait( """Run an agent via SSE streaming and block until completion. This uses POST /agents/{agent_id}/runs/stream and consumes Server-Sent Events (SSE). - The method returns when an `event: done` message is received. + The method returns when an `event: done` message is received. Every event + but `init` and `done` is discarded, so `include_reasoning` has no effect + here beyond extra traffic; use `run_streaming_agent` to receive + `stream_reasoning` events. Args: agent_id: Agent identifier. @@ -1549,7 +1618,7 @@ def list_content_attachments( *, page: int | None = None, limit: int | None = None, - ) -> dict[str, Any]: + ) -> ContentAttachmentsListResponse: """List the files attached to a content item. An agent's ``write_content_attachment`` step attaches a file, an email @@ -1565,15 +1634,18 @@ def list_content_attachments( Returns: The attachments under ``data``, each with its indexing status, and ``pagination``. + + Raises: + SeclaiAPIValidationError: If the API returns a validation error. + SeclaiAPIStatusError: If the API returns a non-success status code. + SeclaiError: If the response body does not decode as the model. """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/contents/{source_connection_content_version}/attachments", - params=_strip_none({"page": page, "limit": limit}), - ), + payload = self.request( + "GET", + f"/contents/{source_connection_content_version}/attachments", + params=_strip_none({"page": page, "limit": limit}), ) + return _parse_model(payload, ContentAttachmentsListResponse) def get_content_attachment( self, @@ -1582,28 +1654,37 @@ def get_content_attachment( *, start: int | None = None, end: int | None = None, - ) -> dict[str, Any]: + ) -> ContentAttachmentDetailResponse: """Get one file attached to a content item. Args: source_connection_content_version: Content version identifier. attachment_id: The ``id`` of an entry in :meth:`list_content_attachments`. - start: Start offset of the returned text (default 0). - end: End offset of the returned text (default 5000). + start: Start offset of the returned text. Omitted, the API + uses 0. + end: End offset of the returned text. Omitted, the API uses 5000. + Any value from 0, the API's minimum, is sent as given, so + ``end=0`` asks for the status and metadata without the text. + :meth:`get_content_detail` also sends ``end=0``; it differs + only in sending its defaults explicitly. Returns: The attachment's indexing status and reason, its metadata, and the text it is indexed by. A file that was not indexed has no text. + + Raises: + SeclaiAPIValidationError: If the API returns a validation error. + SeclaiAPIStatusError: If the API returns a non-success status code, + including 402 when the account has no credits left. + SeclaiError: If the response body does not decode as the model. """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/contents/{source_connection_content_version}/attachments/{attachment_id}", - params=_strip_none({"start": start, "end": end}), - ), + payload = self.request( + "GET", + f"/contents/{source_connection_content_version}/attachments/{attachment_id}", + params=_strip_none({"start": start, "end": end}), ) + return _parse_model(payload, ContentAttachmentDetailResponse) def list_content_attachment_embeddings( self, @@ -1612,7 +1693,7 @@ def list_content_attachment_embeddings( *, page: int | None = None, limit: int | None = None, - ) -> dict[str, Any]: + ) -> ContentEmbeddingsListResponse: """List the embeddings an attached file is indexed by. Args: @@ -1622,16 +1703,22 @@ def list_content_attachment_embeddings( limit: Items per page (1-100, default 20). Returns: - A page of embeddings; empty for a file with no completed index. + A page of embeddings, the same model as + :meth:`list_content_embeddings`; empty for a file with no completed + index. + + Raises: + SeclaiAPIValidationError: If the API returns a validation error. + SeclaiAPIStatusError: If the API returns a non-success status code, + including 402 when the account has no credits left. + SeclaiError: If the response body does not decode as the model. """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/contents/{source_connection_content_version}/attachments/{attachment_id}/embeddings", - params=_strip_none({"page": page, "limit": limit}), - ), + payload = self.request( + "GET", + f"/contents/{source_connection_content_version}/attachments/{attachment_id}/embeddings", + params=_strip_none({"page": page, "limit": limit}), ) + return _parse_model(payload, ContentEmbeddingsListResponse) def download_content_attachment( self, @@ -1654,7 +1741,11 @@ def download_content_attachment( content type; anything else as ``application/octet-stream``. A file withheld by a governance policy, or still being indexed after arriving from outside, answers 403 — the attachment's ``file_withheld`` field - says which beforehand. + says which beforehand. An account with no credits left gets 402. + + The client's ``timeout`` bounds connecting and each read, not the whole + transfer, so a large file is not cut off while bytes keep arriving. + Closing the response stops a download early. Args: source_connection_content_version: Content version identifier. @@ -1664,25 +1755,13 @@ def download_content_attachment( A streaming ``httpx.Response``. Must be closed by the caller. Raises: - SeclaiAPIStatusError: If the API returns a non-success status code. + SeclaiAPIStatusError: If the API returns a non-success status code: + 403 for a withheld file, 402 when the account has no credits + left. """ - request = self._client.build_request( - "GET", - f"/contents/{source_connection_content_version}/attachments/{attachment_id}/file", - headers=_merge_request_headers( - options=self._options, - client_headers=self._client.headers, - request_headers=None, - ), + return self._stream_get( + f"/contents/{source_connection_content_version}/attachments/{attachment_id}/file" ) - response = self._client.send(request, stream=True) - if response.is_error: - # Read the body for a useful error message, then release the - # connection before raising. - response.read() - response.close() - _raise_for_status(response) - return response def list_sources( self, @@ -2339,6 +2418,16 @@ def upload_agent_input( ) -> dict[str, Any]: """Upload a file as input for an agent run. + Only a ``dynamic_input`` agent takes uploads; any other agent answers + 400. The limit is 200 MB per file. + + From ``Seclai-Version: 2026-10-16`` a file of any type is accepted and + is ``ready`` at once, so pass its ``upload_id`` as ``input_upload_id`` + to a run straight away. Earlier versions accept only a fixed list of + extensions and extract each file's text into ``input``: poll + :meth:`get_agent_input_upload_status` until ``status`` is ``ready`` + before running. + Args: agent_id: Agent identifier. file: File payload (bytes, path, or file-like). @@ -2438,25 +2527,10 @@ def download_agent_run_attachment( Returns: A streaming ``httpx.Response``. Must be closed by the caller. """ - request = self._client.build_request( - "GET", + return self._stream_get( f"/v2/agent-runs/{run_id}/attachments/{attachment_id}", params=_strip_none({"download_name": download_name}), - headers=_merge_request_headers( - options=self._options, - client_headers=self._client.headers, - request_headers=None, - ), ) - response = self._client.send(request, stream=True) - if response.is_error: - # Read the body for a useful error message, then release the - # connection before raising — the caller never receives the - # streaming response on the error path. - response.read() - response.close() - _raise_for_status(response) - return response # ── Agent AI Assistant ──────────────────────────────────────────────────── @@ -3125,7 +3199,7 @@ def set_accepted_attachments( agent_id: str, trigger_id: str, accepted_attachments: list[dict[str, Any]] | None, - ) -> dict[str, Any]: + ) -> AcceptedAttachmentsResponse: """Declare the input attachments a trigger accepts. Replaces the trigger's declaration. A run's files are each assigned to @@ -3145,16 +3219,19 @@ def set_accepted_attachments( Returns: The trigger's ``accepted_attachments`` with its ``agent_id`` and ``trigger_id``. + + Raises: + SeclaiAPIValidationError: If the API returns a validation error. + SeclaiAPIStatusError: If the API returns a non-success status code. + SeclaiError: If the response body does not decode as the model. """ body: dict[str, Any] = {"accepted_attachments": accepted_attachments} - return cast( - dict[str, Any], - self.request( - "PUT", - f"/agents/{agent_id}/triggers/{trigger_id}/accepted-attachments", - json=body, - ), + payload = self.request( + "PUT", + f"/agents/{agent_id}/triggers/{trigger_id}/accepted-attachments", + json=body, ) + return _parse_model(payload, AcceptedAttachmentsResponse) # ── Knowledge Bases ─────────────────────────────────────────────────────── @@ -3531,7 +3608,7 @@ def list_email_source_rejections( *, page: int | None = None, limit: int | None = None, - ) -> dict[str, Any]: + ) -> EmailSourceRejectionListResponse: """List mail an email content source refused, newest first. Each entry says who sent the message and why it was refused, never its @@ -3548,15 +3625,18 @@ def list_email_source_rejections( Returns: The refusals under ``data``, and ``pagination``. + + Raises: + SeclaiAPIValidationError: If the API returns a validation error. + SeclaiAPIStatusError: If the API returns a non-success status code. + SeclaiError: If the response body does not decode as the model. """ - return cast( - dict[str, Any], - self.request( - "GET", - f"/sources/{source_id}/email-rejections", - params=_strip_none({"page": page, "limit": limit}), - ), + payload = self.request( + "GET", + f"/sources/{source_id}/email-rejections", + params=_strip_none({"page": page, "limit": limit}), ) + return _parse_model(payload, EmailSourceRejectionListResponse) def delete_source(self, source_id: str) -> None: """Delete a source. @@ -3767,24 +3847,7 @@ def download_source_export(self, source_id: str, export_id: str) -> httpx.Respon Returns: A streaming ``httpx.Response``. Must be closed by the caller. """ - request = self._client.build_request( - "GET", - f"/sources/{source_id}/exports/{export_id}/download", - headers=_merge_request_headers( - options=self._options, - client_headers=self._client.headers, - request_headers=None, - ), - ) - response = self._client.send(request, stream=True) - if response.is_error: - # Read the body for a useful error message, then release the - # connection before raising — the caller never receives the - # streaming response on the error path. - response.read() - response.close() - _raise_for_status(response) - return response + return self._stream_get(f"/sources/{source_id}/exports/{export_id}/download") def estimate_source_export( self, source_id: str, body: dict[str, Any] @@ -5558,6 +5621,37 @@ async def request( return cast(JSONValue, response.json()) return response.text + async def _stream_get( + self, path: str, *, params: Mapping[str, Any] | None = None + ) -> httpx.Response: + """Send a GET and return the response unread, for the caller to stream. + + On an error status the body is read for the error message and the + connection released before raising. A transport error while reading + that body still closes the response and raises the status error, with + no response text, rather than the transport error. + """ + request = self._client.build_request( + "GET", + path, + params=params, + headers=await _merge_request_headers_async( + options=self._options, + client_headers=self._client.headers, + request_headers=None, + ), + ) + response = await self._client.send(request, stream=True) + if response.is_error: + try: + await response.aread() + except httpx.HTTPError: + pass + finally: + await response.aclose() + _raise_for_status(response) + return response + async def run_agent(self, agent_id: str, body: AgentRunRequest) -> AgentRunResponse: """Run an agent. @@ -5622,7 +5716,10 @@ async def run_streaming_agent_and_wait( """Run an agent via SSE streaming and block until completion (async). This uses POST /agents/{agent_id}/runs/stream and consumes Server-Sent Events (SSE). - The method returns when an `event: done` message is received. + The method returns when an `event: done` message is received. Every event + but `init` and `done` is discarded, so `include_reasoning` has no effect + here beyond extra traffic; use `run_streaming_agent` to receive + `stream_reasoning` events. """ import json as _json import time as _time @@ -6062,7 +6159,7 @@ async def list_content_attachments( *, page: int | None = None, limit: int | None = None, - ) -> dict[str, Any]: + ) -> ContentAttachmentsListResponse: """List the files attached to a content item. An agent's ``write_content_attachment`` step attaches a file, an email @@ -6078,15 +6175,18 @@ async def list_content_attachments( Returns: The attachments under ``data``, each with its indexing status, and ``pagination``. + + Raises: + SeclaiAPIValidationError: If the API returns a validation error. + SeclaiAPIStatusError: If the API returns a non-success status code. + SeclaiError: If the response body does not decode as the model. """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/contents/{source_connection_content_version}/attachments", - params=_strip_none({"page": page, "limit": limit}), - ), + payload = await self.request( + "GET", + f"/contents/{source_connection_content_version}/attachments", + params=_strip_none({"page": page, "limit": limit}), ) + return _parse_model(payload, ContentAttachmentsListResponse) async def get_content_attachment( self, @@ -6095,28 +6195,37 @@ async def get_content_attachment( *, start: int | None = None, end: int | None = None, - ) -> dict[str, Any]: + ) -> ContentAttachmentDetailResponse: """Get one file attached to a content item. Args: source_connection_content_version: Content version identifier. attachment_id: The ``id`` of an entry in :meth:`list_content_attachments`. - start: Start offset of the returned text (default 0). - end: End offset of the returned text (default 5000). + start: Start offset of the returned text. Omitted, the API + uses 0. + end: End offset of the returned text. Omitted, the API uses 5000. + Any value from 0, the API's minimum, is sent as given, so + ``end=0`` asks for the status and metadata without the text. + :meth:`get_content_detail` also sends ``end=0``; it differs + only in sending its defaults explicitly. Returns: The attachment's indexing status and reason, its metadata, and the text it is indexed by. A file that was not indexed has no text. + + Raises: + SeclaiAPIValidationError: If the API returns a validation error. + SeclaiAPIStatusError: If the API returns a non-success status code, + including 402 when the account has no credits left. + SeclaiError: If the response body does not decode as the model. """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/contents/{source_connection_content_version}/attachments/{attachment_id}", - params=_strip_none({"start": start, "end": end}), - ), + payload = await self.request( + "GET", + f"/contents/{source_connection_content_version}/attachments/{attachment_id}", + params=_strip_none({"start": start, "end": end}), ) + return _parse_model(payload, ContentAttachmentDetailResponse) async def list_content_attachment_embeddings( self, @@ -6125,7 +6234,7 @@ async def list_content_attachment_embeddings( *, page: int | None = None, limit: int | None = None, - ) -> dict[str, Any]: + ) -> ContentEmbeddingsListResponse: """List the embeddings an attached file is indexed by. Args: @@ -6135,16 +6244,22 @@ async def list_content_attachment_embeddings( limit: Items per page (1-100, default 20). Returns: - A page of embeddings; empty for a file with no completed index. + A page of embeddings, the same model as + :meth:`list_content_embeddings`; empty for a file with no completed + index. + + Raises: + SeclaiAPIValidationError: If the API returns a validation error. + SeclaiAPIStatusError: If the API returns a non-success status code, + including 402 when the account has no credits left. + SeclaiError: If the response body does not decode as the model. """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/contents/{source_connection_content_version}/attachments/{attachment_id}/embeddings", - params=_strip_none({"page": page, "limit": limit}), - ), + payload = await self.request( + "GET", + f"/contents/{source_connection_content_version}/attachments/{attachment_id}/embeddings", + params=_strip_none({"page": page, "limit": limit}), ) + return _parse_model(payload, ContentEmbeddingsListResponse) async def download_content_attachment( self, @@ -6167,7 +6282,11 @@ async def download_content_attachment( content type; anything else as ``application/octet-stream``. A file withheld by a governance policy, or still being indexed after arriving from outside, answers 403 — the attachment's ``file_withheld`` field - says which beforehand. + says which beforehand. An account with no credits left gets 402. + + The client's ``timeout`` bounds connecting and each read, not the whole + transfer, so a large file is not cut off while bytes keep arriving. + Closing the response stops a download early. Args: source_connection_content_version: Content version identifier. @@ -6177,26 +6296,13 @@ async def download_content_attachment( A streaming ``httpx.Response``. Must be closed by the caller. Raises: - SeclaiAPIStatusError: If the API returns a non-success status code. + SeclaiAPIStatusError: If the API returns a non-success status code: + 403 for a withheld file, 402 when the account has no credits + left. """ - headers = await _merge_request_headers_async( - options=self._options, - client_headers=self._client.headers, - request_headers=None, - ) - request = self._client.build_request( - "GET", - f"/contents/{source_connection_content_version}/attachments/{attachment_id}/file", - headers=headers, + return await self._stream_get( + f"/contents/{source_connection_content_version}/attachments/{attachment_id}/file" ) - response = await self._client.send(request, stream=True) - if response.is_error: - # Read the body for a useful error message, then release the - # connection before raising. - await response.aread() - await response.aclose() - _raise_for_status(response) - return response async def list_sources( self, @@ -6860,6 +6966,16 @@ async def upload_agent_input( ) -> dict[str, Any]: """Upload a file as input for an agent run. + Only a ``dynamic_input`` agent takes uploads; any other agent answers + 400. The limit is 200 MB per file. + + From ``Seclai-Version: 2026-10-16`` a file of any type is accepted and + is ``ready`` at once, so pass its ``upload_id`` as ``input_upload_id`` + to a run straight away. Earlier versions accept only a fixed list of + extensions and extract each file's text into ``input``: poll + :meth:`get_agent_input_upload_status` until ``status`` is ``ready`` + before running. + Args: agent_id: Agent identifier. file: File payload (bytes, path, or file-like). @@ -6964,26 +7080,10 @@ async def download_agent_run_attachment( Returns: A streaming ``httpx.Response``. Must be closed by the caller. """ - headers = await _merge_request_headers_async( - options=self._options, - client_headers=self._client.headers, - request_headers=None, - ) - request = self._client.build_request( - "GET", + return await self._stream_get( f"/v2/agent-runs/{run_id}/attachments/{attachment_id}", params=_strip_none({"download_name": download_name}), - headers=headers, ) - response = await self._client.send(request, stream=True) - if response.is_error: - # Read the body for a useful error message, then release the - # connection before raising — the caller never receives the - # streaming response on the error path. - await response.aread() - await response.aclose() - _raise_for_status(response) - return response # ── Agent AI Assistant ──────────────────────────────────────────────────── @@ -7655,7 +7755,7 @@ async def set_accepted_attachments( agent_id: str, trigger_id: str, accepted_attachments: list[dict[str, Any]] | None, - ) -> dict[str, Any]: + ) -> AcceptedAttachmentsResponse: """Declare the input attachments a trigger accepts. Replaces the trigger's declaration. A run's files are each assigned to @@ -7675,16 +7775,19 @@ async def set_accepted_attachments( Returns: The trigger's ``accepted_attachments`` with its ``agent_id`` and ``trigger_id``. + + Raises: + SeclaiAPIValidationError: If the API returns a validation error. + SeclaiAPIStatusError: If the API returns a non-success status code. + SeclaiError: If the response body does not decode as the model. """ body: dict[str, Any] = {"accepted_attachments": accepted_attachments} - return cast( - dict[str, Any], - await self.request( - "PUT", - f"/agents/{agent_id}/triggers/{trigger_id}/accepted-attachments", - json=body, - ), + payload = await self.request( + "PUT", + f"/agents/{agent_id}/triggers/{trigger_id}/accepted-attachments", + json=body, ) + return _parse_model(payload, AcceptedAttachmentsResponse) # ── Knowledge Bases ─────────────────────────────────────────────────────── @@ -8072,7 +8175,7 @@ async def list_email_source_rejections( *, page: int | None = None, limit: int | None = None, - ) -> dict[str, Any]: + ) -> EmailSourceRejectionListResponse: """List mail an email content source refused, newest first. Each entry says who sent the message and why it was refused, never its @@ -8089,15 +8192,18 @@ async def list_email_source_rejections( Returns: The refusals under ``data``, and ``pagination``. + + Raises: + SeclaiAPIValidationError: If the API returns a validation error. + SeclaiAPIStatusError: If the API returns a non-success status code. + SeclaiError: If the response body does not decode as the model. """ - return cast( - dict[str, Any], - await self.request( - "GET", - f"/sources/{source_id}/email-rejections", - params=_strip_none({"page": page, "limit": limit}), - ), + payload = await self.request( + "GET", + f"/sources/{source_id}/email-rejections", + params=_strip_none({"page": page, "limit": limit}), ) + return _parse_model(payload, EmailSourceRejectionListResponse) async def delete_source(self, source_id: str) -> None: """Delete a source. @@ -8314,25 +8420,9 @@ async def download_source_export( Returns: A streaming ``httpx.Response``. Must be closed by the caller. """ - headers = await _merge_request_headers_async( - options=self._options, - client_headers=self._client.headers, - request_headers=None, + return await self._stream_get( + f"/sources/{source_id}/exports/{export_id}/download" ) - request = self._client.build_request( - "GET", - f"/sources/{source_id}/exports/{export_id}/download", - headers=headers, - ) - response = await self._client.send(request, stream=True) - if response.is_error: - # Read the body for a useful error message, then release the - # connection before raising — the caller never receives the - # streaming response on the error path. - await response.aread() - await response.aclose() - _raise_for_status(response) - return response async def estimate_source_export( self, source_id: str, body: dict[str, Any] diff --git a/tests/test_new_methods.py b/tests/test_new_methods.py index 41a6ffa..af83098 100644 --- a/tests/test_new_methods.py +++ b/tests/test_new_methods.py @@ -16,6 +16,13 @@ import seclai from seclai import AgentRunStreamRequest, AsyncSeclai, Seclai from seclai import versions as seclai_versions +from seclai._generated.models import ( + AcceptedAttachmentsResponse, + ContentAttachmentDetailResponse, + ContentAttachmentsListResponse, + ContentEmbeddingsListResponse, + EmailSourceRejectionListResponse, +) # --------------------------------------------------------------------------- # Helpers @@ -4250,6 +4257,16 @@ async def test_async_parity(self) -> None: [], None, ), + ( + # 0 is the spec's minimum for both, so it must be sent, not dropped. + "get_content_attachment", + ("cv1", "att1"), + {"start": 0, "end": 0}, + "GET", + "/contents/cv1/attachments/att1", + [("start", "0"), ("end", "0")], + None, + ), ( "list_content_attachment_embeddings", ("cv1", "att1"), @@ -4307,7 +4324,91 @@ async def test_async_parity(self) -> None: ), ] -_ENVELOPE_BODY = {"data": [{"id": "x1"}], "pagination": _ENVELOPE_PAGINATION} +_ATTACHMENT = { + "id": "att1", + "key": "invoice.pdf", + "content_type": "application/pdf", + "size_bytes": 1024, + "indexed": True, + "indexing_status": "completed", + "indexing_error": None, + "created_at": "2026-10-19T00:00:00Z", + "updated_at": "2026-10-19T00:00:00Z", + "metadata": {"page_count": 2}, +} + +# A schema-valid 200 body for each method, and the generated model it decodes +# into. Bodies use only fields and values the spec defines. +_2026_10_19_RESPONSES: dict[str, tuple[dict[str, Any], type[Any]]] = { + "list_content_attachments": ( + {"data": [_ATTACHMENT], "pagination": _ENVELOPE_PAGINATION}, + ContentAttachmentsListResponse, + ), + "get_content_attachment": ( + { + **_ATTACHMENT, + "file_withheld": None, + "text_content": "Invoice 42", + "text_content_start": 0, + "text_content_end": 10, + "text_content_total_length": 10, + }, + ContentAttachmentDetailResponse, + ), + "list_content_attachment_embeddings": ( + { + "data": [ + { + "id": "e1", + "text_start": 0, + "text_end": 10, + "text": "Invoice 42", + "vector": [0.1, 0.2], + "batch_size": 1, + "batch_duration": 0.5, + } + ], + "pagination": _ENVELOPE_PAGINATION, + }, + ContentEmbeddingsListResponse, + ), + "set_accepted_attachments": ( + { + "agent_id": "0b6f2a4e-3c1d-4e5f-8a9b-1c2d3e4f5a6b", + "trigger_id": "7d8e9f0a-1b2c-4d3e-9f4a-5b6c7d8e9f0a", + "accepted_attachments": [ + { + "name": "invoice", + "label": None, + "content_types": ["application/pdf"], + "name_pattern": None, + "min": 1, + "max": 1, + } + ], + }, + AcceptedAttachmentsResponse, + ), + "list_email_source_rejections": ( + { + "data": [ + { + "id": "r1", + "created_at": "2026-10-19T00:00:00Z", + "recipient": "inbox@example.com", + "sender": "bounce@mailer.example.net", + "from_address": "alice@example.org", + "sender_ip": "192.0.2.1", + "reason": "sender_not_allowed", + "authenticated": True, + "auth_verdicts": {"spf": "pass", "dmarc": "pass"}, + } + ], + "pagination": _ENVELOPE_PAGINATION, + }, + EmailSourceRejectionListResponse, + ), +} class TestAttachmentsAndEmailSourceRejections: @@ -4326,10 +4427,12 @@ def test_request( body: Any, ) -> None: seen: dict[str, Any] = {} - client = _sync_client(_recording_handler(seen, _ENVELOPE_BODY)) + response, model = _2026_10_19_RESPONSES[name] + client = _sync_client(_recording_handler(seen, response)) result = getattr(client, name)(*args, **kwargs) assert seen == {"method": verb, "path": path, "query": query, "body": body} - assert result == _ENVELOPE_BODY + assert isinstance(result, model) + assert result.to_dict() == response @pytest.mark.asyncio @pytest.mark.parametrize( @@ -4347,10 +4450,12 @@ async def test_request_async( body: Any, ) -> None: seen: dict[str, Any] = {} - client = _async_client(_recording_handler(seen, _ENVELOPE_BODY)) + response, model = _2026_10_19_RESPONSES[name] + client = _async_client(_recording_handler(seen, response)) result = await getattr(client, name)(*args, **kwargs) assert seen == {"method": verb, "path": path, "query": query, "body": body} - assert result == _ENVELOPE_BODY + assert isinstance(result, model) + assert result.to_dict() == response def test_download_content_attachment(self) -> None: seen: dict[str, Any] = {} @@ -4461,3 +4566,150 @@ def handler(req: httpx.Request) -> httpx.Response: ("stream_reasoning", {"text": "hmm"}), ("done", {"run_id": "r1"}), ] + + +class _BrokenStream(httpx.SyncByteStream): + def __iter__(self) -> Any: + raise httpx.ReadError("connection reset") + + +class _AsyncBrokenStream(httpx.AsyncByteStream): + async def __aiter__(self) -> Any: + raise httpx.ReadError("connection reset") + yield b"" # pragma: no cover - makes this an async generator + + +# Every streaming download goes through one helper; cover each entry point so +# none can drift back to its own copy. +_DOWNLOADS: list[tuple[str, tuple[str, ...]]] = [ + ("download_content_attachment", ("cv1", "att1")), + ("download_agent_run_attachment", ("run1", "att1")), + ("download_source_export", ("s1", "exp1")), +] + + +class TestStreamingDownloadErrors: + @pytest.mark.parametrize(("name", "args"), _DOWNLOADS) + def test_error_body_read_failure_still_closes_and_raises_status( + self, name: str, args: tuple[str, ...] + ) -> None: + from seclai import SeclaiAPIStatusError + + captured: dict[str, httpx.Response] = {} + + def handler(req: httpx.Request) -> httpx.Response: + resp = httpx.Response(status_code=502, stream=_BrokenStream()) + captured["resp"] = resp + return resp + + client = _sync_client(handler) + with pytest.raises(SeclaiAPIStatusError) as exc: + getattr(client, name)(*args) + assert exc.value.status_code == 502 + assert captured["resp"].is_closed + + @pytest.mark.asyncio + @pytest.mark.parametrize(("name", "args"), _DOWNLOADS) + async def test_async_error_body_read_failure_still_closes_and_raises_status( + self, name: str, args: tuple[str, ...] + ) -> None: + from seclai import SeclaiAPIStatusError + + captured: dict[str, httpx.Response] = {} + + async def handler(req: httpx.Request) -> httpx.Response: + resp = httpx.Response(status_code=502, stream=_AsyncBrokenStream()) + captured["resp"] = resp + return resp + + client = _async_client(handler) + with pytest.raises(SeclaiAPIStatusError) as exc: + await getattr(client, name)(*args) + assert exc.value.status_code == 502 + assert captured["resp"].is_closed + + @pytest.mark.parametrize(("name", "args"), _DOWNLOADS) + def test_error_closes_and_keeps_body_text( + self, name: str, args: tuple[str, ...] + ) -> None: + from seclai import SeclaiAPIStatusError + + captured: dict[str, httpx.Response] = {} + + def handler(req: httpx.Request) -> httpx.Response: + resp = httpx.Response(status_code=402, json={"detail": "no credits"}) + captured["resp"] = resp + return resp + + client = _sync_client(handler) + with pytest.raises(SeclaiAPIStatusError) as exc: + getattr(client, name)(*args) + assert exc.value.status_code == 402 + assert "no credits" in (exc.value.response_text or "") + assert captured["resp"].is_closed + + +class TestAttachmentModelDecoding: + @pytest.mark.parametrize( + "bad", + [ + [_ATTACHMENT], # not an object + "oops", # text body + {"data": [{"id": "att1"}], "pagination": _ENVELOPE_PAGINATION}, + ], + ) + def test_undecodable_body_raises_seclai_error(self, bad: Any) -> None: + from seclai import SeclaiError + + def handler(req: httpx.Request) -> httpx.Response: + if isinstance(bad, str): + return httpx.Response(status_code=200, text=bad) + return _json_response(bad) + + client = _sync_client(handler) + with pytest.raises(SeclaiError): + client.list_content_attachments("cv1") + + @pytest.mark.asyncio + async def test_async_undecodable_body_raises_seclai_error(self) -> None: + from seclai import SeclaiError + + async def handler(req: httpx.Request) -> httpx.Response: + return _json_response({"agent_id": "a1"}) + + client = _async_client(handler) + with pytest.raises(SeclaiError): + await client.set_accepted_attachments("a1", "t1", None) + + def test_typed_fields(self) -> None: + response, _ = _2026_10_19_RESPONSES["list_email_source_rejections"] + client = _sync_client(lambda req: _json_response(response)) + refused = client.list_email_source_rejections("s1") + assert refused.data[0].from_address == "alice@example.org" + assert refused.data[0].authenticated is True + assert refused.pagination.total == 1 + + +class TestAgentRunStreamRequestOptionalKeys: + def test_upload_only_body(self) -> None: + seen: dict[str, Any] = {} + + def handler(req: httpx.Request) -> httpx.Response: + seen["body"] = json.loads(req.content) + return httpx.Response( + status_code=200, + content=b'event: done\ndata: {"run_id": "r1"}\n\n', + headers={"content-type": "text/event-stream"}, + ) + + client = _sync_client(handler) + # input and metadata are optional in the spec, so a run on an upload + # needs neither. + body = AgentRunStreamRequest(input_upload_id="up1") + events = list(client.run_streaming_agent("a1", body)) + assert seen["body"] == {"input_upload_id": "up1"} + assert events == [("done", {"run_id": "r1"})] + + def test_null_metadata_is_accepted(self) -> None: + body = AgentRunStreamRequest(input="hi", metadata=None) + assert body == {"input": "hi", "metadata": None} From c0325df624bd7474b61416e56c273af2f72a3f1d Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Wed, 21 Oct 2026 10:36:38 -0700 Subject: [PATCH 4/8] Addressed review comments --- CHANGELOG.md | 5 +- README.md | 17 +++-- seclai/seclai.py | 151 ++++++++++++++++++++++++-------------- tests/test_new_methods.py | 105 ++++++++++++++++++++++++++ 4 files changed, 214 insertions(+), 64 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3a58e2..126833e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,12 +13,13 @@ - Add `list_content_attachments()`, `get_content_attachment()`, `list_content_attachment_embeddings()` and `download_content_attachment()` to read the files attached to a content item, with their indexing status. The first three return the generated `ContentAttachmentsListResponse`, `ContentAttachmentDetailResponse` and `ContentEmbeddingsListResponse` models; the download returns a streaming `httpx.Response` the caller closes. `get_content_attachment()` sends `start` and `end` only when given, including `end=0` - Add `set_accepted_attachments()` to declare the input attachments an agent trigger accepts, returning `AcceptedAttachmentsResponse` - Add `list_email_source_rejections()` to list the mail an email content source refused, and why, returning `EmailSourceRejectionListResponse` -- Add `include_reasoning`, `input_upload_id`, `input_upload_ids` and `replay_of_run_id` as optional keys of `AgentRunStreamRequest`. `include_reasoning` asks `run_streaming_agent()` for `stream_reasoning` events; `run_streaming_agent_and_wait()` discards them +- Add `include_reasoning`, `input_upload_id`, `input_upload_ids` and `replay_of_run_id` as optional keys of `AgentRunStreamRequest`. `include_reasoning` asks `run_streaming_agent()` for `stream_reasoning` events; `run_streaming_agent_and_wait()`, which keeps only the `init` and `done` events, removes it from the body before sending - Add `ApiVersion` members for `2026-10-05`, `2026-10-13`, `2026-10-16`, `2026-10-18` and `2026-10-19`, so each can be selected without `allow_unknown_api_version` ### Fixed -- Release the connection and raise `SeclaiAPIStatusError` from `download_agent_run_attachment()` and `download_source_export()` when reading an error response's body fails. The connection leaked, and the caller got the transport error instead of the status +- Release the connection and raise `SeclaiAPIStatusError` from `download_agent_run_attachment()` and `download_source_export()` when reading an error response's body fails. The connection leaked, and the caller got the transport error instead of the status. The status error has no response text and keeps the transport error as its `__cause__` +- Raise `SeclaiAPIStatusError` from `run_streaming_agent()` and `run_streaming_agent_and_wait()` when reading an error response's body fails, with the transport error as its `__cause__`. The caller got the transport error, or `SeclaiError` for a read timeout, instead of the status - Correct the streaming-download examples of `download_agent_run_attachment()` and `download_source_export()`. They closed the response with `with response:`, which raises `TypeError` because an `httpx.Response` is not a context manager; they now close it in a `finally` block ## [1.7.2] - 2026-10-05 diff --git a/README.md b/README.md index 1c0a0d9..0956828 100644 --- a/README.md +++ b/README.md @@ -357,7 +357,8 @@ for event_type, data in client.run_streaming_agent( Set `include_reasoning=True` in the request to also receive `stream_reasoning` events with the model's reasoning, for a `streaming_result` step whose author enabled `show_reasoning`. `run_streaming_agent_and_wait()` keeps only the -`init` and `done` events, so there the flag only adds traffic. +`init` and `done` events, so it removes `include_reasoning` from the body +before sending. Every key of `AgentRunStreamRequest` is optional, so a run on an uploaded file can send just `AgentRunStreamRequest(input_upload_id=upload["upload_id"])`. @@ -531,7 +532,9 @@ message itself. Requires an account owner or administrator: ```python refused = client.list_email_source_rejections("source_id", page=1, limit=20) for r in refused.data: # EmailSourceRejectionListResponse - print(r.from_address, r.reason, r.authenticated) + # from_address is Unset when the mail had no parseable From header. + sender = r.from_address if isinstance(r.from_address, str) else None + print(sender, r.reason, r.authenticated) ``` ### Cloud drives @@ -614,8 +617,6 @@ client.cancel_source_embedding_migration("source_id") ### Content ```python -import os - detail = client.get_content_detail("source_connection_content_version") embeddings = client.list_content_embeddings("source_connection_content_version") client.delete_content("source_connection_content_version") @@ -639,8 +640,12 @@ response = client.download_content_attachment( ) # raw streaming httpx.Response; 403 if withheld, 402 with no credits left try: # The key comes from a third party (an email or feed file name), so never - # use it as a path as is: keep only its final component. - with open(os.path.basename(att.key) or att.id, "wb") as f: + # use it as a path as is: keep only its final component, splitting on + # either slash, and fall back to the id for an empty, "." or ".." name. + name = att.key.replace("\\", "/").rsplit("/", 1)[-1] + if name in ("", ".", ".."): + name = att.id + with open(name, "wb") as f: for chunk in response.iter_bytes(): f.write(chunk) finally: diff --git a/seclai/seclai.py b/seclai/seclai.py index 18e2826..06f48bb 100644 --- a/seclai/seclai.py +++ b/seclai/seclai.py @@ -115,8 +115,8 @@ class AgentRunStreamRequest(TypedDict): #: Receive ``stream_reasoning`` events carrying the model's reasoning, for a #: ``streaming_result`` step whose author enabled ``show_reasoning``. Only #: :meth:`Seclai.run_streaming_agent` yields them; - #: :meth:`Seclai.run_streaming_agent_and_wait` discards every event but - #: ``init`` and ``done``, so there it only adds traffic. + #: :meth:`Seclai.run_streaming_agent_and_wait` removes this key before + #: sending, since it keeps only the ``init`` and ``done`` events. include_reasoning: NotRequired[bool] input_upload_id: NotRequired[str | None] input_upload_ids: NotRequired[list[str] | None] @@ -305,6 +305,11 @@ def _empty_page(*, page: int, limit: int) -> dict[str, Any]: } +def _without_reasoning(body: AgentRunStreamRequest) -> dict[str, Any]: + """Return ``body`` without ``include_reasoning``, for a caller that drops reasoning events.""" + return {k: v for k, v in body.items() if k != "include_reasoning"} + + def _strip_none(params: dict[str, Any]) -> dict[str, Any]: """Remove keys with ``None`` values from a parameter dictionary.""" return {k: v for k, v in params.items() if v is not None} @@ -332,6 +337,12 @@ def _parse_model(payload: object, model: type[_ModelT]) -> _ModelT: A body that is not a JSON object, or does not fit the model, raises `SeclaiError` rather than the ``KeyError``/``TypeError`` the generated ``from_dict`` would, so ``except SeclaiError`` handlers still catch it. + + The methods that call this send through ``request`` rather than a generated + ``sync_detailed``: that route applies only an explicitly passed client + timeout (kept so existing calls on it are not cut off at 30 seconds), and + its ``_parse_response`` calls ``from_dict`` unguarded, so a bad 200 body + there raises ``KeyError``/``TypeError`` before ``_expect_model`` runs. """ if not isinstance(payload, dict): raise SeclaiError( @@ -634,6 +645,54 @@ def _raise_for_status(response: httpx.Response) -> None: ) +def _raise_for_unread_status(response: httpx.Response) -> None: + """Raise on an error status of a streamed response whose body is unread. + + The body is read for the error text and the response closed before + raising. A transport error while reading that body still raises the status + error, without response text and with the transport error as its + ``__cause__``, so the status a caller sees does not depend on whether the + error body arrived. + """ + if not response.is_error: + return + read_error: httpx.HTTPError | None = None + try: + response.read() + except httpx.HTTPError as e: + read_error = e + finally: + response.close() + _raise_for_read_status(response, read_error) + + +async def _araise_for_unread_status(response: httpx.Response) -> None: + """Async twin of :func:`_raise_for_unread_status`.""" + if not response.is_error: + return + read_error: httpx.HTTPError | None = None + try: + await response.aread() + except httpx.HTTPError as e: + read_error = e + finally: + await response.aclose() + _raise_for_read_status(response, read_error) + + +def _raise_for_read_status( + response: httpx.Response, read_error: httpx.HTTPError | None +) -> None: + """Raise the status error, chained to ``read_error`` when the body read failed.""" + if read_error is None: + _raise_for_status(response) + return + try: + _raise_for_status(response) + except SeclaiError as e: + raise e from read_error + + def _send_url(client: httpx.Client | httpx.AsyncClient, path: str) -> str: """Return ``path`` for a client with a base URL, else the absolute API URL.""" return path if str(client.base_url) else f"{SECLAI_API_URL.rstrip('/')}{path}" @@ -1078,9 +1137,8 @@ def _stream_get( """Send a GET and return the response unread, for the caller to stream. On an error status the body is read for the error message and the - connection released before raising. A transport error while reading - that body still closes the response and raises the status error, with - no response text, rather than the transport error. + connection released before raising; see + :func:`_raise_for_unread_status`. """ request = self._client.build_request( "GET", @@ -1093,14 +1151,7 @@ def _stream_get( ), ) response = self._client.send(request, stream=True) - if response.is_error: - try: - response.read() - except httpx.HTTPError: - pass - finally: - response.close() - _raise_for_status(response) + _raise_for_unread_status(response) return response def run_agent(self, agent_id: str, body: AgentRunRequest) -> AgentRunResponse: @@ -1166,9 +1217,10 @@ def run_streaming_agent_and_wait( This uses POST /agents/{agent_id}/runs/stream and consumes Server-Sent Events (SSE). The method returns when an `event: done` message is received. Every event - but `init` and `done` is discarded, so `include_reasoning` has no effect - here beyond extra traffic; use `run_streaming_agent` to receive - `stream_reasoning` events. + but `init` and `done` is discarded, so `include_reasoning` is removed + from the body before it is sent: reasoning events would only add + traffic and count against `timeout`. Use `run_streaming_agent` to + receive `stream_reasoning` events. Args: agent_id: Agent identifier. @@ -1204,15 +1256,13 @@ def run_streaming_agent_and_wait( with self._client.stream( "POST", path, - json=body, + json=_without_reasoning(body), headers=merged_headers, timeout=timeout_seconds, ) as response: - if response.status_code >= 400: - # Lazy body inside `stream()`; read it so the error carries - # its text and a 422 its field-level detail. - response.read() - _raise_for_status(response) + # Lazy body inside `stream()`; read it so the error carries + # its text and a 422 its field-level detail. + _raise_for_unread_status(response) current_event: str | None = None data_lines: list[str] = [] @@ -1666,8 +1716,9 @@ def get_content_attachment( end: End offset of the returned text. Omitted, the API uses 5000. Any value from 0, the API's minimum, is sent as given, so ``end=0`` asks for the status and metadata without the text. - :meth:`get_content_detail` also sends ``end=0``; it differs - only in sending its defaults explicitly. + Unlike :meth:`get_content_detail`, which defaults to + ``start=0`` and ``end=5000`` and always sends both, this sends + ``start`` and ``end`` only when given. Returns: The attachment's indexing status and reason, its metadata, and the @@ -5377,11 +5428,9 @@ def run_streaming_agent( headers=merged_headers, timeout=timeout_seconds, ) as response: - if response.status_code >= 400: - # Lazy body inside `stream()`; read it so a 422's field-level - # detail survives into SeclaiAPIValidationError. - response.read() - _raise_for_status(response) + # Lazy body inside `stream()`; read it so a 422's field-level + # detail survives into SeclaiAPIValidationError. + _raise_for_unread_status(response) current_event: str | None = None data_lines: list[str] = [] @@ -5627,9 +5676,8 @@ async def _stream_get( """Send a GET and return the response unread, for the caller to stream. On an error status the body is read for the error message and the - connection released before raising. A transport error while reading - that body still closes the response and raises the status error, with - no response text, rather than the transport error. + connection released before raising; see + :func:`_raise_for_unread_status`. """ request = self._client.build_request( "GET", @@ -5642,14 +5690,7 @@ async def _stream_get( ), ) response = await self._client.send(request, stream=True) - if response.is_error: - try: - await response.aread() - except httpx.HTTPError: - pass - finally: - await response.aclose() - _raise_for_status(response) + await _araise_for_unread_status(response) return response async def run_agent(self, agent_id: str, body: AgentRunRequest) -> AgentRunResponse: @@ -5717,9 +5758,10 @@ async def run_streaming_agent_and_wait( This uses POST /agents/{agent_id}/runs/stream and consumes Server-Sent Events (SSE). The method returns when an `event: done` message is received. Every event - but `init` and `done` is discarded, so `include_reasoning` has no effect - here beyond extra traffic; use `run_streaming_agent` to receive - `stream_reasoning` events. + but `init` and `done` is discarded, so `include_reasoning` is removed + from the body before it is sent: reasoning events would only add + traffic and count against `timeout`. Use `run_streaming_agent` to + receive `stream_reasoning` events. """ import json as _json import time as _time @@ -5740,15 +5782,13 @@ async def run_streaming_agent_and_wait( async with self._client.stream( "POST", path, - json=body, + json=_without_reasoning(body), headers=merged_headers, timeout=timeout_seconds, ) as response: - if response.status_code >= 400: - # Lazy body inside `stream()`; read it so the error carries - # its text and a 422 its field-level detail. - await response.aread() - _raise_for_status(response) + # Lazy body inside `stream()`; read it so the error carries + # its text and a 422 its field-level detail. + await _araise_for_unread_status(response) current_event: str | None = None data_lines: list[str] = [] @@ -6207,8 +6247,9 @@ async def get_content_attachment( end: End offset of the returned text. Omitted, the API uses 5000. Any value from 0, the API's minimum, is sent as given, so ``end=0`` asks for the status and metadata without the text. - :meth:`get_content_detail` also sends ``end=0``; it differs - only in sending its defaults explicitly. + Unlike :meth:`get_content_detail`, which defaults to + ``start=0`` and ``end=5000`` and always sends both, this sends + ``start`` and ``end`` only when given. Returns: The attachment's indexing status and reason, its metadata, and the @@ -9979,11 +10020,9 @@ async def run_streaming_agent( headers=merged_headers, timeout=timeout_seconds, ) as response: - if response.status_code >= 400: - # Lazy body inside `stream()`; read it so a 422's field-level - # detail survives into SeclaiAPIValidationError. - await response.aread() - _raise_for_status(response) + # Lazy body inside `stream()`; read it so a 422's field-level + # detail survives into SeclaiAPIValidationError. + await _araise_for_unread_status(response) current_event: str | None = None data_lines: list[str] = [] diff --git a/tests/test_new_methods.py b/tests/test_new_methods.py index af83098..042d19b 100644 --- a/tests/test_new_methods.py +++ b/tests/test_new_methods.py @@ -4568,6 +4568,52 @@ def handler(req: httpx.Request) -> httpx.Response: ] +class TestStreamAndWaitDropsReasoning: + _DONE = ( + b'event: done\ndata: {"run_id": "r1", "status": "completed", ' + b'"attempts": [], "credits": null, "error_count": 0, "priority": false, ' + b'"input": null, "output": null}\n\n' + ) + + def test_sync_drops_include_reasoning(self) -> None: + seen: dict[str, Any] = {} + + def handler(req: httpx.Request) -> httpx.Response: + seen["body"] = json.loads(req.content) + return httpx.Response( + status_code=200, + content=self._DONE, + headers={"content-type": "text/event-stream"}, + ) + + client = _sync_client(handler) + body = AgentRunStreamRequest(input="hi", include_reasoning=True) + run = client.run_streaming_agent_and_wait("a1", body) + assert run.run_id == "r1" + assert seen["body"] == {"input": "hi"} + # The caller's dict is left as given. + assert body["include_reasoning"] is True + + @pytest.mark.asyncio + async def test_async_drops_include_reasoning(self) -> None: + seen: dict[str, Any] = {} + + async def handler(req: httpx.Request) -> httpx.Response: + seen["body"] = json.loads(req.content) + return httpx.Response( + status_code=200, + content=self._DONE, + headers={"content-type": "text/event-stream"}, + ) + + client = _async_client(handler) + run = await client.run_streaming_agent_and_wait( + "a1", AgentRunStreamRequest(input="hi", include_reasoning=True) + ) + assert run.run_id == "r1" + assert seen["body"] == {"input": "hi"} + + class _BrokenStream(httpx.SyncByteStream): def __iter__(self) -> Any: raise httpx.ReadError("connection reset") @@ -4607,6 +4653,7 @@ def handler(req: httpx.Request) -> httpx.Response: getattr(client, name)(*args) assert exc.value.status_code == 502 assert captured["resp"].is_closed + assert isinstance(exc.value.__cause__, httpx.ReadError) @pytest.mark.asyncio @pytest.mark.parametrize(("name", "args"), _DOWNLOADS) @@ -4627,6 +4674,64 @@ async def handler(req: httpx.Request) -> httpx.Response: await getattr(client, name)(*args) assert exc.value.status_code == 502 assert captured["resp"].is_closed + assert isinstance(exc.value.__cause__, httpx.ReadError) + + @pytest.mark.parametrize( + "name", ["run_streaming_agent", "run_streaming_agent_and_wait"] + ) + def test_streaming_run_error_body_read_failure_raises_status( + self, name: str + ) -> None: + from seclai import SeclaiAPIStatusError + + captured: dict[str, httpx.Response] = {} + + def handler(req: httpx.Request) -> httpx.Response: + resp = httpx.Response(status_code=502, stream=_BrokenStream()) + captured["resp"] = resp + return resp + + client = _sync_client(handler) + with pytest.raises(SeclaiAPIStatusError) as exc: + result = getattr(client, name)("a1", AgentRunStreamRequest(input="hi")) + if name == "run_streaming_agent": + list(result) + assert exc.value.status_code == 502 + assert exc.value.response_text is None + assert isinstance(exc.value.__cause__, httpx.ReadError) + assert captured["resp"].is_closed + + @pytest.mark.asyncio + @pytest.mark.parametrize( + "name", ["run_streaming_agent", "run_streaming_agent_and_wait"] + ) + async def test_async_streaming_run_error_body_read_failure_raises_status( + self, name: str + ) -> None: + from seclai import SeclaiAPIStatusError + + captured: dict[str, httpx.Response] = {} + + async def handler(req: httpx.Request) -> httpx.Response: + resp = httpx.Response(status_code=502, stream=_AsyncBrokenStream()) + captured["resp"] = resp + return resp + + client = _async_client(handler) + with pytest.raises(SeclaiAPIStatusError) as exc: + if name == "run_streaming_agent": + async for _ in client.run_streaming_agent( + "a1", AgentRunStreamRequest(input="hi") + ): + pass + else: + await client.run_streaming_agent_and_wait( + "a1", AgentRunStreamRequest(input="hi") + ) + assert exc.value.status_code == 502 + assert exc.value.response_text is None + assert isinstance(exc.value.__cause__, httpx.ReadError) + assert captured["resp"].is_closed @pytest.mark.parametrize(("name", "args"), _DOWNLOADS) def test_error_closes_and_keeps_body_text( From 5fb86fc778acb4e4f098944d0d7ff978146d4527 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Wed, 21 Oct 2026 11:02:48 -0700 Subject: [PATCH 5/8] Addressed review comments --- README.md | 9 +-------- seclai/seclai.py | 6 ------ tests/test_new_methods.py | 7 ++++--- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 0956828..c48bdcf 100644 --- a/README.md +++ b/README.md @@ -532,7 +532,6 @@ message itself. Requires an account owner or administrator: ```python refused = client.list_email_source_rejections("source_id", page=1, limit=20) for r in refused.data: # EmailSourceRejectionListResponse - # from_address is Unset when the mail had no parseable From header. sender = r.from_address if isinstance(r.from_address, str) else None print(sender, r.reason, r.authenticated) ``` @@ -639,13 +638,7 @@ response = client.download_content_attachment( "source_connection_content_version", att.id ) # raw streaming httpx.Response; 403 if withheld, 402 with no credits left try: - # The key comes from a third party (an email or feed file name), so never - # use it as a path as is: keep only its final component, splitting on - # either slash, and fall back to the id for an empty, "." or ".." name. - name = att.key.replace("\\", "/").rsplit("/", 1)[-1] - if name in ("", ".", ".."): - name = att.id - with open(name, "wb") as f: + with open(f"{att.id}.bin", "wb") as f: for chunk in response.iter_bytes(): f.write(chunk) finally: diff --git a/seclai/seclai.py b/seclai/seclai.py index 06f48bb..712c252 100644 --- a/seclai/seclai.py +++ b/seclai/seclai.py @@ -337,12 +337,6 @@ def _parse_model(payload: object, model: type[_ModelT]) -> _ModelT: A body that is not a JSON object, or does not fit the model, raises `SeclaiError` rather than the ``KeyError``/``TypeError`` the generated ``from_dict`` would, so ``except SeclaiError`` handlers still catch it. - - The methods that call this send through ``request`` rather than a generated - ``sync_detailed``: that route applies only an explicitly passed client - timeout (kept so existing calls on it are not cut off at 30 seconds), and - its ``_parse_response`` calls ``from_dict`` unguarded, so a bad 200 body - there raises ``KeyError``/``TypeError`` before ``_expect_model`` runs. """ if not isinstance(payload, dict): raise SeclaiError( diff --git a/tests/test_new_methods.py b/tests/test_new_methods.py index 042d19b..02ab58b 100644 --- a/tests/test_new_methods.py +++ b/tests/test_new_methods.py @@ -4607,11 +4607,12 @@ async def handler(req: httpx.Request) -> httpx.Response: ) client = _async_client(handler) - run = await client.run_streaming_agent_and_wait( - "a1", AgentRunStreamRequest(input="hi", include_reasoning=True) - ) + body = AgentRunStreamRequest(input="hi", include_reasoning=True) + run = await client.run_streaming_agent_and_wait("a1", body) assert run.run_id == "r1" assert seen["body"] == {"input": "hi"} + # The caller's dict is left as given. + assert body["include_reasoning"] is True class _BrokenStream(httpx.SyncByteStream): From ec99a67d787754adf4dad4eb98d160f9e4b49f5a Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Wed, 21 Oct 2026 11:19:50 -0700 Subject: [PATCH 6/8] Addressed review comments --- seclai/seclai.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/seclai/seclai.py b/seclai/seclai.py index 712c252..3fd48de 100644 --- a/seclai/seclai.py +++ b/seclai/seclai.py @@ -337,6 +337,8 @@ def _parse_model(payload: object, model: type[_ModelT]) -> _ModelT: A body that is not a JSON object, or does not fit the model, raises `SeclaiError` rather than the ``KeyError``/``TypeError`` the generated ``from_dict`` would, so ``except SeclaiError`` handlers still catch it. + Its callers use ``request`` rather than the generated ``sync_detailed`` for + that reason and so the client's default timeout applies; keep them on it. """ if not isinstance(payload, dict): raise SeclaiError( From 7c582dea6afea76e3435ef71272dfa4be238ebf1 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Wed, 21 Oct 2026 11:32:51 -0700 Subject: [PATCH 7/8] Addressed review comments --- seclai/seclai.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seclai/seclai.py b/seclai/seclai.py index 3fd48de..a300e91 100644 --- a/seclai/seclai.py +++ b/seclai/seclai.py @@ -338,7 +338,7 @@ def _parse_model(payload: object, model: type[_ModelT]) -> _ModelT: `SeclaiError` rather than the ``KeyError``/``TypeError`` the generated ``from_dict`` would, so ``except SeclaiError`` handlers still catch it. Its callers use ``request`` rather than the generated ``sync_detailed`` for - that reason and so the client's default timeout applies; keep them on it. + that reason. """ if not isinstance(payload, dict): raise SeclaiError( From 8d83c2c90ca8520ec2653ba6e2cc03c8ddd71fc8 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Wed, 21 Oct 2026 22:25:57 -0700 Subject: [PATCH 8/8] Pulling in latest updates --- CHANGELOG.md | 7 +- README.md | 11 ++- openapi/seclai.openapi.json | 44 ++++++--- ...uation_criteria_criteria_id_summary_get.py | 8 ++ ...aluation_results_non_manual_summary_get.py | 20 ++++ ..._id_evaluation_criteria_test_draft_post.py | 16 ++++ .../evaluation_result_summary_response.py | 3 +- .../models/insufficient_credits_detail.py | 18 ++-- .../models/insufficient_credits_response.py | 16 ++-- ...on_manual_evaluation_mode_stat_response.py | 8 ++ .../non_manual_evaluation_summary_response.py | 8 ++ .../models/test_draft_evaluation_response.py | 10 ++ seclai/seclai.py | 14 ++- seclai/versions.py | 3 +- tests/test_new_methods.py | 93 +++++++++++++++++++ 15 files changed, 238 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 126833e..3ea098c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,8 @@ ### Changed -- Sync the bundled OpenAPI spec, adding 6 paths and 10 schemas. The typed models gain the new fields, including `accepted_attachments` on agent create and definition requests and on the attachment-reference contract, `trigger_id` on an agent, `include_reasoning` on a streaming run, `run_on_attachment_mismatch` on an email trigger, the `cloud_drive_*`, `document_images`, `email_allowed_senders`, `feed_attachments` and `email_address` source fields, `held_for_review` on a content status and `skipped_attachments` on a content item -- Move `LATEST_API_VERSION` to `2026-10-19`. A client built with `api_version=LATEST_API_VERSION` also opts into `2026-10-05` to `2026-10-19`: a content item held for review reports `content_status` `completed` rather than `failed` (read `held_for_review` instead), `create_source()` and `update_source()` refuse an unknown `media_types` kind, or any on a source other than a website or RSS feed, with a 400, `create_source()` refuses `polling_max_items` on a source other than an RSS feed with a 400, and `upload_agent_input()` accepts any file type, `ready` at once +- Sync the bundled OpenAPI spec, adding 6 paths and 10 schemas. The typed models gain the new fields, including `accepted_attachments` on agent create and definition requests and on the attachment-reference contract, `trigger_id` on an agent, `include_reasoning` on a streaming run, `run_on_attachment_mismatch` on an email trigger, the `cloud_drive_*`, `document_images`, `email_allowed_senders`, `feed_attachments` and `email_address` source fields, `held_for_review` on a content status, `skipped_attachments` on a content item, `error` on `NonManualEvaluationSummaryResponse` and `NonManualEvaluationModeStatResponse`, and `status` on `TestDraftEvaluationResponse` +- Move `LATEST_API_VERSION` to `2026-10-21`. A client built with `api_version=LATEST_API_VERSION` also opts into `2026-10-05` to `2026-10-21`: a content item held for review reports `content_status` `completed` rather than `failed` (read `held_for_review` instead), `create_source()` and `update_source()` refuse an unknown `media_types` kind, or any on a source other than a website or RSS feed, with a 400, `create_source()` refuses `polling_max_items` on a source other than an RSS feed with a 400, `upload_agent_input()` accepts any file type, `ready` at once, `get_non_manual_evaluation_summary()` leaves results whose evaluator returned no verdict out of `failed` and the pass and failure rates (read `error` instead), `get_evaluation_criteria_summary()` averages `average_score` over passed and failed results only, and `test_draft_evaluation()` returns `score` and `passed` as `None` for an `error` result instead of 0.5 and `False` - Make `input` and `metadata` optional keys of `AgentRunStreamRequest`, and let `metadata` be `None`, as the API schema does. A run on an uploaded file no longer needs `"input": None, "metadata": {}` as filler to satisfy a type checker ### Added @@ -14,10 +14,11 @@ - Add `set_accepted_attachments()` to declare the input attachments an agent trigger accepts, returning `AcceptedAttachmentsResponse` - Add `list_email_source_rejections()` to list the mail an email content source refused, and why, returning `EmailSourceRejectionListResponse` - Add `include_reasoning`, `input_upload_id`, `input_upload_ids` and `replay_of_run_id` as optional keys of `AgentRunStreamRequest`. `include_reasoning` asks `run_streaming_agent()` for `stream_reasoning` events; `run_streaming_agent_and_wait()`, which keeps only the `init` and `done` events, removes it from the body before sending -- Add `ApiVersion` members for `2026-10-05`, `2026-10-13`, `2026-10-16`, `2026-10-18` and `2026-10-19`, so each can be selected without `allow_unknown_api_version` +- Add `ApiVersion` members for `2026-10-05`, `2026-10-13`, `2026-10-16`, `2026-10-18`, `2026-10-19` and `2026-10-21`, so each can be selected without `allow_unknown_api_version` ### Fixed +- Make the generated `InsufficientCreditsResponse` read the 402 body the API sends, `{"error": {"code", "message", "account_id"}}`. It expected `{"detail": {"error": ...}}`, so `from_dict` raised `KeyError` on a real body. `run_agent()` was unaffected: it raises `SeclaiAPIStatusError` before the model is read - Release the connection and raise `SeclaiAPIStatusError` from `download_agent_run_attachment()` and `download_source_export()` when reading an error response's body fails. The connection leaked, and the caller got the transport error instead of the status. The status error has no response text and keeps the transport error as its `__cause__` - Raise `SeclaiAPIStatusError` from `run_streaming_agent()` and `run_streaming_agent_and_wait()` when reading an error response's body fails, with the transport error as its `__cause__`. The caller got the transport error, or `SeclaiError` for a read timeout, instead of the status - Correct the streaming-download examples of `download_agent_run_attachment()` and `download_source_export()`. They closed the response with `with response:`, which raises `TypeError` because an `httpx.Response` is not a context manager; they now close it in a `finally` block diff --git a/README.md b/README.md index c48bdcf..f11953f 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,7 @@ client decodes: | `2026-10-16` | `upload_agent_input()` accepts a file of any type and it is `ready` at once; each upload reaches steps as a separate file and `input` carries only a heading for it | | `2026-10-18` | A source's `document_images` defaults to true on a text-only embedder as well | | `2026-10-19` | `create_source()` refuses `polling_max_items` with a 400 on any source other than an RSS feed | +| `2026-10-21` | An evaluation result whose evaluator returned no verdict (`error`) is left out of `failed` and of the pass and failure rates in `get_non_manual_evaluation_summary()`; `get_evaluation_criteria_summary()`'s `average_score` averages only passed and failed results; `test_draft_evaluation()` returns `score` and `passed` as `None` for an `error` result instead of 0.5 and `False` | Moving to a later version can still change a value your code branches on, or reject a request that used to work. From `2026-10-05`, a content item held for @@ -251,7 +252,10 @@ reads `failed` from `get_source_content_status()` or `list_source_contents()` to find held items stops seeing them: check `held_for_review` instead. (The `status` filter already matched held items under `completed` on every version.) `2026-10-13` and `2026-10-19` turn source bodies that were accepted before into -400s. Passing +400s. From `2026-10-21`, code that reads `passed` from `test_draft_evaluation()` +as a bool, or does arithmetic on its `score`, gets `None` when `status` is +`error`, and `get_non_manual_evaluation_summary()`'s `failed` no longer counts +those results: read its `error` count. Passing `api_version=LATEST_API_VERSION` opts into all of these at once. ## Resources @@ -451,8 +455,9 @@ detail = client.get_evaluation_criteria("criteria_id") client.update_evaluation_criteria("criteria_id", {"name": "updated"}) client.delete_evaluation_criteria("criteria_id") -# Test a draft -client.test_draft_evaluation("agent_id", {"criteria": {}, "run_id": "run_id"}) +# Test a draft. "status" is "error" when the evaluator returned no verdict; +# from api_version 2026-10-21 its "score" and "passed" are then None. +draft = client.test_draft_evaluation("agent_id", {"criteria": {}, "run_id": "run_id"}) # Results & summaries results = client.list_evaluation_results("criteria_id") diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json index 059fe2c..0ca4052 100644 --- a/openapi/seclai.openapi.json +++ b/openapi/seclai.openapi.json @@ -5188,7 +5188,7 @@ "type": "null" } ], - "description": "Mean score across all evaluated results, or null if none.", + "description": "Mean score of the final passed and failed results, or null if none. On /api before Seclai-Version 2026-10-21 it averages every final result's stored score, `error` included.", "title": "Average Score" }, "error": { @@ -6532,17 +6532,17 @@ "type": "object" }, "InsufficientCreditsDetail": { - "description": "``detail`` body for a 402 ``insufficient_credits`` response.", + "description": "``error`` body of a 402 ``insufficient_credits`` response.", "properties": { "account_id": { "description": "UUID of the account that ran out of credits.", "title": "Account Id", "type": "string" }, - "error": { + "code": { "const": "insufficient_credits", "description": "Stable machine-readable error code.", - "title": "Error", + "title": "Code", "type": "string" }, "message": { @@ -6552,7 +6552,7 @@ } }, "required": [ - "error", + "code", "message", "account_id" ], @@ -6560,14 +6560,14 @@ "type": "object" }, "InsufficientCreditsResponse": { - "description": "402 envelope returned when the account has exhausted its credits.", + "description": "402 envelope returned when the account has exhausted its credits.\n\nThe wire shape ``http_exception_handler`` and ``insufficient_credits_exception_handler`` send.", "properties": { - "detail": { + "error": { "$ref": "#/components/schemas/InsufficientCreditsDetail" } }, "required": [ - "detail" + "error" ], "title": "InsufficientCreditsResponse", "type": "object" @@ -9145,9 +9145,14 @@ "score": { "title": "Score", "type": "number" + }, + "status": { + "$ref": "#/components/schemas/EvaluationStatus", + "description": "`passed`, `failed`, or `error` when the evaluator returned no verdict." } }, "required": [ + "status", "score", "passed", "explanation" @@ -13450,6 +13455,11 @@ "schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse": { "description": "Per-mode rollup for evaluation activity.", "properties": { + "error": { + "description": "Results whose evaluator returned no verdict.", + "title": "Error", + "type": "integer" + }, "failed": { "title": "Failed", "type": "integer" @@ -13484,6 +13494,7 @@ "total", "passed", "failed", + "error", "flagged", "pass_rate", "failure_rate" @@ -13501,6 +13512,11 @@ "title": "By Mode", "type": "array" }, + "error": { + "description": "Results whose evaluator returned no verdict.", + "title": "Error", + "type": "integer" + }, "failed": { "title": "Failed", "type": "integer" @@ -13530,6 +13546,7 @@ "total", "passed", "failed", + "error", "flagged", "pass_rate", "failure_rate", @@ -14681,7 +14698,7 @@ }, "/agents/evaluation-criteria/{criteria_id}/summary": { "get": { - "description": "Get an aggregated summary of evaluation results for a criteria.\n\nReturns total, passed, failed, error, and flagged counts alongside the\naverage score, giving a quick overview of how the criteria is performing.", + "description": "Get an aggregated summary of evaluation results for a criteria.\n\nReturns total, passed, failed, error, and flagged counts alongside the\naverage score, giving a quick overview of how the criteria is performing.\nWith ``2026-10-21`` or later, ``average_score`` averages only passed and failed\nresults; earlier versions average every stored score, ``error`` included.", "operationId": "get_evaluation_summary_api_agents_evaluation_criteria__criteria_id__summary_get", "parameters": [ { @@ -14748,7 +14765,7 @@ }, "/agents/evaluation-results/non-manual-summary": { "get": { - "description": "Get an evaluation summary for API key clients.\n\nReturns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, sample_and_flag).\n\nThe ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset\n(opt in via the ``Seclai-Version`` header). Clients on the legacy baseline\nalways receive the account-wide rollup; ``agent_id`` is ignored for them so\nthe endpoint's behavior is frozen. With ``2026-07-27`` or later, the summary\nis scoped to ``agent_id`` when supplied (and returns 404 if it doesn't exist).", + "description": "Get an evaluation summary for API key clients.\n\nReturns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, sample_and_flag).\n\nWith ``2026-10-21`` or later, ``error`` results (the evaluator returned no\nverdict) are left out of ``failed``, and the rates are over passed and\nfailed results. Earlier versions count them in ``failed`` and rate over\nevery result. ``error`` is returned on every version.\n\nThe ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset\n(opt in via the ``Seclai-Version`` header). Clients on the legacy baseline\nalways receive the account-wide rollup; ``agent_id`` is ignored for them so\nthe endpoint's behavior is frozen. With ``2026-07-27`` or later, the summary\nis scoped to ``agent_id`` when supplied (and returns 404 if it doesn't exist).", "operationId": "get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get", "parameters": [ { @@ -16530,7 +16547,7 @@ }, "/agents/{agent_id}/evaluation-criteria/test-draft": { "post": { - "description": "Run an ephemeral evaluation against provided step output without persisting results.\n\nUse this to interactively test evaluation prompts and expectation\nconfigurations while editing criteria. The evaluation is a billed LLM\ncall; only its result goes unrecorded.", + "description": "Run an ephemeral evaluation against provided step output without persisting results.\n\nUse this to interactively test evaluation prompts and expectation\nconfigurations while editing criteria. The evaluation is a billed LLM\ncall; only its result goes unrecorded.\n\n``status`` is ``error`` when the evaluator returned no verdict. With\n``Seclai-Version: 2026-10-21`` or later, ``score`` and ``passed`` are then\n``null``; earlier versions return ``score`` 0.5 and ``passed`` false.", "operationId": "test_draft_evaluation_api_agents__agent_id__evaluation_criteria_test_draft_post", "parameters": [ { @@ -28005,8 +28022,9 @@ "2026-10-13", "2026-10-16", "2026-10-18", - "2026-10-19" + "2026-10-19", + "2026-10-21" ], - "latest": "2026-10-19" + "latest": "2026-10-21" } } diff --git a/seclai/_generated/api/agent_evaluations/get_evaluation_summary_api_agents_evaluation_criteria_criteria_id_summary_get.py b/seclai/_generated/api/agent_evaluations/get_evaluation_summary_api_agents_evaluation_criteria_criteria_id_summary_get.py index 7a9f366..632a8ae 100644 --- a/seclai/_generated/api/agent_evaluations/get_evaluation_summary_api_agents_evaluation_criteria_criteria_id_summary_get.py +++ b/seclai/_generated/api/agent_evaluations/get_evaluation_summary_api_agents_evaluation_criteria_criteria_id_summary_get.py @@ -94,6 +94,8 @@ def sync_detailed( Returns total, passed, failed, error, and flagged counts alongside the average score, giving a quick overview of how the criteria is performing. + With ``2026-10-21`` or later, ``average_score`` averages only passed and failed + results; earlier versions average every stored score, ``error`` included. Args: criteria_id (str): @@ -139,6 +141,8 @@ def sync( Returns total, passed, failed, error, and flagged counts alongside the average score, giving a quick overview of how the criteria is performing. + With ``2026-10-21`` or later, ``average_score`` averages only passed and failed + results; earlier versions average every stored score, ``error`` included. Args: criteria_id (str): @@ -176,6 +180,8 @@ async def asyncio_detailed( Returns total, passed, failed, error, and flagged counts alongside the average score, giving a quick overview of how the criteria is performing. + With ``2026-10-21`` or later, ``average_score`` averages only passed and failed + results; earlier versions average every stored score, ``error`` included. Args: criteria_id (str): @@ -219,6 +225,8 @@ async def asyncio( Returns total, passed, failed, error, and flagged counts alongside the average score, giving a quick overview of how the criteria is performing. + With ``2026-10-21`` or later, ``average_score`` averages only passed and failed + results; earlier versions average every stored score, ``error`` included. Args: criteria_id (str): diff --git a/seclai/_generated/api/agent_evaluations/get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get.py b/seclai/_generated/api/agent_evaluations/get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get.py index 9bd990a..b26f2ea 100644 --- a/seclai/_generated/api/agent_evaluations/get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get.py +++ b/seclai/_generated/api/agent_evaluations/get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get.py @@ -128,6 +128,11 @@ def sync_detailed( Returns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, sample_and_flag). + With ``2026-10-21`` or later, ``error`` results (the evaluator returned no + verdict) are left out of ``failed``, and the rates are over passed and + failed results. Earlier versions count them in ``failed`` and rate over + every result. ``error`` is returned on every version. + The ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset (opt in via the ``Seclai-Version`` header). Clients on the legacy baseline always receive the account-wide rollup; ``agent_id`` is ignored for them so @@ -188,6 +193,11 @@ def sync( Returns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, sample_and_flag). + With ``2026-10-21`` or later, ``error`` results (the evaluator returned no + verdict) are left out of ``failed``, and the rates are over passed and + failed results. Earlier versions count them in ``failed`` and rate over + every result. ``error`` is returned on every version. + The ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset (opt in via the ``Seclai-Version`` header). Clients on the legacy baseline always receive the account-wide rollup; ``agent_id`` is ignored for them so @@ -240,6 +250,11 @@ async def asyncio_detailed( Returns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, sample_and_flag). + With ``2026-10-21`` or later, ``error`` results (the evaluator returned no + verdict) are left out of ``failed``, and the rates are over passed and + failed results. Earlier versions count them in ``failed`` and rate over + every result. ``error`` is returned on every version. + The ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset (opt in via the ``Seclai-Version`` header). Clients on the legacy baseline always receive the account-wide rollup; ``agent_id`` is ignored for them so @@ -298,6 +313,11 @@ async def asyncio( Returns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, sample_and_flag). + With ``2026-10-21`` or later, ``error`` results (the evaluator returned no + verdict) are left out of ``failed``, and the rates are over passed and + failed results. Earlier versions count them in ``failed`` and rate over + every result. ``error`` is returned on every version. + The ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset (opt in via the ``Seclai-Version`` header). Clients on the legacy baseline always receive the account-wide rollup; ``agent_id`` is ignored for them so diff --git a/seclai/_generated/api/agent_evaluations/test_draft_evaluation_api_agents_agent_id_evaluation_criteria_test_draft_post.py b/seclai/_generated/api/agent_evaluations/test_draft_evaluation_api_agents_agent_id_evaluation_criteria_test_draft_post.py index 63b845d..e7c83a0 100644 --- a/seclai/_generated/api/agent_evaluations/test_draft_evaluation_api_agents_agent_id_evaluation_criteria_test_draft_post.py +++ b/seclai/_generated/api/agent_evaluations/test_draft_evaluation_api_agents_agent_id_evaluation_criteria_test_draft_post.py @@ -98,6 +98,10 @@ def sync_detailed( configurations while editing criteria. The evaluation is a billed LLM call; only its result goes unrecorded. + ``status`` is ``error`` when the evaluator returned no verdict. With + ``Seclai-Version: 2026-10-21`` or later, ``score`` and ``passed`` are then + ``null``; earlier versions return ``score`` 0.5 and ``passed`` false. + Args: agent_id (str): x_account_id (UUID | Unset): @@ -146,6 +150,10 @@ def sync( configurations while editing criteria. The evaluation is a billed LLM call; only its result goes unrecorded. + ``status`` is ``error`` when the evaluator returned no verdict. With + ``Seclai-Version: 2026-10-21`` or later, ``score`` and ``passed`` are then + ``null``; earlier versions return ``score`` 0.5 and ``passed`` false. + Args: agent_id (str): x_account_id (UUID | Unset): @@ -191,6 +199,10 @@ async def asyncio_detailed( configurations while editing criteria. The evaluation is a billed LLM call; only its result goes unrecorded. + ``status`` is ``error`` when the evaluator returned no verdict. With + ``Seclai-Version: 2026-10-21`` or later, ``score`` and ``passed`` are then + ``null``; earlier versions return ``score`` 0.5 and ``passed`` false. + Args: agent_id (str): x_account_id (UUID | Unset): @@ -237,6 +249,10 @@ async def asyncio( configurations while editing criteria. The evaluation is a billed LLM call; only its result goes unrecorded. + ``status`` is ``error`` when the evaluator returned no verdict. With + ``Seclai-Version: 2026-10-21`` or later, ``score`` and ``passed`` are then + ``null``; earlier versions return ``score`` 0.5 and ``passed`` false. + Args: agent_id (str): x_account_id (UUID | Unset): diff --git a/seclai/_generated/models/evaluation_result_summary_response.py b/seclai/_generated/models/evaluation_result_summary_response.py index da5ef4e..3134ab3 100644 --- a/seclai/_generated/models/evaluation_result_summary_response.py +++ b/seclai/_generated/models/evaluation_result_summary_response.py @@ -21,7 +21,8 @@ class EvaluationResultSummaryResponse: flagged (int): passed (int): total (int): - average_score (float | None | Unset): Mean score across all evaluated results, or null if none. + average_score (float | None | Unset): Mean score of the final passed and failed results, or null if none. On + /api before Seclai-Version 2026-10-21 it averages every final result's stored score, `error` included. """ error: int diff --git a/seclai/_generated/models/insufficient_credits_detail.py b/seclai/_generated/models/insufficient_credits_detail.py index ad64030..6edc8b3 100644 --- a/seclai/_generated/models/insufficient_credits_detail.py +++ b/seclai/_generated/models/insufficient_credits_detail.py @@ -11,23 +11,23 @@ @_attrs_define class InsufficientCreditsDetail: - """``detail`` body for a 402 ``insufficient_credits`` response. + """``error`` body of a 402 ``insufficient_credits`` response. Attributes: account_id (str): UUID of the account that ran out of credits. - error (Literal['insufficient_credits']): Stable machine-readable error code. + code (Literal['insufficient_credits']): Stable machine-readable error code. message (str): Human-readable explanation. """ account_id: str - error: Literal["insufficient_credits"] + code: Literal["insufficient_credits"] message: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: account_id = self.account_id - error = self.error + code = self.code message = self.message @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "account_id": account_id, - "error": error, + "code": code, "message": message, } ) @@ -48,17 +48,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) account_id = d.pop("account_id") - error = cast(Literal["insufficient_credits"], d.pop("error")) - if error != "insufficient_credits": + code = cast(Literal["insufficient_credits"], d.pop("code")) + if code != "insufficient_credits": raise ValueError( - f"error must match const 'insufficient_credits', got '{error}'" + f"code must match const 'insufficient_credits', got '{code}'" ) message = d.pop("message") insufficient_credits_detail = cls( account_id=account_id, - error=error, + code=code, message=message, ) diff --git a/seclai/_generated/models/insufficient_credits_response.py b/seclai/_generated/models/insufficient_credits_response.py index da8b9cb..958cad9 100644 --- a/seclai/_generated/models/insufficient_credits_response.py +++ b/seclai/_generated/models/insufficient_credits_response.py @@ -17,21 +17,23 @@ class InsufficientCreditsResponse: """402 envelope returned when the account has exhausted its credits. - Attributes: - detail (InsufficientCreditsDetail): ``detail`` body for a 402 ``insufficient_credits`` response. + The wire shape ``http_exception_handler`` and ``insufficient_credits_exception_handler`` send. + + Attributes: + error (InsufficientCreditsDetail): ``error`` body of a 402 ``insufficient_credits`` response. """ - detail: InsufficientCreditsDetail + error: InsufficientCreditsDetail additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - detail = self.detail.to_dict() + error = self.error.to_dict() field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "detail": detail, + "error": error, } ) @@ -42,10 +44,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.insufficient_credits_detail import InsufficientCreditsDetail d = dict(src_dict) - detail = InsufficientCreditsDetail.from_dict(d.pop("detail")) + error = InsufficientCreditsDetail.from_dict(d.pop("error")) insufficient_credits_response = cls( - detail=detail, + error=error, ) insufficient_credits_response.additional_properties = d diff --git a/seclai/_generated/models/non_manual_evaluation_mode_stat_response.py b/seclai/_generated/models/non_manual_evaluation_mode_stat_response.py index e811d5f..11b07a5 100644 --- a/seclai/_generated/models/non_manual_evaluation_mode_stat_response.py +++ b/seclai/_generated/models/non_manual_evaluation_mode_stat_response.py @@ -14,6 +14,7 @@ class NonManualEvaluationModeStatResponse: """Per-mode rollup for evaluation activity. Attributes: + error (int): Results whose evaluator returned no verdict. failed (int): failure_rate (float): flagged (int): @@ -23,6 +24,7 @@ class NonManualEvaluationModeStatResponse: total (int): """ + error: int failed: int failure_rate: float flagged: int @@ -33,6 +35,8 @@ class NonManualEvaluationModeStatResponse: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + error = self.error + failed = self.failed failure_rate = self.failure_rate @@ -51,6 +55,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update(self.additional_properties) field_dict.update( { + "error": error, "failed": failed, "failure_rate": failure_rate, "flagged": flagged, @@ -66,6 +71,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + error = d.pop("error") + failed = d.pop("failed") failure_rate = d.pop("failure_rate") @@ -81,6 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: total = d.pop("total") non_manual_evaluation_mode_stat_response = cls( + error=error, failed=failed, failure_rate=failure_rate, flagged=flagged, diff --git a/seclai/_generated/models/non_manual_evaluation_summary_response.py b/seclai/_generated/models/non_manual_evaluation_summary_response.py index d760e08..8511c5c 100644 --- a/seclai/_generated/models/non_manual_evaluation_summary_response.py +++ b/seclai/_generated/models/non_manual_evaluation_summary_response.py @@ -21,6 +21,7 @@ class NonManualEvaluationSummaryResponse: Attributes: by_mode (list[NonManualEvaluationModeStatResponse]): + error (int): Results whose evaluator returned no verdict. failed (int): failure_rate (float): flagged (int): @@ -30,6 +31,7 @@ class NonManualEvaluationSummaryResponse: """ by_mode: list[NonManualEvaluationModeStatResponse] + error: int failed: int failure_rate: float flagged: int @@ -44,6 +46,8 @@ def to_dict(self) -> dict[str, Any]: by_mode_item = by_mode_item_data.to_dict() by_mode.append(by_mode_item) + error = self.error + failed = self.failed failure_rate = self.failure_rate @@ -61,6 +65,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "by_mode": by_mode, + "error": error, "failed": failed, "failure_rate": failure_rate, "flagged": flagged, @@ -88,6 +93,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: by_mode.append(by_mode_item) + error = d.pop("error") + failed = d.pop("failed") failure_rate = d.pop("failure_rate") @@ -102,6 +109,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: non_manual_evaluation_summary_response = cls( by_mode=by_mode, + error=error, failed=failed, failure_rate=failure_rate, flagged=flagged, diff --git a/seclai/_generated/models/test_draft_evaluation_response.py b/seclai/_generated/models/test_draft_evaluation_response.py index 6b294fc..942bfa6 100644 --- a/seclai/_generated/models/test_draft_evaluation_response.py +++ b/seclai/_generated/models/test_draft_evaluation_response.py @@ -6,6 +6,8 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.evaluation_status import EvaluationStatus + T = TypeVar("T", bound="TestDraftEvaluationResponse") @@ -17,11 +19,13 @@ class TestDraftEvaluationResponse: explanation (None | str): passed (bool): score (float): + status (EvaluationStatus): Result status of a single evaluation run. """ explanation: None | str passed: bool score: float + status: EvaluationStatus additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,6 +36,8 @@ def to_dict(self) -> dict[str, Any]: score = self.score + status = self.status.value + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -39,6 +45,7 @@ def to_dict(self) -> dict[str, Any]: "explanation": explanation, "passed": passed, "score": score, + "status": status, } ) @@ -59,10 +66,13 @@ def _parse_explanation(data: object) -> None | str: score = d.pop("score") + status = EvaluationStatus(d.pop("status")) + test_draft_evaluation_response = cls( explanation=explanation, passed=passed, score=score, + status=status, ) test_draft_evaluation_response.additional_properties = d diff --git a/seclai/seclai.py b/seclai/seclai.py index a300e91..8688433 100644 --- a/seclai/seclai.py +++ b/seclai/seclai.py @@ -2907,7 +2907,9 @@ def test_draft_evaluation( body: Draft evaluation criteria and test run. Returns: - Test evaluation result. + Test evaluation result. ``status`` is ``"error"`` when the evaluator + returned no verdict; from ``2026-10-21`` ``score`` and ``passed`` are + then ``None``, and earlier versions return ``0.5`` and ``False``. """ return cast( dict[str, Any], @@ -3030,7 +3032,8 @@ def get_non_manual_evaluation_summary(self, agent_id: str) -> dict[str, Any]: Summary of automated evaluation results — for ``agent_id`` when the client has opted in, account-wide otherwise. The two are indistinguishable in the payload, so check the client's - ``api_version`` rather than the response. + ``api_version`` rather than the response. From ``2026-10-21``, + ``failed`` and the rates leave out results counted in ``error``. """ return cast( dict[str, Any], @@ -7450,7 +7453,9 @@ async def test_draft_evaluation( body: Draft evaluation criteria and test run. Returns: - Test evaluation result. + Test evaluation result. ``status`` is ``"error"`` when the evaluator + returned no verdict; from ``2026-10-21`` ``score`` and ``passed`` are + then ``None``, and earlier versions return ``0.5`` and ``False``. """ return cast( dict[str, Any], @@ -7573,7 +7578,8 @@ async def get_non_manual_evaluation_summary(self, agent_id: str) -> dict[str, An Summary of automated evaluation results — for ``agent_id`` when the client has opted in, account-wide otherwise. The two are indistinguishable in the payload, so check the client's - ``api_version`` rather than the response. + ``api_version`` rather than the response. From ``2026-10-21``, + ``failed`` and the rates leave out results counted in ``error``. """ return cast( dict[str, Any], diff --git a/seclai/versions.py b/seclai/versions.py index aaf4ddd..e839dfb 100644 --- a/seclai/versions.py +++ b/seclai/versions.py @@ -30,13 +30,14 @@ class ApiVersion(StrEnum): V2026_10_16 = "2026-10-16" V2026_10_18 = "2026-10-18" V2026_10_19 = "2026-10-19" + V2026_10_21 = "2026-10-21" #: Baseline applied to an unpinned, header-less caller. DEFAULT_API_VERSION = ApiVersion.V2026_07_01 #: Newest version known to this SDK release. May lag the server. -LATEST_API_VERSION = ApiVersion.V2026_10_19 +LATEST_API_VERSION = ApiVersion.V2026_10_21 def validate_api_version(version: str | None, *, allow_unknown: bool) -> str | None: diff --git a/tests/test_new_methods.py b/tests/test_new_methods.py index 02ab58b..1b8349a 100644 --- a/tests/test_new_methods.py +++ b/tests/test_new_methods.py @@ -22,6 +22,12 @@ ContentAttachmentsListResponse, ContentEmbeddingsListResponse, EmailSourceRejectionListResponse, + EvaluationStatus, + InsufficientCreditsResponse, + NonManualEvaluationSummaryResponse, +) +from seclai._generated.models import ( + TestDraftEvaluationResponse as DraftEvaluationResponse, ) # --------------------------------------------------------------------------- @@ -4819,3 +4825,90 @@ def handler(req: httpx.Request) -> httpx.Response: def test_null_metadata_is_accepted(self) -> None: body = AgentRunStreamRequest(input="hi", metadata=None) assert body == {"input": "hi", "metadata": None} + + +# --------------------------------------------------------------------------- +# 2026-10-21: evaluation `error` results, the 402 body's wire shape +# --------------------------------------------------------------------------- + +_INSUFFICIENT_CREDITS_402 = { + "error": { + "code": "insufficient_credits", + "message": "Out of credits.", + "account_id": "acct-1", + } +} + + +class TestLatestApiVersion20261021: + def test_latest_is_2026_10_21(self) -> None: + assert ( + seclai_versions.LATEST_API_VERSION is seclai_versions.ApiVersion.V2026_10_21 + ) + + def test_latest_is_sent_as_the_header(self) -> None: + seen: dict[str, Any] = {} + + def handler(req: httpx.Request) -> httpx.Response: + seen["version"] = req.headers.get("seclai-version") + return _json_response({"data": []}) + + client = _sync_client(handler, api_version=seclai_versions.LATEST_API_VERSION) + client.list_agents() + assert seen["version"] == "2026-10-21" + + +class TestInsufficientCredits402: + def test_generated_model_reads_the_wire_shape(self) -> None: + parsed = InsufficientCreditsResponse.from_dict(_INSUFFICIENT_CREDITS_402) + assert parsed.error.code == "insufficient_credits" + assert parsed.error.account_id == "acct-1" + assert parsed.to_dict() == _INSUFFICIENT_CREDITS_402 + + +_TEST_DRAFT_ERROR = { + "status": "error", + "score": None, + "passed": None, + "explanation": "The evaluator returned no verdict.", +} + + +class TestTestDraftErrorVerdict: + def test_generated_model_decodes_null_score_and_passed(self) -> None: + # The spec types score and passed as non-null, the legacy shape; + # 2026-10-21 sends null for an error result. + parsed = DraftEvaluationResponse.from_dict(_TEST_DRAFT_ERROR) + assert parsed.status is EvaluationStatus.ERROR + assert parsed.score is None + assert parsed.passed is None + + +_NON_MANUAL_SUMMARY = { + "total": 10, + "passed": 6, + "failed": 2, + "error": 2, + "flagged": 1, + "pass_rate": 0.75, + "failure_rate": 0.25, + "by_mode": [ + { + "mode": "eval_and_retry", + "total": 10, + "passed": 6, + "failed": 2, + "error": 2, + "flagged": 1, + "pass_rate": 0.75, + "failure_rate": 0.25, + } + ], +} + + +class TestNonManualSummaryErrorCount: + def test_generated_model_reads_error_counts(self) -> None: + parsed = NonManualEvaluationSummaryResponse.from_dict(_NON_MANUAL_SUMMARY) + assert parsed.error == 2 + assert parsed.by_mode[0].error == 2